/* ==========================================================================
   Essência & Propósito — folha de estilos do site
   Organização: 1. Fontes  2. Variáveis  3. Base  4. Layout  5. Cabeçalho
   6. Componentes  7. Seções  8. Rodapé  9. Ajustes para telas maiores
   ========================================================================== */

/* 1. Fontes (cópias locais, licença SIL OFL 1.1) -------------------------- */
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/CormorantGaramond-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/CormorantGaramond-500i.woff") format("woff"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fontes/CormorantGaramond-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fontes/EBGaramond-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fontes/EBGaramond-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fontes/Montserrat-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fontes/Montserrat-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

/* 2. Variáveis ------------------------------------------------------------ */
:root {
  --cor-fundo: #faf6ee;         /* off-white */
  --cor-bege: #f1e8d8;          /* bege */
  --cor-bege-escuro: #e4d8c2;
  --cor-salvia: #7c8f6b;        /* verde-sálvia */
  --cor-salvia-clara: #dfe5d6;
  --cor-verde: #3e4a2e;         /* verde profundo: títulos e botões */
  --cor-verde-escuro: #2f3922;
  --cor-dourado: #b8964a;       /* dourado: apenas detalhes decorativos */
  --cor-dourado-texto: #7d5f22; /* dourado com contraste suficiente para texto */
  --cor-texto: #33352d;
  --cor-texto-suave: #5b5e52;
  --cor-linha: #dccfb6;

  --fonte-titulo: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --fonte-texto: "EB Garamond", Georgia, "Times New Roman", serif;
  --fonte-apoio: "Montserrat", "Segoe UI", Arial, sans-serif;

  /* Textura orgânica muito suave (grão de papel), gerada em SVG — sem arquivo externo */
  --textura: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .3 0 0 0 0 .18 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
  --ramo: url("../imagens/ramo.svg");

  --largura: 70rem;
  --largura-texto: 40rem;
  --margem: 1.25rem;
  --secao: 4rem;
}

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cor-fundo) var(--textura);
  color: var(--cor-texto);
  font-family: var(--fonte-texto);
  font-size: 1.1875rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--fonte-titulo);
  font-weight: 500;
  color: var(--cor-verde);
  line-height: 1.12;
  margin: 0 0 1rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 8vw, 4.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 5.5vw, 2.875rem); }
h3 { font-size: 1.625rem; }

h1 em, h2 em { font-style: italic; color: var(--cor-dourado-texto); }

p { margin: 0 0 1.25rem; }

a { color: var(--cor-verde); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--cor-dourado-texto); }

:focus-visible { outline: 2px solid var(--cor-verde); outline-offset: 3px; }

