/* Full-screen PDF reader for e-books */

:root {
    --maroon: #7f0909;
    --maroon-dark: #5e0606;
    --gold: #f5c518;
    --paper-bg: #3a3a3a;
    --white: #fff;
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--paper-bg); color: var(--white); }
svg { width: 20px; height: 20px; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.reader { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--paper-bg); }

.reader__bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--maroon); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); z-index: 2; flex-wrap: wrap; }
.reader__back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--white); flex-shrink: 0; }
.reader__back:hover { background: rgba(255, 255, 255, .15); }
.reader__title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; line-height: 1.3; }
.reader__title strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__title span { font-size: 12px; opacity: .8; }

.reader__controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reader__group { display: flex; align-items: center; gap: 2px; background: rgba(0, 0, 0, .18); border-radius: 999px; padding: 3px; }
.reader__btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--white); cursor: pointer; text-decoration: none; }
.reader__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.reader__btn:disabled { opacity: .4; cursor: default; }
.reader__btn:focus-visible, .reader__zoom:focus-visible, .reader__back:focus-visible, .reader__page input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.reader__zoom { min-width: 56px; height: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--white); font: 500 13px var(--font); cursor: pointer; }
.reader__zoom:hover { background: rgba(255, 255, 255, .18); }
.reader__page { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
.reader__page input { width: 46px; height: 28px; border: 0; border-radius: 6px; text-align: center; font: 500 13px var(--font); color: #222; }

.reader__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .15); }
.reader__progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

.reader__viewport { flex: 1; overflow: auto; position: relative; outline: none; -webkit-overflow-scrolling: touch; }
.reader__pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 12px 40px; width: max-content; min-width: 100%; }
.reader__sheet { position: relative; background: var(--white); box-shadow: 0 4px 16px rgba(0, 0, 0, .45); flex-shrink: 0; }
.reader__sheet canvas { display: block; width: 100%; height: 100%; }
.reader__sheet::after { content: attr(data-page); position: absolute; bottom: 6px; right: 10px; font-size: 11px; color: #999; }
.reader__sheet.is-rendered::after { content: none; }

.reader__status { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 15px; color: rgba(255, 255, 255, .85); }
.reader__status[hidden] { display: none; }
.reader__status p { margin: 0; max-width: 420px; }
.reader__status a { color: var(--gold); }

.reader:fullscreen .reader__bar { padding-top: 6px; padding-bottom: 6px; }

@media (max-width: 720px) {
    .reader__bar { padding: 6px 10px; gap: 6px 10px; }
    .reader__title { flex-basis: calc(100% - 60px); }
    .reader__controls { width: 100%; justify-content: space-between; gap: 6px; }
    .reader__pages { padding: 10px 6px 30px; gap: 10px; }
}
