/* layout.css: containers, header, drawer, footer, page hero, shared grids */

.wrap { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.section { margin-block: var(--section-gap); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.section-head h2 { font-size: var(--fs-h2); margin-top: .6rem; }
.section-head p { max-width: 46ch; color: var(--color-text-muted); margin-top: .75rem; }
.two-col { display: grid; grid-template-columns: 5fr 7fr; gap: 2rem clamp(2rem, 5vw, 5rem); align-items: start; }
.two-col h2 { font-size: var(--fs-h2); margin-top: .6rem; }
.on-dark { background: var(--color-ink); color: var(--color-on-ink); }
.on-dark .section-head p { color: var(--color-on-ink-muted); } /* the muted gray above is for light backgrounds: 2.1:1 on ink */

/* ---------- header (TUDOR: centered logo, icon + label items) ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); color: var(--color-on-ink); transition: transform .35s var(--ease), background .3s, color .3s, box-shadow .3s; }
/* Slides away while scrolling down, comes back on scroll up (nav.js). */
.site-header.is-hidden { transform: translateY(-100%); box-shadow: none; }
.site-header::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--scrim-mid), transparent); pointer-events: none; transition: opacity .3s; }
.site-header.is-solid { background: var(--color-bg); color: var(--color-text); box-shadow: 0 1px 0 var(--color-border); }
.site-header.is-solid::before { opacity: 0; }
.header-grid { position: relative; height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
/* Both sides spread from the outer edge to the same distance from the logo, so the logo sits in an even gap. */
.nav-side { --logo-gap: clamp(1.25rem, 2.5vw, 2.25rem); display: flex; align-items: center; justify-content: space-between; gap: clamp(.5rem, 1.6vw, 1.75rem); padding-inline-end: var(--logo-gap); }
.nav-side.right { padding-inline: var(--logo-gap) 0; gap: clamp(.5rem, 1.2vw, 1.25rem); }
.nav-side > * { flex-shrink: 0; white-space: nowrap; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-width: var(--touch-min); min-height: var(--touch-min); padding: .25rem .35rem; background: none; border: 0; color: inherit; font: 600 .6875rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item[aria-current="page"] { text-decoration: underline; text-underline-offset: .4em; }
.logo { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; line-height: 1; }
.logo-mark { width: 30px; height: 30px; }
.logo-word { font: 700 1.5rem/1 var(--font-display); letter-spacing: .14em; margin-top: .2rem; }
.nav-side .header-quote { padding-inline: 1.25rem; }
/* EN | ES toggle: a quiet nav item, never the loudest thing in the header. */
.lang-switch span { white-space: nowrap; }
.site-header:not(.is-solid) .header-quote { background: var(--color-on-ink); color: var(--color-ink); }
.hide-sm { display: flex; }
.show-sm { display: none; }

/* ---------- drawer ---------- */
/* Full screen on phones, a side panel over a dimmed page on wider screens.
   Opening: panel slides in, burger turns into an X, links rise in one after another.
   prefers-reduced-motion turns all of it off (base.css). */
.drawer { position: fixed; inset: 0 auto 0 0; width: 100%; z-index: 60; background: var(--color-bg); color: var(--color-text); padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem; overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s; }
.drawer.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: var(--scrim-mid); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s .4s; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
.drawer-close { position: absolute; top: calc((var(--header-h) - var(--touch-min)) / 2); left: var(--gutter); }
.drawer h2 { font-size: .8125rem; font-family: var(--font-body); letter-spacing: .14em; color: var(--color-text-muted); margin: 2rem 0 .5rem; }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer li a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--color-border); font: 600 1.6rem/1 var(--font-display); text-transform: uppercase; text-decoration: none; transition: color .2s, padding-left .25s var(--ease); }
.drawer li a:hover, .drawer li a[aria-current="page"] { color: var(--color-accent); padding-left: .5rem; }
.drawer-cta { margin-top: 2rem; width: 100%; }
.drawer-lang { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--touch-min); margin-top: 1rem; font: 600 .8125rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--color-accent); }
.drawer-lang svg { width: 18px; height: 18px; }

