/* ============================================================================
   GEORGE SHOWLER FAMILY HISTORY — ARCHIVAL DESIGN SYSTEM
   Theme: Classical Museum Exhibition Gallery (Dark Slate & Antique Gold)
   Responsive Architecture: Mobile (<640px) | Tablet (640-1023px) | Desktop (>=1024px)
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Design Tokens & CSS Custom Properties
   ---------------------------------------------------------------------------- */
:root {
  /* Typography */
  --font-heading: 'Cinzel', serif;
  --font-narrative: Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

  /* Palette */
  --bg-canvas: #0c1017;
  --bg-card: #141a24;
  --border-card: rgba(200, 155, 60, 0.22);
  --border-card-hover: rgba(229, 184, 92, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Typography Colors */
  --text-gold: #e5b85c;        /* Primary Radiant Gold (Titles & Major Accents) */
  --text-gold-antique: #ddbe76;/* Secondary Warm Honey Gold (Subtitles, Chapter Labels, Event Numbers) */
  --text-body: #f2efe9;        /* Bright Warm Ivory (15.2:1 AAA contrast on cards) */
  --text-muted: #a3b3c9;       /* Archival Datelines & Locations (8.25:1 AAA contrast on cards) */

  /* Controls (Cool Silver / Slate) */
  --silver-bg: #1e2633;
  --silver-text: #e2e8f0;

  /* Contemporary Layer (Glacier Slate Blue / Digital Publication & Author) */
  --glacier-primary: #7dd3fc;
  --glacier-light: #bae6fd;
  --glacier-border: rgba(125, 211, 252, 0.28);
  --glacier-bg: rgba(14, 165, 233, 0.08);
  --glacier-bg-hover: rgba(125, 211, 252, 0.14);

  /* Dimensions & Shapes */
  --header-height: 68px;
  --drawer-width: min(440px, 92vw);
  --content-max-width: 860px;
  --touch-target-min: 44px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
}

/* ----------------------------------------------------------------------------
   2. Global Reset & Base
   ---------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
html,
.narrative-pane {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) #080c12;
}

html::-webkit-scrollbar,
.narrative-pane::-webkit-scrollbar {
  width: 7px;
}

html::-webkit-scrollbar-track,
.narrative-pane::-webkit-scrollbar-track {
  background: #080c12;
}

html::-webkit-scrollbar-thumb,
.narrative-pane::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover,
.narrative-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(226, 232, 240, 0.6);
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-body);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ----------------------------------------------------------------------------
   3. Sticky Global Header
   ---------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: rgba(12, 16, 23, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 10px 1.375rem;
  box-shadow:
    0 2px 0 0 #000000,
    0 6px 14px rgba(0, 0, 0, 0.85),
    0 10px 20px rgba(0, 0, 0, 0.65);
}

/* Shared Header Action Button Geometry */
.header-gold-btn,
.header-silver-btn {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 0.95rem;
  height: 42px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Left: Gold Header Action Button (Navigation) */
.header-gold-btn {
  background: rgba(229, 184, 92, 0.1);
  border: 1px solid var(--text-gold);
  color: var(--text-gold);
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
}

.header-gold-btn:hover,
.header-gold-btn[aria-expanded="true"] {
  background: var(--text-gold);
  color: #0c1017;
  border-color: #fce29f;
  box-shadow: 0 0 14px rgba(229, 184, 92, 0.38);
}

.header-gold-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  fill: currentColor;
}

.header-gold-btn .btn-text {
  line-height: 1;
  vertical-align: middle;
  padding-top: 2.5px; /* Top padding to balance Cinzel cap-height and center text vertically */
  box-sizing: border-box;
}

.header-silver-btn .btn-text {
  line-height: 1;
  vertical-align: middle;
  padding-top: 0.5px;
  box-sizing: border-box;
}

/* Tablet Baseline (640px - 1023px): Show short labels (EVENTS / BOOK) */
.header-gold-btn .btn-text-full,
.header-silver-btn .btn-text-full {
  display: none;
}

.header-gold-btn .btn-text-short,
.header-silver-btn .btn-text-short {
  display: inline-block;
}

/* Right: Glacier Header Action Button (Book / Publication) */
.header-silver-btn {
  background: var(--glacier-bg);
  border: 1px solid var(--glacier-border);
  color: var(--glacier-primary);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
}

.header-silver-btn:hover,
.header-silver-btn[aria-expanded="true"] {
  background: var(--glacier-primary);
  color: #0c1017;
  border-color: var(--glacier-light);
  box-shadow: 0 0 14px rgba(125, 211, 252, 0.35);
}

.header-silver-btn .book-icon {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  flex-shrink: 0;
}

.header-silver-btn .dropdown-chevron {
  width: 13.5px;
  height: 6.75px;
  display: block;
  fill: currentColor;
  flex-shrink: 0;
  margin-left: -1px;
  transform-origin: center;
  transition: transform 0.2s ease;
}

.header-silver-btn[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

/* Center: 2-line Publication Title & Subtitle */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-width: 0;
  overflow: visible;
  gap: 4px;
  padding: 0;
  margin: 0 auto;
}

.header-title-line {
  font-family: var(--font-heading);
  font-size: clamp(1.08rem, 2.2vw, 1.42rem);
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--text-gold);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.15;
  margin: 0;
  padding: 0;
}

