/* ==========================================================================
   Carvalho & Gueiros Advocacia
   Ordem: tokens, reset, base, layout, componentes, seções, utilitários, media
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS

   Paleta extraída do manual de marca do escritório, o arquivo
   Logo_Geraldo_Carvalho.pdf da pasta Identidade Visual no Drive.
   O dourado e o prata são amostras do próprio logo; o terracota é o fundo
   do ensaio fotográfico, então a foto e a página falam a mesma língua.
   A fonte Sarabun também veio de lá.

   Nenhum valor de cor aparece fora deste bloco.
   -------------------------------------------------------------------------- */
:root {
  /* Preto da marca. O logo usa um gradiente que vai de #100F0D a #211E29. */
  --brand-deeper:    #0B0B0D;
  --brand-deep:      #14141A;
  --brand-mid:       #23232B;

  /* Terracota do fundo das fotos, medido em #432316. */
  --terra:           #432316;
  --terra-deep:      #2C160D;

  /* Dourado do logo. --accent-deep é o único que passa contraste sobre claro. */
  --accent:          #B99E6A;
  --accent-light:    #CCB374;
  --accent-deep:     #86662D;
  --accent-soft:     #EFE4CE;

  /* Prata do logo, para linha fina e detalhe sobre escuro. */
  --silver:          #C6C6C2;

  --white:           #FFFFFF;
  --canvas:          #FFFFFF;
  --canvas-alt:      #F6F4F0;
  --ink:             #16161A;
  --muted:           #5A5A60;
  --border:          #E5E1D9;
  --on-deep:         #F2F0EC;
  --on-deep-muted:   #B0AEA9;

  /* Tipografia: Sarabun, a fonte da marca, servida do próprio domínio. */
  --font-display: "Sarabun", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Sarabun", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --text-h1:      clamp(2.25rem, 5.5vw, 3.9rem);
  --text-h2:      clamp(1.8rem, 4vw, 2.8rem);
  --text-h3:      clamp(1.15rem, 2.4vw, 1.45rem);
  --text-lead:    clamp(1.05rem, 1.9vw, 1.25rem);
  --text-body:    1rem;
  --text-small:   0.875rem;
  --text-eyebrow: 0.75rem;

  --step-1: 0.5rem;
  --step-2: 1rem;
  --step-3: 1.5rem;
  --step-4: 2rem;
  --step-6: 3rem;
  --step-8: 4rem;

  --container: 1200px;
  --gutter:    clamp(1.25rem, 5vw, 2.5rem);
  --section-v: clamp(4rem, 9vw, 7.5rem);
  --header-h:  86px;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 14px 40px rgba(11, 11, 13, 0.13);
  --shadow-sm: 0 4px 16px rgba(11, 11, 13, 0.09);
  --ring:      0 0 0 3px rgba(185, 158, 106, 0.55);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   1b. FONTE DA MARCA

   Sarabun servida do próprio domínio, não do CDN do Google: em site de
   escritório de advocacia, o IP de quem visita não precisa ir para um
   terceiro antes de a pessoa aceitar qualquer coisa.

   ATENÇÃO, e isto vale para toda peça gráfica do escritório: o arquivo
   Sarabun que está na pasta Identidade Visual do Drive é a versão 1.3.2,
   de 2013, e nela os acentos agudos e circunflexos do português são
   desenhados fora da caixa da linha. "Maceió" sai "Maceio" na tela.
   Os arquivos servidos aqui são a Sarabun oficial do Google Fonts, a mesma
   fonte da marca em versão corrigida. Os dois estão guardados em
   MARCA/fontes, e o defeito está registrado no DECISOES.md.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Sarabun";
  src: url("/assets/fonts/sarabun-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("/assets/fonts/sarabun-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("/assets/fonts/sarabun-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sarabun";
  src: url("/assets/fonts/sarabun-400i.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   3. BASE
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--text-h1); letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); letter-spacing: -0.015em; }
h3 { font-size: var(--text-h3); }

p + p { margin-top: var(--step-2); }
strong { font-weight: 650; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand-deep); color: var(--white);
  padding: var(--step-2) var(--step-3); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-v); }
