/* =============================================
   Terminal Station — Newspaper Theme
   Est. 1847 | Atlanta, Georgia
   ============================================= */

/* --- TOKENS --- */
:root {
  --paper:      #F5F0E8;
  --paper-dark: #EDE7D9;
  --paper-mid:  #E8E0CF;
  --ink:        #1A1A1A;
  --ink-light:  #4A4A3F;
  --ink-faint:  #8A8675;
  --rule:       #C4B99A;
  --rule-dark:  #9E9478;
  --accent:     #8B1A1A;
  --accent-light: #B04040;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

html, body {
  background: var(--paper);
}

body {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.2;
  color: var(--ink);
}

p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5em 1.2em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--ink-light);
}

/* --- RULES & DIVIDERS --- */
.rule-double {
  border: none;
  border-top: 3px double var(--ink);
  margin: 0;
}

.rule-single {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.rule-thick {
  border: none;
  border-top: 2px solid var(--ink);
  margin: 0;
}

/* --- MASTHEAD --- */
#masthead {
  text-align: center;
  padding: 10px 24px 0;
  background: var(--paper);
}

#masthead::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--ink);
  margin-bottom: 2px;
}

.masthead-top-rule {
  height: 2px;
  background: var(--ink);
  margin-bottom: 6px;
}

.masthead-dateline {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.masthead-title-row {
  position: relative;
  text-align: center;
}

.masthead-title {
  font-family: "UnifrakturCook", "Playfair Display", serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 2px;
}

.masthead-title a { color: var(--ink); text-decoration: none; }
.masthead-title a:hover { color: var(--accent); }

.masthead-subtitle {
  font-family: "Playfair Display", serif;
  font-size: clamp(11px, 1.6vw, 13px);
  font-style: italic;
  color: var(--ink-light);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* --- SPECIAL EDITION BANNER --- */
#special-edition {
  /* no border — typography carries the visual weight */
}

#special-edition-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 130px;
  background: transparent;
  color: var(--ink);
  border: none;
  padding: 20px 64px;
  cursor: pointer;
  text-align: center;
  /* Explicit family defeats UA button font shorthand reset */
  font-family: "Libre Baskerville", Georgia, serif;
  transition: background 0.15s ease;
}

#special-edition-toggle:hover {
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="dark"] #special-edition-toggle:hover {
  background: rgba(255, 255, 255, 0.025);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #special-edition-toggle:hover {
    background: rgba(255, 255, 255, 0.025);
  }
}

.extra-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.extra-label::before { content: "—\00a0"; }
.extra-label::after  { content: "\00a0—"; }

/* High specificity + !important — defeats UA button font shorthand in all browsers */
#special-edition-toggle .extra-title-display {
  display: block;
  font-family: "UnifrakturCook", "Playfair Display", serif !important;
  font-size: clamp(56px, 9vw, 108px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.extra-headline-preview {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-light);
  opacity: 0.85;
  margin-top: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.extra-chevron {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--ink);
  opacity: 0.35;
  transition: transform 0.25s ease;
}

#special-edition-toggle[aria-expanded="true"] .extra-chevron {
  transform: translateY(-50%) rotate(180deg);
}

#special-edition-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, border-color 0.3s ease;
  background: transparent;
  border-top: 1px solid transparent;
}

#special-edition-content.open {
  max-height: 500px;
  border-top-color: var(--rule);
}

.extra-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 24px;
  border-left: 3px solid var(--accent, #8B1A1A);
}

