/* ==========================================================================
   Israel 2026 Interactive Journey & Teaching Notes Stylesheet
   ========================================================================== */

:root {
  --primary: #c97a3e;        /* Judean sandstone / terracotta */
  --primary-dark: #a35d29;
  --primary-light: #fef5ed;
  --accent: #2563eb;         /* Mediterranean blue */
  --accent-light: #eff6ff;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 50vw;
}

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

body:not(.curator-body) {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

/* ==========================================================================
   Layout: Split Screen
   ========================================================================== */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar (Left) */
.story-sidebar {
  width: var(--sidebar-width, 540px);
  min-width: 380px;
  max-width: calc(100vw - 320px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  border-right: 1px solid var(--border);
  z-index: 10;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.story-header {
  padding: 24px 28px 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Header Top Row & Width Presets */
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.panel-width-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.width-preset-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.width-preset-btn:hover {
  color: var(--text-main);
}

.width-preset-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Draggable Sidebar Resizer Handle */
.sidebar-resizer {
  width: 8px;
  height: 100vh;
  background: #e2e8f0;
  cursor: col-resize;
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s;
  flex-shrink: 0;
}

.sidebar-resizer:hover,
.sidebar-resizer.is-resizing {
  background: var(--primary);
}

.resizer-handle {
  width: 4px;
  height: 36px;
  background: #94a3b8;
  border-radius: 999px;
  transition: background 0.15s;
}

.sidebar-resizer:hover .resizer-handle,
.sidebar-resizer.is-resizing .resizer-handle {
  background: #ffffff;
}

.header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.header-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

/* Day Filter Pills */
.day-filters-container {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -8px;
  padding: 4px 8px;
}
.day-filters-container::-webkit-scrollbar {
  display: none;
}

.day-filters {
  display: flex;
  gap: 6px;
  width: max-content;
}

.filter-btn {
  background: var(--bg-main);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.filter-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}

/* Scrollable Chapter Feed */
.chapters-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  scroll-behavior: smooth;
}

.chapters-container::-webkit-scrollbar {
  width: 6px;
}
.chapters-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Chapter Card */
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}

.chapter-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.chapter-card.active-chapter {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.day-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
}

.date-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stop-number {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.scripture-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.card-summary {
  font-size: 0.94rem;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 16px;
}

/* Photo Gallery Grid */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.photo-thumb-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
}

.photo-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-thumb-wrapper:hover img {
  transform: scale(1.06);
}

.photo-time-badge {
  display: none !important;
}

.photo-source-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(37, 99, 235, 0.85);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  backdrop-filter: blur(2px);
}

/* More Photos Overlay on 6th photo */
.photo-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  backdrop-filter: blur(3px);
  transition: background 0.2s;
  cursor: pointer;
  text-align: center;
  padding: 4px;
}

.photo-more-overlay:hover {
  background: rgba(15, 23, 42, 0.88);
}

.photo-more-count {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f59e0b;
  line-height: 1.1;
}

