/* ==========================================================================
   Praça do Samba · estilos
   Organização: 1) fontes  2) tokens  3) base  4) layout  5) componentes
   6) seções  7) utilitários  8) movimento/impressão
   Regra de ouro: cores, espaços e tipos SEMPRE via tokens (variáveis CSS).
   ========================================================================== */

/* 1) Fontes auto-hospedadas (LGPD: nenhuma requisição a terceiros) ------- */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  /* Atkinson Hyperlegible: desenhada para leitores com baixa visão */
  font-family: "Atkinson";
  src: url("/assets/fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

@font-face {
  /* Algarismos sem o zero cortado da Atkinson (protocolo e CEP mais claros) */
  font-family: "Digits";
  src: url("/assets/fonts/digits.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+0030-0039;
}

/* 2) Tokens --------------------------------------------------------------- */
:root {
  /* Cores (todas as combinações de texto passam WCAG AA; a maioria AAA) */
  --c-bg: #FBF6EC;        /* creme */
  --c-surface: #FFFFFF;
  --c-tint: #F3ECDD;      /* creme mais escuro p/ seções alternadas */
  --c-ink: #14231B;       /* texto principal: 15.6:1 sobre --c-bg */
  --c-muted: #4A5A50;     /* texto secundário: 7.1:1 sobre --c-bg */
  --c-line: #E2D8C4;
  --c-forest: #123A2A;    /* marca */
  --c-forest-2: #1C5038;
  --c-leaf: #266B42;      /* 5.4:1 sobre --c-tint */
  --c-sun: #F2B33D;       /* destaque / foco */
  --c-clay: #B4472A;      /* acento (somente texto grande) */
  --c-whats: #0B7A3E;     /* verde WhatsApp escurecido p/ contraste AA */

  /* Tipografia (escala fluida) */
  --f-display: "Fraunces", ui-serif, Georgia, serif;
  --f-body: "Digits", "Atkinson", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-sm: 0.9375rem;
  --t-base: 1.125rem;                          /* 18px: confortável p/ idosos */
  --t-lg: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);
  --t-h3: 1.25rem;
  --t-h2: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);
  --t-display: clamp(2.625rem, 1.4rem + 5.6vw, 5.5rem);

  /* Espaço, raio, sombra */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: clamp(4rem, 3rem + 4vw, 7rem);
  --r-sm: 10px; --r-md: 16px; --r-lg: 28px; --r-pill: 999px;
  --shadow: 0 1px 2px rgb(20 35 27 / 6%), 0 8px 24px -12px rgb(20 35 27 / 18%);
  --container: 72rem;
  --focus: 0 0 0 3px var(--c-bg), 0 0 0 6px var(--c-forest);
}

/* 3) Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: 400 var(--t-base)/1.6 var(--f-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-forest-2); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--c-forest); text-decoration-thickness: 2.5px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
strong { font-weight: 700; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
kbd, code {
  font: 600 0.95em var(--f-mono);
  background: var(--c-tint); border: 1px solid var(--c-line);
  border-radius: 6px; padding: 0.1em 0.4em;
}
q { quotes: "“" "”"; }

/* 4) Layout --------------------------------------------------------------- */
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.section { padding-block: var(--s-8); }
.section--tint { background: var(--c-tint); }
.section--ink { background: var(--c-forest); color: #F4EFE3; }
.section__head { max-width: 42rem; margin-bottom: var(--s-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* 5) Componentes ---------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--c-forest); color: #fff; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: var(--s-4); }

.display {
  font: 560 var(--t-display)/0.98 var(--f-display);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.025em; color: var(--c-forest);
}
.h2 {
  font: 560 var(--t-h2)/1.05 var(--f-display);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em; color: var(--c-forest);
  margin-bottom: var(--s-4);
}
.display em, .h2 em { font-style: italic; font-weight: 480; color: var(--c-clay); }
.section--ink .h2 { color: #FFF8EA; }
.section--ink .h2 em { color: var(--c-sun); }
.lead { font-size: var(--t-lg); color: var(--c-muted); max-width: 38rem; }
.muted { color: var(--c-muted); }
.eyebrow {
  font: 700 0.875rem/1.2 var(--f-body); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-leaf); margin-bottom: var(--s-3);
}
.eyebrow--light { color: var(--c-sun); }
.fineprint { font-size: var(--t-sm); color: var(--c-muted); margin-top: var(--s-5); }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-pill); padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  font-size: var(--t-sm); font-weight: 700; color: var(--c-forest);
  box-shadow: var(--shadow); margin-bottom: var(--s-5);
}
.chip__dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--c-leaf); box-shadow: 0 0 0 4px rgb(47 122 77 / 18%); }