.header-subtitle-line {
  font-family: var(--font-heading);
  font-size: clamp(0.86rem, 1.7vw, 1.08rem);
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--text-gold-antique); /* Warm Honey Antique Gold */
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.15;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------------------------
   4. Author & Download Dropdown Popover & Site Dimming
   ---------------------------------------------------------------------------- */
.dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dropdown-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

body.dropdown-active .site-header .header-left,
body.dropdown-active .site-header .header-center {
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.author-dropdown-wrapper {
  position: relative;
  z-index: 105;
}

.author-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 350px;
  background: #0d121a;
  border: 1px solid var(--glacier-border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(125, 211, 252, 0.08);
  z-index: 150;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-sans);
}

.author-dropdown-menu.open {
  display: flex;
}

.dropdown-menu-header {
  height: 54px;
  min-height: 54px;
  padding: 0 1.05rem;
  border-bottom: 1px solid var(--glacier-border);
  display: flex;
  align-items: center;
}

.dropdown-menu-title {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--glacier-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.dropdown-menu-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dropdown-menu-item {
  background: var(--bg-card);
  border: 1px solid var(--glacier-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  color: var(--silver-text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  text-align: left;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  transition: all 0.18s ease;
}

.dropdown-menu-item:hover {
  background: var(--glacier-bg-hover);
  border-color: var(--glacier-primary);
}

.dropdown-menu-item svg {
  width: 24px;
  height: 24px;
  fill: var(--glacier-primary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.dropdown-menu-item:hover svg {
  transform: scale(1.06);
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  gap: 3px;
}

.menu-item-primary {
  font-weight: 700;
  color: var(--glacier-primary);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: color 0.15s ease;
}

.dropdown-menu-item:hover .menu-item-primary {
  color: var(--glacier-light);
}

.menu-item-secondary {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------------------
   5. Main Layout Stage (Mobile & Tablet Baseline)
   ---------------------------------------------------------------------------- */
.main-stage {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 1.375rem;
  display: flex;
  flex-direction: column;
}

.narrative-pane {
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  width: 100%;
}

.inline-mobile-media {
  display: block;
  margin-top: 1.5rem;
}

.anchored-media-pane {
  display: none;
}

/* ----------------------------------------------------------------------------
   6. Shared Card Frame & Chapter Hero Card
   ---------------------------------------------------------------------------- */
.chapter-hero-card,
.event-card,
.next-chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.90rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease;
}

.chapter-hero-card:hover,
.event-card:hover,
.next-chapter-card:hover {
  border-color: var(--border-card-hover);
}

.chapter-hero-card {
  text-align: center;
}

/* Return to Previous Chapter Link (Frameless Above Top Card) */
.chapter-prev-return {
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.chapter-prev-link {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted); /* Subdued slate grey #a3b3c9 matching colophon footer */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.3;
  transition: color 0.18s ease;
}

.chapter-prev-link:hover {
  color: var(--silver-text);
}

.chapter-card-label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-gold-antique);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.chapter-card-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.04em;
  line-height: 1.25;
}

/* ----------------------------------------------------------------------------
   7. Event Dossier Card & Story Narrative
   ---------------------------------------------------------------------------- */
.event-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  scroll-margin-top: calc(var(--header-height) + 1.25rem);
}

.event-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0;
}

.event-card-title {
  font-family: var(--font-heading);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text-gold);
  line-height: 1.22;
  letter-spacing: 0.03em;
  margin: 0;
}