.extra-kicker {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent, #8B1A1A);
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.extra-title {
  font-family: "Playfair Display", serif;
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.extra-title a { color: var(--ink); text-decoration: none; }
.extra-title a:hover { color: var(--accent, #8B1A1A); }

.extra-dateline {
  font-size: 11px;
  color: var(--ink-light);
  font-style: italic;
  margin-bottom: 10px;
}

.extra-excerpt { font-size: 15px; line-height: 1.65; margin-bottom: 14px; }

@media (max-width: 640px) {
  #special-edition-toggle .extra-title-display { font-size: clamp(48px, 14vw, 72px); }
  #special-edition-toggle { min-height: 100px; }
  .extra-inner { padding: 16px; }
  .extra-title { font-size: 20px; }
}

/* --- NAVIGATION --- */
#terminus-nav {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-top: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#terminus-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
}

#terminus-nav ul li a {
  display: block;
  padding: 6px 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink);
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  border-right: 1px solid var(--rule);
  transition: background 0.15s;
}

#terminus-nav ul li:first-child a { border-left: 1px solid var(--rule); }
#terminus-nav ul li a:hover { background: var(--paper-dark); text-decoration: none; color: var(--accent); }
#terminus-nav ul li.current-menu-item a { background: var(--ink); color: var(--paper); }

/* --- LAYOUT --- */
.site-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-area { padding: 32px 0; }

/* Section header (rule + title) */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  white-space: nowrap;
  font-weight: 700;
}
.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* --- BORDERED PANEL --- */
.panel {
  border: 1px solid var(--rule-dark);
  position: relative;
  background: var(--paper);
}
/* inner double-frame removed — single border only */
.panel-inner { padding: 24px 28px; position: relative; z-index: 2; }

/* --- FRONT PAGE --- */
.front-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule-dark);
}

.front-page-grid .col {
  padding: 24px;
  border-right: 1px solid var(--rule);
}
.front-page-grid .col:last-child { border-right: none; }

.front-page-map {
  border: 1px solid var(--rule-dark);
  position: relative;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.front-page-map-header {
  border-bottom: 1px solid var(--rule);
}

.map-header-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.map-header-link:hover {
  background: var(--rule);
}

.map-header-link h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 16px;
  font-weight: 700;
  font-style: italic;
}

.map-header-cta {
  font-family: "Libre Baskerville", serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--ink-light);
  margin-left: auto;
  transition: color 0.15s ease;
}

.map-header-link:hover .map-header-cta {
  color: var(--ink);
}

.map-preview-link {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.map-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(transparent, rgba(26, 26, 26, 0.6));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.map-preview-link:hover .map-preview-overlay {
  opacity: 1;
}

.map-preview-prompt {
  font-family: "Playfair Display", serif;
  font-size: 13px;
  font-style: italic;
  color: #F5F0E8;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.map-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 24px;
  border-top: 1px solid var(--rule);
}

.map-stat {
  font-family: "Libre Baskerville", serif;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.front-page-map #map {
  width: 100%;
  height: 55vh;
  min-height: 400px;
}

/* --- NEWS / POSTS --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
}

.news-item {
  padding: 20px 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.news-item:nth-child(3n) { border-right: none; }

.news-category {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.news-headline {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}

.news-headline a { color: var(--ink); }
.news-headline a:hover { color: var(--accent); text-decoration: none; }

.news-dateline {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.news-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-light);
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
}

/* --- SINGLE POST --- */
.post-header { padding: 32px 0 24px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; }

.post-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.post-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.post-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
}

.post-content { max-width: 740px; }
.post-content p { font-size: 17px; line-height: 1.75; margin-bottom: 1.4em; }
.post-content h2 { font-size: 24px; margin: 1.6em 0 0.6em; }
.post-content h3 { font-size: 20px; margin: 1.4em 0 0.5em; }

/* Drop cap for first paragraph */
.post-content > p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  font-size: 4.5em;
  font-weight: 900;
  line-height: 0.75;
  float: left;
  margin: 0.08em 0.08em 0 0;
  color: var(--ink);
}

/* --- GALLERY --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  border: 1px solid var(--rule-dark);
}

.gallery-item {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: sepia(20%) contrast(95%);
  transition: filter 0.3s ease;
}

.gallery-item:hover img { filter: sepia(0%) contrast(100%); }

.gallery-caption {
  padding: 12px 16px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

.gallery-caption p {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-light);
  margin: 0;
  line-height: 1.4;
}

.gallery-credit {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
  margin-top: 4px;
  display: block;
}

/* --- FURTHER READING --- */
.further-reading {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 3px double var(--ink);
}

