/* ═══════════════════════════════════════════════════════════════════════════
   ARCHIVES — BASIC  (v7 · cinematic editorial index)
   --------------------------------------------------------------------------
   Goals of this rewrite:
     · Eliminate the grid-image horizontal overflow bug on phones / tablets
       (every grid track is minmax(0,1fr); every grid item has min-width:0).
     · A genuinely modern sticky sidebar index that *moves with the scroll*
       and reads like a film-strip table of contents.
     · A cinematic editorial atmosphere — subtle ambient glow, gold accents,
       restrained motion — that matches the cinematic mode in feel.
═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bs-ink:        #0a0908;
  --bs-ink-2:      #131110;
  --bs-paper:      #e8e2d6;
  --bs-paper-dim:  rgba(232, 226, 214, 0.62);
  --bs-paper-faint:rgba(232, 226, 214, 0.34);
  --bs-bronze:     #c4a76c;
  --bs-bronze-soft:rgba(196, 167, 108, 0.32);
  --bs-bronze-line:rgba(196, 167, 108, 0.14);
  --bs-ease:       cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  background: var(--bs-ink);
  color: var(--bs-paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body.basic-body { overflow-x: hidden; }
a       { color: inherit; text-decoration: none; }
button  { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul      { list-style: none; }
img     { display: block; max-width: 100%; }

/* ── Page wrapper: pads under unified .nav header ───────────────────── */
.bs { padding-top: var(--nav-height, 76px); }

/* ══════════════════════════════════════════════════════════════════════════
   AMBIENT BACKDROP — a faint warm vignette + slow drift
══════════════════════════════════════════════════════════════════════════ */
.basic-body::before {
  content: '';
  position: fixed; inset: -8%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 18% 12%, rgba(176,141,87,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 82% 88%, rgba(40, 60, 50, 0.16)  0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(196,167,108,0.04) 0%, transparent 70%);
  animation: bsDrift 36s ease-in-out infinite alternate;
  filter: saturate(0.92);
}
.basic-body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  opacity: 0.5;
}
@keyframes bsDrift {
  0%   { transform: scale(1)    translate3d(0,0,0); }
  100% { transform: scale(1.06) translate3d(0.8%, -0.6%, 0); }
}
.bs, .bs-coda, .bs-lightbox { position: relative; z-index: 2; }

/* ══════════════════════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════════════════════ */
.bs-hero {
  padding: clamp(40px, 8vh, 90px) clamp(20px, 5vw, 72px) clamp(36px, 5vh, 64px);
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.bs-hero::after {
  content: '';
  display: block;
  width: 44px; height: 1px;
  background: var(--bs-bronze);
  margin: 36px auto 0;
  opacity: 0.4;
}
.bs-eyebrow {
  display: inline-block;
  font-family: var(--font-sc);
  font-size: clamp(9.5px, 0.75vw, 11px);
  letter-spacing: 0.48em;
  text-transform: uppercase;
  color: rgba(196, 167, 108, 0.7);
  margin-bottom: 24px;
}
.bs-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin-bottom: 22px;
  color: var(--bs-paper);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.bs-title em {
  font-style: italic;
  color: var(--bs-bronze);
  font-weight: 400;
}
.bs-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.18vw, 18px);
  line-height: 1.7;
  color: rgba(232, 226, 214, 0.55);
  max-width: 62ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.bs-hero-meta {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 24px;
}
.bs-hero-meta-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.bs-num {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  color: var(--bs-bronze);
  line-height: 1;
}
.bs-lbl {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.36);
}
.bs-hero-meta-sep {
  width: 1px; height: 30px;
  background: rgba(196, 167, 108, 0.18);
}

/* ══════════════════════════════════════════════════════════════════════════
   BODY LAYOUT
   Desktop ≥1025px : sticky sidebar index + content stream
   Tablet  ≤1024px : horizontal sticky strip + stream below
   Phone   ≤768px  : drawer (mobile.css) replaces the strip
══════════════════════════════════════════════════════════════════════════ */
.bs-body {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 72px) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}
@media (max-width: 1024px) {
  .bs-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px clamp(16px, 4vw, 40px) 64px;
  }
}

