/* ============================================================
   Jackie Melo — Base: reset, tipografia, primitivas, utilidades
   Carregar após tokens.css. Componentes de seção ficam em public.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-on-light);
  background: var(--paper-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
svg { fill: currentColor; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600; /* Cormorant 600 = presença elegante, sem peso excessivo */
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
  color: inherit;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: 0; }
h4 { font-weight: 600; }

p { max-width: 68ch; }

::selection { background: var(--gold-300); color: var(--ink-900); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--r-xs);
}

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); }
/* Ritmo claro predominante: paper (off-white) / white / soft (bege). Dark é pontual e suave. */
.section--paper { background: var(--paper-50); color: var(--text-on-light); }
.section--white { background: var(--paper-0); color: var(--text-on-light); }
.section--soft  { background: var(--paper-100); color: var(--text-on-light); }
.section--dark  { background: var(--ink-800); color: var(--text-on-dark); }

/* Filete dourado — o "fio de ourives" que costura a marca */
.hr-gold { height: 1px; border: 0; background: var(--gold-line); }
.rule-foil { height: 1px; border: 0; background: var(--gold-foil); opacity: .85; }

/* ---- Eyebrow editorial ---- */
.eyebrow {
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-ink); /* contraste AA em fundo claro (padrão) */
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
/* Em fundo escuro (acento pontual), o dourado claro tem contraste alto e fica elegante.
   Nos demais contêineres (agora CLAROS), o eyebrow usa --gold-ink (AA). */
.section--dark .eyebrow {
  color: var(--gold-500);
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--gold-line);
}

/* Numeração de seção (cara de revista) */
.section-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-line);
  opacity: .7;
}
/* Quando o "section-num" carrega uma PALAVRA (não um número decorativo), precisa
   ser legível: preenchimento sólido dourado escuro (contraste AA em fundo claro). */
.section-num--word {
  color: var(--gold-ink);
  -webkit-text-stroke: 0;
  opacity: 1;
  font-style: italic;
}

/* ---- Botões ---- */
.btn {
  --_pad-y: .85rem; --_pad-x: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-text); font-size: .95rem; font-weight: 600;
  letter-spacing: .01em;
  padding: var(--_pad-y) var(--_pad-x);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-soft),
              box-shadow var(--dur-1) var(--ease-soft),
              background var(--dur-1) var(--ease-soft),
              color var(--dur-1) var(--ease-soft);
  position: relative; overflow: hidden;
  text-align: center;
}
.btn:focus-visible { box-shadow: var(--ring-focus); }

/* CTA dourado — ouro metálico premium (no máximo UM por tela) */
.btn--gold {
  background: linear-gradient(180deg, #E8C874 0%, var(--gold-600) 48%, #B98525 100%);
  color: var(--ink-900);
  border-color: var(--gold-600);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -2px 0 rgba(122,86,20,.20),
    0 8px 18px rgba(138,106,37,.16);
}
.btn--gold:hover {
  background: linear-gradient(180deg, #F0D487 0%, var(--gold-500) 48%, #C19232 100%);
  border-color: var(--gold-500);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.46),
    inset 0 -2px 0 rgba(122,86,20,.18),
    0 10px 22px rgba(138,106,37,.20);
}
.btn--gold:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #C99F3D 0%, var(--gold-600) 100%);
  box-shadow:
    inset 0 2px 4px rgba(122,86,20,.24),
    0 4px 10px rgba(138,106,37,.14);
}
.btn--gold:focus-visible { outline: 3px solid var(--gold-800); outline-offset: 3px; }
.btn--gold::after { content: none; }

/* Secundário: contorno dourado refinado */
.btn--ghost { background: var(--paper-0); border-color: var(--gold-line); color: var(--text-on-light); }
.btn--ghost:hover { background: var(--gold-soft); border-color: var(--gold-600); transform: translateY(-1px); }

.btn--block { width: 100%; }
.btn--lg { --_pad-y: 1.05rem; --_pad-x: 2rem; font-size: 1rem; }

/* Link com underline dourado que cresce da esquerda */
.link-gold { position: relative; color: inherit; font-weight: 600; }
.link-gold::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--gold-600); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-2) var(--ease-soft);
}
.link-gold:hover::after { transform: scaleX(1); }

/* ---- Formulários ---- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--text-on-light-muted); }
.input, .textarea, .select {
  font-family: var(--font-text); font-size: 1rem;
  padding: .9rem 1.1rem;
  background: var(--paper-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--text-on-light);
  transition: border-color var(--dur-1) var(--ease-soft), box-shadow var(--dur-1) var(--ease-soft);
  width: 100%;
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--gold-line); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--gold-600); box-shadow: var(--ring-focus);
}
.input::placeholder, .textarea::placeholder { color: var(--color-muted-2); }
.field--error .input { border-color: var(--error); }
.field-error { color: var(--error); font-size: var(--fs-small); }

/* ---- Alertas / flash ---- */
.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); font-size: .95rem; border: 1px solid transparent; }
.alert--error { background: #FBEAE8; color: var(--error); border-color: #F1C9C4; }
.alert--success { background: #E9F4EA; color: var(--success); border-color: #C7E3CA; }
.alert--info { background: var(--paper-100); color: var(--text-on-light); border-color: var(--border-soft); }

/* ---- Bullet dourado losango ---- */
.list-gold { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.list-gold li { position: relative; padding-left: 1.4rem; }
.list-gold li::before {
  content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px;
  background: var(--gold-600); transform: rotate(45deg);
}

/* ---- Reveal on scroll (JS adiciona .is-visible) ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
/* Sem JS (desabilitado/bloqueado/falho), o conteúdo NUNCA pode ficar invisível: a classe
   no-js no <html> só é removida quando o JS roda. Garante progressive enhancement (WCAG). */
.no-js .reveal { opacity: 1 !important; transform: none !important; }

/* ---- Acessibilidade ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 1000;
  background: var(--ink-900); color: var(--text-on-dark); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); transition: top var(--dur-2) var(--ease-soft);
}
.skip-link:focus { top: var(--sp-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Acessibilidade — refino (auditoria): foco visível, estados,
   alvos de toque, viewport dinâmico. Não altera identidade visual.
   ============================================================ */

/* Foco visível em componentes interativos não-nativos */
.radio-card:has(input:focus-visible),
.faq__item summary:focus-visible,
.slot:focus-visible,
.chip:focus-visible,
.cookie-banner__custom summary:focus-visible {
  box-shadow: var(--ring-focus);
  border-radius: var(--r-xs);
  outline: none;
}

/* Botão desabilitado: affordance correta (não parece clicável) */
.btn:disabled, .btn[disabled] {
  opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}
/* Estado de carregamento (aria-busy) */
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Âncoras navegáveis não aterrissam sob o header fixo (escopo restrito p/ não afetar campos internos) */
:target, #conteudo, main > section[id], main article[id], #inscricao, #contato-form {
  scroll-margin-top: calc(var(--header-h) + var(--sp-4));
}

/* Viewport dinâmico no hero (evita "pulo" da barra de URL no mobile) */
@supports (height: 100svh) {
  .hero { min-height: 100svh; }
}

/* Alvos de toque confortáveis no mobile (WCAG 2.5.8) */
@media (max-width: 760px) {
  .row-actions .btn--sm, .table-actions .btn--sm { min-height: 44px; }
  .row-actions, .table-actions { gap: var(--sp-3); }
}
