/* ==========================================================================
   O Trauma encontrou Palavra — Landing page de lançamento
   Design system: paleta extraída da capa e do miolo do livro (impressão
   final). Ver docs/plano-desenvolvimento.md § 3.1 para a origem de cada cor.
   ========================================================================== */

/* --- Fontes (auto-hospedadas, as mesmas da diagramação do livro) -------- */

@font-face {
  font-family: 'Cormorant';
  src: url('../fontes/Cormorant-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../fontes/Cormorant-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../fontes/Cormorant-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../fontes/Cormorant-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('../fontes/Alegreya-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('../fontes/Alegreya-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('../fontes/Alegreya-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('../fontes/Alegreya-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Alegreya';
  src: url('../fontes/Alegreya-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------- */

:root {
  /* Paleta — amostrada da capa e do miolo impressos */
  --tinta: #14130e;      /* fundo principal, preto quente */
  --tinta-2: #1c1812;    /* superfícies elevadas / cards */
  --tinta-3: #241d17;    /* bordas e divisores sobre fundo escuro */
  --ouro: #d5c35b;       /* título da capa — cor de destaque e CTA */
  --ouro-claro: #e8dfa0; /* texto de apoio sobre fundo escuro */
  --pele: #b69785;       /* tom de pele da capa — acentos discretos */
  --vinho: #5a1f28;      /* veios da capa — usado com parcimônia */
  --creme: #f7eee5;      /* fundo claro — também é cor da marca do site */
  --creme-2: #efe4d6;    /* superfície sobre fundo claro */
  --texto-claro: #ece6db;   /* texto de corpo sobre fundo escuro */
  --texto-claro-fraco: #a89e8c;
  --texto-escuro: #241f18;  /* texto de corpo sobre fundo claro */
  --texto-escuro-fraco: #6b6154;

  /* Tipografia */
  --fonte-display: 'Cormorant', 'Georgia', serif;
  --fonte-corpo: 'Alegreya', 'Georgia', serif;

  /* Espaçamento e forma */
  --raio: 4px;
  --raio-grande: 8px;
  --largura-maxima: 1120px;
  --largura-leitura: 640px;
  --sombra-elevada: 0 30px 70px -20px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

/* --- Reset mínimo ----------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--tinta);
  color: var(--texto-claro);
  font-family: var(--fonte-corpo);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }

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

/* --- Tipografia --------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--fonte-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

.rotulo {
  font-family: var(--fonte-corpo);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.epigrafe {
  font-family: var(--fonte-display);
  font-style: italic;
  font-weight: 500;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* --- Layout --------------------------------------------------------- */

.secao {
  padding: clamp(48px, 8vw, 88px) clamp(20px, 5vw, 48px);
}
.secao--clara {
  background: var(--creme);
  color: var(--texto-escuro);
}
.secao--clara h1, .secao--clara h2, .secao--clara h3 { color: var(--texto-escuro); }

/* Pequeno contraste entre seções escuras, sem sair da paleta da página —
   alterna com o fundo padrão (--tinta) para separar as seções visualmente. */
.secao--sombreada {
  background: var(--tinta-2);
  box-shadow: inset 0 1px 0 var(--tinta-3), inset 0 -1px 0 var(--tinta-3);
}

.container {
  max-width: var(--largura-maxima);
  margin: 0 auto;
}
.container--leitura {
  max-width: var(--largura-leitura);
  margin: 0 auto;
}

.divisor {
  width: 56px;
  height: 2px;
  background: var(--ouro);
  border: none;
  margin: 28px 0;
}
.divisor--centro { margin-left: auto; margin-right: auto; }

/* --- Botões ----------------------------------------------------------- */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border-radius: 999px;
  font-family: var(--fonte-corpo);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.botao:hover { transform: translateY(-2px); }

.botao--ouro {
  background: var(--ouro);
  color: var(--tinta);
  box-shadow: 0 10px 30px -8px rgba(213, 195, 91, 0.45);
}
.botao--ouro:hover { background: var(--ouro-claro); }

.botao--contorno {
  background: transparent;
  color: var(--ouro-claro);
  border-color: rgba(213, 195, 91, 0.5);
}
.botao--contorno:hover { border-color: var(--ouro); background: rgba(213, 195, 91, 0.08); }

.botao__icone-amazon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  /* A logo é preta (com o sorriso laranja) e some no botão de contorno,
     sobre o fundo escuro da página. Um fundo claro atrás do ícone garante
     contraste nos dois estilos de botão, ouro e contorno. */
  background: var(--creme);
  border-radius: 50%;
  padding: 3px;
  box-sizing: content-box;
}

.botao--contorno-escuro {
  background: transparent;
  color: var(--texto-escuro);
  border-color: rgba(36, 31, 24, 0.35);
}
.botao--contorno-escuro:hover { border-color: var(--texto-escuro); background: rgba(36, 31, 24, 0.05); }

/* --- Botões de compra (repetidos ao longo da página) --------------------- */

.botoes-compra {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.botoes-compra--centro { justify-content: center; }

/* Variante compacta — só o hero: texto curto ("Impresso" / "Digital").
   Mobile-first: quebra livremente por padrão (abaixo de 860px o hero__grade
   já vira 1 coluna, então não há disputa de espaço com a capa do livro).
   Só força uma única linha a partir de 861px, onde a coluna de texto do
   hero é estreita (até 520px) e é isso que equilibra a altura com a
   capa — nesse ponto já sabemos que os dois botões cabem. */
.botoes-compra--compacto { gap: 12px; }
.botoes-compra--compacto .botao {
  padding: 13px 20px;
  font-size: 0.86rem;
  white-space: nowrap;
}
@media (min-width: 861px) {
  .botoes-compra--compacto { flex-wrap: nowrap; }
}

/* Botão indisponível — versão sem link de venda ainda (ver botaoCompra() em
   lib/funcoes.php). É um <span>, não um link: inerte, sem cursor de clique
   e sem efeito de hover, para não sugerir que algo vai acontecer ao tocar
   nele. O selo "Em breve" fica embutido no próprio botão. */
.botao--indisponivel {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}
.botao--indisponivel:hover {
  /* Anula o hover de .botao--contorno (única variante usada aqui) — o botão
     indisponível não reage ao passar o mouse. */
  transform: none;
  background: transparent;
  border-color: rgba(213, 195, 91, 0.5);
}

.botao__selo {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(213, 195, 91, 0.18);
  color: var(--ouro-claro);
}

/* --- Selo / badge ------------------------------------------------------- */

.selo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(213, 195, 91, 0.08);
  border: 1px solid rgba(213, 195, 91, 0.3);
  color: var(--ouro-claro);
}
.selo__ponto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vinho);
  box-shadow: 0 0 0 3px rgba(90, 31, 40, 0.25);
  animation: pulsar 2.4s ease-in-out infinite;
}
@keyframes pulsar {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.35); }
}

/* --- Utilidades de revelação ao rolar ----------------------------------- */

.revelar {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.revelar.esta-visivel {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .revelar { opacity: 1; transform: none; transition: none; }
}

/* --- Acessibilidade: foco visível --------------------------------------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ouro);
  outline-offset: 3px;
}

/* --- Pular para o conteúdo ------------------------------------------ */

.pular-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ouro);
  color: var(--tinta);
  padding: 12px 20px;
  z-index: 1000;
  font-weight: 700;
}
.pular-link:focus { left: 16px; top: 16px; }
