/* Site do Zé Vagner: estilo comum a todas as páginas. Cores por livro vêm de --acento e --fundo no <body>. */
:root {
  --fundo: #1b1e1f;
  --fundo-2: #26292a;
  --texto: #ece6d8;
  --texto-suave: #b4ad9f;
  --acento: #c8302c;
  --brilho: #7fc4c0;
  --raio: 6px;
  --largura: 1100px;
  --titulo: "Bebas Neue", "Impact", sans-serif;
  --corpo: "Literata", Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* senão .botao (inline-flex) ignora o atributo hidden */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 18px/1.6 var(--corpo);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brilho); outline-offset: 3px; }

.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  background: rgba(20, 22, 23, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.topo .marca { font: 26px/1 var(--titulo); letter-spacing: .04em; text-decoration: none; }
.topo nav { display: flex; gap: 16px; font-size: 15px; }
.topo nav a { text-decoration: none; color: var(--texto-suave); }
.topo nav a:hover { color: var(--texto); }

.miolo { max-width: var(--largura); margin: 0 auto; padding: 0 16px; }

.botao {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--raio);
  background: var(--acento); color: #fff;
  font: 20px/1 var(--titulo); letter-spacing: .06em;
  text-decoration: none; border: 0; cursor: pointer;
}
.botao:hover { filter: brightness(1.1); }
.botao.secundario { background: transparent; border: 1px solid rgba(255, 255, 255, .25); color: var(--texto); }

h1, h2, h3 { font-family: var(--titulo); font-weight: 400; letter-spacing: .03em; line-height: 1.05; margin: 0 0 .4em; }
h1 { font-size: clamp(48px, 9vw, 96px); }
h2 { font-size: clamp(32px, 5vw, 48px); }
h3 { font-size: 28px; }
p { margin: 0 0 1em; }
.suave { color: var(--texto-suave); }
.etiqueta { font: 16px/1 var(--titulo); letter-spacing: .12em; color: var(--acento); }

.rodape { margin-top: 80px; padding: 32px 16px; text-align: center; font-size: 14px; color: var(--texto-suave); border-top: 1px solid rgba(255, 255, 255, .06); }

/* ---------- Livro 3D ---------- */
.palco {
  position: relative;
  display: grid; place-items: center;
  min-height: min(78vh, 720px);
  perspective: 1600px;
  isolation: isolate;
}
.palco::before { /* brilho atrás do livro, nas cores da capa */
  content: ""; position: absolute; inset: 10% 15%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brilho) 35%, transparent), transparent);
  filter: blur(30px);
  animation: pulsa 6s ease-in-out infinite;
}
@keyframes pulsa { 50% { opacity: .55; } }