/* Staggered reveal. Delays come from nth-child because the CSP blocks inline styles. */
.drawer h2, .drawer li, .drawer-cta, .drawer-lang { opacity: 0; transform: translateY(14px); transition: opacity .15s, transform .15s; }
.drawer.is-open h2, .drawer.is-open li, .drawer.is-open .drawer-cta, .drawer.is-open .drawer-lang { opacity: 1; transform: none; transition: opacity .4s var(--ease), transform .5s var(--ease); transition-delay: .12s; }
.drawer.is-open li:nth-child(1) { transition-delay: .16s; }
.drawer.is-open li:nth-child(2) { transition-delay: .2s; }
.drawer.is-open li:nth-child(3) { transition-delay: .24s; }
.drawer.is-open li:nth-child(4) { transition-delay: .28s; }
.drawer.is-open li:nth-child(5) { transition-delay: .32s; }
.drawer.is-open li:nth-child(6) { transition-delay: .36s; }
.drawer.is-open li:nth-child(7) { transition-delay: .4s; }
.drawer.is-open li:nth-child(n+8) { transition-delay: .44s; }
.drawer.is-open .drawer-cta { transition-delay: .46s; }
.drawer.is-open .drawer-lang { transition-delay: .5s; }

/* Burger → X. The Close button sits exactly where Menu was, so the icon reads as one control morphing. */
.burger { width: 20px; height: 20px; overflow: visible; }
.burger path { fill: none; stroke: currentColor; stroke-width: 1.6; transform-box: fill-box; transform-origin: center; transition: transform .4s var(--ease), opacity .2s; }
.drawer.is-open .burger-top { transform: translateY(6px) rotate(45deg); }
.drawer.is-open .burger-mid { opacity: 0; transform: scaleX(0); }
.drawer.is-open .burger-bot { transform: translateY(-6px) rotate(-45deg); }
.drawer.is-open .drawer-close .burger path { transition-delay: .15s; }

@media (min-width: 861px) {
  .drawer { width: min(440px, 100%); box-shadow: 0 0 40px var(--scrim-soft); }
}

/* ---------- interior page hero ---------- */
.page-hero { padding: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(2.5rem, 6vw, 4.5rem); }
.page-hero h1 { font-size: var(--fs-page); font-weight: 700; line-height: .95; max-width: 18ch; margin-top: 1rem; }
.page-hero .eyebrow { display: inline-flex; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.page-hero .eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.page-sub { max-width: 56ch; margin-top: 1.25rem; font-size: clamp(1rem, 1.3vw, 1.125rem); color: var(--color-on-ink-soft); }
.page-hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 2rem clamp(2rem, 5vw, 4rem); align-items: center; }
.page-hero-media { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: var(--fs-small); color: var(--color-on-ink-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: .5rem; }
.breadcrumb a { color: var(--color-on-ink); }

/* ---------- footer ---------- */
.site-footer { background: var(--color-ink); color: var(--color-on-ink); padding: clamp(3rem, 6vw, 5rem) 0 2rem; margin-top: var(--section-gap); }
.foot-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2rem; }
.site-footer h2 { font: 600 .75rem/1 var(--font-body); letter-spacing: .14em; color: var(--color-on-ink-muted); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a, .site-footer .link-btn { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; font-size: .9375rem; }
.site-footer li a:hover, .site-footer .link-btn:hover { text-decoration: underline; }
.foot-brand p { color: var(--color-on-ink-muted); font-size: .9375rem; margin-top: 1rem; max-width: 30ch; }
.foot-brand .logo { align-items: flex-start; }
.nap { margin-top: 1.25rem; font-size: .9375rem; line-height: 1.7; color: var(--color-on-ink-muted); }
.nap strong { color: var(--color-on-ink); font-weight: 600; }
.nap a { color: var(--color-on-ink); }
.social { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 1rem !important; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--color-on-ink-faint); font-size: var(--fs-small); color: var(--color-on-ink-muted); }
.foot-bottom a { color: var(--color-on-ink); }
.tecl { color: var(--color-on-ink); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .foot-top { grid-template-columns: repeat(2, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
}
/* Header only: the right side (language, phone, quote button) runs out of room before the page layout does.
   1101-1279px: phone and language switch use their short labels. 1100px and below: the compact phone header. */
@media (min-width: 1101px) and (max-width: 1279px) {
  .nav-side.right .nav-item .hide-sm { display: none !important; }
  .nav-side.right .nav-item .show-sm { display: flex !important; }
}
@media (max-width: 1100px) {
  .site-header .hide-sm { display: none !important; }
  .site-header .show-sm { display: flex !important; }
  .nav-side { justify-content: flex-start; padding-inline: 0; }
  .nav-side.right { justify-content: flex-end; }
}
@media (max-width: 860px) {
  /* !important: utility must beat component display rules (.btn) that load later */
  .hide-sm { display: none !important; }
  .show-sm { display: flex !important; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-word { font-size: 1.2rem; }
  .two-col, .page-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .foot-top { grid-template-columns: 1fr 1fr; }
}
