/* ==========================================================================
   MISHNA.CO — Heirloom Illustrated Shas Mishnayos
   Archival Sefer Palette & Editorial Typography
   ========================================================================== */

:root {
  --bg-cream: #FAF7F1;
  --bg-linen: #F3EDE0;
  --bg-paper: #FFFDF9;
  --navy: #1E3554;
  --navy-deep: #14253B;
  --navy-ink: #111E30;
  --gold: #C5A258;
  --gold-deep: #9E7C35;
  --gold-soft: #E5D4AA;
  --ink: #221F1B;
  --ink-muted: #575047;
  --border: #DDD4C3;
  --border-strong: #C9BDA6;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-editorial: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-hebrew: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-soft: 0 8px 28px rgba(30, 53, 84, 0.08);
  --shadow-book: 0 22px 54px rgba(20, 37, 59, 0.18), 0 4px 14px rgba(34, 31, 27, 0.08);
  --container-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-cream);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg-cream);
  overflow-x: hidden;
  border-top: 3px solid var(--gold);
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--bg-cream);
  padding: 10px 16px;
  z-index: 200;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 241, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  min-width: 0;
}

.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--navy);
  color: var(--bg-cream);
  border: 1.5px solid var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hebrew);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--navy);
  line-height: 1;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--gold);
  opacity: 0.85;
}

.brand-hebrew {
  font-family: var(--font-hebrew);
  font-size: 22px;
  font-weight: 500;
  color: var(--gold-deep);
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-nav a:hover {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
}

.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg-paper);
  padding: 12px 24px 16px;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  border-bottom: 1px solid var(--bg-linen);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* ---------- Shared Typography & Buttons ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.eyebrow span[lang="he"] {
  font-family: var(--font-hebrew);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.eyebrow--light {
  color: var(--gold-soft);
}

.eyebrow-dot {
  opacity: 0.65;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-navy {
  background: var(--navy);
  color: var(--bg-cream);
}

.badge-gold {
  background: rgba(197, 162, 88, 0.18);
  color: #6E5218;
  border: 1px solid rgba(197, 162, 88, 0.45);
}

.badge-soft {
  background: var(--bg-linen);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1.5px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.14s ease;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 9px 14px;
  font-size: 13px;
}

.btn-primary {
  background: var(--navy);
  color: var(--bg-cream);
  border-color: var(--navy);
}

.btn-primary:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

.btn-secondary {
  background: var(--bg-paper);
  color: var(--navy);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--navy);
  background: var(--bg-linen);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--navy);
  background: var(--bg-linen);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-ink);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: #D4B269;
  border-color: #D4B269;
}

.text-action {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  border-bottom: 1.5px solid var(--gold);
}

.text-action:hover {
  color: var(--gold-deep);
}

/* ---------- Hero ---------- */
.hero {
  padding: 42px 0 64px;
  background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy {
  max-width: 740px;
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.4vw, 66px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-deep);
}

.hero-subtitle {
  margin: 0 auto 26px;
  max-width: 650px;
  font-family: var(--font-editorial);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 34px;
}

.hero-showcase {
  width: 100%;
  max-width: 960px;
  margin: 0;
}

.spread-frame-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--bg-linen);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-book);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.spread-frame-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 28px 64px rgba(20, 37, 59, 0.22), 0 6px 18px rgba(34, 31, 27, 0.1);
}

.spread-frame-inner {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(197, 162, 88, 0.35);
  background: #FFF;
}

.spread-frame-inner img {
  width: 100%;
  height: auto;
  aspect-ratio: 2200 / 1444;
  object-fit: cover;
}

.spread-spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 36px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(20, 37, 59, 0) 0%, rgba(20, 37, 59, 0.12) 48%, rgba(20, 37, 59, 0.16) 50%, rgba(20, 37, 59, 0.11) 52%, rgba(20, 37, 59, 0) 100%);
  pointer-events: none;
}

.spread-hover-pill {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(30, 53, 84, 0.92);
  color: var(--bg-cream);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(197, 162, 88, 0.65);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.hero-showcase-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 18px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 14px;
  color: var(--ink-muted);
}

.caption-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.caption-meta strong {
  color: var(--navy);
  font-weight: 600;
}

/* ---------- Section Headers ---------- */
.library-section,
.format-section,
.vision-section {
  padding: 72px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-header--centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 40px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy);
}