/* Botões: alvo mínimo 48px (WCAG 2.5.8 / idosos) */
.btn {
  --btn-bg: var(--c-surface); --btn-fg: var(--c-forest); --btn-bd: var(--c-line);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0.7rem 1.25rem;
  font: 700 1rem/1.2 var(--f-body); text-decoration: none; cursor: pointer;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1.5px solid var(--btn-bd); border-radius: var(--r-pill);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); color: var(--btn-fg); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: var(--c-forest); --btn-fg: #FFF8EA; --btn-bd: var(--c-forest); box-shadow: var(--shadow); }
.btn--primary:hover { --btn-bg: var(--c-forest-2); }
.btn--secondary { --btn-bg: transparent; --btn-fg: var(--c-forest); --btn-bd: var(--c-forest); }
.btn--ghost { --btn-bg: var(--c-surface); }
.btn--light { --btn-bg: #FFF8EA; --btn-fg: var(--c-forest); --btn-bd: #FFF8EA; }
.btn--whats { --btn-bg: var(--c-whats); --btn-fg: #fff; --btn-bd: var(--c-whats); }
.btn--lg { min-height: 56px; padding-inline: 1.6rem; font-size: 1.0625rem; }
.btn--sm { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.9375rem; }
.btn.is-done { --btn-bg: var(--c-leaf); --btn-fg: #fff; --btn-bd: var(--c-leaf); }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--fill { fill: currentColor; stroke: none; }

/* Cabeçalho */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgb(251 246 236 / 88%); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgb(226 216 196 / 70%);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: var(--s-3); min-width: 0; text-decoration: none; color: var(--c-ink); }
.brand__mark { flex: none; }
.brand__mark { width: 2.25rem; height: 2.25rem; }
.brand span { display: grid; line-height: 1.15; white-space: nowrap; }
.brand strong { font: 600 1.125rem var(--f-display); color: var(--c-forest); }
.brand small { font-size: 0.8125rem; color: var(--c-muted); }

/* Caixa de copiar */
.copybox {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; margin-top: var(--s-4);
}
.copybox__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--c-line); background: #FDFAF3;
}
.copybox__label { font-weight: 700; font-size: var(--t-sm); color: var(--c-forest); }
.copybox__text {
  margin: 0; padding: var(--s-4); max-height: 22rem; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font: 400 1rem/1.6 var(--f-body); color: var(--c-ink);
}
.copybox--sm .copybox__text { max-height: none; }
.copybox--dark { background: rgb(255 255 255 / 6%); border-color: rgb(255 255 255 / 16%); box-shadow: none; }
.copybox--dark .copybox__head { background: rgb(255 255 255 / 5%); border-color: rgb(255 255 255 / 14%); }
.copybox--dark .copybox__label, .copybox--dark .copybox__text { color: #F4EFE3; }

/* Campos (endereço) */
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin: var(--s-4) 0; }
.field { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); }
.field--wide { grid-column: 1 / -1; }
.field dt { font-size: 0.8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.field dd { margin: var(--s-1) 0 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.field code { background: none; border: 0; padding: 0; font: 700 1.0625rem/1.4 var(--f-body); color: var(--c-ink); }

.hint { font-size: var(--t-sm); color: var(--c-muted); }
.callout { background: #EAF3EC; border-left: 4px solid var(--c-leaf); padding: var(--s-4); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Disclosure (detalhes/FAQ) */
.disclosure { border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); margin-top: var(--s-3); }
.disclosure summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; padding: var(--s-3) var(--s-5); font-weight: 700; color: var(--c-forest);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after {
  content: ""; width: 0.65rem; height: 0.65rem; flex: none;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg) translateY(-25%); transition: transform .2s ease;
}
.disclosure[open] summary::after { transform: rotate(-135deg) translateY(-25%); }
.disclosure__body { padding: 0 var(--s-5) var(--s-5); color: var(--c-muted); }
.disclosure__body .copybox__text { color: var(--c-ink); }
.extras { display: grid; gap: var(--s-3); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: max(var(--s-5), env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 150%); opacity: 0;
  background: var(--c-ink); color: #fff; font-weight: 700;
  padding: var(--s-3) var(--s-5); border-radius: var(--r-pill); box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s ease; pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* 6) Seções ---------------------------------------------------------------- */
.hero { padding-top: clamp(2.5rem, 2rem + 4vw, 5.5rem); }
.hero__inner { text-align: left; }
.hero .lead { margin-top: var(--s-5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__art { margin-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); margin-bottom: 0; }
.hero__art img { width: 100%; border-radius: var(--r-lg); box-shadow: 0 30px 60px -30px rgb(18 58 42 / 45%); aspect-ratio: 3 / 2; object-fit: cover; }
.hero__art figcaption { font-size: var(--t-sm); color: var(--c-muted); margin-top: var(--s-3); text-align: center; font-style: italic; }

.facts { margin-top: var(--s-7); }
.facts__grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-block: 1px solid var(--c-line); }
.facts__grid > div { padding: var(--s-5) var(--s-4); display: flex; flex-direction: column; justify-content: flex-start; gap: var(--s-2); }
.facts__grid > div + div { border-left: 1px solid var(--c-line); }
.facts dt { font-size: var(--t-sm); color: var(--c-muted); }
.facts dd { order: -1; margin: 0; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; font: 560 clamp(2rem, 1.5rem + 2vw, 3rem)/1 var(--f-display); color: var(--c-forest); letter-spacing: -0.02em; }

.video { display: grid; grid-template-columns: minmax(0, 22rem) 1fr; gap: var(--s-6); align-items: center; }
.video video { width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-lg); background: var(--c-forest); box-shadow: var(--shadow); }
.video__side { display: grid; gap: var(--s-3); justify-items: start; max-width: 28rem; }
.video__side p { color: var(--c-muted); }