.section-alt { background: var(--canvas-alt); }
.section-deep { background: var(--brand-deep); color: var(--on-deep); }
.section-deep h2 { color: var(--white); }
.section-head { max-width: 60ch; margin-bottom: var(--step-6); }
.section-head .lead { margin-top: var(--step-2); font-size: var(--text-lead); color: var(--muted); }
.section-deep .section-head .lead { color: var(--on-deep-muted); }

.eyebrow {
  display: inline-block;
  font-size: var(--text-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: var(--step-2);
}
.section-deep .eyebrow { color: var(--accent-soft); }

/* --------------------------------------------------------------------------
   5. COMPONENTES
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.95em 1.6em;
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; line-height: 1;
  cursor: pointer; text-align: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--brand-deeper); }
.btn-primary:hover { background: var(--accent-deep); color: var(--white); }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-outline { border-color: var(--border); background: var(--white); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); }
/* Dentro do header e do rodapé, que são escuros, o contorno inverte. */
#header .btn-outline, #footer .btn-outline {
  background: transparent; color: var(--on-deep); border-color: rgba(198, 198, 194, 0.35);
}
#header .btn-outline:hover, #footer .btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-block { width: 100%; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex; flex-direction: column;
}
.card h3 { margin-bottom: var(--step-2); }
.card > p { color: var(--muted); }

.card-list { margin-top: var(--step-3); display: grid; gap: 0.6rem; }
.card-list li { position: relative; padding-left: 1.6rem; font-size: 0.95rem; }
.card-list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

.note {
  margin-top: var(--step-3);
  padding: var(--step-3);
  background: var(--canvas-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}
.card .note { margin-top: auto; }

.grid { display: grid; gap: var(--step-4); }
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   6. HEADER
   -------------------------------------------------------------------------- */
/* O header é escuro porque o logo da marca só existe em versão clara sobre
   fundo escuro e em versão escura sobre fundo claro. Sobre o preto do manual,
   o lockup prata e dourado aparece exatamente como foi desenhado. */
#header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(198, 198, 194, 0.16);
  color: var(--on-deep);
}
#header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--step-3); }
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand img { height: 48px; width: auto; object-fit: contain; }
@media (min-width: 900px) { .brand img { height: 58px; } }
.nav { display: none; gap: var(--step-4); }
.nav a { font-size: 0.95rem; color: var(--on-deep-muted); transition: color 0.2s var(--ease); }
.nav a:hover { color: var(--accent-light); }
.header-cta { display: none; }
/* 44px de alvo de toque, mínimo recomendado para acessibilidade */
.nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; background: none; border: 0; padding: 0.75rem 0.5rem; min-height: 44px; min-width: 44px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--on-deep); transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  background: var(--brand-deeper); border-bottom: 1px solid rgba(198, 198, 194, 0.16);
  color: var(--on-deep);
  padding: var(--step-4) var(--gutter) var(--step-6);
  display: grid; gap: var(--step-3);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a { font-size: 1.1rem; }

@media (min-width: 900px) {
  .nav, .header-cta { display: flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none; }
}

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
/* O terracota entra no gradiente porque é a cor do fundo do ensaio
   fotográfico do escritório: a foto e a página passam a ser a mesma peça. */
#hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 78% 12%, rgba(67, 35, 22, 0.85) 0%, rgba(67, 35, 22, 0) 62%),
    linear-gradient(160deg, var(--brand-deep) 0%, var(--brand-deeper) 100%);
  color: var(--on-deep);
  padding-block: clamp(3.5rem, 9vw, 7rem);
  overflow: hidden;
}
#hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: var(--step-6); align-items: center; }
.hero-figure { position: relative; justify-self: center; max-width: 420px; width: 100%; }
.hero-figure img {
  width: 100%; border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(11, 11, 13, 0.55);
}
/* Fio dourado atrás da foto, o mesmo dourado do logo. */
.hero-figure::after {
  content: ""; position: absolute; inset: auto -14px -14px auto;
  width: 62%; height: 62%; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  border-radius: 0 0 var(--radius-lg) 0; z-index: -1;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--step-8); }
  .hero-figure { justify-self: end; max-width: 460px; }
}
#hero h1 { color: var(--white); max-width: 16ch; }
#hero .lead { margin-top: var(--step-3); font-size: var(--text-lead); color: var(--on-deep-muted); max-width: 54ch; }
.hero-actions { margin-top: var(--step-6); display: flex; flex-wrap: wrap; gap: var(--step-2); }
.hero-trust {
  margin-top: var(--step-4); padding-top: var(--step-3);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; flex-wrap: wrap; gap: 0.5rem var(--step-3);
  font-size: var(--text-small); color: var(--on-deep-muted);
}
.hero-trust li { display: flex; align-items: center; gap: 0.45rem; }
.hero-trust li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* --------------------------------------------------------------------------
   7b. FIGURA EM DUAS COLUNAS
   Usada nas seções que ganham foto ao lado do texto.
   -------------------------------------------------------------------------- */
.media-grid { display: grid; gap: var(--step-6); align-items: center; }
@media (min-width: 900px) {
  .media-grid { grid-template-columns: 1fr 1fr; gap: var(--step-8); }
  .media-grid.media-right .media-figure { order: 2; }
}
/* isolation cria o contexto de empilhamento aqui, senao o fio dourado com
   z-index negativo cai atras do fundo pintado da secao e some. */
.media-figure { position: relative; isolation: isolate; }
.media-figure img { position: relative; z-index: 1; width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.media-figure::after {
  content: ""; position: absolute; inset: -12px -12px auto auto; z-index: 0;
  width: 46%; height: 46%; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent);
  border-radius: 0 var(--radius-lg) 0 0;
}

/* Faixa larga com foto de fundo, para separar blocos da página. */
.faixa-foto {
  position: relative; isolation: isolate;
  background: var(--brand-deeper); color: var(--on-deep);
  padding-block: clamp(4rem, 9vw, 7rem);
}
.faixa-foto img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%; z-index: -2;
}
.faixa-foto::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(11, 11, 13, 0.94) 0%, rgba(11, 11, 13, 0.82) 46%, rgba(44, 22, 13, 0.62) 100%);
}

/* --------------------------------------------------------------------------
   8. FAIXA DE CREDENCIAIS
   -------------------------------------------------------------------------- */
#credenciais { background: var(--canvas-alt); border-bottom: 1px solid var(--border); padding-block: var(--step-6); }
.cred-item strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--brand-deep); }
.cred-item span { font-size: var(--text-small); color: var(--muted); }

/* --------------------------------------------------------------------------
   9. COMO FUNCIONA
   -------------------------------------------------------------------------- */
.step { position: relative; padding-top: var(--step-4); }
.step::before {
  content: attr(data-step);
  position: absolute; top: 0; left: 0;
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 600;
  color: var(--accent-soft); line-height: 1;
}
.step h3 { margin-bottom: var(--step-1); }
.step p { color: var(--muted); }
.section-deep .step p { color: var(--on-deep-muted); }
.section-deep .step::before { color: var(--accent); }

/* --------------------------------------------------------------------------
   10. PROVA
   -------------------------------------------------------------------------- */
.prova-grid { display: grid; gap: var(--step-6); }
@media (min-width: 900px) { .prova-grid { grid-template-columns: 1.2fr 0.8fr; align-items: center; } }
/* O texto desta secao divide a linha com um retrato vertical alto. Numa
   coluna de metade da largura, o corpo em 1rem deixava um vazio grande ao
   lado da foto: aqui ele sobe para a escala de lead. */
.prova-texto p { font-size: var(--text-lead); line-height: 1.6; }
.prova-texto .prova-numbers { margin-top: var(--step-6); }