/* Curator Link in Header (Restricted to Localhost / Local Network) */
.curator-link-btn {
  display: none !important;
  align-items: center;
  gap: 5px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.is-local-env .curator-link-btn {
  display: inline-flex !important;
}

.curator-link-btn:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

/* Gallery Action Row */
.gallery-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.btn-view-location-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-view-location-gallery:hover {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

.btn-curate-link {
  display: none !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.is-local-env .btn-curate-link {
  display: inline-flex !important;
}

.btn-curate-link:hover {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}

.no-photos-msg {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ==========================================================================
   Teaching Notes Accordion
   ========================================================================== */

.notes-accordion {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: 16px;
}

.notes-toggle-btn {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notes-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--primary);
}

.notes-toggle-btn .icon {
  font-size: 0.8rem;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.notes-accordion.open .notes-toggle-btn {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.notes-accordion.open .notes-toggle-btn .icon {
  transform: rotate(180deg);
  color: #1e40af;
}

.notes-content {
  display: none;
  margin-top: 14px;
  padding: 20px 22px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.6;
}

.notes-accordion.open .notes-content {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Editorial Study Guide & Scripture Reader Cards
   ========================================================================== */

.study-guide-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.study-section-block {
  padding-bottom: 16px;
  border-bottom: 1px dashed #e2e8f0;
}

.study-section-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.study-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.study-section-header .section-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.study-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.study-paragraph {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.65;
  margin: 6px 0;
}

/* Bullet list without empty dashes or clutter */
.study-bullet-list {
  list-style: none;
  padding-left: 2px;
  margin: 6px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.study-bullet-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.55;
}

.study-bullet-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  top: -1px;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.study-bullet-list li strong {
  color: #0f172a;
  font-weight: 700;
}

/* Indented Sub-bullet List for valleys, lists, and theological points */
.study-sub-bullet-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.study-sub-bullet-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
}

.study-sub-bullet-list li::before {
  content: "—";
  position: absolute;
  left: 2px;
  top: 0px;
  color: #6366f1;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.study-sub-bullet-list li em {
  color: #0f172a;
  font-weight: 700;
  font-style: normal;
}

/* Numbered Group Block for 10 Commandments and Bedouin Pillars */
.numbered-group-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1; /* Royal Indigo */
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.numbered-group-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.numbered-group-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1rem;
  color: #4f46e5;
  background: #eef2ff;
  padding: 1px 7px;
  border-radius: 4px;
}

.numbered-group-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.numbered-group-intro {
  font-size: 0.88rem;
  color: #64748b;
  margin: 4px 0 8px 0;
  line-height: 1.5;
}

/* Requirements Card (Nazarite Vow, etc.) */
.requirements-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-left: 4px solid #f59e0b; /* Amber */
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.08);
}

.requirements-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #b45309;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.requirements-numbered-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.requirements-numbered-list li {
  font-size: 0.89rem;
  color: #334155;
  line-height: 1.55;
}

.requirements-numbered-list li strong {
  color: #0f172a;
}

/* Historical Timeline (Intertestamental 400-Year Timeline) */
.historical-timeline {
  position: relative;
  padding: 16px 0;
  margin: 18px 0;
}

.timeline-spine {
  position: absolute;
  left: 120px;
  top: 14px;
  bottom: 24px;
  width: 3px;
  background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 50%, #f59e0b 100%);
  border-radius: 999px;
  z-index: 1;
}

.timeline-event {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  width: 100%;
}

.timeline-event:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  flex-shrink: 0;
  width: 110px;
  text-align: right;
  padding-right: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: #4338ca;
  line-height: 1.4;
  padding-top: 12px;
  white-space: nowrap;
}

.timeline-node {
  position: absolute;
  left: 115px;
  top: 14px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  z-index: 2;
}

.timeline-content {
  flex: 1;
  margin-left: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.timeline-content:hover {
  border-color: #cbd5e1;
  border-left-color: #4f46e5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.timeline-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.timeline-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

/* Live Teaching Dialogue Card */
.live-teaching-dialogue-card {
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  border-left: 4px solid #c026d3;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}

.live-dialogue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.live-dialogue-badge {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #a21caf;
  letter-spacing: 0.05em;
}

.participant-badge {
  font-size: 0.74rem;
  font-weight: 700;
  background: #fae8ff;
  color: #86198f;
  padding: 1px 7px;
  border-radius: 4px;
}

.live-dialogue-body {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.94rem;
  line-height: 1.6;
  color: #4a044e;
}

/* Scripture Reader Cards — Distinguished, illuminated presentation */
.scripture-reader-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-left: 5px solid #2563eb; /* Mediterranean Royal Blue */
  border-radius: 10px;
  padding: 16px 18px;
  margin: 14px 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.reader-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.reader-scripture-pill {
  background: #1e3a8a !important;
}

.reader-icon {
  font-size: 0.85rem;
}

.reader-name {
  font-weight: 700;
}

.scripture-citation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 6px;
}

.scripture-citation .book-icon {
  font-size: 0.85rem;
}

.scripture-quote-body {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #0f172a;
}

.quote-mark {
  color: #93c5fd;
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1;
}

/* Discussion Question Callout */
.discussion-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-left: 4px solid #9333ea;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(147, 51, 234, 0.05);
}

.disc-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #9333ea;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.disc-text {
  font-weight: 600;
  font-size: 0.92rem;
  color: #581c87;
  line-height: 1.5;
}

/* Inline Scripture Quote Box */
.inline-scripture-quote {
  display: block;
  background: #fffdfa;
  border: 1px solid #fed7aa;
  border-left: 3.5px solid #ea580c;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  margin-bottom: 6px;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.05);
}