.event-meta-num {
  font-weight: 900;
  color: var(--text-gold);
  margin-right: 0.1rem;
}

.event-meta-bullet {
  color: var(--text-gold);
  opacity: 0.6;
  font-size: 1.15rem;
  margin: 0 0.2rem;
}

.event-title-text {
  color: var(--text-gold);
}

.event-card-dateline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.event-meta-date {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-body); /* Same colour as event description text, normal weight */
  opacity: 1;
  line-height: 1.25;
}

.event-card-location {
  font-family: var(--font-sans);
  font-size: 0.90rem;
  font-weight: 400;
  color: var(--text-body); /* Same colour as event description text, normal weight */
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  line-height: 1.25;
}

.pin-icon {
  width: 14.5px;
  height: 14.5px;
  fill: var(--text-body);
  flex-shrink: 0;
}

.event-narrative-body {
  font-family: var(--font-narrative);
  font-size: 1.09rem;
  line-height: 1.62;
  color: var(--text-body);
}

.event-narrative-body p {
  margin-bottom: 0.78rem;
}

.event-narrative-body p:last-child {
  margin-bottom: 0;
}

.narrative-list {
  margin: 1rem 0 1.25rem 1.25rem;
  list-style-type: square;
}

.narrative-list li {
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

/* Title Page Card (FRONT Chapter Hero Card) */
.title-page-card {
  text-align: center;
  padding: 1.65rem 1.90rem;
  gap: 1.65rem;
}

.title-page-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.title-page-heading-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem; /* Tightly groups TITLE-1 and TITLE-2 */
}

.title-card-overline {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-gold-antique);
  text-transform: uppercase;
  line-height: 1.2;
}

.title-card-main {
  font-family: var(--font-heading);
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-gold);
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
}

.title-card-subtitle {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-gold-antique);
  text-transform: uppercase;
  line-height: 1.25;
}

