/* =========================================================================
   Yáqʷa Annual Report — Standalone Flipbook (embeddable)
   Reader only: no splash, forms, or kiosk chrome. Fills its frame (iframe
   or full page). Brand: blue #005EB8 · near-black #1D1D1D.
   ========================================================================= */

/* ---- Self-hosted BC Sans for the page counter (á, ʷ safe) -------------- */
@font-face {
  font-family: "BC Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/BCSans-Regular.woff2") format("woff2"),
       url("../fonts/BCSans-Regular.woff") format("woff");
}
@font-face {
  font-family: "BC Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/BCSans-Bold.woff2") format("woff2"),
       url("../fonts/BCSans-Bold.woff") format("woff");
}

:root {
  --brand-blue: #005EB8;
  --brand-black: #1D1D1D;
  /* Rendered page art is 2520 × 1960 = 1.2857 (9:7). */
  --page-w: 2520;
  --page-h: 1960;
  --transition: 360ms;
  --font-ui: "BC Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--brand-black);
  color: #fff;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
body {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  position: fixed; inset: 0;
}
img {
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}

/* ---- Stage: fixed 9:7 aspect, scales to fit, letterboxes --------------- */
#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage {
  position: relative;
  aspect-ratio: var(--page-w) / var(--page-h);
  width: min(100vw, calc(100vh * (var(--page-w) / var(--page-h))));
  height: auto; max-height: 100vh;
  background: var(--brand-black);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.page {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: translateX(0);
  transition: opacity var(--transition) ease, transform var(--transition) ease,
              visibility 0s linear var(--transition);
  will-change: opacity, transform;
}
.page img { width: 100%; height: 100%; object-fit: contain; display: block; }
.page.is-active {
  opacity: 1; visibility: visible; transform: translateX(0);
  transition: opacity var(--transition) ease, transform var(--transition) ease, visibility 0s;
  z-index: 2;
}
.page.is-prev { transform: translateX(-6%); }
.page.is-next { transform: translateX(6%); }
#stage.is-dragging .page { transition: none; }
#stage.is-dragging .page.is-active { transform: translateX(var(--drag, 0px)); }

/* ---- Edge tap zones ---------------------------------------------------- */
.tap-zone { position: absolute; top: 0; bottom: 0; width: 18%; z-index: 5; cursor: pointer; }
.tap-zone--left { left: 0; }
.tap-zone--right { right: 0; }
.tap-zone[hidden] { display: none; }
.tap-zone .chevron {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.75rem; height: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0, 0, 0, 0.28); border-radius: 50%;
  opacity: 0; transition: opacity 200ms ease;
}
.tap-zone--left .chevron { left: 0.9rem; }
.tap-zone--right .chevron { right: 0.9rem; }
@media (hover: hover) { .tap-zone:hover .chevron { opacity: 1; } }
.tap-zone .chevron svg { width: 1.5rem; height: 1.5rem; }

/* ---- Page indicator ---------------------------------------------------- */
#indicator {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.4rem 0.9rem; background: rgba(29, 29, 29, 0.55); border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#indicator .counter {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums; min-width: 3.6em; text-align: center;
}
#indicator .dots { display: flex; gap: 0.4rem; }
#indicator .dots[hidden] { display: none; }
#indicator .dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 200ms ease, transform 200ms ease;
}
#indicator .dot.is-active { background: var(--brand-blue); transform: scale(1.25); }

/* ---- Fullscreen button ------------------------------------------------- */
#fs-btn {
  position: fixed; top: max(0.9rem, env(safe-area-inset-top)); right: max(0.9rem, env(safe-area-inset-right));
  z-index: 10; width: 2.75rem; height: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(29, 29, 29, 0.55); border: none; border-radius: 50%; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#fs-btn svg { width: 1.35rem; height: 1.35rem; }
#fs-btn:active { transform: scale(0.94); }
