/* ==========================================================================
   Turfe em Cidade Jardim — design system (base)
   Tema: esmeralda + ouro, editorial paulista. Mobile-first, custom properties.
   Fontes: Fraunces (títulos) / Inter (texto), auto-hospedadas.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  /* Marca (ТЗ, "Визуальная система") */
  --emerald-900: #052E22;
  --emerald-800: #063D2E;   /* verde principal */
  --emerald-700: #0E5C42;   /* verde secundário */
  --emerald-600: #146E50;
  --emerald-500: #1C8A64;
  --gold:        #D4AF37;   /* ouro — acento decorativo e sobre fundo escuro */
  --gold-600:    #B8942A;
  --gold-650:    #96771A;   /* ouro para texto grande sobre claro (≥ 3:1) */
  --gold-700:    #6E570F;   /* ouro escuro para texto pequeno sobre claro (≥ 4,5:1) */
  --gold-200:    #EBD9A3;
  --gold-100:    #F3EAC6;
  --gold-050:    #FBF6E6;
  --ink:         #101317;
  --paper:       #F7F8F5;   /* fundo */
  --white:       #FFFFFF;

  /* Semântica */
  --bg:             var(--paper);
  --surface:        var(--white);
  --surface-2:      #FDFDFB;
  --surface-3:      #F0F2ED;
  --surface-dark:   var(--emerald-800);
  --surface-darker: var(--emerald-900);

  --text:               #16201B;
  --text-muted:         #56605A;
  --text-soft:          #66716B;          /* ≥ 4,5:1 sobre branco e sobre --paper */
  --text-invert:        #F4F6F1;
  --text-invert-muted:  rgba(244, 246, 241, .78);

  --hairline:        rgba(16, 19, 23, .10);
  --hairline-strong: rgba(16, 19, 23, .16);
  --hairline-gold:   rgba(212, 175, 55, .40);
  --hairline-invert: rgba(244, 246, 241, .18);
  --border-ui:       #7E8A83;             /* bordas de controles (≥ 3:1) */

  --success: #1C8A64;
  --danger:  #C2413B;
  --warning: #C98A12;

  /* Raios: botões e cartões entre 10 e 14 px (ТЗ) */
  --r-xs:  6px;
  --r-sm:  10px;
  --r:     12px;
  --r-lg:  14px;
  --r-pill: 999px;   /* só para selos/badges */

  /* Sombras */
  --sh-sm: 0 1px 2px rgba(16, 19, 23, .06), 0 1px 3px rgba(16, 19, 23, .05);
  --sh:    0 4px 14px rgba(16, 19, 23, .08), 0 2px 6px rgba(16, 19, 23, .05);
  --sh-lg: 0 18px 48px rgba(6, 61, 46, .16), 0 6px 18px rgba(16, 19, 23, .08);

  /* Tipografia */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs:   0.8125rem;  /* 13px — só rótulos em caixa alta */
  --fs-sm:   0.875rem;   /* 14px — texto de serviço, rodapé */
  --fs-base: 1rem;       /* 16px */
  --fs-md:   1.125rem;   /* 18px */
  --fs-lg:   1.35rem;
  --fs-xl:   clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem);
  --fs-2xl:  clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);   /* H2: 28–40 px */
  --fs-3xl:  clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);   /* H1: 36–60 px */

  --lh-tight: 1.1;
  --lh-snug:  1.28;
  --lh:       1.62;

  /* Layout: contêiner 1200 px; margens 16 / 24 / 32–40 px */
  --container:        1200px;
  --container-narrow: 780px;
  --gutter:           clamp(1rem, 3.2vw, 2.5rem);
  --header-h:         72px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .2s;
}

