/* Page-level structure: container, header, race-day strip, sections, footer,
 * inner-page hero. Ported from the approved mockup A (Painel da Tablada). */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--container-pad));
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── header (mockup: top-bar) ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--color-bg);
  border-bottom: 1px solid var(--line-dark);
}
.topbar { display: flex; align-items: center; gap: var(--space-24); min-height: var(--header-h); }

.brand { display: flex; flex-direction: column; justify-content: center; min-height: 44px; text-decoration: none; line-height: 1; flex: none; }
.brand__name {
  font-family: var(--font-display); font-weight: 850; font-stretch: 72%;
  font-size: 1.3rem; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.brand__name b { color: var(--color-brand); font-weight: 850; }
.brand__sub {
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--color-muted);
  margin-top: 6px; letter-spacing: .02em; white-space: nowrap;
}

.nav { margin-inline: auto; display: flex; align-items: center; }
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__link, .nav__more {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px;
  font: 600 var(--fs-small)/1 var(--font-body); color: var(--color-text); text-decoration: none;
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.nav__link:hover, .nav__more:hover { color: var(--color-brand); }
.nav__link[aria-current="page"] { border-bottom-color: var(--color-brand); }
.nav__more .icon { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease); }
.nav__more[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav__more.is-current { border-bottom-color: var(--color-brand); }
.nav__item--more { position: relative; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: var(--z-dropdown); min-width: 260px;
  background: var(--color-surface); border: 1px solid var(--line-dark-strong);
  border-top: 2px solid var(--color-brand); padding: 6px 0; box-shadow: var(--shadow-pop);
}
.dropdown a {
  display: flex; justify-content: space-between; align-items: center; min-height: var(--tap);
  padding: 0 16px; text-decoration: none; font-weight: 500; font-size: var(--fs-small);
}
.dropdown a:hover, .dropdown a:focus-visible { background: var(--color-surface-2); color: var(--color-brand); }
.dropdown a[aria-current="page"] { color: var(--color-brand); }
.dropdown li + li a { border-top: 1px solid var(--line-dark); }

.age {
  display: inline-grid; place-items: center; min-width: 48px; height: var(--tap); padding: 0 10px;
  border: 1.5px solid var(--color-text); font: 600 1rem/1 var(--font-mono); text-decoration: none; flex: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.age:hover { background: var(--color-text); color: var(--color-ink); }

.burger {
  display: none; width: var(--tap); height: var(--tap); place-items: center;
  background: none; border: 1px solid var(--line-dark-strong); color: var(--color-text);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.burger:hover { border-color: var(--color-brand); color: var(--color-brand); }
.burger .icon--close { display: none; }
.burger[aria-expanded="true"] .icon--open { display: none; }
.burger[aria-expanded="true"] .icon--close { display: block; }

.mnav {
  border-top: 1px solid var(--line-dark); background: var(--color-bg);
  max-height: calc(100vh - var(--header-h)); overflow: auto;
}
.mnav ul { padding: 8px 0 20px; }
.mnav a {
  display: flex; align-items: center; gap: 14px; min-height: 48px;
  text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line-dark);
  transition: color var(--dur-fast);
}
.mnav a .mono { color: var(--color-muted); font-size: var(--fs-label); width: 26px; }
.mnav a:hover, .mnav a[aria-current="page"] { color: var(--color-brand); }

/* ── race-day strip — static, not a ticker ────────────────────────────── */
.raceday { background: var(--color-surface); border-bottom: 1px solid var(--line-dark); }
.raceday__row {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; min-height: 44px;
  font-family: var(--font-mono); font-size: .875rem; color: var(--color-text);
}
.raceday__row > span { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.raceday__row > span + span::before {
  content: ""; width: 1px; height: 14px; background: var(--line-dark-strong); margin-inline: 14px;
}
.raceday__lbl { color: var(--color-muted); }
.raceday .short { display: none; }
.raceday .status { color: var(--color-data); }
.raceday__link {
  margin-left: auto; color: var(--color-text); text-decoration: none;
  display: inline-flex; gap: 6px; align-items: center; min-height: 44px;
  transition: color var(--dur-fast);
}
.raceday__link:hover { color: var(--color-brand); }
.raceday__link .icon { width: 16px; height: 16px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 600; letter-spacing: .02em; }
.status::before { content: ""; width: 8px; height: 8px; background: currentColor; flex: none; }

/* ── sections ─────────────────────────────────────────────────────────── */
.sec { padding-block: var(--section-pad); }
.sec--light { background: var(--color-surface-light); color: var(--color-ink); }
.sec--surface { background: var(--color-surface); }
.sec--tight { padding-block: clamp(40px, 5vw, 72px); }
.sec__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px 40px; margin-bottom: clamp(28px, 3vw, 44px);
}
.sec__eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase;
  margin: 0 0 12px; display: flex; align-items: center; gap: 10px; color: var(--color-data);
}
.sec--light .sec__eyebrow { color: var(--color-data-light); }
.sec h2, .sec__title {
  font-family: var(--font-display); font-weight: 850; font-stretch: var(--stretch-display);
  font-size: var(--fs-h2); line-height: var(--lh-tight); text-transform: uppercase; letter-spacing: -.005em;
}
.sec__lede { margin: 14px 0 0; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--color-muted); }
.sec--light .sec__lede { color: var(--color-muted-light); }
.sec__intro { max-width: 62ch; margin-top: 14px; color: var(--color-muted); }
.sec--light .sec__intro { color: var(--color-muted-light); }