.section-intro {
  margin: 0;
  max-width: 520px;
  font-family: var(--font-editorial);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.section-header--centered .section-intro {
  max-width: 640px;
  margin-top: 10px;
}

/* ---------- Filter Tabs ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.filter-tab:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.filter-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--bg-cream);
}

.tab-count {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(30, 53, 84, 0.09);
  color: var(--navy);
  font-weight: 600;
}

.filter-tab.is-active .tab-count {
  background: rgba(197, 162, 88, 0.25);
  color: var(--gold-soft);
}

/* ---------- Chapter Groups & Cards ---------- */
.chapter-group {
  margin-bottom: 52px;
}

.chapter-group:last-child {
  margin-bottom: 0;
}

.chapter-group[hidden] {
  display: none;
}

.chapter-heading-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.chapter-heading-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
}

.chapter-heading-bar h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
}

.chapter-hebrew {
  font-family: var(--font-hebrew);
  font-size: 20px;
  color: var(--gold-deep);
}

.spread-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.folio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.mishnah-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mishnah-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(30, 53, 84, 0.12);
}

.card-thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  background: var(--bg-linen);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.card-thumb-btn--spread {
  padding: 14px;
}

.card-thumb-btn--spread img {
  width: 100%;
  aspect-ratio: 800 / 518;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(20, 37, 59, 0.14);
}

.card-thumb-btn--folio {
  padding: 14px 18px;
}

.card-thumb-btn--folio img {
  width: 100%;
  aspect-ratio: 800 / 1035;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 6px 16px rgba(20, 37, 59, 0.12);
  background: #FFF;
}

.thumb-overlay-chip {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(30, 53, 84, 0.9);
  color: var(--bg-cream);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(197, 162, 88, 0.55);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
}

.mishnah-card--spread .card-body {
  padding: 22px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.card-hebrew {
  margin: 0 0 6px;
  font-family: var(--font-hebrew);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  text-align: right;
}

.mishnah-card--spread .card-hebrew {
  font-size: 25px;
}

.card-title {
  margin: 0 0 8px;
  font-family: var(--font-editorial);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.mishnah-card--spread .card-title {
  font-size: 21px;
}

.card-desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.card-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions .btn {
  flex: 1 1 auto;
}

/* ---------- Format Section ---------- */
.format-section {
  background: var(--bg-linen);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.format-book-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.format-page-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.format-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.format-page-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
}

.format-thumb-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--bg-linen);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.format-thumb-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.format-thumb-btn img {
  width: 100%;
  max-height: 410px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(20, 37, 59, 0.14);
}

.format-points {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.format-points li::marker {
  color: var(--gold-deep);
}

.format-spine-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.spine-rule {
  width: 1px;
  flex: 1;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}

.spine-medallion {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  border: 1.5px solid var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hebrew);
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Kollel Study Packet ---------- */
.kollel-section {
  padding: 64px 0 12px;
}

.kollel-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  gap: 32px;
  align-items: center;
  padding: 38px 42px;
  background: var(--navy);
  color: var(--bg-cream);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gold);
  box-shadow: var(--shadow-book);
}

.kollel-panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.12;
  color: var(--bg-cream);
}

.kollel-desc {
  margin: 0 0 22px;
  font-family: var(--font-editorial);
  font-size: 17px;
  line-height: 1.6;
  color: #E3DBCC;
}

.kollel-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(197, 162, 88, 0.35);
}

.kollel-meta dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 2px;
}

.kollel-meta dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--bg-cream);
}

.kollel-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.kollel-cta .btn {
  width: 100%;
  padding: 15px 22px;
  font-size: 15px;
}

.kollel-note {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: #CFC7B8;
}

/* ---------- Vision / Roadmap ---------- */
.roadmap-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.roadmap-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.roadmap-step {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.roadmap-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
}

.roadmap-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 48px;
  background: var(--bg-linen);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-tagline {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 16px;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy);
}

.footer-links a:hover {
  color: var(--gold-deep);
}

.footer-copy {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ---------- Full-Screen Interactive Sefer Reader Modal ---------- */
.reader-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: #101C2D;
  color: var(--bg-cream);
}

.reader-modal[hidden] {
  display: none;
}

.reader-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 20px;
  background: var(--navy-ink);
  border-bottom: 1px solid rgba(197, 162, 88, 0.35);
}

.reader-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reader-titles {
  min-width: 0;
}