/* ---- 2. Reset / base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-width: 320px;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.16em; flex: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--gold-200); color: var(--ink); }
[hidden] { display: none !important; }

/* ---- 3. Tipografia ------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}
h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 500; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { color: var(--text-muted); }
strong { color: var(--text); font-weight: 600; }
small { font-size: var(--fs-sm); }
.prose { max-width: 70ch; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 1rem; }
.prose ul { display: grid; gap: .5rem; margin-top: .75rem; }
.prose ul li { position: relative; padding-left: 1.4rem; color: var(--text-muted); }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.prose a:not(.btn), .legal-body a:not(.btn), .callout a, .faq a { color: var(--emerald-700); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose a:not(.btn):hover, .legal-body a:not(.btn):hover { color: var(--emerald-800); }

/* ---- 4. Layout ---------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }
.section--soft { background: var(--surface-3); }
.section--dark { background: var(--surface-dark); color: var(--text-invert); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--text-invert); }
.section--dark p, .section--dark li { color: var(--text-invert-muted); }
.section--dark strong { color: var(--text-invert); }
.section--dark .prose a:not(.btn) { color: var(--gold); }
.stack > * + * { margin-top: 1rem; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
@media (max-width: 860px) { .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* ---- 5. Cabeçalhos de seção --------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-700);
}
.section--dark .eyebrow, .page-hero .eyebrow, .hero .eyebrow { color: var(--gold); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--gold); border-radius: 2px; flex: none; }
.section-head { max-width: 64ch; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section-head h2 { margin-top: .5rem; }
.section-head .lead { margin-top: .75rem; font-size: var(--fs-md); }
.accent { color: var(--gold-650); font-style: italic; }
.section--dark .accent, .hero .accent, .page-hero .accent { color: var(--gold); }

/* ---- 6. Botões (altura ≥ 48 px; área de toque ≥ 44 px) ------------------ */
.btn {
  --btn-bg: var(--emerald-800);
  --btn-fg: var(--text-invert);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .75rem 1.4rem; min-height: 48px;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em; line-height: 1.3;
  text-align: center;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent; border-radius: var(--r);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  max-width: 100%;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { background: var(--emerald-700); box-shadow: var(--sh); }
.btn--gold { --btn-bg: var(--gold); --btn-fg: var(--ink); }
.btn--gold:hover { background: var(--gold-600); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--emerald-800); border-color: var(--border-ui); }
.btn--outline:hover { border-color: var(--emerald-700); background: var(--surface-3); box-shadow: none; }
.btn--ghost-invert { --btn-bg: transparent; --btn-fg: var(--text-invert); border-color: rgba(244, 246, 241, .55); }
.btn--ghost-invert:hover { background: rgba(255, 255, 255, .1); box-shadow: none; }
.btn--lg { padding: .9rem 1.75rem; font-size: var(--fs-base); min-height: 52px; }
.btn--sm { padding: .5rem 1rem; min-height: 44px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 480px) {
  .btn-row .btn { width: 100%; }
}

/* ---- 7. Selos ----------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-muted);
}
.badge .ic { width: 14px; height: 14px; }
.badge--gold { background: var(--gold); color: var(--ink); font-weight: 700; }
.badge--emerald { background: rgba(20, 110, 80, .12); color: var(--emerald-700); }
.badge--18 { background: var(--danger); color: #fff; font-weight: 700; padding: .3rem .6rem; letter-spacing: .01em; }
.badge--grupo { background: var(--ink); color: var(--gold); font-weight: 700; }
.pareo-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--emerald-800); color: var(--gold);
  font-weight: 700; font-size: var(--fs-sm); flex: none;
}

/* ---- 8. Cartões --------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  min-width: 0;
}
.card--pad { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.card--dark { background: var(--surface-dark); color: var(--text-invert); border-color: var(--hairline-invert); }
.card--dark h2, .card--dark h3, .card--dark h4 { color: var(--text-invert); }
.card--dark p { color: var(--text-invert-muted); }
.card--dark strong { color: var(--text-invert); }
.card h3 { font-size: var(--fs-md); }
.card h3 .ic { color: var(--emerald-700); }
.card p { font-size: var(--fs-sm); margin-top: .5rem; }
.card p a:not(.btn) { color: var(--emerald-700); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.card--dark p a:not(.btn), .link-ouro { color: var(--gold); }
.rule { height: 1px; background: var(--hairline); border: 0; }
.rule--gold { background: linear-gradient(90deg, transparent, var(--hairline-gold), transparent); }

/* ---- 9. Cabeçalho ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow var(--dur) var(--ease);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--paper); } }
.site-header.is-scrolled { box-shadow: var(--sh); }
.header-bar { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .65rem; flex: none; min-width: 0; }
.brand__crest { width: 44px; height: 44px; color: var(--emerald-800); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--emerald-800); letter-spacing: -0.01em; white-space: nowrap; }
.brand__tag { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); font-weight: 600; margin-top: .2rem; }

.nav-main { display: none; align-items: center; gap: .25rem; margin-inline: auto; }
.nav-main a {
  position: relative; display: inline-flex; align-items: center;
  min-height: 44px; padding: .5rem .8rem; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-main a::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .3rem; height: 2px;
  background: var(--gold); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-main a:hover { color: var(--emerald-700); }
.nav-main a:hover::after, .nav-main a[aria-current]::after { transform: scaleX(1); }
.nav-main a[aria-current] { color: var(--emerald-800); font-weight: 600; }

/* Menu móvel (details/summary): funciona sem JS, não é modal, não bloqueia o resto da página. */
.nav-mobile { margin-left: auto; }
.nav-mobile > summary {
  list-style: none; display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; min-width: 44px; padding: .45rem .7rem;
  border: 1px solid var(--border-ui); border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600; color: var(--emerald-800); cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary:hover { background: var(--surface-3); border-color: var(--emerald-700); }
.nav-toggle .ic { width: 20px; height: 20px; }
.nav-toggle__close { display: none; }
.nav-mobile[open] .nav-toggle__open { display: none; }
.nav-mobile[open] .nav-toggle__close { display: inline-flex; }
.nav-mobile__panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 65;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  background: var(--surface); border-bottom: 1px solid var(--hairline); box-shadow: var(--sh-lg);
  padding: .75rem var(--gutter) 1rem;
}
.nav-mobile__panel a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 48px; padding: .7rem .9rem; border-radius: var(--r-sm);
  font-size: var(--fs-base); font-weight: 500; color: var(--text);
}
.nav-mobile__panel a .ic { width: 18px; height: 18px; color: var(--gold-650); }
.nav-mobile__panel a:hover { background: var(--surface-3); color: var(--emerald-800); }
.nav-mobile__panel a[aria-current] { background: var(--surface-3); color: var(--emerald-800); font-weight: 600; }
.nav-mobile__meta { margin-top: .75rem; padding: .5rem .9rem 0; border-top: 1px solid var(--hairline); font-size: var(--fs-sm); color: var(--text-soft); }