.inline-cite-badge {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c2410c;
  background: #ffedd5;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  margin-bottom: 3px;
}

.inline-quote-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #1e293b;
  display: inline;
}

/* Teaching Illustration Card (Live Demonstrations) */
.teaching-illustration-card {
  background: #faf5ff;
  border: 1px solid #f3e8ff;
  border-left: 4px solid #a855f7;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  box-shadow: 0 1px 3px rgba(168, 85, 247, 0.06);
}

.illus-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9333ea;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.illus-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.96rem;
  color: #581c87;
  line-height: 1.6;
  margin: 0;
}

/* Study Subtopic Title */
.study-subtopic-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  margin: 14px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Archaeological Context */
.archaeology-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}

.arch-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #b45309;
  margin-bottom: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.archaeology-box p {
  color: #78350f;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.story-footer {
  padding: 16px 28px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Map Section (Right)
   ========================================================================== */

.map-section {
  flex: 1;
  position: relative;
  height: 100vh;
}

.map-view {
  width: 100%;
  height: 100%;
  background: #e5e7eb;
}

/* Custom Marker Pin Styles */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid var(--primary);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-pin.active {
  background: var(--primary);
  color: #ffffff;
  border-color: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 6px 16px rgba(201, 122, 62, 0.5);
  z-index: 1000 !important;
}

/* Floating Map Controls */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-ctrl-btn {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.map-ctrl-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.map-ctrl-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* ==========================================================================
   Route Waypoint Map Pins & Popups
   ========================================================================== */

.route-pin-wrapper {
  background: none;
  border: none;
}

.route-pin {
  width: 22px;
  height: 22px;
  background: #f59e0b; /* Amber */
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s;
}

.route-pin:hover {
  transform: scale(1.35);
  background: #d97706;
}

.route-pin svg {
  width: 11px;
  height: 11px;
  fill: #ffffff;
}

/* Route Popup */
.route-popup-card {
  font-family: 'Plus Jakarta Sans', sans-serif;
  max-width: 240px;
}

.route-popup-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
}

.route-popup-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 2px;
}

.route-popup-meta {
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   Photo Lightbox Modal
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 10;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding: 0 4px;
}

.lightbox-site-badge {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.lightbox-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  padding: 0;
}

.lightbox-action-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.lightbox-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: transform 0.15s;
}

.lightbox-close:hover {
  transform: scale(1.15);
}

.lightbox-image-wrapper {
  position: relative;
  text-align: center;
  max-width: 85vw;
}