.reader-title-en {
  margin: 0;
  font-family: var(--font-editorial);
  font-size: 17px;
  font-weight: 600;
  color: var(--bg-cream);
  line-height: 1.2;
}

.reader-title-he {
  margin: 2px 0 0;
  font-family: var(--font-hebrew);
  font-size: 16px;
  color: var(--gold-soft);
  line-height: 1.2;
  text-align: left;
}

.reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(197, 162, 88, 0.35);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.segmented-control[hidden] {
  display: none;
}

.seg-btn {
  padding: 6px 11px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #DDD5C7;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.seg-btn:hover {
  color: #FFF;
}

.seg-btn.is-active {
  background: var(--gold);
  color: var(--navy-ink);
}

.reader-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--bg-cream);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reader-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--gold);
}

.reader-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.reader-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.reader-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.reader-canvas img {
  max-height: calc(100vh - 196px);
  max-width: min(1240px, calc(100vw - 48px));
  width: auto;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(197, 162, 88, 0.35);
  background: #FFFDF9;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.reader-stage.zoom-150 .reader-canvas img {
  max-height: none;
  max-width: none;
  width: 150%;
  min-width: 1120px;
  cursor: zoom-out;
}

.reader-stage.zoom-200 .reader-canvas img {
  max-height: none;
  max-width: none;
  width: 200%;
  min-width: 1500px;
  cursor: zoom-out;
}

.reader-bottombar {
  padding: 12px 20px 14px;
  background: var(--navy-ink);
  border-top: 1px solid rgba(197, 162, 88, 0.35);
}

.reader-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1160px;
  margin: 0 auto;
}

.reader-step-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(197, 162, 88, 0.45);
  background: rgba(255, 255, 255, 0.07);
  color: var(--bg-cream);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.reader-step-btn:hover:not(:disabled) {
  background: rgba(197, 162, 88, 0.22);
  border-color: var(--gold);
}

.reader-step-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.reader-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 4px;
  scrollbar-width: thin;
}

.reader-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #E3DBCC;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.reader-pill:hover {
  border-color: var(--gold);
  color: #FFF;
}

.reader-pill.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-ink);
  font-weight: 600;
}

.reader-caption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: #BEB5A4;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1040px) {
  .folio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kollel-panel {
    grid-template-columns: 1fr;
    padding: 30px 28px;
  }
}

@media (max-width: 820px) {
  .spread-grid {
    grid-template-columns: 1fr;
  }
  .format-book-grid {
    grid-template-columns: 1fr;
  }
  .format-spine-divider {
    flex-direction: row;
    padding: 4px 0;
  }
  .spine-rule {
    height: 1px;
    width: auto;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-showcase-caption {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  .site-nav {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .brand-wordmark {
    font-size: 18px;
    letter-spacing: 0.1em;
  }
  .brand-hebrew {
    font-size: 19px;
  }
  .hero {
    padding: 28px 0 44px;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1 1 100%;
  }
  .spread-frame-btn {
    padding: 8px;
  }
  .spread-hover-pill {
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }
  .library-section,
  .format-section,
  .vision-section {
    padding: 48px 0;
  }
  .folio-grid,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }
  .kollel-panel {
    padding: 24px 20px;
  }
  .reader-topbar {
    padding: 10px 12px;
    gap: 8px;
  }
  .reader-controls {
    width: 100%;
    justify-content: space-between;
  }
  .reader-pdf-link {
    flex: 1 1 auto;
  }
  .reader-stage {
    padding: 10px;
  }
  .reader-canvas img {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 250px);
  }
  .reader-bottombar {
    padding: 10px 12px 12px;
  }
  .reader-step-btn {
    padding: 7px 10px;
    font-size: 12px;
  }
  .reader-caption {
    display: none;
  }
}

/* Reader Topbar High-Contrast Badge */
.reader-topbar .badge-gold {
  background: rgba(197, 162, 88, 0.22);
  color: #F4E3B6;
  border-color: rgba(197, 162, 88, 0.7);
}

/* Mobile Reader Topbar Tight Alignment */
@media (max-width: 640px) {
  .reader-topbar {
    position: relative;
    padding-right: 52px;
  }
  .reader-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
  }
  .reader-title-en {
    font-size: 15px;
  }
  .reader-controls {
    gap: 6px;
    margin-right: -40px;
  }
  .seg-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .reader-pdf-link {
    padding: 6px 10px;
    font-size: 12px;
  }
}
