/* Gazet flip reader. Works without JS as a vertical list of page images; flipbook.js adds .fb-on. */
.fb-body { margin: 0; background: var(--soft); }
.fb { min-height: 100vh; display: flex; flex-direction: column; }
.fb-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 6px 12px; background: var(--paper);
  border-bottom: 3px double var(--ink); font-family: var(--serif); }
.fb-textlink { font-weight: 700; font-size: .85rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--link-deco);
  text-underline-offset: 3px; padding: 6px 2px; white-space: nowrap; }
.fb-textlink:hover { color: var(--accent); text-decoration-color: currentColor; }
.fb-brand { font-family: var(--display); font-size: 1.9rem; line-height: 1; text-decoration: none; color: var(--ink); }
.fb-title { margin: 0; flex: 1 1 12rem; font-weight: 700; font-size: .85rem; line-height: 1.3; color: var(--muted); }
.fb-ed { color: var(--accent); }
.fb-links { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .9rem; }
.fb-links a { color: var(--accent); text-decoration: none; border: 1.5px solid var(--accent); padding: 4px 10px; }
.fb-links a:hover { background: var(--accent); color: var(--on-accent); }
.fb-links a, .fb-links .theme-toggle { white-space: nowrap; }
.fb-links .theme-toggle { margin: 0; min-height: 0; padding: 4px 10px; font: 800 .9rem var(--serif); color: var(--ink); border: 1.5px solid var(--hair); cursor: pointer; }
.fb-links .theme-toggle:hover { background: var(--soft); }
.fb-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fb-stage { flex: 1; position: relative; }
.fb-pages { list-style: none; margin: 0 auto; padding: 12px; max-width: 720px; display: grid; gap: 14px; }
.fb-page img { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.fb-disc { display: block; margin: 0; padding: 6px 12px 8px; text-align: center; font-size: .72rem; line-height: 1.4; color: var(--muted); background: var(--paper); }
.fb-disc a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---- JS reader ---- */
.fb-on { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.fb-on .fb-pages { display: none; }
.fb-on .fb-stage { overflow: hidden; touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fb-book { position: relative; perspective: 2600px; }
.fb-half { position: absolute; top: 0; height: 100%; width: 50%; background: #fff; overflow: hidden; }
.fb-half.fb-r { right: 0; box-shadow: 2px 0 12px rgba(0,0,0,.18); }
.fb-half.fb-l { left: 0; box-shadow: -2px 0 12px rgba(0,0,0,.18); }
.fb-half.fb-one { width: 100%; right: 0; box-shadow: 0 2px 14px rgba(0,0,0,.2); }
.fb-half.fb-empty { background: transparent; box-shadow: none; }
.fb-half img[hidden], .fb-face img[hidden] { display: none; }
.fb-half img, .fb-face img { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; pointer-events: none; }
/* spine shading on spreads */
.fb-half.fb-r:not(.fb-empty)::after, .fb-half.fb-l:not(.fb-empty)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; }
.fb-half.fb-r::after { right: auto; left: 0; background: linear-gradient(to right, rgba(0,0,0,.14), rgba(0,0,0,0)); }
.fb-half.fb-l::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.14), rgba(0,0,0,0)); }

/* the turning leaf */
.fb-leaf { position: absolute; top: 0; height: 100%; width: 50%; z-index: 3; transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.45,.05,.3,1); will-change: transform; }
.fb-leaf.fb-from-l { left: 0; transform-origin: 100% 50%; }
.fb-leaf.fb-from-r { right: 0; transform-origin: 0 50%; }
.fb-leaf.fb-go.fb-from-l { transform: rotateY(180deg); }
.fb-leaf.fb-go.fb-from-r { transform: rotateY(-180deg); }
.fb-face { position: absolute; inset: 0; background: #fff; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.fb-face.fb-back { transform: rotateY(180deg); }
.fb-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .62s; }
.fb-from-l .fb-front::after { background: linear-gradient(to left, rgba(0,0,0,.28), rgba(0,0,0,0) 60%); }
.fb-from-r .fb-front::after { background: linear-gradient(to right, rgba(0,0,0,.28), rgba(0,0,0,0) 60%); }
.fb-go .fb-front::after { opacity: 1; }

/* single page: slide */
.fb-slide { transition: transform .38s cubic-bezier(.3,.1,.3,1); will-change: transform; }

.fb-controls { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 10px; background: var(--paper);
  border-top: 1px solid var(--hair); font-family: var(--serif); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.fb-controls[hidden] { display: none; }
.fb-btn { white-space: nowrap; font: 800 1rem var(--serif); min-width: 44px; min-height: 44px; padding: 6px 12px; background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bg); cursor: pointer; }
.fb-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fb-btn:disabled { opacity: .35; cursor: default; background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.fb-prev, .fb-next { font-size: 1.35rem; line-height: 1; }
.fb-range { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 1 22rem; min-width: 7rem; }
.fb-count { font-weight: 800; font-size: .88rem; white-space: nowrap; }
.fb-range input { width: 100%; accent-color: var(--accent); margin: 0; }

/* zoom */
.fb-zoom { position: fixed; inset: 0; z-index: 20; background: rgba(21,21,21,.92); display: flex; flex-direction: column; }
.fb-zoom[hidden] { display: none; }
.fb-zoom-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; color: #fff; font: 800 .95rem var(--serif); }
.fb-zoom-bar .fb-btn { background: #fff; color: #151515; border-color: #fff; }
.fb-zoom-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: auto; text-align: center; }
.fb-zoom-scroll img { display: inline-block; width: 220vw; max-width: none; height: auto; background: #fff; }
@media (min-width: 760px) { .fb-zoom-scroll img { width: min(1104px, 96vw); } }
.fb-zoom-scroll img.fb-zoom-more { width: 1650px; }

@media (max-width: 520px) {
  .fb-brand { font-size: 1.5rem; }
  .fb-title { order: 3; flex-basis: 100%; font-size: .78rem; }
  .fb-links { margin-inline-start: auto; font-size: .82rem; }
  .fb-disc { font-size: .68rem; padding: 4px 8px; }
  .fb-links { gap: 6px; }
  .fb-links a, .fb-links .theme-toggle { padding: 3px 7px; }
  .fb-controls { gap: 6px; padding-inline: 6px; }
  .fb-btn { padding: 6px 8px; font-size: .9rem; }
  .fb-range { min-width: 5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fb-leaf, .fb-slide, .fb-face::after { transition: none; }
}
[data-theme="dark"] .fb-half img, [data-theme="dark"] .fb-face img, [data-theme="dark"] .fb-page img { filter: brightness(.9) sepia(.1); }
@media print { .fb-bar, .fb-controls, .fb-disc { display: none; } .fb-on { height: auto; overflow: visible; } .fb-on .fb-pages { display: grid; } .fb-book { display: none; } }