.title-card-byline {
  margin-top: 0;
  padding-top: 1.65rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.title-card-author {
  font-family: var(--font-narrative);
  font-size: 1.28rem;
  color: var(--text-body);
  line-height: 1.3;
}

.title-card-date {
  font-family: var(--font-narrative);
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Auxiliary Content Cards (Front Matter & End Matter Section Titles Centered) */
.aux-content-card .event-card-header,
.aux-content-card .event-card-title {
  text-align: center;
}

/* ----------------------------------------------------------------------------
   8. Archival Media Components (Shared Across Mobile, Tablet & Desktop)
   ---------------------------------------------------------------------------- */
.media-carousel-stage {
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* PC & Tablet Zoom Control & Instruction Toolbar (>= 640px) */
.media-zoom-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  padding: 0.15rem 0.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.media-zoom-toolbar.is-hidden-for-slide {
  visibility: hidden;
  pointer-events: none;
}

.zoom-instruction-group {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-muted); /* Tone 2 Cool Slate #a3b3c9 (8.19:1 AAA) */
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
}

.zoom-hint-icon {
  width: 17px;
  height: 17px;
  fill: var(--text-muted);
  flex-shrink: 0;
}

.zoom-controls-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.zoom-ctrl-btn {
  background: #1e293b;
  border: 1px solid rgba(163, 179, 201, 0.5);
  color: var(--silver-text); /* Tone 1 Bright Silver #e2e8f0 */
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 26px;
  height: 25px;
  padding: 0 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.zoom-ctrl-btn.zoom-in-btn,
.zoom-ctrl-btn.zoom-out-btn {
  font-size: 1.0rem;
  padding: 0;
}

.zoom-ctrl-btn:hover:not(:disabled) {
  background: var(--silver-text);
  color: #0c1017;
  border-color: #ffffff;
}

.zoom-ctrl-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.zoom-level-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 44px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 0.3rem;
  background: #1e293b;
  border: 1px solid rgba(163, 179, 201, 0.35);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.zoom-level-badge.is-zoomed {
  color: #ffffff;
  border-color: var(--silver-text);
}

.carousel-stage-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

/* Keep single-item viewport aligned with the same side margins on tablet & desktop while toolbar spans full frame */
@media (min-width: 640px) {
  .media-carousel-stage.single-item-stage:not(.static-cover-stage) .carousel-stage-frame {
    padding-left: calc(50px + 0.75rem);
    padding-right: calc(50px + 0.75rem);
  }
}

.carousel-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 280px;
  max-height: 500px;
  margin: 0;
  background: rgba(4, 7, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 10px;
  isolation: isolate;
}

.carousel-slide {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  display: flex;
}

.carousel-slide.image-slide,
.carousel-slide.static-image-slide {
  overflow: hidden;
}

.carousel-slide.image-slide {
  cursor: zoom-in;
}

.carousel-slide.static-image-slide {
  cursor: default;
}

.carousel-slide.image-slide img,
.carousel-slide.static-image-slide img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6));
  pointer-events: auto;
}

/* Transcription Paper (Archival Record View) */
.carousel-slide.transcription-slide {
  padding: 0.5rem;
}

.transcription-paper {
  background-color: #f6f1e5;
  color: #241e17;
  border: 1px solid #dfd5c4;
  border-radius: var(--radius-md);
  padding: 1.75rem 2.25rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  max-height: 480px;
  width: 100%;
  max-width: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #c4b397 transparent;
}

.transcription-paper::-webkit-scrollbar {
  width: 7px;
}

.transcription-paper::-webkit-scrollbar-track {
  background: transparent;
}

.transcription-paper::-webkit-scrollbar-thumb {
  background-color: #c4b397;
  border-radius: 4px;
}

.transcription-paper::-webkit-scrollbar-thumb:hover {
  background-color: #9c8462;
}

.transcription-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.transcription-badge {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #6b4c1b;
  text-transform: uppercase;
  line-height: 1.3;
}

.transcription-doc-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #4a3d30;
  text-align: right;
  line-height: 1.35;
  max-width: 60%;
  word-break: break-word;
}

.transcription-rule {
  height: 1px;
  background: #dfd5c4;
  margin: 0.85rem 0 1.25rem;
  width: 100%;
  flex-shrink: 0;
}

.transcription-body {
  font-family: var(--font-narrative);
  font-size: 1.18rem;
  line-height: 1.75;
  color: #1e1914;
  white-space: pre-wrap;
}

/* Dedicated Outer-Margin Archival Navigation Arrows (Larger & Brighter, never overlap document) */
.carousel-arrow-btn {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1e293b;
  border: 1.5px solid rgba(226, 232, 240, 0.75);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f8fafc;
  opacity: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  z-index: 20;
}

.carousel-arrow-btn:hover {
  background: var(--silver-text);
  border-color: #ffffff;
  color: #0c1017;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 12px rgba(226, 232, 240, 0.25);
}

.carousel-arrow-btn:active {
  transform: scale(0.95);
}