.pular {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--cor-verde); color: #fff;
  padding: 0.75rem 1rem; z-index: 20;
  font-family: var(--fonte-apoio); font-size: 0.875rem;
}
.pular:focus { top: 1rem; color: #fff; }

/* 4. Layout --------------------------------------------------------------- */
.container { width: 100%; max-width: var(--largura); margin: 0 auto; padding: 0 var(--margem); }
.secao { padding: var(--secao) 0; }
.secao--bege { background: var(--cor-bege) var(--textura); }
.secao--verde { background: var(--cor-verde); color: #f3eedf; position: relative; overflow: hidden; }
.secao--verde h2 { color: #fff; }
.secao--verde > .container { position: relative; z-index: 1; }

/* Ramos discretos nos cantos das seções verdes (decorativos) */
.secao--verde::before, .secao--verde::after {
  content: ""; position: absolute; pointer-events: none;
  width: 6rem; height: 12rem;
  background: var(--ramo) no-repeat center / contain;
  filter: brightness(0) invert(1); opacity: 0.09;
}
.secao--verde::before { left: -1.25rem; bottom: -2rem; transform: rotate(24deg); }
.secao--verde::after { right: -1.25rem; top: -2rem; transform: rotate(204deg); }
.texto { max-width: var(--largura-texto); }
.centro { text-align: center; margin-left: auto; margin-right: auto; }

.sobretitulo {
  font-family: var(--fonte-apoio);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cor-dourado-texto);
  margin: 0 0 1rem;
}
.secao--verde .sobretitulo { color: #e3cf9a; }

.destaque { font-size: 1.375rem; line-height: 1.5; color: var(--cor-texto-suave); }

/* Ornamento: linha — ponto — linha, como na capa do livro */
.ornamento {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin: 1.75rem auto; width: 7rem; color: var(--cor-dourado);
}
.ornamento::before, .ornamento::after { content: ""; flex: 1; height: 1px; background: currentColor; }
.ornamento span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ornamento--esquerda { margin-left: 0; }

/* 5. Cabeçalho ------------------------------------------------------------ */
.topo { border-bottom: 1px solid var(--cor-linha); background: var(--cor-fundo); }
.topo__linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 4.5rem; }

.marca {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  font-family: var(--fonte-apoio); font-weight: 600;
  font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cor-verde); text-decoration: none; padding: 0.75rem 0;
}
.marca:hover { color: var(--cor-verde); }
.marca img { width: 1.75rem; height: 1.75rem; flex: none; }
/* Em telas muito estreitas, o símbolo cede espaço ao nome */
@media (max-width: 21.5rem) { .topo .marca img { display: none; } }
/* O "&" em itálico serifado, como assinatura editorial */
.marca span {
  font-family: var(--fonte-titulo); font-style: italic; font-weight: 500;
  font-size: 1.5em; letter-spacing: 0; text-transform: none; line-height: 1;
  color: var(--cor-dourado-texto); margin: 0 0.1em 0 -0.1em;
}

.menu-botao {
  display: none;
  font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  background: none; color: var(--cor-verde);
  border: 1px solid var(--cor-verde); border-radius: 2px;
  padding: 0.7rem 0.85rem; min-height: 2.75rem; cursor: pointer;
}
.js .menu-botao { display: inline-block; }

.menu { width: 100%; }
.js .menu { display: none; }
.js .menu.aberto { display: block; }
.menu ul { list-style: none; margin: 0; padding: 0 0 1rem; }
.menu a {
  display: block; padding: 0.85rem 0;
  font-family: var(--fonte-apoio); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--cor-texto);
  border-top: 1px solid var(--cor-linha);
}
.menu a:hover { color: var(--cor-dourado-texto); }
.menu a[aria-current="page"] { color: var(--cor-verde); font-weight: 600; }