/* ── inner page hero (new, in the mockup's language) ──────────────────── */
.page-hero { padding-block: clamp(36px, 5vw, 64px) clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--line-dark); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 0; font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-muted); margin-bottom: 22px; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin-inline: 10px; color: var(--line-dark-strong); }
.crumbs a { text-decoration: none; position: relative; }
.crumbs a:hover { color: var(--color-brand); }
.crumbs a::after { content: ""; position: absolute; inset: 50% 0 auto 0; translate: 0 -50%; height: 100%; min-height: 24px; }
.page-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 56px; align-items: end; }
.kicker {
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-data); letter-spacing: .04em;
  margin: 0 0 18px; display: flex; gap: 10px; align-items: center;
}
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 850; font-stretch: 70%;
  font-size: clamp(2.5rem, 1.2rem + 4.2vw, 4.75rem); line-height: .92; text-transform: uppercase; letter-spacing: -.01em;
}
.page-hero__lede { color: var(--color-muted); max-width: 52ch; }
.page-hero__lede strong { color: var(--color-text); font-weight: 600; }
.page-hero__aside { display: flex; flex-direction: column; gap: 18px; }

/* photo band under the title (21:9, the photos' own ratio — nothing is cropped) */
.photo-band { margin: 28px 0 0; border-top: 1px solid var(--line-dark-strong); border-bottom: 1px solid var(--line-dark-strong); }
/* full container width; height follows 21:9 up to 460px (max-height + aspect-ratio would shrink the width) */
.photo-band .ph { width: 100%; aspect-ratio: auto !important; height: clamp(160px, 38vw, 460px); }
.photo-band figcaption { font-size: var(--fs-micro); color: var(--color-muted); padding: 8px 0; }

/* sand texture behind every inner page title — signature «raia» */
.page-hero { position: relative; isolation: isolate; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07; pointer-events: none;
  background: url("/assets/img/raia-textura-500.webp") center / cover;
}

/* in-page anchor nav (long pages) */
.toc { display: flex; gap: 8px; margin-top: 28px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }   /* one row of chips; scrolls if the page has many sections */
.toc a { flex: none; }
.toc a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-dark-strong); font: 500 var(--fs-label)/1 var(--font-mono);
  text-decoration: none; letter-spacing: .02em;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.toc a:hover { border-color: var(--color-brand); color: var(--color-brand); }