/* Numa coluna de meia largura, tres colunas lado a lado dao cerca de
   130px uteis e "OAB/AL 478/16" nao cabe: quebrava em duas linhas e o
   rotulo em tres. Empilhado em linhas, cada item tem a largura inteira,
   e a altura extra ajuda a coluna de texto a acompanhar o retrato. */
.prova-numbers { display: grid; gap: var(--step-2); }
.prova-numbers div {
  display: flex; align-items: baseline; gap: 0.85rem; flex-wrap: wrap;
  border-left: 2px solid var(--accent); padding-left: var(--step-3);
}
.prova-numbers strong { flex: 0 0 auto; font-family: var(--font-display); font-size: 1.1rem; color: var(--white); line-height: 1.3; }
.prova-numbers span { font-size: var(--text-small); color: var(--on-deep-muted); line-height: 1.4; }

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: 76ch; margin-inline: auto; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--step-3);
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: var(--step-3) 0; font-weight: 600; font-size: 1.05rem;
}
.faq-q::after {
  content: ""; flex: 0 0 auto; width: 11px; height: 11px; margin-top: 0.45em;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq-q[aria-expanded="true"]::after { transform: rotate(-135deg); }
.faq-a { display: none; padding-bottom: var(--step-3); color: var(--muted); max-width: 68ch; }
.faq-a.is-open { display: block; }

/* --------------------------------------------------------------------------
   12. CONTATO
   -------------------------------------------------------------------------- */
.contato-grid { display: grid; gap: var(--step-6); }
@media (min-width: 900px) { .contato-grid { grid-template-columns: 1fr 1fr; } }
.contato-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: var(--shadow-sm); }
.contato-box h3 { margin-bottom: var(--step-2); }
.info-line { display: flex; gap: var(--step-2); padding-block: var(--step-2); border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.info-line:last-child { border-bottom: 0; }
.info-line dt { flex: 0 0 auto; min-width: 9rem; color: var(--muted); }
.info-line dd { font-weight: 500; }
/* No celular o rotulo comia quase metade da largura, e o endereco quebrava
   em quatro linhas. Empilhado, cada um ocupa a linha inteira. */
@media (max-width: 560px) {
  .info-line { display: grid; gap: 0.15rem; }
  .info-line dt { min-width: 0; }
}
.map-embed { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: var(--canvas-alt); }

/* --------------------------------------------------------------------------
   13. RODAPÉ
   -------------------------------------------------------------------------- */
#footer { background: var(--brand-deeper); color: var(--on-deep-muted); padding-block: var(--step-8) var(--step-6); font-size: var(--text-small); }
#footer .brand { color: var(--white); margin-bottom: var(--step-3); }
#footer .brand img { height: 52px; }
#footer a:hover { color: var(--white); }
.footer-grid { display: grid; gap: var(--step-6); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-legal { margin-top: var(--step-6); padding-top: var(--step-4); border-top: 1px solid rgba(255, 255, 255, 0.12); display: grid; gap: var(--step-3); }
.footer-legal p { max-width: 90ch; line-height: 1.6; }

/* --------------------------------------------------------------------------
   14. CTA FIXO NO MOBILE
   -------------------------------------------------------------------------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(11, 11, 13, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(198, 198, 194, 0.18);
  transform: translateY(110%); transition: transform 0.28s var(--ease);
}
.sticky-cta.is-visible { transform: translateY(0); }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* --------------------------------------------------------------------------
   15. COOKIES
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; z-index: 120; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  max-width: 560px; margin-inline: auto;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: var(--step-4);
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-actions { margin-top: var(--step-3); display: flex; flex-wrap: wrap; gap: var(--step-2); }

/* --------------------------------------------------------------------------
   16. REVELAÇÃO
   -------------------------------------------------------------------------- */
/* O conteúdo só é escondido quando o JS está vivo e assumiu a revelação.
   Sem JS, ou se o script quebrar, tudo aparece normalmente. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   17. UTILITÁRIOS
   -------------------------------------------------------------------------- */
.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;
}
.mt-4 { margin-top: var(--step-4); }