.livro3d {
  --l: min(300px, 62vw); --a: calc(var(--l) * var(--prop, 1.5)); --e: calc(var(--l) * .1);
  position: relative; width: var(--l); height: var(--a);
  transform-style: preserve-3d;
  cursor: grab; touch-action: pan-y;
  background: none; border: 0; padding: 0; color: inherit;
}
.livro3d:active { cursor: grabbing; }
.livro3d .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 2px 6px 6px 2px; overflow: hidden; }
.livro3d .frente { transform: translateZ(calc(var(--e) / 2)); box-shadow: inset 4px 0 8px rgba(0, 0, 0, .35); }
.livro3d .frente img { width: 100%; height: 100%; object-fit: cover; }
.livro3d .verso {
  transform: rotateY(180deg) translateZ(calc(var(--e) / 2));
  background: linear-gradient(160deg, #3a3f40, #1d2021);
  padding: 12%; display: flex; flex-direction: column; justify-content: center;
  font-size: 13px; line-height: 1.5; text-align: left;
}
.livro3d .verso strong { font: 22px/1.1 var(--titulo); letter-spacing: .03em; display: block; margin-bottom: 12px; }
.livro3d .lombada {
  width: var(--e); left: calc(50% - var(--e) / 2);
  transform: rotateY(-90deg) translateZ(calc(var(--l) / 2));
  background: linear-gradient(90deg, #1f2223, #3a3f40 50%, #1f2223);
  display: grid; place-items: center;
}
.livro3d .lombada span { writing-mode: vertical-rl; transform: rotate(180deg); font: 18px/1 var(--titulo); letter-spacing: .15em; }
.livro3d .paginas {
  width: var(--e); left: calc(50% - var(--e) / 2);
  transform: rotateY(90deg) translateZ(calc(var(--l) / 2 - 3px));
  background: repeating-linear-gradient(90deg, #e9e3d3 0 2px, #cfc8b6 2px 3px);
  inset-block: 3px;
}
.livro3d .sombra {
  position: absolute; left: 10%; right: 10%; bottom: -40px; height: 30px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
  transform: rotateX(90deg); pointer-events: none;
}
.dica { margin-top: 28px; font-size: 15px; color: var(--texto-suave); text-align: center; }

/* ---------- Folheador (amostra) ---------- */
.folheador[hidden] { display: none; }
.folheador {
  position: fixed; inset: 0; z-index: 50;
  background: #0b0c0d;
  display: flex; flex-direction: column;
}
.folheador .barra {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 12px 60px 12px 16px; /* espaço para o botão fechar */
}
.folheador .barra button {
  font: 17px/1 var(--titulo); letter-spacing: .06em;
  padding: 9px 14px; border-radius: var(--raio);
  background: var(--fundo-2); color: var(--texto); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer;
}
.folheador .barra button[aria-current="true"] { background: var(--acento); border-color: var(--acento); }
.folheador .fechar { position: absolute; top: 10px; right: 12px; font-size: 28px !important; padding: 4px 12px !important; }
.folheador .area { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 16px; }
/* duas páginas 2:3 lado a lado = 4:3; limita pela altura livre para não cortar */
/* !important: a biblioteca põe width:100% inline */
.folheador .livro-aberto { width: min(100%, 1100px, calc((100dvh - 170px) * 2 / var(--prop, 1.5))) !important; }
.folheador .pagina { background: #e9e3d3; }
.folheador .pagina img { width: 100%; height: 100%; object-fit: cover; user-select: none; }
@media (max-width: 700px) { .folheador .livro-aberto { width: min(100%, calc((100dvh - 200px) / var(--prop, 1.5))) !important; } }
.folheador .pe {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
  padding: 12px 16px 18px; font-size: 15px; color: var(--texto-suave);
}
.folheador .setas button { font-size: 22px; width: 44px; height: 44px; border-radius: 50%; background: var(--fundo-2); color: var(--texto); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; }

/* ---------- Página do livro ---------- */
.livro-heroi { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding-top: 24px; }
.livro-heroi .acoes { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.lista-icones { list-style: none; padding: 0; margin: 0 0 24px; }
.lista-icones li { padding: 8px 0 8px 22px; position: relative; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.lista-icones li::before { content: ""; position: absolute; left: 0; top: 18px; width: 8px; height: 8px; background: var(--acento); }
.bloco { margin-top: 64px; }
.aviso { background: var(--fundo-2); border-left: 3px solid var(--acento); padding: 16px 20px; border-radius: var(--raio); font-size: 16px; }

/* ---------- Estante (início) ---------- */
.estante { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px; }
.estante a { text-decoration: none; }
.estante img { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 6px 6px 2px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); transition: transform .2s; }
.estante a:hover img { transform: translateY(-6px) rotate(-1deg); }
.estante .nome { margin-top: 12px; font: 22px/1.1 var(--titulo); letter-spacing: .03em; }

/* ---------- Home do autor ---------- */
.autor-heroi { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 48px 0 8px; }
.autor-heroi .chamada { font-size: 21px; max-width: 640px; }
.foto-autor { width: 220px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; filter: grayscale(.3); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.estante .em-breve { opacity: .75; }
.estante .capa-vazia {
  aspect-ratio: 2 / 3; display: grid; place-items: center; padding: 16px; text-align: center;
  border: 1px dashed rgba(255, 255, 255, .3); border-radius: 2px 6px 6px 2px;
  font: 26px/1.1 var(--titulo); letter-spacing: .03em; color: var(--texto-suave);
}
.estante .selo { display: inline-block; margin-top: 6px; font: 14px/1 var(--titulo); letter-spacing: .1em; padding: 5px 8px; border-radius: var(--raio); background: var(--acento); color: #fff; }
.rodape .outros-nomes { margin-bottom: 8px; }

@media (max-width: 800px) {
  .autor-heroi { grid-template-columns: 1fr; }
  .foto-autor { width: 160px; }
  body { font-size: 17px; }
  .livro-heroi { grid-template-columns: 1fr; }
  .palco { min-height: 62vh; }
  .topo nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .palco::before { animation: none; }
  .estante img { transition: none; }
}