/* ── footer (mockup, three link columns + wide data band) ─────────────── */
.site-footer { background: var(--color-bg); border-top: 1px solid var(--line-dark); }
.rg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px 28px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line-dark); }
.rg__age {
  display: grid; place-items: center; width: 64px; height: 64px;
  border: 2px solid var(--color-brand); color: var(--color-brand); font: 600 1.375rem/1 var(--font-mono);
}
.rg p { font-size: var(--fs-body); line-height: 1.5; }
.rg p strong { display: block; font-size: 1.125rem; }
.rg p span { color: var(--color-muted); }

.foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 48px; padding: 48px 0 40px; }
.foot h2 {
  font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted); margin: 0 0 14px;
}
.foot ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.foot ul.one { grid-template-columns: minmax(0, 1fr); }
.foot li a, .foot li button {
  display: flex; align-items: center; width: 100%; min-height: 40px; text-decoration: none;
  font-size: var(--fs-small); border: 0; border-bottom: 1px solid var(--line-dark);
  background: none; padding: 0; text-align: left; cursor: pointer; color: inherit;
  transition: color var(--dur-fast);
}
.foot li a:hover, .foot li button:hover { color: var(--color-brand); }

.foot-brand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 40px; padding-top: 40px; }
.foot__about { color: var(--color-muted); max-width: 58ch; font-size: var(--fs-small); }

.req {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark);
}
.req div { padding: 20px 24px 20px 0; font-size: var(--fs-small); line-height: 1.55; }
.req div + div { padding-left: 24px; border-left: 1px solid var(--line-dark); }
.req dt {
  font: 500 var(--fs-micro)/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: 8px;
}
.req dd { margin: 0; }
.req .mono { font-size: .875rem; }
.req a { text-decoration: underline; text-underline-offset: 3px; }
.req a:hover { color: var(--color-brand); }
.copy {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 18px 0 28px;
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--color-muted);
}

/* back to top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-header);
  width: var(--tap); height: var(--tap); display: grid; place-items: center;
  border: 1px solid var(--line-dark-strong); background: var(--color-surface); color: var(--color-text);
  cursor: pointer; transition: border-color var(--dur-fast), color var(--dur-fast), opacity var(--dur-base);
}
.to-top:hover { border-color: var(--color-brand); color: var(--color-brand); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nav, .topbar > .age { display: none; }
  .burger { display: grid; }
  .topbar { justify-content: space-between; }
  .topbar__end { display: flex; gap: 10px; align-items: center; }
}
@media (min-width: 1181px) {
  .topbar__end .age--m { display: none; }
  .topbar__end { display: none; }   /* both children (+18 mobile, burger) are hidden here */
  .mnav { display: none !important; }
}
@media (max-width: 1100px) {
  .foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot > :last-child { grid-column: 1 / -1; }
  .foot > :last-child ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .page-hero__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .brand__name { font-size: 1.0625rem; }
  .brand__sub { font-size: .6875rem; }
  .raceday__row { font-size: var(--fs-label); }
  .raceday__row > span + span::before { margin-inline: 10px; }
  .raceday__link { display: none; }
  .raceday .long { display: none; }
  .raceday .short { display: inline; }
  /* 2 × 2 on phones: label + date / time + status */
  .raceday__row { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 20px; }
  .raceday__row > span { min-height: 34px; }
  .raceday__row > span + span::before { display: none; }
  .rg { grid-template-columns: auto minmax(0, 1fr); }
  .rg .btn { grid-column: 1 / -1; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot > :last-child { grid-column: auto; }
  .req div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-dark); }
  .req div { padding-right: 0; }
}

/* below the approved 390: shrink, never change 390 itself */
@media (max-width: 389px) {
  .brand__name { font-size: .9375rem; }
  .brand__sub { display: none; }
  .topbar { gap: 12px; }
  .topbar__end { gap: 6px; }
  .age { min-width: 44px; padding: 0 6px; }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .req { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .req div:nth-child(3) { padding-left: 0; border-left: 0; }
  .req div:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
}

@media (max-width: 860px) {
  .toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc a { overflow-wrap: anywhere; }
}
