/* CRASA Digital Anchor Ecosystem — canonical chrome.
 *
 * The public header, the language switcher and the site footer, taken from
 * .design/screens/02-homepage.dc.html and section 06 of the design
 * foundations. Screens include these partials rather than rebuilding them.
 *
 * Colour, spacing, radius and elevation come from tokens.css. Nothing in
 * this file carries a hard-coded value.
 */

/* Header --------------------------------------------------------------- */

.c-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-sand);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--e-1);
}

.c-header__inner {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: var(--s-4) var(--page-x);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap; /* Wrapping is the floor. Never a horizontal scrollbar. */
}

/* Identity never shrinks. */
.c-header__identity {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
}
.c-header__mark { width: 40px; height: 40px; flex: none; }
.c-header__names { display: flex; flex-direction: column; min-width: 0; }
.c-header__acronym {
  font-family: var(--f-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--c-navy);
  line-height: 1.1;
}
/*
 * "font-size:10.5px;color:var(--c-slate);letter-spacing:.03em;max-width:230px"
 * -- screen 02 line 57. Every value is the screen's.
 *
 * WHERE IT SHOWS IS NOT. Measured from the shipped font files at the
 * shipped sizes, the header needs more room than it has:
 *
 *   available at 1440, less --page-x twice        1344px
 *   identity with the 230px full name              282
 *   nine nav links at 15px, padding 9px 11px       836 (en) 830 (fr) 755 (pt)
 *   search, language group, extranet               321
 *   two --s-5 gaps                                  48
 *   ------------------------------------------------------
 *   total                                         1488 (en) 1481 (fr) 1406 (pt)
 *
 * It overflows in all three languages and the container is capped at
 * --w-page, so a wider viewport gives the header nothing: the full name and
 * nine links cannot share a row at any width. flex-wrap then puts the nav
 * on a second row, which is what the screenshots showed.
 *
 * Screen 02's own compressed state answers this by hiding this exact
 * element -- "[data-compressed] .c-header__fullname { display: none }". The
 * same device is used a step earlier: the full name shows while the nav is
 * in the drawer, and stands down when the nav comes inline and needs the
 * room. Dropping it takes the identity from 282 to 117 and every locale
 * fits, English with 21px to spare and Portuguese with 103.
 *
 * The name is not lost. It is the footer's first line, the <title>, and the
 * logo's alt text.
 */
.c-header__fullname {
  font-size: 10.5px;
  color: var(--c-slate);
  letter-spacing: .03em;
  line-height: 1.25;
  max-width: 230px;
}
@media (min-width: 1024px) {
  .c-header__fullname { display: none; }
}

/*
 * The compressed sticky state.
 *
 * Screen 02 draws it under the heading "Compressed sticky state, 1440px":
 *
 *   background:var(--c-white);border:1px solid var(--c-sand);
 *   border-radius:var(--r-md);box-shadow:var(--e-2);padding:9px var(--s-5)
 *   img ... width:30px;height:30px
 *   span ... font-family:var(--f-head);font-size:17px
 *   nav ... margin-left:auto
 *   current item ... border-bottom:2px solid var(--c-green-dark)
 *
 * It is what closes the elevation hierarchy. The header at rest is --e-1,
 * the header compressed and floating over the page is --e-2, and the
 * drawer over everything is --e-3. Three elevations, three depths, which
 * is what the three tokens are for.
 *
 * Below 1024 the header has already given its nav a second row or a
 * drawer, so there is nothing left to compress and the state does not
 * apply. The screen draws it at 1440.
 */
@media (min-width: 1024px) {
  .c-header[data-compressed] {
    box-shadow: var(--e-2);
    border-bottom-color: transparent;
  }

  /* 9px var(--s-5), against the resting var(--s-4) var(--page-x). */
  .c-header[data-compressed] .c-header__inner { padding-block: 9px; }

  /* 40px to 30px, and 20px to 17px. */
  .c-header[data-compressed] .c-header__mark { width: 30px; height: 30px; }
  .c-header[data-compressed] .c-header__acronym { font-size: 17px; }

  /* The full name goes. At 9px of padding there is no room for a second
     line of type, which is why the screen draws only the acronym. */
  .c-header[data-compressed] .c-header__fullname { display: none; }

  /* Motion answers an action. Here the action is scrolling, so the change
     is a state rather than an animation, and it is instant for anyone who
     has asked for reduced motion. */
  @media (prefers-reduced-motion: no-preference) {
    .c-header,
    .c-header__mark,
    .c-header__acronym { transition: all .18s var(--ease-in); }
  }
}

