/* ──────────────────────────────────────────────────────────────────────
   THE READER
   One reader serves both publications. /artbook/ and /catalogue/ are two
   thin pages that name a file and load this; everything they look like
   and everything they do lives here and in reader.js, so a fix reaches
   both at once.
   ────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    background: #000;
    color: #fff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
    -webkit-user-select: none; user-select: none;
}
#gl {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    touch-action: none;
    cursor: grab;
}
#gl.dragging { cursor: grabbing; }

footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
    z-index: 5000; pointer-events: none;
}
.foot-l { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.foot-l a { color: rgba(255,255,255,.55); text-decoration: none; }
.foot-l a:hover { color: #fff; }
#counter { opacity: .35; }
.nav-arrows { display: flex; gap: 10px; pointer-events: auto; }
.nav-arrows button {
    background: none; border: 1px solid rgba(255,255,255,.22); border-radius: 50%;
    width: 28px; height: 28px; cursor: pointer;
    font-family: inherit; font-size: 10px; color: rgba(255,255,255,.6);
    transition: all .2s ease;
}
.nav-arrows button:hover:not(:disabled) { background: #fff; color: #000; }
.nav-arrows button:disabled { opacity: .12; cursor: default; }

/* ── the bottom furniture stacks: footer, then the scrubber, then zoom.
   --uih is the height all three take together; the page is laid out
   clear of it so nothing is ever covered. ── */
:root { --footh: 54px; --scrubh: 40px; }

/* ── page scrubber: drag through the whole booklet, per cent ── */
#scrubbar {
    position: fixed; left: 50%; bottom: calc(var(--footh) + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: none; align-items: center; gap: 12px;
    width: min(92vw, 560px); padding: 8px 15px;
    background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px; z-index: 5200;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#scrub {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 auto; height: 2px; margin: 0;
    background: rgba(255,255,255,.28); border-radius: 2px; outline: none;
    touch-action: none;
}
#scrub::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
}
#scrub::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
}
#pct {
    flex: 0 0 auto; min-width: 34px; text-align: right;
    font-size: 9px; letter-spacing: 1.5px; color: rgba(255,255,255,.55);
    font-variant-numeric: tabular-nums;
}

/* ── one page / two pages ──
   a pill, not a disc: it has to hold a word, so it overrides the
   round geometry the two arrows next to it share. */
#modebtn {
    background: none; border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
    width: auto; min-width: 0; height: 28px; padding: 0 12px; cursor: pointer;
    font-family: inherit; font-size: 8px; letter-spacing: 1.6px; text-transform: uppercase;
    color: rgba(255,255,255,.6); transition: all .2s ease; white-space: nowrap;
}
/* while one-page reading is on, the button reads as held down */
#modebtn[aria-pressed="true"] { border-color: rgba(255,255,255,.5); color: rgba(255,255,255,.9); }
@media (hover: hover) { #modebtn:hover { background: #fff; color: #000; border-color: #fff; } }

/* ── zoom slider (hidden until the pdf is ready) ── */
#zoombar {
    position: fixed; left: 50%;
    bottom: calc(var(--footh) + var(--scrubh) + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: none; align-items: center; gap: 11px;
    width: min(56vw, 240px); padding: 7px 13px;
    background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px; z-index: 5200;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#zoombar .zmk { font-size: 13px; line-height: 1; color: rgba(255,255,255,.5);
    width: 11px; text-align: center; flex: 0 0 auto; }
#zoom {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 auto; height: 2px; margin: 0;
    background: rgba(255,255,255,.28); border-radius: 2px; outline: none;
}
#zoom::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
}
#zoom::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
}

#loading, #error {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; letter-spacing: 3px; text-transform: uppercase;
    z-index: 6000; background: #000; color: rgba(255,255,255,.7);
}
#loading span { animation: pulse 1.2s ease infinite; }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: .8; } }
#error { display: none; flex-direction: column; gap: 12px; text-align: center; padding: 20px; }
#error small { opacity: .4; letter-spacing: 1px; text-transform: none; word-break: break-all; max-width: 70vw; }
