/* ═══════════════════════════════════════════
   HOME PAGE STYLES — index.html only
   Shared base styles: styles.css
═══════════════════════════════════════════ */

/* ===== WELCOME OVERLAY ===== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 25% 15%,
      rgba(26, 82, 118, 0.55) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 75% 85%,
      rgba(26, 82, 118, 0.4) 0%,
      transparent 50%
    ),
    linear-gradient(160deg, #080f1c 0%, #0c1a30 45%, #111827 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  animation: welcomeFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.welcome-overlay.closing {
  animation: welcomeFadeOut 0.5s ease forwards;
  pointer-events: none;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes welcomeFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  width: 100%;
  animation: welcomeSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes welcomeSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-logo {
  width: 120px;
  height: auto;
  margin-bottom: 2rem;
  opacity: 0.9;

  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(180, 220, 255, 0.35))
    drop-shadow(0 0 16px rgba(120, 180, 255, 0.25));

  transition: all 0.3s ease;
}

.welcome-logo:hover {
  transform: scale(1.04);

  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(200, 230, 255, 0.5))
    drop-shadow(0 0 24px rgba(140, 190, 255, 0.35));
}

.welcome-eyebrow {
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xxs);
  letter-spacing: var(--ls-massive);
  text-transform: uppercase;
  color: rgba(218, 165, 32, 0.6);
  margin-bottom: 1.4rem;
}

.welcome-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: var(--fs-4xl);
  color: #ffffff;
  letter-spacing: var(--ls-tighter);
  line-height: 1.1;
  margin-bottom: 1.6rem;
}

.welcome-title em {
  color: var(--accent-warm);
  font-style: italic;
}

.welcome-divider {
  width: 56px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-warm),
    transparent
  );
  margin: 0 auto 1.6rem;
}

.welcome-tagline {
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1.8rem;
}

.welcome-description {
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2.8rem;
  max-width: 50ch;
}

.welcome-btn {
  background: transparent;
  color: var(--accent-warm);
  border: 1px solid rgba(218, 165, 32, 0.6);
  border-radius: 30px;
  padding: 0.9rem 2.6rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.welcome-btn:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #0c1a30;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(218, 165, 32, 0.35);
}

.welcome-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 480px) {
  .welcome-title {
    font-size: var(--fs-3xl);
  }

  .welcome-logo {
    width: 56px;
    margin-bottom: 1.6rem;
  }

  .welcome-description {
    font-size: var(--fs-xs);
    margin-bottom: 2.2rem;
  }

  .welcome-btn {
    padding: 0.8rem 2rem;
  }
}

/* ===== BASE LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* PREFACE OVERLAY */
.preface-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none; /* ← CHANGED: hidden by default */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preface-overlay.visible {
  display: flex; /* ← shows it */
  opacity: 1;
}

.preface-overlay.hidden {
  display: none;
}

.preface-modal {
  background: var(--border-light, #eaf4f8);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.8rem;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  border-top: 4px solid var(--primary, #1a5276);
}

.preface-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted, #888);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.preface-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink, #1a1a1a);
}