.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.gallery a { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 5; background: var(--c-line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery a:hover img { transform: scale(1.04); }
.gallery span {
  position: absolute; inset: auto var(--s-2) var(--s-2) var(--s-2);
  display: flex; align-items: center; justify-content: space-between;
  background: rgb(20 35 27 / 82%); color: #fff; backdrop-filter: blur(6px);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-weight: 700; font-size: var(--t-sm);
}
.gallery span::after { content: "↓"; font-size: 1.1em; }

/* Linha do tempo de passos */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step { position: relative; counter-increment: step; padding: 0 0 var(--s-7) 4.25rem; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: -0.25rem;
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  background: var(--c-forest); color: var(--c-sun); border-radius: 50%;
  font: 600 1.25rem var(--f-display);
}
.step::after { content: ""; position: absolute; left: 1.3125rem; top: 2.75rem; bottom: 0.25rem; width: 2px; background: var(--c-line); }
.step:last-child { padding-bottom: var(--s-5); }
.step:last-child::after { display: none; }
.step__title { font: 600 var(--t-h3)/1.3 var(--f-body); color: var(--c-ink); margin-bottom: var(--s-2); }
.step > p { color: var(--c-muted); max-width: 40rem; }

.share { display: grid; grid-template-columns: 1fr auto; gap: var(--s-7); align-items: center; }
.share p { color: #D9D2C1; }
.qr { margin: 0; text-align: center; max-width: 15rem; }
.qr img { background: #fff; padding: var(--s-4); border-radius: var(--r-md); margin-inline: auto; }
.qr figcaption { font-size: var(--t-sm); color: #D9D2C1; margin-top: var(--s-3); }
.qr a { color: var(--c-sun); }

.law { display: grid; gap: var(--s-3); margin: 0; }
.law > div { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); }
.law dt { font-weight: 700; color: var(--c-forest); margin-bottom: var(--s-1); }
.law dd { margin: 0; color: var(--c-muted); }

.footer { border-top: 1px solid var(--c-line); padding-block: var(--s-6); font-size: var(--t-sm); color: var(--c-muted); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); }

/* Página de texto simples (privacidade) */
.prose { padding-block: var(--s-7); max-width: 42rem; }
.prose h1 { font: 560 var(--t-h2)/1.1 var(--f-display); color: var(--c-forest); margin-bottom: var(--s-5); }
.prose h2 { font: 700 var(--t-h3) var(--f-body); margin: var(--s-6) 0 var(--s-2); }

/* Responsivo --------------------------------------------------------------- */
@media (max-width: 52rem) {
  .video, .share { grid-template-columns: 1fr; }
  .video video { max-width: 22rem; }
  .qr { justify-self: center; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .fields { grid-template-columns: 1fr 1fr; }
  .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 36rem) {
  /* Celular: linhas com os números numa coluna comum (subgrid), rótulos alinhados à direita deles */
  .facts__grid { grid-template-columns: max-content 1fr; column-gap: var(--s-5); }
  .facts__grid > div {
    grid-column: 1 / -1; display: grid; grid-template-columns: subgrid;
    align-items: center; padding: var(--s-4) 0;
  }
  .facts__grid > div + div { border-left: 0; border-top: 1px solid var(--c-line); }
  .facts dd { font-size: 1.875rem; }
  .facts dt { line-height: 1.35; }
  .hero__actions .btn, .row .btn { width: 100%; }
  .step { padding-left: 3.5rem; }
  .step::before { width: 2.375rem; height: 2.375rem; font-size: 1.125rem; }
  .step::after { left: 1.125rem; top: 2.375rem; }
  .fields { grid-template-columns: 1fr; }
  .topbar .btn { padding-inline: 0.85rem; flex: none; }
}
@media (max-width: 26rem) {
  /* Telas bem estreitas: botão vira só ícone (rótulo continua para leitores de tela) */
  .topbar .btn { width: 48px; height: 48px; min-height: 48px; padding: 0; gap: 0; border-radius: 50%; }
  .topbar .btn__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* 7) Utilitários ----------------------------------------------------------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* 8) Movimento reduzido e alto contraste ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .btn, .chip, .copybox, .field, .disclosure { border: 1px solid CanvasText; }
}