.further-reading-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule-dark);
}

.further-reading-item {
  padding: 20px 24px;
  border-right: 1px solid var(--rule);
}

.further-reading-item:last-child {
  border-right: none;
}

@media (max-width: 640px) {
  .further-reading-list { grid-template-columns: 1fr; }
  .further-reading-item { border-right: none; border-bottom: 1px solid var(--rule); }
  .further-reading-item:last-child { border-bottom: none; }
}

/* --- TIMELINE CENTURY NAV --- */
.century-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 0;
  width: 100%;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}

.century-btn {
  display: block;
  flex: 1;
  text-align: center;
  padding: 10px 28px;
  font-family: "Playfair Display", serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--ink-light);
  text-decoration: none;
  border-right: 1px solid var(--rule);
  transition: background 0.15s ease, color 0.15s ease;
}

.century-btn:first-child { border-left: 1px solid var(--rule); }
.century-btn:hover { background: var(--paper-dark); color: var(--ink); text-decoration: none; }

.century-btn.active {
  background: var(--ink);
  color: var(--paper);
}

/* --- CENTURY SECTION HEADERS --- */
.century-section {
  margin-bottom: 16px;
}

.century-header {
  text-align: center;
  padding: 24px 0 16px;
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  margin-bottom: 8px;
}

.century-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--ink);
  margin-bottom: 4px;
}

.century-range {
  font-family: "Libre Baskerville", serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 1px;
  color: var(--ink-faint);
}

/* --- TIMELINE --- */
.timeline { position: relative; padding: 0; }

.timeline-year {
  font-family: "Playfair Display", serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--rule);
  line-height: 1;
  margin: 32px 0 0;
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}

.timeline-entry {
  padding: 16px 0 16px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
}

.timeline-date {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
  padding-top: 4px;
  font-weight: 700;
}

.timeline-body h3 {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.timeline-body p {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.6;
  margin: 0;
}

.timeline-entry.has-image {
  grid-template-columns: 120px 160px 1fr;
}

.timeline-photo {
  align-self: start;
}

.timeline-photo img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  filter: sepia(25%) contrast(92%);
  border: 1px solid var(--rule);
  display: block;
}

/* Transparent-background emblems — no border, no sepia filter */
.timeline-photo img.borderless {
  border: none;
  filter: none;
  object-fit: contain;
  background: transparent;
}

.timeline-map-link {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 6px;
  display: inline-block;
}

/* --- ABOUT PAGE --- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  border: 1px solid var(--rule-dark);
}

.about-mission { padding: 32px; border-right: 1px solid var(--rule); }
.about-bio { padding: 32px; background: var(--paper-dark); }

.about-mission h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-faint);
  margin-bottom: 16px;
  font-weight: 700;
  font-family: "Libre Baskerville", serif;
}

.about-mission .lede {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--ink);
}

.bio-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: sepia(15%) contrast(95%);
  margin-bottom: 16px;
  border: 1px solid var(--rule);
}

.bio-name {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.bio-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

/* --- FOOTER --- */
#site-footer {
  border-top: 3px double var(--ink);
  padding: 20px 24px;
  margin-top: 32px;
  background: var(--paper);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-title {
  font-family: "Playfair Display", serif;
  font-size: 16px;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
}

.footer-tagline {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.3px;
}

.footer-copy {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
}

/* --- MAP PAGE --- */
#map-wrapper {
  border: 1px solid var(--rule-dark);
  position: relative;
  margin-bottom: 0;
}

/* map-wrapper inner frame removed */

#map-wrapper #map {
  width: 100%;
  height: 70vh;
  min-height: 500px;
}

/* Legend */
#legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  background: var(--paper);
  border: 1px solid var(--rule-dark);
  padding: 12px 16px;
  max-width: 200px;
}

/* legend inner frame removed */

#legend h3 {
  font-family: "Playfair Display", serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-light);
  margin-bottom: 10px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}

.legend-section-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  margin-top: 8px;
  margin-bottom: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--ink-light);
}