@media (max-width: 440px) { .nav-toggle__label { display: none; } .brand__tag { display: none; } }
@media (max-width: 359px) { .brand__name { font-size: .92rem; } }
@media (min-width: 1024px) {
  .nav-main { display: flex; }
  .nav-mobile { display: none; }
  :root { --header-h: 80px; }
}

/* ---- 10. Rodapé (texto ≥ 14 px) ----------------------------------------- */
.site-footer { background: var(--surface-darker); color: var(--text-invert); padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; font-size: var(--fs-sm); }
.footer-top { display: grid; gap: 2rem clamp(1.5rem, 4vw, 3rem); grid-template-columns: minmax(0, 1fr); }
.footer-brand { max-width: 36ch; }
.footer-brand .brand__name, .footer-brand .brand__crest { color: var(--text-invert); }
.footer-brand .brand__tag { color: var(--gold); }
.footer-brand p { color: var(--text-invert-muted); margin-top: 1rem; font-size: var(--fs-sm); }
.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
.footer-col { min-width: 0; }
.footer-col h3 { font-family: var(--font-body); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: .75rem; }
.footer-col a { display: block; padding: .35rem 0; font-size: var(--fs-sm); color: var(--text-invert-muted); transition: color var(--dur) var(--ease); }
.footer-col a:hover { color: var(--text-invert); text-decoration: underline; }
.footer-col p { font-size: var(--fs-sm); color: var(--text-invert-muted); margin-top: .35rem; overflow-wrap: anywhere; }
.footer-col p strong { color: var(--text-invert); }
.footer-col p a { display: inline; padding: 0; text-decoration: underline; }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline-invert);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  font-size: var(--fs-sm); color: var(--text-invert-muted);
}
@media (min-width: 640px) { .footer-top { grid-template-columns: 1.2fr 2fr; } }
@media (min-width: 900px) { .footer-cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
@media (max-width: 480px) { .footer-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---- 11. Utilitários ---------------------------------------------------- */
.text-center { text-align: center; }
.visually-hidden {
  position: absolute !important; 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: 50%; top: -80px; transform: translateX(-50%);
  background: var(--emerald-800); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 var(--r) var(--r);
  z-index: 100; transition: top var(--dur) var(--ease); font-weight: 600;
}
.skip-link:focus { top: 0; }

.to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--emerald-800); color: var(--gold); box-shadow: var(--sh-lg);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.no-js .to-top { display: none; }

/* ---- 12. Movimento reduzido --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