/* Primary navigation shrinks and wraps; it never pushes the utilities off. */
.c-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  margin-left: auto;
}
.c-nav__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-charcoal);
  padding: 9px 11px;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms var(--ease-in), color 150ms var(--ease-in);
}
.c-nav__link:hover { background: var(--c-green-light); color: var(--c-navy); }
.c-nav__link[aria-current] {
  font-weight: 600;
  color: var(--c-navy);
  border-bottom: 2px solid var(--c-green-dark);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.c-header__utilities {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0; /* Without this the switcher clips. */
}

.c-iconbutton {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--c-charcoal);
}
.c-iconbutton:hover { border-color: var(--c-navy); }

.c-extranet {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-white);
  background: var(--c-navy);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms var(--ease-in);
}
.c-extranet:hover { background: var(--c-navy-deep); color: var(--c-white); }

/* The account link beside it, for a signed-in reader. Quiet on purpose:
   the workspace button is the action and this is the way back to your own
   settings and your way out, which is a link rather than a button. */
.c-header__account {
  flex: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-navy);
  text-decoration: none;
  white-space: nowrap;
  padding: 12px 4px;
}
.c-header__account:hover { color: var(--c-green-dark); text-decoration: underline; text-underline-offset: 4px; }

/* Language switcher ---------------------------------------------------- */
/* The current language is always shown as text, never as a flag alone.
   Each control is a link, so switching works without JavaScript. */

.c-lang {
  display: flex;
  flex: none;
  border: 1.5px solid var(--c-navy);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.c-lang__option {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 13px;
  min-width: 44px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--c-navy);
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms var(--ease-in), color 150ms var(--ease-in);
}
.c-lang__option:hover { background: var(--c-green-light); color: var(--c-navy); }
.c-lang__option[aria-current] { background: var(--c-navy); color: var(--c-white); }
.c-lang__option[aria-current]:hover { background: var(--c-navy); color: var(--c-white); }

/* On a navy surface the switcher inverts: extranet top bar and drawer. */
.c-lang--on-navy { border-color: var(--c-navy-edge); background: var(--c-navy); }
.c-lang--on-navy .c-lang__option { color: var(--c-cream); }
.c-lang--on-navy .c-lang__option:hover { background: var(--c-navy-mid); color: var(--c-white); }
.c-lang--on-navy .c-lang__option[aria-current],
.c-lang--on-navy .c-lang__option[aria-current]:hover { background: var(--c-green-dark); color: var(--c-white); }

/* Drawer --------------------------------------------------------------- */
/*
 * Breakpoints, from screen 01's canonical chrome notes verbatim:
 *
 *   "1440px. One row, all nine items, full identity lockup."
 *   "768px. Nav wraps to a second row or collapses to the drawer ...
 *    The switcher and the extranet action stay on the first row."
 *   "375px. Identity, drawer trigger. Nav, switcher and extranet action
 *    move into the drawer, each at a 44px target."
 *
 * Plain media queries, not a runtime measurement. Three attempts at
 * measuring the header failed three different ways, each time collapsing a
 * navigation that fitted. A media query cannot be wrong about the viewport
 * width.
 *
 *   1024 and up   full inline navigation. Never a hamburger.
 *   768 to 1023   nav wraps to its own row; switcher and extranet stay up.
 *   below 768     drawer.
 *
 * The 1024 boundary is a disclosed variation: screen 01 names 1440, 768 and
 * 375 and is silent between 768 and 1440. See OPEN_ITEMS.md.
 */

/* Default, and 1024 and up: everything inline. */
.c-header__toggle { display: none; }
.c-drawer { display: none; }

/* 768 to 1023. The nav takes its own row. Screen 01: the switcher and the
   extranet action stay on the first row. */
@media (max-width: 1023.98px) and (min-width: 768px) {
  .c-nav {
    flex-basis: 100%;
    margin-left: 0;
    order: 3;
    border-top: 1px solid var(--c-sand);
    padding-top: var(--s-3);
    margin-top: var(--s-1);
  }
}

/* Below 768. Identity and the drawer trigger only; nav, switcher and
   extranet move into the drawer. */
@media (max-width: 767.98px) {
  .c-nav,
  .c-header__utilities { display: none; }

  .has-js .c-header__toggle { display: inline-flex; margin-left: auto; }
  .c-drawer { display: flex; }
  .c-drawer[hidden] { display: none; }
}

/* Without JavaScript there is no drawer to open, so the nav stays visible
   and wraps. Layout invariant 6: wrapping beats the alternative. */
@media (max-width: 767.98px) {
  html:not(.has-js) .c-nav,
  html:not(.has-js) .c-header__utilities { display: flex; }
  html:not(.has-js) .c-nav { flex-basis: 100%; margin-left: 0; order: 3; }
}

.c-header__toggle {
  gap: var(--s-2);
  width: auto;
  min-width: 44px;
  padding: 0 var(--s-3);
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-navy);
}
.c-header__toggle-label { white-space: nowrap; }