.legend-line {
  width: 20px;
  height: 3px;
  border-radius: 1px;
  flex-shrink: 0;
}

.legend-divider {
  height: 1px;
  background: var(--rule);
  margin: 8px 0;
}

/* Station info panel */
#station-info {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--paper);
  border: 1px solid var(--rule-dark);
  padding: 14px 18px;
  min-width: 220px;
  display: none;
}

/* station-info inner frame removed */

#station-info.visible { display: block; }

.info-close-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.7;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.info-close-btn:hover { color: var(--accent); opacity: 1; }

#station-info h2 {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.line-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }

.line-badge {
  font-family: "Libre Baskerville", serif;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.station-type {
  font-size: 10px;
  font-style: italic;
  color: var(--ink-faint);
}

/* Footer stats bar */
#footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 4px 0 24px;
}

#footer-bar .stat {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#footer-bar .stat strong { color: var(--ink-light); font-weight: 700; }

/* Station annotation dots */
.station-dot {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border: 1.5px solid var(--paper);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 0 0 1px var(--ink);
}

.station-dot:hover { transform: scale(1.6); }

.station-dot.hub {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.station-dot.anchor {
  width: 16px;
  height: 16px;
  background: var(--ink-faint);
  border: 2.5px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink-faint), 0 0 0 4px var(--paper), 0 0 0 5px var(--ink-faint);
  opacity: 0.7;
}

.station-dot.abandoned {
  background: var(--ink-faint);
  box-shadow: 0 0 0 1px var(--ink-faint);
  opacity: 0.7;
}

.station-label {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 9px;
  color: var(--ink);
  text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper), 1px 1px 2px var(--paper), -1px -1px 2px var(--paper);
  white-space: nowrap;
  pointer-events: none;
  padding-top: 3px;
  letter-spacing: 0.3px;
}

.station-label.anchor {
  font-family: "Playfair Display", serif;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
}

.station-label.abandoned { font-style: italic; color: var(--ink-faint); }

@media (max-width: 768px) {
  #map-wrapper #map { height: 60vh; min-height: 400px; }
  #station-info { top: 8px; left: 8px; min-width: 180px; }
  #legend {
    bottom: 0; left: 0; right: 0;
    max-width: 100%;
    border-left: none; border-right: none; border-bottom: none;
    padding: 8px 12px;
  }
  #legend h3, .legend-section-label, .legend-divider { display: none; }
  #legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
  }
  .legend-item { margin-bottom: 0; font-size: 10px; }
  #footer-bar { flex-direction: column; align-items: flex-start; }
}

/* Mini info card for small phones (iPhone 13 mini, SE) */
@media (max-width: 390px) {
  #station-info {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: auto;
    padding: 10px 14px;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--rule-dark);
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
  }
  #station-info.visible { display: flex; }
  #station-info h2 {
    font-size: 14px;
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #station-info .line-badges { margin-bottom: 0; }
  #station-info .station-type { font-size: 9px; width: 100%; }
  #station-info #info-route { margin-top: 2px; }
  .flyover-btn { margin-top: 4px; padding: 4px 10px; font-size: 9px; }
}

@media (min-width: 1024px) {
  #map-wrapper #map { height: 75vh; }
}

/* --- GUEST DISPATCHES --- */
.guest-dispatches {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 3px double var(--ink);
}