.preface-label {
  font-size: var(--fs-xs, 0.72rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary, #1a5276);
  font-weight: 500;
  margin-bottom: 1rem;
}

.preface-quote {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: var(--fs-lg, 1.35rem);
  line-height: 1.55;
  color: var(--ink, #1a1a1a);
  border: none;
  margin: 0 0 1.8rem 0;
  padding: 0 0 1.4rem 0;
  border-bottom: 1px dashed var(--border-light, #ddd);
}

.preface-body p {
  font-size: var(--fs-sm, 0.88rem);
  line-height: 1.85;
  color: var(--text-primary, #3a3530);
  margin-bottom: 1rem;
}

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

/* ===== PREFACE TRIGGER BUTTON ===== */
.preface-trigger {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--accent-warm);
  color: var(--ink);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: all 0.15s;
}
.preface-trigger {
  pointer-events: all;
  z-index: 10;
  position: relative;
}

.preface-trigger:hover {
  background: rgba(218, 165, 32, 0.1);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

/* ===== CONTENTS OVERLAY ===== */
.contents-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.contents-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contents-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.contents-num {
  background: var(--primary);
  color: var(--background);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-widest);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  flex-shrink: 0;
}

.contents-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: var(--fs-base);
  color: var(--ink);
}

.contents-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contents-link {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  display: block;
  transition:
    background 0.15s,
    color 0.15s;
}

.contents-link:hover {
  background: var(--lightblue-bg);
  color: var(--primary);
}

/* ===== MOBILE WARNING BANNER ===== */
.mobile-warning {
  background-color: #f0f7ff;
  border-bottom: 2px solid #3498db;
  padding: 0.75rem 1rem;
  display: none;
  width: 100%;
  box-sizing: border-box;
  animation: slideDownBanner 0.3s ease-out;
}

.mobile-warning .warning-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: #2c3e50;
}

.mobile-warning .warning-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.mobile-warning .warning-text {
  flex: 1;
  line-height: 1.4;
}

.mobile-warning .warning-dismiss {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mobile-warning .warning-dismiss:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

.warning-dismiss:active {
  animation: shakeDismiss 0.3s;
}

.mobile-warning.active + header {
  margin-top: 0;
}

@media (max-width: 480px) {
  .mobile-warning .warning-content {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-warning .warning-text {
    width: calc(100% - 2rem);
    order: 1;
  }

  .mobile-warning .warning-dismiss {
    order: 2;
    margin-left: auto;
  }
}

/* ===== GLOBAL HTML SETTINGS ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ===== SERIES INTRO ===== */
.series-intro {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.series-intro .kicker {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-huge);
  text-transform: uppercase;
  line-height: 2;
  color: var(--muted);
  margin-bottom: 1rem;
  display: block;
}

.series-intro h2 {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: var(--fs-2xl);
  color: var(--accent-warm);
  letter-spacing: var(--ls-tighter);
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* p is MYO KYI THA & NILAR KHIN on home page */
.series-intro p {
  max-width: 40ch;
  letter-spacing: var(--ls-huge);
  margin: 0 auto;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  color: var(--primary-dark);
  line-height: 1;
  padding: 0.5rem 1rem;
  box-shadow: var(--bs-heavy);
  margin-top: 1rem;
  border-radius: 50px;
}

/* ===== SECTIONS GRID ===== */
.sections-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 3rem;
  padding: 0.5rem 0.2rem 1rem;
}

/* ===== SECTION CARD (album cover / large polaroid) ===== */
.section-card {
  background: #ffffff;
  padding: 6px 6px 22px;
  border-radius: 2px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.08);
  width: 300px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.sections-grid .section-card:hover {
  transform: translateY(-10px) scale(1.2);
}

.sections-grid .section-card {
  transition: transform 0.25s ease;
}

.section-card:hover {
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.22),
    0 6px 12px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.section-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.section-card-image {
  height: 200px;
  background: linear-gradient(145deg, #1a5276 0%, #0d3b5a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
}

.section-card-watermark {
  position: absolute;
  top: -10px;
  right: 2px;
  font-family: "Fraunces", serif;
  font-size: 8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.section-card-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.88);
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  z-index: 1;
}

.section-card-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: 1.08rem;
  color: #ffffff;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.4rem;
}

.section-card-desc {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.section-card-caption {
  padding: 7px 5px 0;
}

.section-card-sub {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  display: block;
}

/* Per-section gradient tints */
.section-theme-principles .section-card-image {
  background: linear-gradient(145deg, #1a5276 0%, #0d3b5a 100%);
}
.section-theme-history .section-card-image {
  background: linear-gradient(145deg, #117a65 0%, #0b5e4e 100%);
}
.section-theme-language .section-card-image {
  background: linear-gradient(145deg, #1a4a7a 0%, #0f2f5a 100%);
}
.section-theme-exam .section-card-image {
  background: linear-gradient(145deg, #1b3a6b 0%, #0d2447 100%);
}
.section-theme-pathophys .section-card-image {
  background: linear-gradient(145deg, #2d4263 0%, #192535 100%);
}
.section-theme-management .section-card-image {
  background: linear-gradient(145deg, #7b1d1d 0%, #561212 100%);
}

/* Same tints for photo cards inside the panel */
.section-theme-principles .photo-card-image {
  background: linear-gradient(145deg, #1a5276 0%, #0d3b5a 100%);
}
.section-theme-history .photo-card-image {
  background: linear-gradient(145deg, #117a65 0%, #0b5e4e 100%);
}
.section-theme-language .photo-card-image {
  background: linear-gradient(145deg, #1a4a7a 0%, #0f2f5a 100%);
}
.section-theme-exam .photo-card-image {
  background: linear-gradient(145deg, #1b3a6b 0%, #0d2447 100%);
}
.section-theme-pathophys .photo-card-image {
  background: linear-gradient(145deg, #2d4263 0%, #192535 100%);
}
.section-theme-management .photo-card-image {
  background: linear-gradient(145deg, #7b1d1d 0%, #561212 100%);
}

/* ===== SECTION PANEL OVERLAY ===== */
.section-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.section-panel-overlay.visible {
  opacity: 1;
}

.section-panel {
  background: #f5f4ef;
  border-radius: 20px;
  max-width: 1020px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  animation: panelSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panelSlideUp {
  from {
    transform: translateY(30px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.section-panel-header {
  background: #ffffff;
  padding: 1.8rem 2.2rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.section-panel-meta {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.section-panel-num {
  background: var(--primary);
  color: #ffffff;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xxs);
  font-weight: 600;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  padding: 0.28rem 0.75rem;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 5px;
}

.section-panel-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: var(--fs-xl);
  color: var(--ink);
  letter-spacing: var(--ls-tighter);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.section-panel-desc {
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}

.section-panel-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}

.section-panel-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.section-panel-body {
  padding: 1.5rem 2.2rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.section-panel-body .notes-grid {
  padding: 0.6rem 0.3rem 0.8rem;
  margin-bottom: 0;
}

/* ===== NOTES GRID ===== */
.notes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
  padding: 1rem 0.3rem 1.4rem;
}

/* ===== PHOTO CARD (polaroid style) ===== */
.photo-card {
  background: #ffffff;
  padding: 5px 5px 20px;
  border-radius: 2px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.18),
    0 2px 5px rgba(0, 0, 0, 0.1);
  width: 204px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.notes-grid .photo-card:hover {
  transform: translateY(-10px) scale(1.3);
}

.photo-card:hover {
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.22),
    0 6px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.photo-card:focus-visible {
  transform: translateY(-8px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.2),
    0 0 0 3px var(--primary);
  z-index: 10;
  outline: none;
}

/* ── Photo area (the "image" portion of the polaroid) ── */
.photo-card-image {
  height: 155px;
  background: linear-gradient(145deg, #1a5276 0%, #0d3b5a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px 11px;
}

/* Watermark number */
.photo-card-num {
  position: absolute;
  top: -6px;
  right: 2px;
  font-family: "Fraunces", serif;
  font-size: 6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.photo-card-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: 0.86rem;
  color: #ffffff;
  line-height: 1.35;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* ── Caption strip (the white polaroid label) ── */
.photo-card-caption {
  padding: 7px 5px 0;
}

.photo-card-sub {
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  line-height: 1.45;
  display: block;
}

/* Photo card gradient — driven by .section-theme-* on parent .notes-grid */

/* ===== TOPIC DETAIL OVERLAY ===== */
.topic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.topic-overlay.visible {
  opacity: 1;
}

.topic-modal {
  background: #ffffff;
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.6rem;
  position: relative;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.32);
  border-left: 4px solid var(--primary);
  animation: topicModalIn 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes topicModalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.topic-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}

.topic-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.topic-badge {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xxs);
  font-weight: 600;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

.topic-title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: var(--fs-2xl);
  color: var(--ink);
  letter-spacing: var(--ls-tighter);
  line-height: 1.15;
  margin-bottom: 0.65rem;
}

.topic-subtitle {
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.6rem;
}

.topic-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 1.6rem;
}

.topic-description {
  font-size: var(--fs-sm);
  line-height: 1.95;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.topic-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topic-cancel-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 25px;
  padding: 0.65rem 1.4rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.topic-cancel-btn:hover {
  background: var(--cream-bg);
  border-color: var(--border);
  color: var(--ink);
}

.topic-goto-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  padding: 0.65rem 1.6rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition:
    background 0.15s,
    transform 0.2s;
}

.topic-goto-btn:hover {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateX(3px);
}

/* Mobile horizontal scroll for cards */
@media (max-width: 640px) {
  .notes-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .notes-grid::-webkit-scrollbar {
    height: 4px;
  }
  .notes-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
}

@media (max-width: 480px) {
  .topic-modal {
    padding: 1.8rem 1.4rem;
  }

  .topic-title {
    font-size: var(--fs-xl);
  }
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablets and small desktops */
@media (max-width: 900px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links::-webkit-scrollbar {
    height: 3px;
  }
  .nav-links::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 12px;
  }

  .section-panel {
    max-height: 90vh;
  }

  .section-panel-body {
    padding: 1.2rem 1.5rem 1.5rem;
  }
}

/* Tablet portrait */
@media (max-width: 750px) {
  .container {
    padding: 0 1.2rem;
  }

  header h1 {
    font-size: var(--fs-3xl);
    line-height: 1.2;
  }

  .series-intro h2 {
    font-size: var(--fs-3xl);
  }

  .series-intro p {
    font-size: var(--fs-sm);
    padding: 0 1rem;
  }

  /* Section cards: horizontal scroll on small screens */
  .sections-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .sections-grid::-webkit-scrollbar {
    height: 4px;
  }
  .sections-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  header h1 {
    font-size: var(--fs-3xl);
  }

  .series-intro h2 {
    font-size: var(--fs-2xl);
  }

  .series-intro .kicker {
    font-size: var(--fs-xs);
  }

  footer p {
    font-size: var(--fs-xxs);
  }

  .section-card {
    width: 260px;
  }

  .section-card-image {
    height: 170px;
  }

  .section-panel-header {
    padding: 1.2rem 1.2rem 1rem;
  }

  .section-panel-body {
    padding: 1rem 1.2rem 1.5rem;
  }

  .section-panel-title {
    font-size: var(--fs-lg);
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .series-intro h2 {
    font-size: var(--fs-xl);
  }

  .section-card {
    width: 240px;
  }
}

/* Touch-friendly */
@media (max-width: 768px) {
  .nav-link {
    -webkit-tap-highlight-color: transparent;
  }

  .section-card,
  .photo-card {
    -webkit-tap-highlight-color: rgba(26, 82, 118, 0.1);
  }
}