/* Desktop sidebar removed — chapter navigation lives in the floating
   "Index" button (mobile.css). Hide aside completely. */
.bs-index { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR INDEX — sticky, vertical, with a "playhead" that tracks scroll
══════════════════════════════════════════════════════════════════════════ */
.bs-index {
  position: sticky;
  top: calc(var(--nav-height, 76px) + 18px);
  align-self: start;
  max-height: calc(100vh - var(--nav-height, 76px) - 36px);
  min-width: 0;
}
.bs-index-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 22px 22px;
  max-height: calc(100vh - var(--nav-height, 76px) - 36px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-bronze-soft) transparent;
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.62) 0%, rgba(20, 18, 16, 0.42) 100%);
  border: 1px solid var(--bs-bronze-line);
  border-radius: 4px;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow:
    0 30px 60px -28px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.bs-index-inner::-webkit-scrollbar { width: 4px; }
.bs-index-inner::-webkit-scrollbar-thumb { background: var(--bs-bronze-soft); border-radius: 2px; }

.bs-index-label {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.40);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bs-bronze-line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.bs-index-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bs-bronze);
  box-shadow: 0 0 0 4px rgba(196, 167, 108, 0.12);
}

/* Index list = vertical filmstrip with a left guide line + sliding playhead */
.bs-index-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 18px;
}
.bs-index-list::before {
  content: '';
  position: absolute;
  left: 6px; top: 12px; bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--bs-bronze-line) 12%, var(--bs-bronze-line) 88%, transparent);
}
.bs-index-playhead {
  position: absolute;
  left: 0; top: 0;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bs-bronze);
  box-shadow:
    0 0 0 3px rgba(196, 167, 108, 0.18),
    0 0 14px 2px rgba(196, 167, 108, 0.40);
  transform: translateY(-50%);
  transition: top 0.32s var(--bs-ease);
  pointer-events: none;
  opacity: 0;
}
.bs-index-playhead.is-on { opacity: 1; }

.bs-ix {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 9px 4px 9px 0;
  text-align: left;
  color: rgba(232, 226, 214, 0.48);
  cursor: pointer;
  transition: color 0.28s, padding-left 0.32s var(--bs-ease);
  border-bottom: 1px solid rgba(196, 167, 108, 0.05);
}
.bs-ix:last-child { border-bottom: 0; }
.bs-ix:hover { color: var(--bs-paper); padding-left: 4px; }
.bs-ix.is-active {
  color: var(--bs-bronze);
}
.bs-ix.is-active .bs-ix-title { color: var(--bs-paper); }

.bs-ix-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(196, 167, 108, 0.72);
  line-height: 1;
  text-align: left;
}
.bs-ix.is-active .bs-ix-roman { color: var(--bs-bronze); }
.bs-ix-title {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-ix-count {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(232, 226, 214, 0.24);
  font-variant-numeric: tabular-nums;
}

/* Progress bar at the foot of the sidebar */
.bs-index-progress {
  height: 2px;
  background: rgba(196, 167, 108, 0.10);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.bs-index-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(to right, rgba(196,167,108,0.4), var(--bs-bronze));
  box-shadow: 0 0 8px rgba(196, 167, 108, 0.4);
  transition: width 0.18s linear;
}

/* Grid-size toolbox */
.bs-index-tools {
  display: flex;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--bs-bronze-line);
  margin-top: 2px;
}
.bs-tool {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bs-bronze-line);
  color: rgba(232, 226, 214, 0.36);
  border-radius: 2px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.bs-tool:hover { color: var(--bs-paper); border-color: rgba(196, 167, 108, 0.40); }
.bs-tool.is-active {
  color: var(--bs-bronze);
  border-color: rgba(196, 167, 108, 0.50);
  background: rgba(196, 167, 108, 0.08);
}
.bs-tool svg { fill: currentColor; }