.carousel-arrow-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Media Caption Box (Crisp non-italic museum placard style in Tone 1 Bright Silver) */
.media-caption-box {
  padding: 0.35rem 0.75rem 0.1rem;
  font-family: var(--font-narrative);
  font-size: 0.87rem; /* Reduced 15% from 1.02rem */
  font-style: normal;
  letter-spacing: 0.015em;
  line-height: 1.4;
  color: var(--silver-text); /* Tone 1 Bright Silver #e2e8f0 (14.16:1 AAA contrast) */
  background: transparent;
  border: none;
  text-align: center;
}

/* Carousel Dots Bar */
.carousel-dots-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.2rem 1rem 0.25rem;
  background: transparent;
  border: none;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(163, 179, 201, 0.55);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot:hover {
  background: rgba(226, 232, 240, 0.6);
  border-color: rgba(226, 232, 240, 0.8);
  transform: scale(1.15);
}

.carousel-dot.active {
  background: var(--silver-text);
  border-color: var(--silver-text);
  box-shadow: none;
  transform: scale(1.2);
}

/* ----------------------------------------------------------------------------
   9. Next Chapter Navigation Card
   ---------------------------------------------------------------------------- */
.next-chapter-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.next-ch-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin: 0;
}

.next-chapter-action {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

.continue-story-btn {
  background: rgba(226, 232, 240, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.5);
  color: var(--silver-text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.continue-story-btn:hover {
  background: var(--silver-text);
  color: #0c1017;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(226, 232, 240, 0.35);
}

/* Frameless 3-Line Colophon Footer at Bottom of Event Frame */
.narrative-colophon-footer {
  font-family: var(--font-sans);
  font-size: 0.72rem; /* Reduced 15% from 0.84rem */
  color: var(--text-muted); /* Darker two-tone grey #a3b3c9 */
  text-align: center;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  line-height: 1.35;
}

.colophon-email {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.colophon-email:hover {
  color: var(--silver-text);
  text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   10. Slideout TOC Drawer (Events Navigation)
   ---------------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.slideout-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-width);
  background: #0d121a;
  border-right: 1px solid var(--border-card);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.slideout-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  height: 54px;
  min-height: 54px;
  padding: 0 0.85rem 0 1.05rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-header .icon-btn {
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.17rem; /* Increased 15% from 1.02rem for clear TOC header hierarchy */
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.08em;
  line-height: 1;
  padding-top: 2px;
}

/* Drawer Body with Dedicated Gold Scrollbar */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(229, 184, 92, 0.45) #080c12;
}

.drawer-body::-webkit-scrollbar {
  width: 7px;
}

.drawer-body::-webkit-scrollbar-track {
  background: #080c12;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(229, 184, 92, 0.4);
  border-radius: 4px;
}

.drawer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(229, 184, 92, 0.75);
}

.toc-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toc-chapter-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.toc-chapter-item:hover,
.toc-chapter-item.expanded {
  border-color: var(--border-card-hover);
}

.toc-chapter-header {
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toc-chapter-header:hover {
  background: rgba(229, 184, 92, 0.08); /* Muted gold background */
}

.toc-chapter-header.active {
  background: rgba(229, 184, 92, 0.12);
  border-left: 3px solid var(--text-gold);
}

.toc-chapter-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc-ch-num {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--text-gold-antique);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.toc-ch-title {
  font-family: var(--font-heading);
  font-size: 1.00rem;
  font-weight: 700;
  color: var(--text-gold); /* Radiant Gold for ALL chapters */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.toc-chevron {
  width: 20px;
  height: 20px;
  fill: var(--text-gold-antique);
  opacity: 0.85;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.toc-chapter-header.active .toc-chevron {
  opacity: 1;
  fill: var(--text-gold);
}

.toc-chapter-item.expanded .toc-chevron {
  transform: rotate(180deg);
}

.toc-events-list {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem;
  border-top: 1px solid var(--border-card);
  background: #090d14;
}

.toc-chapter-item.expanded .toc-events-list {
  display: flex;
}

.toc-event-link {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.toc-event-link:hover {
  background: rgba(226, 232, 240, 0.08);
  border-color: rgba(226, 232, 240, 0.32);
}

.toc-event-title-line {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f1f5f9; /* Bright Alabaster Grey (Tone 1 of two-tone grey) */
  line-height: 1.3;
  transition: color 0.15s ease;
}

.toc-event-link:hover .toc-event-title-line {
  color: #ffffff;
}

.toc-event-num {
  font-weight: 700;
  margin-right: 0.15rem;
}

.toc-event-bullet {
  opacity: 0.65;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.toc-event-title {
  text-transform: none;
}

.toc-event-date {
  font-family: var(--font-sans);
  font-size: 0.80rem;
  color: var(--text-muted); /* Cool Slate Grey #a3b3c9 (Tone 2 of two-tone grey) */
  line-height: 1.25;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--silver-text);
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.5rem;
}

.icon-btn:hover {
  background: var(--silver-bg);
  color: #ffffff;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ----------------------------------------------------------------------------
   12. Responsive Breakpoint: Mobile (< 640px)
   ---------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .site-header {
    padding: 0.5rem 0.65rem;
    min-height: 62px;
  }

  /* Compact Icon-Only Buttons on Phone (Saves ~90px of space) */
  .header-gold-btn,
  .header-silver-btn {
    height: 38px;
    min-height: 38px;
    min-width: 38px;
    padding: 0 0.55rem;
    gap: 0.25rem;
    justify-content: center;
  }

  .header-gold-btn .btn-text,
  .header-silver-btn .btn-text {
    display: none;
  }

  .header-gold-btn svg,
  .header-silver-btn .book-icon {
    width: 15px;
    height: 15px;
  }

  .header-silver-btn .dropdown-chevron {
    width: 10px;
    height: 5px;
    margin-left: 0;
  }

  .header-center {
    max-width: calc(100% - 84px);
    overflow: visible;
    gap: 3.5px;
    padding: 0;
  }

  .header-title-line {
    font-size: clamp(0.88rem, 4.2vw, 1.05rem);
    letter-spacing: 0.07em;
  }

  .header-subtitle-line {
    font-size: clamp(0.74rem, 3.4vw, 0.86rem);
    letter-spacing: 0.06em;
    margin-top: 0;
  }

  .main-stage {
    padding: 1rem;
    gap: 1rem;
  }

  .narrative-pane {
    gap: 1rem;
  }

  .event-card,
  .chapter-hero-card,
  .title-page-card,
  .next-chapter-card {
    padding: 1.32rem;
  }

  .chapter-card-title {
    font-size: 1.45rem;
  }

  .event-card-title {
    font-size: 1.32rem;
  }

  .event-narrative-body {
    font-size: 1.12rem; /* Reduced 15% from 1.32rem */
    line-height: 1.62;
  }

  /* Hide PC/Tablet Zoom Toolbar on Smartphone (< 640px) */
  .media-zoom-toolbar {
    display: none !important;
  }

  /* Standardized Event Card Viewport on Phone with Outer Arrow Margins */
  .inline-mobile-media .carousel-stage-frame {
    gap: 0.45rem;
  }

  .inline-mobile-media .carousel-viewport {
    height: 290px;
    min-height: 290px;
    max-height: 290px;
    padding: 6px;
  }

  .carousel-arrow-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-arrow-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* ----------------------------------------------------------------------------
   13. Responsive Breakpoint: Mobile & Tablet Small Screens (< 1024px)
   ---------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  /* Standardized Inline Event Card Viewport (Never jumps, full-height portrait / full-width landscape) */
  .inline-mobile-media {
    margin-top: 1.25rem;
    width: 100%;
  }

  .inline-mobile-media .carousel-stage-frame {
    width: 100%;
  }

  .inline-mobile-media .carousel-viewport {
    width: 100%;
    height: 330px;
    min-height: 330px;
    max-height: 330px;
    padding: 8px;
    border-radius: 10px;
  }

  /* Ensure only the single active slide displays at a time */
  .inline-mobile-media .carousel-slide {
    display: none !important;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  .inline-mobile-media .carousel-slide.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .inline-mobile-media .carousel-slide.image-slide img,
  .inline-mobile-media .carousel-slide.static-image-slide img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
  }

  .inline-mobile-media .carousel-slide.transcription-slide .transcription-paper {
    height: 100%;
    max-height: 100%;
    width: 100%;
  }
}

/* ----------------------------------------------------------------------------
   13. Responsive Breakpoint: Desktop & Landscape Split View (>= 1024px)
   ---------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  html, body {
    height: 100vh;
    overflow: hidden;
  }

  .site-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .header-left {
    justify-self: start;
  }

  .header-center {
    justify-self: center;
    gap: 4px;
    padding-top: 1px;
  }

  .header-right {
    justify-self: end;
  }

  /* Desktop (>= 1024px): Show full labels (LIST OF EVENTS / DOWNLOAD THE BOOK) */
  .header-gold-btn .btn-text-full,
  .header-silver-btn .btn-text-full {
    display: inline-block;
  }

  .header-gold-btn .btn-text-short,
  .header-silver-btn .btn-text-short {
    display: none;
  }

  /* Fluid Header Scaling on Large Displays (+10% in PC mode) */
  .header-title-line {
    font-size: clamp(1.41rem, 1.49vw, 1.60rem);
    letter-spacing: 0.11em;
    line-height: 1.15;
  }

  .header-subtitle-line {
    font-size: clamp(1.08rem, 1.12vw, 1.21rem);
    letter-spacing: 0.09em;
    line-height: 1.15;
  }

  /* 45 / 55 Split Viewport */
  .main-stage {
    display: grid;
    grid-template-columns: 45% 55%;
    height: calc(100vh - var(--header-height));
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    gap: 0;
  }

  /* Left Narrative Column with dedicated archival scrollbar (Cool Slate / Grey) */
  .narrative-pane {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 1.375rem;
    gap: 1.375rem;
    background: var(--bg-canvas);
  }

  /* Hide inline media inside cards on large screen because it's anchored on the right */
  .inline-mobile-media {
    display: none !important;
  }

  /* Right Column: Anchored Media Stage (Museum Mat-Board Framing & Balanced Vertical Centering) */
  .anchored-media-pane {
    display: flex !important;
    position: relative;
    height: 100%;
    width: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-card);
    overflow: hidden;
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .anchored-event-media {
    position: absolute;
    top: 1.35rem;
    bottom: 0.65rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .anchored-event-media.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 5;
  }

  .anchored-event-media .media-carousel-stage {
    height: 100%;
    max-height: 100%;
    align-items: center;
    justify-content: center;
  }

  .anchored-event-media .carousel-stage-frame {
    flex: 1;
    min-height: 0;
  }

  .anchored-event-media .carousel-viewport {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .anchored-event-media .carousel-slide.image-slide img,
  .anchored-event-media .carousel-slide.static-image-slide img {
    width: auto;
    height: auto;
  }

  .anchored-event-media .carousel-slide.transcription-slide .transcription-paper {
    max-height: 100%;
    max-width: 860px;
  }

  .anchored-event-media .media-caption-box {
    padding: 0.25rem 0.5rem 0.05rem;
    line-height: 1.35;
  }

  .anchored-event-media .carousel-dots-bar {
    padding: 0.1rem 0.5rem 0.15rem;
  }

  /* Anchored Placeholder Box for Text-only events */
  .anchored-placeholder-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 460px;
    margin: auto;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
  }

  .placeholder-icon svg {
    width: 48px;
    height: 48px;
    fill: var(--text-gold);
    opacity: 0.85;
  }

  .placeholder-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: 0.05em;
    line-height: 1.35;
  }

  .placeholder-date {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-gold);
    letter-spacing: 0.12em;
  }

  .placeholder-note {
    font-family: var(--font-narrative);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    width: 100%;
  }
}