/* 6. Componentes ---------------------------------------------------------- */
.botao {
  display: inline-block;
  font-family: var(--fonte-apoio); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; text-align: center;
  background: var(--cor-verde); color: #fff;
  border: 1px solid var(--cor-verde); border-radius: 2px;
  padding: 1rem 1.75rem; min-height: 3rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.botao:hover { background: var(--cor-verde-escuro); color: #fff; }
.botao--contorno { background: transparent; color: var(--cor-verde); }
.botao--contorno:hover { background: var(--cor-verde); color: #fff; }
.botao--claro { background: #f3eedf; color: var(--cor-verde); border-color: #f3eedf; }
.botao--claro:hover { background: #fff; color: var(--cor-verde); }
.botao--inativo, .botao--inativo:hover {
  background: var(--cor-bege-escuro); border-color: var(--cor-bege-escuro);
  color: var(--cor-texto-suave); cursor: default;
}
/* Botão de compra ativo (aplicado pelo site.js quando há link em config.js) */
.botao--compra {
  font-size: 0.875rem; padding: 1.15rem 2.25rem;
  box-shadow: 0 0 0 1px var(--cor-fundo), 0 0 0 2px var(--cor-dourado), 0 12px 24px -14px rgba(62, 74, 46, 0.7);
}
.botao--compra::after { content: " \2197"; font-size: 1.05em; }

.acoes { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.75rem; }
.nota { font-size: 1rem; color: var(--cor-texto-suave); margin-top: 1rem; }

.etiqueta {
  display: inline-block;
  font-family: var(--fonte-apoio); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cor-verde); background: var(--cor-salvia-clara);
  padding: 0.4rem 0.7rem; border-radius: 2px; margin-bottom: 1rem;
}

.capa { box-shadow: 0 1px 2px rgba(62, 74, 46, 0.12), 0 18px 40px -18px rgba(62, 74, 46, 0.45); border-radius: 2px; }

/* Par de capas sobrepostas (livro + caderno) */
.kit-capas { position: relative; max-width: 27rem; margin: 0 auto; padding: 0 0 15% 0; }
.kit-capas .capa:first-child { width: 60%; position: relative; z-index: 1; }
.kit-capas .capa:last-child { width: 54%; position: absolute; right: 0; bottom: 0; }

/* Indicação do tipo de produto: "Kit digital • Livro + caderno de atividades" */
.selo-kit {
  display: inline-block;
  font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.5;
  color: var(--cor-verde);
  border-top: 1px solid var(--cor-dourado); border-bottom: 1px solid var(--cor-dourado);
  padding: 0.55rem 0.15rem; margin: 0.25rem 0 1.25rem;
}

/* Lista "O que você encontrará neste material" */
.encontra { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--cor-linha); }
.encontra li {
  position: relative; padding: 1.25rem 0 1.25rem 2.5rem;
  border-bottom: 1px solid var(--cor-linha);
  font-family: var(--fonte-titulo); font-size: 1.4375rem; line-height: 1.3; color: var(--cor-verde);
}
.encontra li::before {
  content: ""; position: absolute; left: 0; top: 1.45rem; width: 1.375rem; height: 1.375rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21C3 10 10 3 21 3c0 11-7 18-18 18Z' fill='%23b8964a'/%3E%3Cpath d='M3 21 14 10' stroke='%23faf6ee' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Raminho acima do título (telas menores) e ramos laterais (telas largas) */
.raminho { width: 1.75rem; height: 3.5rem; margin: 0 auto 1rem; opacity: 0.85; }

.preco { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0 0; }
.preco__valor { font-family: var(--fonte-titulo); font-weight: 600; font-size: 2.75rem; line-height: 1; color: var(--cor-verde); }
.preco__rotulo { font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cor-texto-suave); }

/* Grades */
.grade { display: grid; gap: 2.5rem; }
/* Impede que textos longos (como o e-mail) alarguem as colunas no celular */
.grade > *, .publicacao > * { min-width: 0; }
[data-email] { overflow-wrap: anywhere; }
.grade--temas { gap: 0; border-top: 1px solid var(--cor-linha); }

.tema { padding: 1.5rem 0; border-bottom: 1px solid var(--cor-linha); }
.tema h3 { margin-bottom: 0.4rem; }
.tema p { margin: 0; color: var(--cor-texto-suave); font-size: 1.0625rem; }

.cartao { background: var(--cor-fundo); border: 1px solid var(--cor-linha); padding: 1.75rem; border-radius: 2px; }
.cartao .capa { max-width: 13rem; margin-bottom: 1.5rem; }
.cartao p:last-child { margin-bottom: 0; }

.ficha { margin: 0; border-top: 1px solid var(--cor-linha); }
.ficha div { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.7rem 0; border-bottom: 1px solid var(--cor-linha); }
.ficha dt { font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cor-texto-suave); padding-top: 0.3rem; }
.ficha dd { margin: 0; text-align: right; }

.sumario { list-style: none; margin: 0; padding: 0; counter-reset: capitulo; border-top: 1px solid var(--cor-linha); }
.sumario li { counter-increment: capitulo; display: flex; gap: 1.25rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--cor-linha); font-family: var(--fonte-titulo); font-size: 1.5rem; line-height: 1.25; color: var(--cor-verde); }
.sumario li::before { content: counter(capitulo, decimal-leading-zero); font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; color: var(--cor-dourado-texto); }

.citacao { margin: 0; font-family: var(--fonte-titulo); font-style: italic; font-size: clamp(1.625rem, 4.5vw, 2.25rem); line-height: 1.3; }
.citacao footer { margin-top: 1.25rem; font-family: var(--fonte-apoio); font-style: normal; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: #e3cf9a; }

.passos { list-style: none; margin: 0; padding: 0; counter-reset: passo; }
.passos li { counter-increment: passo; position: relative; padding: 0 0 1.5rem 3rem; }
.passos li::before { content: counter(passo); position: absolute; left: 0; top: 0.1rem; width: 2rem; height: 2rem; border: 1px solid var(--cor-dourado); border-radius: 50%; display: grid; place-items: center; font-family: var(--fonte-apoio); font-size: 0.8125rem; font-weight: 600; color: var(--cor-dourado-texto); }

.redes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.migalhas { font-family: var(--fonte-apoio); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cor-texto-suave); padding-top: 1.5rem; }
.migalhas a { color: inherit; }

/* 7. Seções --------------------------------------------------------------- */
.abertura { padding: 2.5rem 0 3.5rem; }
.abertura--centro { text-align: center; position: relative; overflow: hidden; }
/* Aproxima a introdução do conteúdo que vem logo abaixo (página Publicações) */
.abertura--curta { padding-bottom: 2rem; }
.secao--junto { padding-top: 3rem; }

/* Páginas de texto corrido (Política de Privacidade e Termos de Uso) */
.documento { max-width: 44rem; }
.documento h2 { font-size: clamp(1.625rem, 4.5vw, 2rem); margin-top: 2.75rem; }
.documento h2:first-of-type { margin-top: 2rem; }
.documento ul { padding-left: 1.25rem; margin: 0 0 1.25rem; }
.documento li { margin-bottom: 0.5rem; }
.aviso-minuta {
  border: 1px solid var(--cor-dourado); border-left-width: 4px; border-radius: 2px;
  background: var(--cor-bege); padding: 1.25rem 1.5rem; margin: 0 0 1rem;
  font-size: 1.0625rem;
}
.aviso-minuta p:last-child { margin-bottom: 0; }
.aviso-minuta strong { font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cor-dourado-texto); }
/* Trechos que dependem de confirmação do proprietário ou de revisão jurídica */
.pendente { background: #f3e3b8; color: var(--cor-texto); padding: 0.05em 0.3em; border-radius: 2px; font-size: 0.95em; }
.rodape__legal a { margin-right: 1.25rem; }
.abertura--centro .texto { margin-left: auto; margin-right: auto; }

.publicacao { display: grid; gap: 2.5rem; align-items: center; }

/* 8. Rodapé --------------------------------------------------------------- */
.rodape { border-top: 1px solid var(--cor-linha); background: var(--cor-bege) var(--textura); padding: 3rem 0 2rem; font-size: 1.0625rem; }
.rodape__grade { display: grid; gap: 2rem; }
.rodape h2 { font-family: var(--fonte-apoio); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cor-verde); margin-bottom: 0.75rem; }
.rodape ul { list-style: none; margin: 0; padding: 0; }
.rodape li { margin-bottom: 0.4rem; }
.rodape a { display: inline-block; padding: 0.2rem 0; overflow-wrap: anywhere; }
.rodape__fim { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--cor-linha); font-size: 0.9375rem; color: var(--cor-texto-suave); }
.rodape__fim p { margin: 0 0 0.4rem; }