/* ── Tablet horizontal strip (≤1024 ≥769) ─────────────────────────── */
@media (max-width: 1024px) {
  .bs-index {
    position: sticky;
    top: var(--nav-height, 76px);
    z-index: 100;
    max-height: none;
    margin: 0 calc(clamp(16px, 4vw, 40px) * -1);  /* edge-to-edge strip */
  }
  .bs-index-inner {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 10px;
    padding: 10px clamp(16px, 4vw, 40px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    background: rgba(10, 9, 8, 0.92);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  }
  .bs-index-inner::-webkit-scrollbar { display: none; }
  .bs-index-inner { scrollbar-width: none; }
  .bs-index-label { display: none; }
  .bs-index-progress { display: none; }
  .bs-index-playhead { display: none; }
  .bs-index-list {
    flex-direction: row;
    padding: 0;
    gap: 8px;
    flex-shrink: 0;
  }
  .bs-index-list::before { display: none; }
  .bs-ix {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 7px 12px;
    border: 1px solid rgba(196, 167, 108, 0.16);
    border-radius: 999px;
    grid-template-columns: auto auto;
    gap: 7px;
    background: rgba(20, 18, 16, 0.4);
  }
  .bs-ix:hover { padding-left: 12px; }
  .bs-ix.is-active {
    border-color: var(--bs-bronze-soft);
    background: rgba(196, 167, 108, 0.10);
  }
  .bs-ix-title {
    max-width: min(46vw, 18rem);
    white-space: nowrap;
  }
  .bs-ix-count { display: none; }
  .bs-index-tools {
    flex-shrink: 0;
    border-top: 0;
    border-left: 1px solid var(--bs-bronze-line);
    padding-top: 0;
    padding-left: 8px;
    margin-left: 4px;
    margin-top: 0;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   STREAM — chapter blocks
══════════════════════════════════════════════════════════════════════════ */
.bs-stream {
  min-width: 0;          /* CRITICAL — lets the grid track shrink to viewport */
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 8vh, 110px);
  min-height: 60vh;
}

.bs-loading {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 80px 0;
}
.bs-loading-dot {
  width: 6px; height: 6px;
  background: var(--bs-bronze);
  border-radius: 50%;
  opacity: 0.3;
  animation: bsLoad 1.2s ease-in-out infinite;
}
.bs-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.bs-loading-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes bsLoad {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-6px); }
}

/* ── Chapter block ─────────────────────────────────────────────────── */
.bs-ch {
  min-width: 0;
  scroll-margin-top: calc(var(--nav-height, 76px) + 24px);
  animation: bsFade 0.9s var(--bs-ease) both;
}
@keyframes bsFade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.bs-ch-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: baseline;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--bs-bronze-line);
  position: relative;
}
.bs-ch-head::after {
  /* gilded accent below the rule */
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 56px; height: 1px;
  background: var(--bs-bronze);
  opacity: 0.55;
}
.bs-ch-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(30px, 3vw, 44px);
  color: var(--bs-bronze);
  line-height: 1;
  letter-spacing: -0.02em;
}
.bs-ch-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.12;
  color: var(--bs-paper);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  hyphens: auto;
  min-width: 0;
}
.bs-ch-meta {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.40);
  text-align: right;
  white-space: nowrap;
}
.bs-ch-meta span + span::before {
  content: ' · ';
  margin: 0 2px;
  color: rgba(196, 167, 108, 0.45);
}
@media (max-width: 1180px) {
  .bs-ch-head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 16px;
    align-items: start;
  }
  .bs-ch-roman { grid-row: 1 / 3; }
  .bs-ch-meta {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    white-space: normal;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   GRID — every track uses minmax(0,1fr) so images can never push wider
   than their cell.
══════════════════════════════════════════════════════════════════════════ */
.bs-grid {
  display: grid;
  gap: clamp(10px, 1.2vw, 18px);
  grid-template-columns: repeat(3, minmax(0, 1fr));    /* fallback = md */
}
.bs-grid.is-md { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bs-grid.is-sm { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bs-grid.is-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .bs-grid.is-md,
  .bs-grid.is-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bs-grid.is-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bs-grid.is-md,
  .bs-grid.is-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-grid.is-lg { grid-template-columns: minmax(0, 1fr); }
}

/* ── Tile ─────────────────────────────────────────────────────────── */
.bs-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #191612;
  cursor: zoom-in;
  border: 1px solid transparent;
  transition: border-color 0.4s, box-shadow 0.5s, transform 0.5s var(--bs-ease);
  min-width: 0;
  width: 100%;
}
.bs-tile::after {
  /* subtle gold sheen on hover */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(196,167,108,0.10) 50%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--bs-ease);
  pointer-events: none;
}
.bs-tile:hover {
  border-color: var(--bs-bronze-soft);
  box-shadow: 0 26px 60px -20px rgba(0, 0, 0, 0.7);
}
.bs-tile:hover::after { opacity: 1; }
.bs-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--bs-ease), opacity 0.6s, filter 0.6s;
  opacity: 0;
  filter: saturate(0.94);
}
.bs-tile img.is-loaded { opacity: 1; }
.bs-tile:hover img { transform: scale(1.04); filter: saturate(1.05); }

