/* =================================================================
   VDEFENSYS — leitor da revista "Conexão VDEFENSYS"
   Mesmas cores e cabeçalho do site; área de leitura escura para
   destacar as páginas. O funcionamento (folhear) está em leitor.js.
   ================================================================= */

:root {
  --navy: #082343;
  --navy-deep: #05182f;
  --blue: #0078b7;
  --cyan: #9fd8f2;
  --sky: #e2f1fb;
  --sky-line: #bfd7e9;
  --green: #07994b;
  --yellow: #f5ca31;
  --radius: 6px;
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #eef6fd;
  background:
    radial-gradient(ellipse 80% 60% at 50% 18%, #17405c 0%, rgba(8,35,67,0) 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
a { color: #cdeaf9; text-underline-offset: .23em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Cabeçalho igual ao do site (logo sobre azul-claro) */
.top { background: var(--sky); border-bottom: 1px solid var(--sky-line); color-scheme: light; }
.top-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.top-brand img { width: clamp(150px, 22vw, 220px); height: auto; }
.top-back {
  padding: 8px 16px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.top-back:hover { background: var(--navy); color: #fff; }
.brand-line {
  height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 78%, var(--green) 78% 90%, var(--yellow) 90%);
}

/* Título da edição */
main { flex: 1; text-align: center; padding: clamp(28px, 4vw, 52px) 12px 44px; }
.edition { font-size: .75rem; letter-spacing: .18em; color: var(--yellow); font-weight: 700; }
h1 {
  margin: .4em 0 .2em;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.intro { margin: 0 0 26px; color: #c2d7e8; line-height: 1.5; }

/* Livro */
.reader { max-width: 640px; margin: auto; }
.book {
  width: min(100%, calc(69svh * .7067), 520px);
  min-width: min(100%, 290px);
  margin: auto;
  position: relative;
  aspect-ratio: 1190 / 1684;
  perspective: 1700px;
  touch-action: pan-y pinch-zoom;
  isolation: isolate;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 28px 60px rgba(0,0,0,.55), 4px 3px 0 #9cabb6, 7px 5px 0 #d3dfe6;
  background: #fff;
}
.current, .leaf, .face, .back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.current, .face { background: #081e37; }
.leaf { transform-origin: 0 50%; transform-style: preserve-3d; z-index: 2; pointer-events: none; will-change: transform; }
.leaf[hidden] { display: none; }
.face, .back { backface-visibility: hidden; }
.back { transform: rotateY(180deg); background: linear-gradient(90deg, #b4c1cb, #f8f9fa 13%, #dce4eb 90%, #a5b4c0); }
.leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: linear-gradient(90deg, #0007, transparent 30%, #fff2 76%, #0004);
  animation: shade .62s ease both;
}
@keyframes shade { 0%, 100% { opacity: 0; } 48% { opacity: 1; } }

/* Áreas de toque (metade esquerda volta, metade direita avança) */
.zone {
  position: absolute; top: 0; bottom: 0; width: 50%;
  display: flex; align-items: center; padding: 8px;
  background: none; border: 0; z-index: 3;
  color: #fff; cursor: pointer;
  touch-action: pan-y pinch-zoom;
}
.zone:disabled { pointer-events: none; opacity: 0; }
.zone.prev { left: 0; justify-content: flex-start; }
.zone.next { right: 0; justify-content: flex-end; }
.zone span {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 26px; line-height: 1;
  background: rgba(7,26,50,.85);
  border: 1px solid rgba(194,215,232,.5);
  border-radius: 50%;
  transition: background-color .2s, transform .2s;
}
.zone:hover span { background: var(--blue); transform: scale(1.06); }

/* Botões e contador */
.controls { display: flex; justify-content: center; align-items: center; gap: clamp(12px, 4vw, 30px); margin: 24px auto 14px; }
.controls button {
  font: inherit; font-weight: 700;
  min-height: 44px; padding: 9px 18px;
  background: var(--blue); color: #fff;
  border: 1px solid var(--blue); border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
  transition: background-color .2s;
}
.controls button:hover:not(:disabled) { background: #00669c; }
.controls button:disabled { background: transparent; border-color: #3e5d78; color: #7f97ab; cursor: default; }
.count { min-width: 56px; font-variant-numeric: tabular-nums; color: #d5e5f0; font-weight: 700; letter-spacing: .06em; }
.tools { display: flex; justify-content: center; gap: 12px 26px; flex-wrap: wrap; font-size: .9rem; }

/* Rodapé */
.foot { background: var(--navy-deep); border-top: 1px solid rgba(255,255,255,.08); color: #a9bccd; font-size: 13px; }
.foot-inner {
  max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px);
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
}
.foot strong { color: #fff; letter-spacing: .06em; }

@media (max-width: 600px) {
  .book { width: min(92vw, 420px); min-width: 0; }
  .intro { font-size: .9rem; }
  .top-back { padding: 7px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .leaf::after { animation: none; }
  * { transition: none !important; }
}

/* Página ampliada (ampliar.html): imagem centralizada, no tamanho original
   até caber na largura da tela */
.zoom { padding: 24px 12px 48px; }
.zoom-nav { display: flex; justify-content: center; align-items: center; gap: clamp(12px, 4vw, 30px); margin: 0 auto 22px; }
.zoom-step {
  min-height: 44px;
  display: inline-flex; align-items: center;
  padding: 9px 18px;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s;
}
.zoom-step:hover { background: #00669c; }
.zoom-step.is-disabled { background: transparent; border-color: #3e5d78; color: #7f97ab; pointer-events: none; }
.zoom-page {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  box-shadow: 0 28px 60px rgba(0,0,0,.55);
}