.lightbox-image-wrapper img {
  max-width: 85vw;
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.lightbox-caption {
  margin-top: 12px;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Edge-to-Edge Fullscreen Lightbox Mode */
.lightbox.is-fullscreen {
  background: #000000;
}

.lightbox.is-fullscreen .lightbox-overlay {
  background: #000000;
}

.lightbox.is-fullscreen .lightbox-content {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

.lightbox.is-fullscreen .lightbox-image-wrapper {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox.is-fullscreen .lightbox-image-wrapper img {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-out;
}

.lightbox.is-fullscreen .lightbox-top-bar {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  z-index: 40;
  pointer-events: none;
}

.lightbox.is-fullscreen .lightbox-site-badge {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: auto;
}

.lightbox.is-fullscreen .lightbox-top-actions {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox.is-fullscreen .lightbox-caption {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 20px;
  border-radius: 999px;
  max-width: 85vw;
  margin: 0;
  z-index: 40;
  pointer-events: auto;
  font-size: 0.88rem;
}

.lightbox.is-fullscreen .lightbox-nav {
  z-index: 40;
}

.lightbox.is-fullscreen .lightbox-nav.prev {
  left: 16px;
}

.lightbox.is-fullscreen .lightbox-nav.next {
  right: 16px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: -70px;
}

.lightbox-nav.next {
  right: -70px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Live Teaching Demonstration Card
   ========================================================================== */

.live-teaching-dialogue-card {
  margin: 16px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fffaf5 0%, #fff7ed 100%);
  border: 1.5px solid #fdba74;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.live-dialogue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.live-dialogue-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.participant-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ea580c;
  background: #ffedd5;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #fed7aa;
}

.live-dialogue-body {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
  font-style: italic;
}

.live-dialogue-text {
  margin: 0;
}

/* ==========================================================================
   Biblical Tribes Overlay Styling
   ========================================================================== */

.tribe-popup {
  padding: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.tribe-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.tribe-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.tribe-hebrew {
  font-size: 1.05rem;
  font-weight: 400;
  color: #64748b;
  margin-left: 6px;
}

.tribe-scripture {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d97706;
  margin-bottom: 8px;
}

.tribe-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 8px;
}

.tribe-sites {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

.tribe-tooltip {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Refined Biblical Tribal Territory Labels (Legible Atlas Cartography) */
.tribe-map-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: none !important;
  cursor: default !important;
}

.tribe-map-label::before,
.tribe-map-label::after {
  display: none !important; /* Hide Leaflet triangle arrow */
}

.tribe-label-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  user-select: none;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 5px;
  padding: 2px 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tribe-main-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #0f172a; /* Deep Slate - high legibility, crisp and distinct */
  line-height: 1.25;
}

.tribe-sub-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #334155;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Country Map Labels for Prominent Regional Borders */
.country-label-wrapper {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.country-map-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #1e293b;
  text-align: center;
  text-shadow: 
    0 0 3px #ffffff,
    0 0 6px #ffffff,
    0 0 10px rgba(255, 255, 255, 0.95),
    1px 1px 2px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  user-select: none;
}

/* Waypoint Hover Tooltip (Small view on hover, click opens full image) */
.waypoint-hover-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.waypoint-hover-tooltip::before,
.waypoint-hover-tooltip::after {
  display: none !important;
}

.waypoint-hover-card {
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 220px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.waypoint-hover-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.waypoint-hover-info {
  padding: 8px 10px 10px 10px;
}

.waypoint-hover-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.waypoint-hover-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 3px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.waypoint-hover-hint {
  font-size: 0.70rem;
  font-weight: 600;
  color: #2563eb;
  margin-top: 5px;
}

/* ==========================================================================
   Teacher Attribution & Devotional Styling
   ========================================================================== */

.header-teachers-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.header-teacher-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cbd5e1;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-teachers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px 0;
}

.card-teacher-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.card-teacher-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.card-teacher-chip .chip-icon {
  font-size: 0.78rem;
}

/* Compact Teacher Micro-Chip */
.teacher-compact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: default;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
}

.teacher-compact-chip .chip-name-full {
  display: none;
}

.teacher-compact-chip:hover .chip-name-short {
  display: none;
}

.teacher-compact-chip:hover .chip-name-full {
  display: inline;
}

.teacher-compact-chip.ralph-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.teacher-compact-chip.ralph-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.teacher-compact-chip.steve-chip {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

.teacher-compact-chip.steve-chip:hover {
  background: #fde68a;
  border-color: #f59e0b;
  color: #78350f;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.12);
}

.teacher-compact-chip.cotaught-chip {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.teacher-compact-chip.cotaught-chip:hover {
  background: #d1fae5;
  border-color: #34d399;
  color: #064e3b;
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.12);
}

/* Legacy attribution badges preserved as fallback */
.teacher-attribution-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.teacher-attribution-badge.ralph-badge {
  background: rgba(30, 64, 175, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

.teacher-attribution-badge.steve-badge {
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.3);
  color: #0f766e;
}

.teacher-attribution-badge.cotaught-badge {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #6d28d9;
}

/* Devotional Card Highlight */
.study-section-block.devotional-card {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.5) 0%, rgba(255, 237, 213, 0.35) 100%);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

/* Unified Single-Header Devotionals */
.study-section-header.devotional-unified-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.devotional-title-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.devotional-sun-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
}

.devotional-text-group {
  display: flex;
  flex-direction: column;
}

.devotional-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #b45309;
  text-transform: uppercase;
  line-height: 1.2;
}

.study-section-header.devotional-unified-header .study-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #78350f;
  margin-top: 1px;
}

/* ==========================================================================
   Responsive Breakpoints: Phone, iPad & Desktop
   ========================================================================== */

.mobile-nav {
  display: none;
}

/* iPad & Tablet Landscape / Portrait (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .story-sidebar {
    width: 44% !important;
    min-width: 380px;
    max-width: 460px;
  }

  .sidebar-resizer {
    display: block;
    width: 8px;
  }

  .map-section {
    display: block !important;
    position: relative !important;
    flex: 1;
    height: 100vh;
  }

  .mobile-nav {
    display: none !important;
  }

  .panel-width-controls {
    display: none; /* Hide custom width presets on iPad to avoid header crowding */
  }

  .map-ctrl-btn {
    min-height: 44px;
    padding: 9px 14px;
  }
}

/* Mobile Phones (< 768px: iPhone, Galaxy, Pixel) */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .story-sidebar {
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    height: 100vh;
    padding-bottom: 70px; /* Comfortable breathing space above compact navigation dock */
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-resizer {
    display: none;
  }

  .panel-width-controls {
    display: none;
  }

  .map-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 20;
  }

  .map-section.mobile-active {
    display: block;
  }

  /* Fixed Bottom Tab Dock (Ultra-compact, sleek, floating glass pill) */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 3px;
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.15);
    gap: 3px;
  }

  .mobile-nav-btn {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
  }

  .mobile-nav-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
  }

  .mobile-nav-btn:hover {
    color: #ffffff;
  }

  .mobile-nav-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
  }

  /* Map overlay controls on phone */
  .map-controls {
    top: 10px;
    right: 10px;
    gap: 5px;
    max-width: 90vw;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .map-ctrl-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
    min-height: 34px;
    border-radius: 6px;
  }

  /* Lightbox touch optimization */
  .lightbox-nav {
    width: 46px;
    height: 46px;
    font-size: 2.2rem;
  }

  .lightbox-nav.prev {
    left: 8px;
  }

  .lightbox-nav.next {
    right: 8px;
  }

  /* Mobile Story Header - Baseline Compact */
  .story-header {
    padding: 10px 12px 6px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .header-badge {
    font-size: 0.63rem;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    font-weight: 700;
  }

  .header-title {
    font-size: 1.25rem;
    line-height: 1.15;
    margin: 2px 0 3px 0;
    transition: all 0.25s ease;
  }

  .header-subtitle {
    font-size: 0.76rem;
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--text-muted);
    transition: all 0.2s ease;
  }

  .header-teachers-strip {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
  }

  .header-teacher-chip {
    font-size: 0.68rem;
    padding: 2px 7px;
  }

  .day-filters-container {
    padding: 2px 0;
    margin: 0 -4px;
  }

  .day-filters {
    gap: 5px;
  }

  .filter-btn {
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    min-height: 28px;
    border-radius: 999px;
  }

  /* Compact Mode on Scroll: Automatically collapses extra header details while keeping slim title and day filter tabs! */
  .story-header.is-compact {
    padding: 6px 12px 5px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }

  .story-header.is-compact .header-top-row,
  .story-header.is-compact .header-subtitle,
  .story-header.is-compact .header-teachers-strip {
    display: none !important;
  }

  .story-header.is-compact .header-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 3px 0;
    line-height: 1.1;
    font-family: inherit;
  }

  .story-header.is-compact .day-filters-container {
    padding: 1px 0;
  }

  .story-header.is-compact .filter-btn {
    padding: 3px 9px;
    font-size: 0.72rem;
    min-height: 26px;
  }

  .chapter-card {
    padding: 16px 14px;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .scripture-reader-card {
    padding: 14px 12px;
  }

  .scripture-citation {
    font-size: 0.88rem;
  }
}

/* ==========================================================================
   Tour Password Protection & Lock Screen Modal
   ========================================================================== */
.tour-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tour-auth-modal.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(217, 119, 6, 0.1);
  border-radius: 20px;
  padding: 40px 32px 32px;
  text-align: center;
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', sans-serif;
  animation: authCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-emblem {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(217, 119, 6, 0.4));
}

.auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.auth-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.auth-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #94a3b8;
  margin: 0 0 24px 0;
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.auth-input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: #d97706;
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.auth-input:disabled {
  opacity: 0.6;
  background: #1e293b;
  cursor: not-allowed;
}

.btn-toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-toggle-pw:hover {
  color: #f8fafc;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: #d97706;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  background: #475569;
  box-shadow: none;
}

.auth-error-msg {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
  animation: authShake 0.35s ease;
}

.auth-error-msg.rate-limited {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  color: #64748b;
}