.bs-tile-num {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(232, 226, 214, 0.88);
  padding: 4px 8px;
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}
.bs-tile:hover .bs-tile-num { opacity: 1; transform: none; }

.bs-tile-cap {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  line-height: 1.25;
  color: var(--bs-bronze);
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(10, 9, 8, 0) 0%, rgba(10, 9, 8, 0.78) 100%);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-tile:hover .bs-tile-cap,
.bs-tile:focus-visible .bs-tile-cap { opacity: 1; transform: none; }

/* Chapter footer cue */
.bs-ch-foot {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.24);
}
.bs-ch-foot-line {
  width: 40px; height: 1px;
  background: rgba(196, 167, 108, 0.28);
}

/* Lazy-load sentinel — animated pulse while next batch fetches. */
.bs-grid-sentinel {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px 0 6px;
  pointer-events: none;
}
.bs-grid-sentinel-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--bs-bronze);
  opacity: 0.25;
  animation: bsLoad 1.2s ease-in-out infinite;
}
.bs-grid-sentinel-dot:nth-child(2) { animation-delay: 0.15s; }
.bs-grid-sentinel-dot:nth-child(3) { animation-delay: 0.30s; }

/* ══════════════════════════════════════════════════════════════════════════
   CODA
══════════════════════════════════════════════════════════════════════════ */
.bs-coda {
  max-width: 900px;
  margin: clamp(40px, 8vh, 100px) auto 0;
  padding: clamp(50px, 8vh, 90px) clamp(20px, 5vw, 48px);
  text-align: center;
  border-top: 1px solid var(--bs-bronze-line);
}
.bs-coda-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.12;
  margin: 18px 0 16px;
  color: var(--bs-paper);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.bs-coda-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.2vw, 18px);
  color: rgba(232, 226, 214, 0.50);
  margin-bottom: 30px;
  text-wrap: pretty;
}
.bs-coda-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.bs-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  font-family: var(--font-sc);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  border: 1px solid var(--bs-bronze);
  color: var(--bs-ink);
  background: var(--bs-bronze);
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.bs-btn:hover { background: transparent; color: var(--bs-bronze); }
.bs-btn-ghost {
  background: transparent;
  color: rgba(232, 226, 214, 0.7);
  border-color: rgba(232, 226, 214, 0.18);
}
.bs-btn-ghost:hover { background: rgba(232, 226, 214, 0.06); color: var(--bs-paper); border-color: rgba(232, 226, 214, 0.38); }

