/* Visor de la Revista SAEJ (revista-bootcamp-2030.html) */
:root { --navy:#1B1D3D; --deep:#0E1030; --blue:#004AAD; --cyan:#00D4E0; --gold:#C9A45C; --ink:#E9ECFB; --soft:#AEB6DA; }
* { box-sizing:border-box; margin:0; padding:0; }
html, body { height:100%; }
body { background:radial-gradient(ellipse at 50% 35%, #2F3370 0%, var(--navy) 45%, var(--deep) 100%); color:var(--ink); font-family:'DM Sans', system-ui, sans-serif; overflow:hidden; }
button, a { font:inherit; color:inherit; }
button { cursor:pointer; background:none; border:0; }
[hidden] { display:none !important; }
:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
.rv-sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.rv { display:flex; flex-direction:column; height:100vh; height:100dvh; }

/* Barra superior */
.rv-top { display:flex; align-items:center; gap:18px; padding:10px 22px; border-bottom:1px solid rgba(255,255,255,.1); background:rgba(10,12,36,.55); }
.rv-logo img { display:block; height:36px; width:auto; }
.rv-title { flex:1; min-width:0; border-left:1px solid rgba(255,255,255,.18); padding-left:18px; }
.rv-title span { display:block; font-size:11px; letter-spacing:2.4px; text-transform:uppercase; color:var(--cyan); font-weight:700; }
.rv-title h1 { font-size:17px; line-height:1.3; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-tools { display:flex; gap:8px; }
.rv-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:40px; height:40px; padding:0 13px; border-radius:10px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06); font-size:14px; font-weight:500; text-decoration:none; transition:background .2s, border-color .2s; }
.rv-btn:hover { background:rgba(0,212,224,.14); border-color:var(--cyan); color:#fff; text-decoration:none; }
.rv-btn--solid { background:var(--blue); border-color:var(--blue); color:#fff; }

/* Escenario */
.rv-stage { position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.rv-book { position:relative; perspective:2600px; transition:transform .6s cubic-bezier(.3,.7,.3,1); touch-action:pan-y pinch-zoom; user-select:none; -webkit-user-select:none; }
.rv-slot, .rv-leaf { position:absolute; top:0; height:100%; }
.rv-slot { width:50%; }
.rv-slot--l { left:0; }
.rv-slot--r { left:50%; }
.rv-single .rv-slot--l { display:none; }
.rv-single .rv-slot--r { left:0; width:100%; }
.rv-page { position:absolute; inset:0; background:#fff; overflow:hidden; cursor:zoom-in; }
.rv-page img { display:block; width:100%; height:100%; pointer-events:none; }
.rv-slot:not(:empty) { box-shadow:0 22px 45px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.3); }
.rv-slot--l .rv-page::after, .rv-face--l::after { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg, transparent 88%, rgba(0,0,0,.07) 95%, rgba(0,0,0,.22)); }
.rv-slot--r .rv-page::after, .rv-face--r::after { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg, rgba(0,0,0,.2), rgba(0,0,0,.05) 4%, transparent 11%); }
.rv-single .rv-page::after { display:none; }
.rv-hot { position:absolute; display:block; z-index:2; border-radius:4px; cursor:pointer; }
.rv-hot:hover, .rv-hot:focus-visible { background:rgba(0,212,224,.2); box-shadow:inset 0 0 0 2px var(--cyan); outline:0; }

/* Hoja que gira */
.rv-leaf { z-index:5; width:50%; transform-style:preserve-3d; pointer-events:none; will-change:transform; }
.rv-leaf--next { left:50%; transform-origin:left center; }
.rv-leaf--prev { left:0; transform-origin:right center; }
.rv-single .rv-leaf { left:0; width:100%; transform-origin:left center; }
.rv-face { position:absolute; inset:0; background:#fff; overflow:hidden; backface-visibility:hidden; -webkit-backface-visibility:hidden; }
.rv-face img { display:block; width:100%; height:100%; }
.rv-face--back { transform:rotateY(180deg); }
.rv-shade { position:absolute; inset:0; opacity:0; z-index:3; background:linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.08) 40%, rgba(255,255,255,.18) 70%, rgba(0,0,0,.2)); }

/* Flechas y esquina */
.rv-arrow { position:absolute; top:50%; z-index:8; width:52px; height:52px; margin-top:-26px; border-radius:50%; border:1px solid rgba(255,255,255,.22); background:rgba(14,16,48,.7); font-size:20px; display:flex; align-items:center; justify-content:center; transition:background .2s, opacity .2s; }
.rv-arrow:hover { background:var(--blue); border-color:var(--cyan); }
.rv-arrow--prev { left:18px; }
.rv-arrow--next { right:18px; }
.rv-arrow:disabled { opacity:0; pointer-events:none; }
.rv-open { position:absolute; bottom:14px; left:50%; transform:translateX(-50%); z-index:8; white-space:nowrap; padding:11px 22px; border-radius:30px; background:var(--cyan); color:var(--deep); font-weight:700; font-size:14px; box-shadow:0 10px 24px rgba(0,0,0,.35); animation:rvPulse 2.2s ease-in-out infinite; }
@keyframes rvPulse { 50% { transform:translateX(-50%) translateY(-4px); } }

/* Barra inferior */
.rv-bottom { display:flex; align-items:center; justify-content:center; gap:14px; padding:10px 18px 14px; }
.rv-section { width:230px; text-align:right; font-size:13px; color:var(--soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-range { -webkit-appearance:none; appearance:none; width:min(420px, 40vw); height:4px; border-radius:4px; background:rgba(255,255,255,.18); cursor:pointer; }
.rv-range::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; border-radius:50%; background:var(--cyan); border:3px solid var(--deep); }
.rv-range::-moz-range-thumb { width:14px; height:14px; border-radius:50%; background:var(--cyan); border:3px solid var(--deep); }
.rv-count { width:230px; font-size:13px; color:var(--soft); font-variant-numeric:tabular-nums; }

/* Panel lateral: índice y miniaturas */
.rv-panel { position:fixed; inset:0; z-index:30; background:rgba(5,7,24,.7); display:flex; justify-content:flex-end; }
.rv-panel__box { width:min(420px, 100%); height:100%; background:var(--navy); border-left:1px solid rgba(255,255,255,.12); display:flex; flex-direction:column; animation:rvIn .28s ease-out; }
@keyframes rvIn { from { transform:translateX(40px); opacity:0; } }
.rv-panel__head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid rgba(255,255,255,.1); }
.rv-panel__head h2 { font-size:18px; color:#fff; }
.rv-panel__body { overflow-y:auto; padding:14px 20px 26px; }
.rv-toc { list-style:none; }
.rv-toc button { display:flex; align-items:center; gap:14px; width:100%; text-align:left; padding:14px 8px; border-bottom:1px solid rgba(255,255,255,.1); font-size:15px; }
.rv-toc button:hover, .rv-toc button.is-on { background:rgba(0,212,224,.1); }
.rv-toc b { color:var(--gold); font-size:13px; width:24px; }
.rv-toc em { margin-left:auto; font-style:normal; font-size:12px; color:var(--soft); }
.rv-thumbs { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.rv-thumbs button { display:block; text-align:center; font-size:12px; color:var(--soft); }
.rv-thumbs img { display:block; width:100%; height:auto; border-radius:5px; border:2px solid transparent; margin-bottom:4px; background:#fff; }
.rv-thumbs button:hover img, .rv-thumbs button.is-on img { border-color:var(--cyan); }

/* Ampliación */
.rv-zoom { position:fixed; inset:0; z-index:40; background:rgba(7,9,28,.97); display:flex; flex-direction:column; }
.rv-zoom__bar { display:flex; align-items:center; justify-content:center; gap:8px; padding:10px; border-bottom:1px solid rgba(255,255,255,.1); }
.rv-pct { min-width:64px; height:40px; text-align:center; font-size:13px; color:var(--soft); border-radius:10px; }
.rv-pct:hover { color:#fff; background:rgba(255,255,255,.08); }
.rv-zoom__bar .rv-btn:disabled { opacity:.35; cursor:default; }
#rvZoomClose { background:var(--cyan); border-color:var(--cyan); color:var(--deep); font-weight:700; }
#rvZoomClose span { display:inline; }
button, .rv-btn { touch-action:manipulation; } /* evita que tocar dos veces un botón agrande toda la pantalla */
.rv-zoom__scroll { flex:1; overflow:auto; cursor:grab; -webkit-overflow-scrolling:touch; }
.rv-zoom__scroll.is-drag { cursor:grabbing; user-select:none; }
.rv-zoom__inner { display:flex; margin:0 auto; padding:16px 0; }
.rv-zoom__inner .rv-page { position:relative; inset:auto; cursor:inherit; aspect-ratio:824/1004; }
.rv-zoom__inner .rv-page img { -webkit-user-drag:none; }

.rv-toast { position:fixed; left:50%; bottom:70px; transform:translateX(-50%); z-index:50; background:#fff; color:var(--navy); padding:10px 18px; border-radius:10px; font-size:14px; font-weight:700; box-shadow:0 10px 30px rgba(0,0,0,.35); }

@media (max-width:900px) {
    .rv-btn span { display:none; }
    .rv-section, .rv-count { width:auto; }
    .rv-section { display:none; }
}
.rv-curl { position:absolute; left:0; top:0; z-index:6; pointer-events:none; }
.rv-ambient, .rv-cap, .rv-hint, .rv-btn small { display:none; }
.rv-bottom { position:relative; }
.rv-bubble { position:absolute; left:50%; bottom:100%; transform:translateX(-50%); z-index:20; padding:8px 8px 6px; border-radius:12px; background:var(--navy); border:1px solid rgba(255,255,255,.2); box-shadow:0 18px 40px rgba(0,0,0,.5); text-align:center; font-size:12px; color:var(--soft); }
.rv-bubble img { display:block; width:110px; height:auto; border-radius:5px; background:#fff; margin-bottom:4px; }

@media (max-width:700px) {
    .rv { padding-bottom:calc(66px + env(safe-area-inset-bottom)); }
    .rv-top { gap:12px; padding:calc(10px + env(safe-area-inset-top)) 16px 10px; background:rgba(10,12,36,.35); border-bottom:0; }
    .rv-logo img { height:30px; }
    .rv-title { padding-left:12px; }
    .rv-title h1 { font-size:14px; }
    .rv-title span { font-size:9px; letter-spacing:1.6px; }

    /* barra de herramientas abajo, al alcance del pulgar */
    .rv-tools { position:fixed; left:0; right:0; bottom:0; z-index:20; gap:0; justify-content:space-between; padding:6px 6px calc(6px + env(safe-area-inset-bottom)); background:rgba(14,16,48,.92); border-top:1px solid rgba(255,255,255,.1); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); }
    .rv-tools .rv-btn { flex:1; flex-direction:column; gap:3px; height:54px; padding:0; border:0; background:none; font-size:19px; border-radius:12px; color:var(--ink); }
    .rv-tools .rv-btn:active { background:rgba(0,212,224,.16); }
    .rv-tools .rv-btn small { display:block; font-size:10.5px; font-weight:500; color:var(--soft); }
    .rv-tools .rv-btn--solid i, .rv-tools .rv-btn--solid small { color:var(--cyan); }
    #rvFull { display:none; }

    .rv-stage { z-index:1; }
    .rv-ambient { display:block; position:absolute; inset:-40px; background-size:cover; background-position:center; filter:blur(46px) saturate(1.5); opacity:.3; transition:background-image .4s; pointer-events:none; }
    .rv-cap { display:block; position:absolute; top:6px; left:20px; right:20px; text-align:center; pointer-events:none; }
    .rv-cap span { display:block; font-size:10.5px; letter-spacing:2.2px; text-transform:uppercase; color:var(--cyan); font-weight:700; }
    .rv-cap strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:16px; line-height:1.25; color:#fff; margin-top:3px; }
    .rv-hint { display:block; position:absolute; left:70px; right:70px; bottom:18px; text-align:center; font-size:12px; line-height:1.3; color:var(--soft); pointer-events:none; transition:opacity .5s; }
    .rv-usado .rv-hint, .rv-portada .rv-hint { opacity:0; }
    .rv-book.rv-single { touch-action:none; }
    .rv-stage { touch-action:none; }
    .rv-single .rv-slot--r { border-radius:2px 6px 6px 2px; box-shadow:2px 1px 0 #d9dcea, 4px 2px 0 #b9bed6, 6px 3px 0 #8f95b8, 0 26px 50px rgba(0,0,0,.55); }
    .rv-single .rv-slot--r::before { content:''; position:absolute; top:0; bottom:0; left:0; width:16px; z-index:3; pointer-events:none; background:linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.14) 40%, transparent); }
    .rv-single .rv-page { cursor:pointer; }

    .rv-arrow { top:auto; bottom:8px; margin:0; width:42px; height:42px; font-size:16px; background:rgba(255,255,255,.08); }
    .rv-arrow--prev { left:16px; }
    .rv-arrow--next { right:16px; }
    .rv-open { bottom:8px; font-size:14px; padding:11px 20px; }

    .rv-bottom { gap:14px; padding:6px 20px 10px; }
    .rv-range { flex:1; width:auto; height:5px; background:linear-gradient(90deg, var(--cyan) var(--avance, 0%), rgba(255,255,255,.18) var(--avance, 0%)); }
    .rv-range::-webkit-slider-thumb { width:22px; height:22px; background:#fff; border:5px solid var(--cyan); }
    .rv-count { font-size:12px; }

    /* índice y miniaturas como hoja que sube desde abajo */
    .rv-panel { align-items:flex-end; }
    .rv-panel__box { width:100%; height:auto; max-height:82dvh; border-left:0; border-radius:22px 22px 0 0; animation:rvUp .32s cubic-bezier(.2,.8,.3,1); padding-bottom:env(safe-area-inset-bottom); }
    .rv-panel__head { position:relative; padding-top:22px; }
    .rv-panel__head::before { content:''; position:absolute; top:8px; left:50%; width:40px; height:4px; margin-left:-20px; border-radius:4px; background:rgba(255,255,255,.25); }
    .rv-thumbs { grid-template-columns:repeat(3, 1fr); gap:10px; }

    .rv-zoom__bar { order:2; gap:6px; padding:10px 8px calc(10px + env(safe-area-inset-bottom)); border-bottom:0; border-top:1px solid rgba(255,255,255,.12); touch-action:none; }
    .rv-zoom__bar .rv-btn { height:46px; min-width:44px; padding:0 10px; }
    #rvZoomClose { padding:0 16px; margin-left:4px; }
    .rv-pct { min-width:54px; height:46px; padding:0; }
    .rv-zoom__scroll { touch-action:pan-x pan-y; }
    .rv-toast { bottom:130px; white-space:nowrap; }
    body #saej-ck { bottom:calc(76px + env(safe-area-inset-bottom)); }
}
@keyframes rvUp { from { transform:translateY(100%); } }
/* celular acostado */
@media (max-height:500px) and (orientation:landscape) {
    .rv-top { padding:5px 14px; }
    .rv-logo img { height:24px; }
    .rv-title span { display:none; }
    .rv-btn { height:32px; }
    .rv-bottom { padding:3px 14px 6px; }
}
@media (prefers-reduced-motion:reduce) {
    .rv-book, .rv-panel__box { transition:none; animation:none; }
    .rv-open { animation:none; }
}