[hidden] { display: none !important; }

/* 9. Telas maiores -------------------------------------------------------- */
@media (min-width: 48rem) {
  :root { --margem: 2rem; --secao: 6rem; }
  body { font-size: 1.25rem; }

  .topo__linha { flex-wrap: nowrap; }
  .marca { font-size: 0.8125rem; letter-spacing: 0.24em; gap: 0.7rem; }
  .marca img { width: 2.125rem; height: 2.125rem; }
  .js .menu-botao { display: none; }
  .menu, .js .menu { display: block; width: auto; }
  .menu ul { display: flex; gap: 2rem; padding: 0; }
  .menu a { border: 0; padding: 0.75rem 0; }
  .menu a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--cor-dourado); }

  .abertura { padding: 4rem 0 5rem; }
  .abertura--curta { padding-bottom: 2.75rem; }
  .secao--junto { padding-top: 4.25rem; }
  .encontra { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .secao--verde::before, .secao--verde::after { width: 9rem; height: 18rem; opacity: 0.11; }
  .secao--verde::before { left: 1.5rem; bottom: -3.5rem; }
  .secao--verde::after { right: 1.5rem; top: -3.5rem; }
  .grade--2 { grid-template-columns: 1fr 1fr; }
  .grade--temas { grid-template-columns: repeat(3, 1fr); column-gap: 3rem; border-top: 0; }
  .tema { border-top: 1px solid var(--cor-linha); border-bottom: 0; padding: 1.75rem 0 2rem; }
  .rodape__grade { grid-template-columns: 1.2fr 1fr 1.5fr; gap: 3rem; }
}

/* Capa e texto lado a lado só quando há largura suficiente */
@media (min-width: 60rem) {
  .publicacao { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .publicacao--capa-direita > :first-child { order: 2; }
}

/* Ramos laterais na abertura da página inicial: só quando sobra margem */
@media (min-width: 64rem) {
  .raminho { display: none; }
  .abertura--centro::before, .abertura--centro::after {
    content: ""; position: absolute; pointer-events: none;
    top: 50%; width: 8.5rem; height: 17rem; margin-top: -8.5rem;
    background: var(--ramo) no-repeat center / contain; opacity: 0.5;
  }
  .abertura--centro::before { left: calc(50% - 31.5rem); transform: rotate(-16deg); }
  .abertura--centro::after { right: calc(50% - 31.5rem); transform: scaleX(-1) rotate(-16deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .botao { transition: none; }
}

@media print {
  .topo, .rodape, .botao, .pular { display: none; }
  body { background: #fff; }
}
