:root {
  --noite: #0f1c2e;
  --noite-2: #16263b;
  --dourado: #d8b25c;
  --azul: #13365c;
  --destaque: #0b7285;
  --texto: #1f2933;
  --suave: #5f6b76;
  --fundo: #ffffff;
  --fundo-2: #f4f6f8;
  --linha: #d9e2ec;
  --aviso: #b5650d;
}
@media (prefers-color-scheme: dark) {
  :root { --azul: #9cc2ea; --destaque: #5fc4d4; --texto: #e4e7eb; --suave: #a0aab4; --fundo: #121820; --fundo-2: #19212b; --linha: #2c3a48; --aviso: #f0a35e; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 17px/1.6 Charter, Georgia, serif; }
h1, h2, h3, .marca, nav, label, button, .sobretitulo, .estado, footer { font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
a { color: var(--destaque); }

/* Topo */
.topo { background: var(--noite); border-bottom: 1px solid #22344d; position: sticky; top: 0; z-index: 5; }
.topo-dentro, .abertura-dentro, main, .rodape-dentro, header:not(.topo), body > main { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }
.topo-dentro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.6rem; flex-wrap: wrap; }
.marca { color: #e8edf3; text-decoration: none; letter-spacing: 0.02em; }
.marca strong { color: var(--dourado); }
nav { display: flex; gap: 1.2rem; font-size: 0.92rem; }
nav a { color: #c3cedb; text-decoration: none; }
nav a:hover { color: #fff; }

/* Abertura */
.abertura { background: radial-gradient(ellipse at 80% 0%, #1d3553 0%, var(--noite) 60%); color: #e8edf3; padding: 4.5rem 0 4rem; }
.sobretitulo { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.78rem; color: #9fb3c8; margin: 0 0 1rem; }
.abertura h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.1; margin: 0 0 1.2rem; color: #fff; max-width: 18ch; }
.abertura h1 span { color: var(--dourado); }
.lead { font-size: 1.15rem; max-width: 42rem; color: #d3dce6; margin: 0 0 1.4rem; padding-top: 1.2rem; border-top: 2px solid var(--dourado); }
.edicoes { color: #9fb3c8; font-size: 0.95rem; margin: 0; }

/* Livros */
main h2 { color: var(--azul); font-size: 1.55rem; margin: 3.2rem 0 0.4rem; }
.seccao-lead { color: var(--suave); max-width: 44rem; margin: 0 0 1.6rem; }
.grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.6rem; }
.livro { display: flex; flex-direction: column; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 8px; overflow: hidden; }
.capa { position: relative; aspect-ratio: 2 / 3; background:
    linear-gradient(var(--noite-2) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--noite-2) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--noite);
  color: #e8edf3; padding: 1.4rem 1.3rem; display: flex; flex-direction: column; font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
.capa::after { content: ""; position: absolute; left: 50%; bottom: 4.4rem; width: 34%; aspect-ratio: 1; border: 1.5px solid var(--acento); opacity: 0.45; transform: translateX(-50%) rotate(45deg); box-shadow: inset 0 0 0 10px var(--noite), inset 0 0 0 11.5px var(--acento); }
.capa-tema { margin: 0; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: #9fb3c8; border: 1px solid #2e4563; padding: 0.35rem 0.5rem; text-align: center; }
.capa-titulo { margin: 1.1rem 0 0.7rem; font-size: 1.85rem; font-weight: 700; line-height: 1.08; color: #fff; }
.capa-titulo span { color: var(--acento); }
.capa-sub { margin: 0; padding-top: 0.7rem; border-top: 2px solid var(--dourado); font-size: 0.82rem; line-height: 1.4; color: #c3cedb; max-width: 92%; }
.capa-autor { margin: auto 0 0; text-align: center; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.86rem; }
.capa-volume { position: absolute; top: 4rem; right: 1.1rem; margin: 0; font-size: 0.72rem; font-weight: 700; color: var(--noite); background: var(--acento); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; }
.ficha { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.ficha h3 { margin: 0; color: var(--azul); font-size: 1.08rem; }
.ficha p { margin: 0; font-size: 0.95rem; }
.estado { align-self: flex-start; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--noite); background: var(--dourado); padding: 0.2rem 0.55rem; border-radius: 3px; }
.em { color: var(--suave); margin-top: auto !important; padding-top: 0.5rem; font-size: 0.88rem !important; }

/* Autor */
.autor { margin: 4rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--linha); }
.autor-bloco { display: grid; grid-template-columns: 11rem 1fr; gap: 1.6rem; align-items: start; max-width: 54rem; }
.autor-bloco img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--linha); }
.autor-texto { border-left: 3px solid var(--dourado); padding-left: 1.2rem; }
.autor-texto p:first-child { margin-top: 0; }
@media (max-width: 600px) { .autor-bloco { grid-template-columns: 1fr; } .autor-bloco img { max-width: 12rem; } }

/* Materiais */
.materiais { margin: 4rem 0 2rem; padding-top: 0.5rem; border-top: 1px solid var(--linha); }
.materiais > p { max-width: 44rem; }
.cartao { max-width: 34rem; background: var(--fundo-2); border: 1px solid var(--linha); border-radius: 8px; padding: 0.4rem 1.4rem 1.4rem; }
.cartao h3 { color: var(--azul); font-size: 1.05rem; margin: 1rem 0 0.4rem; }
label { display: block; margin: 0.8rem 0 0.3rem; font-size: 0.9rem; color: var(--suave); }
input, select { width: 100%; padding: 0.55rem; font: inherit; color: inherit; background: var(--fundo); border: 1px solid var(--linha); border-radius: 4px; }
button { margin-top: 1rem; padding: 0.6rem 1.2rem; font-weight: 600; font-size: 0.95rem; color: #fff; background: var(--destaque); border: 0; border-radius: 4px; cursor: pointer; }
button:hover { filter: brightness(1.1); }
#turnstile { margin-top: 1rem; }
.pergunta { font-size: 1.05rem; padding: 0.8rem 1rem; border-left: 3px solid var(--destaque); background: var(--fundo); }
.aviso { color: var(--aviso); font-family: system-ui, sans-serif; }
.nota { margin-top: 1.6rem; color: var(--suave); font-size: 0.95rem; }

/* Rodapé */
footer { margin-top: 3rem; padding: 1.6rem 0 2.2rem; color: var(--suave); font-size: 0.85rem; border-top: 1px solid var(--linha); }
.rodape-dentro { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Páginas simples (área reservada, privacidade) */
body > header:not(.topo) { border-bottom: 1px solid var(--linha); max-width: 40rem; }
body > header:not(.topo) .marca { color: var(--azul); display: block; padding: 1rem 0; }
body > header:not(.topo) ~ main { max-width: 40rem; }
body > header:not(.topo) ~ main h1 { color: var(--azul); font-size: 1.7rem; }
body > header:not(.topo) ~ footer { max-width: 40rem; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }

@media (max-width: 540px) {
  nav { gap: 0.8rem; font-size: 0.85rem; }
  .abertura { padding: 3rem 0 2.8rem; }
}