/* ══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════════════════ */
.bs-lightbox {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  max-width: none; max-height: none;
  padding: 0; margin: 0; border: 0;
  background: rgba(10,9,8,0.96);
  color: rgba(246,242,236,0.9);
  z-index: 2200;
}
.bs-lightbox::backdrop { background: rgba(10,9,8,0.85); }
.bs-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-lb-figure {
  max-width: 90vw; max-height: 86vh;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.bs-lb-figure img {
  max-width: 100%; max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,0.6);
}
.bs-lb-caption {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 18px;
  font-family: var(--font-sc);
  font-size: 10px; letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(246,242,236,0.58);
  max-width: calc(100vw - 48px);
  text-align: center;
}
.bs-lb-chapter { color: var(--bs-bronze); overflow-wrap: anywhere; }
.bs-lb-close,
.bs-lb-nav {
  position: absolute;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(246,242,236,0.85);
  border: 1px solid rgba(246,242,236,0.15);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
  border-radius: 2px;
}
.bs-lb-close:hover,
.bs-lb-nav:hover {
  color: var(--warm-white, #f6f2ec);
  border-color: var(--bs-bronze);
  background: rgba(196,167,108,0.12);
}
.bs-lb-close { top: 24px; right: 24px; }
.bs-lb-prev  { top: 50%; left: 24px;  transform: translateY(-50%); }
.bs-lb-next  { top: 50%; right: 24px; transform: translateY(-50%); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bs-ch { animation: none; opacity: 1; }
  .bs-tile:hover img { transform: none; }
  .basic-body::before { animation: none; }
  .bs-index-playhead { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CHAPTER INDEX DRAWER (trigger now visible on all viewports)
   Anchored bottom-left so it pairs with the bottom-right cx-switch.
══════════════════════════════════════════════════════════════════════════ */
.bs-ch-menu-btn {
  display: inline-flex;
  position: fixed;
  bottom: clamp(20px, 3vh, 32px);
  left:   clamp(20px, 3vw, 32px);
  z-index: 9800;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  background: rgba(10, 9, 8, 0.78);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(196, 167, 108, 0.22);
  border-radius: 999px;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--limestone, #e8e2d6);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, gap 0.3s var(--ease-out, ease);
}
.bs-ch-menu-btn:hover,
.bs-ch-menu-btn:active {
  background: rgba(22, 17, 12, 0.9);
  border-color: var(--bronze-pale, #c4a76c);
  color: var(--bronze-pale, #c4a76c);
  gap: 14px;
}
.bs-ch-menu-btn svg { color: var(--bronze-pale, #c4a76c); flex-shrink: 0; }

.bs-ch-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(85vw, 320px);
  z-index: 500;
  background: rgba(10, 9, 8, 0.98);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-left: 1px solid var(--bs-bronze-line);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  pointer-events: none;
}
.bs-ch-menu.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.bs-ch-menu-overlay {
  position: fixed; inset: 0;
  z-index: 490;
  background: rgba(10, 9, 8, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.34s;
}
.bs-ch-menu-overlay.is-open { opacity: 1; pointer-events: auto; }
.bs-ch-menu-inner {
  display: flex; flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bs-ch-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bs-bronze-line);
  flex-shrink: 0;
}
.bs-ch-menu-title {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.40em;
  text-transform: uppercase;
  color: rgba(232, 226, 214, 0.50);
}
.bs-ch-menu-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bs-bronze-line);
  color: rgba(232, 226, 214, 0.52);
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.bs-ch-menu-close:hover { color: var(--bs-bronze); border-color: var(--bs-bronze-soft); }
.bs-ch-menu-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}
.bs-ch-menu-item {
  display: flex; align-items: baseline; gap: 14px;
  width: 100%;
  padding: 15px 20px;
  text-align: left;
  color: rgba(232, 226, 214, 0.55);
  border-bottom: 1px solid rgba(196, 167, 108, 0.05);
  transition: color 0.2s, background 0.2s;
  min-height: 52px;
}
.bs-ch-menu-item:active,
.bs-ch-menu-item:focus-visible {
  background: rgba(196, 167, 108, 0.07);
  color: var(--bs-paper);
}
.bs-ch-menu-item.is-active { color: var(--bs-bronze); }
.bs-ch-menu-roman {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: rgba(196, 167, 108, 0.62);
  min-width: 20px;
  flex-shrink: 0;
}
.bs-ch-menu-name {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE — ≤ 768px (mobile.css adds structural overrides)
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .bs-hero {
    padding: 30px 18px 24px;
    text-align: left;
  }
  .bs-hero::after { margin-left: 0; width: 32px; }
  .bs-eyebrow { font-size: 9px; margin-bottom: 14px; }
  .bs-title { font-size: clamp(2rem, 8.5vw, 2.8rem); }
  .bs-lede { font-size: 15px; line-height: 1.65; max-width: 100%; }
  .bs-hero-meta { margin-top: 22px; gap: 16px; }
  .bs-num { font-size: 22px; }
  .bs-hero-meta-sep { height: 26px; }

  .bs-body { padding: 28px 14px 56px; gap: 18px; }
  .bs-stream { gap: 60px; }

  .bs-ch { scroll-margin-top: calc(var(--nav-height, 64px) + 80px); }
  .bs-ch-head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 14px;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }
  .bs-ch-roman {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 26px;
    padding-right: 8px;
    border-right: 1px solid rgba(196, 167, 108, 0.18);
  }
  .bs-ch-title { font-size: clamp(16px, 5vw, 24px); }
  .bs-ch-meta {
    grid-column: 2;
    text-align: left;
    font-size: 8px;
    letter-spacing: 0.32em;
    white-space: normal;
  }
  .bs-ch-foot { margin-top: 22px; gap: 12px; font-size: 8px; }
  .bs-ch-foot-line { width: 28px; }

  .bs-grid { gap: 8px; }
  .bs-tile { aspect-ratio: 1 / 1; cursor: pointer; }
  .bs-tile:active {
    border-color: rgba(196, 167, 108, 0.45);
    box-shadow: 0 0 0 1px rgba(196, 167, 108, 0.25);
  }
  /* Always show caption + number on touch — no hover */
  .bs-tile-num { opacity: 1; transform: none; font-size: 8px; padding: 3px 6px; }
  .bs-tile-cap {
    opacity: 1; transform: none;
    font-size: 11px;
    left: 6px; right: 6px; bottom: 6px;
    padding: 5px 8px;
  }

  .bs-coda-title { font-size: clamp(20px, 7vw, 30px); margin: 14px 0 12px; }
  .bs-coda-lede { font-size: 15px; line-height: 1.65; margin-bottom: 24px; }

  .bs-lightbox { padding: 12px; }
  .bs-lb-figure { max-width: 100vw; max-height: 92vh; gap: 12px; }
  .bs-lb-figure img { max-height: 70vh; width: 100%; }
  .bs-lb-caption {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 9px;
    letter-spacing: 0.32em;
    padding: 0 12px;
  }
  .bs-lb-chapter {
    font-style: italic;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
  }
  .bs-lb-close { top: 14px; right: 14px; width: 44px; height: 44px; }
  .bs-lb-prev,
  .bs-lb-next {
    top: auto; bottom: 14px; transform: none;
    width: 52px; height: 52px;
    background: rgba(196, 167, 108, 0.18);
    border-color: rgba(196, 167, 108, 0.55);
    color: var(--bs-bronze);
  }
  .bs-lb-prev { left: 14px; }
  .bs-lb-next { right: 14px; }
}

@media (max-width: 480px) {
  .bs-hero { padding: 24px 14px 18px; }
  .bs-num { font-size: 18px; }
  .bs-lede { font-size: 14.5px; }
  .bs-body { padding: 20px 10px 48px; gap: 14px; }
  .bs-stream { gap: 48px; }
  .bs-ch-roman { font-size: 22px; }
  .bs-ch-title { font-size: clamp(15px, 5vw, 22px); }
  .bs-grid { gap: 6px; }
  .bs-tile { aspect-ratio: 4 / 5; }
  .bs-tile-cap { font-size: 11px; }
  .bs-coda { padding: 32px 14px 40px; }
  .bs-coda-title { font-size: clamp(18px, 7.5vw, 26px); }
  .bs-lb-figure img { max-height: 64vh; }
  .bs-lb-prev { left: 8px; }
  .bs-lb-next { right: 8px; }
}