.c-drawer {
  box-shadow: var(--e-3);
  background: var(--c-navy);
  padding: var(--s-4) var(--page-x) var(--s-5);
  flex-direction: column;
  gap: 2px;
}

.c-drawer__nav { display: flex; flex-direction: column; gap: 2px; }

.c-drawer__link {
  font-size: 16px;
  color: var(--c-cream);
  padding: 13px var(--s-3);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.c-drawer__link:hover { background: var(--c-navy-mid); color: var(--c-white); }
.c-drawer__link[aria-current] {
  font-weight: 600;
  color: var(--c-white);
  background: var(--c-navy-mid);
  border-left-color: var(--c-green);
}

.c-drawer__lang {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-4);
  border-top: 1px solid var(--c-navy-line);
  padding-top: var(--s-4);
}
.c-drawer__lang .c-lang__option {
  flex: 1;
  border: 1.5px solid var(--c-navy-edge);
  border-radius: var(--r-sm);
  padding: 12px;
  font-size: 15px;
  color: var(--c-cream);
}
.c-drawer__lang .c-lang__option[aria-current] {
  background: var(--c-green-dark);
  border-color: var(--c-green-dark);
  color: var(--c-white);
}

.c-drawer__extranet {
  margin-top: var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-navy);
  background: var(--c-cream);
  padding: 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.c-drawer__extranet:hover { background: var(--c-white); color: var(--c-navy); }

.c-drawer__search { margin-bottom: var(--s-3); }

/* Footer --------------------------------------------------------------- */

.c-footer { background: var(--c-navy); color: var(--c-sand); }
.c-footer__inner {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: var(--s-8) var(--page-x) var(--s-6);
}

.c-footer__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--s-7);
}

.c-footer__identity {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  text-decoration: none;
}
.c-footer__mark { width: 38px; height: 38px; flex: none; }
.c-footer__acronym { font-family: var(--f-head); font-size: 19px; font-weight: 600; color: var(--c-white); }

.c-footer__blurb { margin: 0 0 var(--s-4); font-size: 14px; line-height: 1.6; max-width: 34ch; }
.c-footer__address { font-size: 14px; line-height: 1.7; font-style: normal; }
.c-footer__address a { color: var(--c-green-light); }
.c-footer__address .c-footer__email { margin-top: 8px; }
.c-footer__address a:hover { color: var(--c-white); }

.c-footer__heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: var(--s-4);
}
.c-footer__links { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.c-footer__links a { color: var(--c-sand); text-decoration: none; }
.c-footer__links a:hover { color: var(--c-white); text-decoration: underline; }

.c-footer__legal {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-navy-line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  justify-content: space-between;
  font-size: 13.5px;
}
.c-footer__legal-links { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.c-footer__legal-links a { color: var(--c-sand); text-decoration: none; }
.c-footer__legal-links a:hover { color: var(--c-white); text-decoration: underline; }

/* Header dropdowns --------------------------------------------------------- */
/* Screen 01 draws no dropdown. It names --e-2 as the elevation for "Hover,
   dropdowns, sticky headers" and stops there, so the elevation is the
   screen's and the rest is a disclosed variation in docs/OPEN_ITEMS.md.

   THE FLOOR. Without script the menu is open and every child link is in the
   document: the rules that close it are all under html.has-js, and the
   toggle button is not drawn at all. Nothing on this platform hides
   navigation behind a script. */

.c-nav__group { position: relative; display: flex; align-items: center; }

.c-nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.c-nav__toggle svg { transition: transform 150ms var(--ease-in); }
.c-nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.c-nav__menu { display: flex; flex-direction: column; }

.c-nav__child {
  font-size: 15px;
  color: var(--c-charcoal);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.c-nav__child:hover { background: var(--c-green-light); color: var(--c-navy); }
.c-nav__child[aria-current] { font-weight: 600; color: var(--c-navy); }

html.has-js .c-nav__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  /* No min-width. The children carry white-space: nowrap, so the menu is
     as wide as its longest label -- which is the right behaviour on a
     platform whose French and Portuguese labels run 15 to 30% longer than
     the English, and the reason CLAUDE.md forbids fixing a nav width to
     English text. */
  padding: var(--s-2);
  background: var(--c-white);
  border: 1px solid var(--c-sand);
  border-radius: var(--r-md);
  /* --e-2, which screen 01 names for exactly this. */
  box-shadow: var(--e-2);
}
html.has-js .c-nav__menu[hidden] { display: none; }
html:not(.has-js) .c-nav__toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  .c-nav__toggle svg { transition: none; }
}

/* The drawer's second level. */
.c-drawer__link--child { padding-left: var(--s-6); font-size: 15px; }
.c-drawer__heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-slate);
  margin: var(--s-3) 0 2px;
  padding: 0 var(--s-3);
}