.guest-dispatches-credit {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.guest-dispatches-credit a {
  color: var(--accent);
  font-weight: 600;
}

.guest-dispatches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.guest-dispatch-card {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.guest-dispatch-card:nth-child(2n) {
  border-right: none;
}

.guest-dispatch-img-link {
  display: block;
  margin-bottom: 12px;
}

.guest-dispatch-img {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
  position: relative;
  filter: sepia(15%) contrast(95%);
}

.guest-dispatch-img-credit {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #ddd;
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
}

.guest-dispatch-title {
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
}

.guest-dispatch-title a { color: var(--ink); }
.guest-dispatch-title a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 900px) {
  .guest-dispatches-grid { grid-template-columns: 1fr; }
  .guest-dispatch-card { border-right: none; }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .front-page-grid { grid-template-columns: 1fr; }
  .front-page-grid .col { border-right: none; border-bottom: 1px solid var(--rule); }
  .about-grid { grid-template-columns: 1fr; }
  .about-bio { border-top: 1px solid var(--rule); }
  .timeline-entry { grid-template-columns: 80px 1fr; gap: 12px; }
  .timeline-entry.has-image { grid-template-columns: 80px 1fr; }
  .timeline-photo { grid-column: 2; grid-row: 1; }
  .timeline-body { grid-column: 2; grid-row: 2; }
  .timeline-photo img { height: 180px; width: 100%; max-width: 280px; }
}

@media (max-width: 640px) {
  .site-wrapper { padding: 0 16px; }
  #terminus-nav ul { justify-content: center; }
  #terminus-nav ul::-webkit-scrollbar { display: none; }
  #terminus-nav ul li a { padding: 8px 14px; font-size: 9px; letter-spacing: 1.5px; white-space: nowrap; }
  .news-grid { grid-template-columns: 1fr; }
  .news-item { border-right: none; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .timeline-entry { grid-template-columns: 1fr; gap: 4px; }
  .timeline-year { font-size: 32px; }
  .century-btn { padding: 8px 16px; font-size: 9px; letter-spacing: 1.5px; }
  .century-header { padding: 16px 0 12px; }
  .century-header h2 { font-size: 11px; letter-spacing: 3px; }
}

/* ===========================================
   DARK MODE
   Activated by: system preference OR
   html[data-theme="dark"] (manual toggle)
   html[data-theme="light"] forces light mode
   =========================================== */

/* Dark palette — aged newsprint by lamplight */
html[data-theme="dark"] {
  --paper:        #1C1A13;
  --paper-dark:   #141209;
  --paper-mid:    #242118;
  --ink:          #E6DCC6;
  --ink-light:    #B4AA90;
  --ink-faint:    #78705A;
  --rule:         #38322A;
  --rule-dark:    #4A4236;
  --accent:       #C45A5A;
  --accent-light: #D07070;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper:        #1C1A13;
    --paper-dark:   #141209;
    --paper-mid:    #242118;
    --ink:          #E6DCC6;
    --ink-light:    #B4AA90;
    --ink-faint:    #78705A;
    --rule:         #38322A;
    --rule-dark:    #4A4236;
    --accent:       #C45A5A;
    --accent-light: #D07070;
  }
}

/* Extra! title — ink pressed into dark newsprint */
html[data-theme="dark"] #special-edition-toggle .extra-title-display {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #special-edition-toggle .extra-title-display {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
  }
}

/* Soften photo filters in dark mode */
html[data-theme="dark"] .gallery-item img,
html[data-theme="dark"] .timeline-photo img,
html[data-theme="dark"] .bio-photo {
  filter: sepia(10%) contrast(80%) brightness(0.85);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .gallery-item img,
  html:not([data-theme="light"]) .timeline-photo img,
  html:not([data-theme="light"]) .bio-photo {
    filter: sepia(10%) contrast(80%) brightness(0.85);
  }
}

/* --- MASTHEAD UTILITY ROW (dateline + theme toggle) --- */
.masthead-utility-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* --- THEME TOGGLE BUTTON --- */
.theme-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  color: var(--ink-faint);
  line-height: 1;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--ink);
}

/* --- MASTHEAD PRICE --- */
.masthead-price {
  position: absolute;
  right: 0;
  bottom: 2px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(10px, 1.4vw, 14px);
  letter-spacing: 2px;
  color: var(--ink-light);
  margin: 0;
  line-height: 1;
}

.masthead-price a {
  color: inherit;
  text-decoration: none;
}

.masthead-price a:hover {
  text-decoration: underline;
}

.masthead-price .price-short {
  display: none;
}

@media (max-width: 480px) {
  .masthead-price {
    position: static;
    text-align: right;
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--ink-faint);
  }
  .masthead-price .price-full {
    display: none;
  }
  .masthead-price .price-short {
    display: inline;
  }
}
