/* ══════════════════════════════════════════════════════════════════
   stories.css — Field Notes / Departures Board
   Paths relative to style/ folder
   ══════════════════════════════════════════════════════════════════ */

/* ── OVERRIDE: no wallpaper on this page, keep bg dark ── */
body {
  background-image:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 18px 18px;
  background-attachment: fixed;
}

/* ── PAGE HEADER ─────────────────────────────────────────────────── */
.stories-header {
  padding: 1.8rem 3.5rem 1.4rem;
  border-bottom: 1px solid var(--glass-border);
}

.stories-eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.stories-title {
  font-family: 'Doto', monospace;
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.stories-sub {
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.65;
  margin-top: 0.3rem;
}

/* ── DEPARTURES WRAP ─────────────────────────────────────────────── */
.departures-wrap {
  flex: 1;
  margin: 2rem 3.5rem;
  border: 1px solid rgba(123,94,167,0.4);
  background: rgba(10,10,18,0.7);
  position: relative;
  overflow: hidden;
}

/* Amber glow overlay — inner light of the board */
.departures-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── BOARD HEADER ────────────────────────────────────────────────── */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  position: relative;
  z-index: 1;
}

.board-station {
  font-family: 'Doto', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--green);
  text-shadow: 0 0 12px rgba(74,140,92,0.4);
}

.board-time-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Doto', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--green);
  text-transform: uppercase;
}

.board-time {
  font-family: 'Doto', monospace;
  font-size: 0.85rem;
  color: var(--green);
  text-shadow: 0 0 12px rgba(74,140,92,0.4);
  letter-spacing: 0.22em;
}

/* ── COLUMN HEADERS ──────────────────────────────────────────────── */
.board-col-headers {
  display: grid;
  grid-template-columns: var(--board-cols);
  padding: 0.5rem 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  position: relative;
  z-index: 1;
}

.board-col-headers span {
  font-size: 0.52rem;
  letter-spacing: 0.26em;
  color: rgba(255,255,255,0.82);
  text-transform: uppercase;
}

/* ── ROWS ────────────────────────────────────────────────────────── */
.board-rows {
  position: relative;
  z-index: 1;
}

.board-row {
  display: grid;
  grid-template-columns: var(--board-cols);
  padding: 0.72rem 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: background 0.18s;
  align-items: center;
}

.board-row:hover {
  background: rgba(255,255,255,0.08);
}

.board-row:hover .dest-name {
  color: var(--green);
  text-shadow: 0 0 14px rgba(74,140,92,0.5);
}

.bd-val {
  font-family: 'Doto', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 8px rgba(255,255,255,0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* destination is Playfair-ish but we keep dot-matrix for board feel */
.dest-name {
  font-family: 'Doto', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.18s, text-shadow 0.18s;
}

/* Info col: muted, smaller */
.info-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.82);
  text-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delay styling */
.delay-val {
  font-size: 0.72rem;
}

.board-row--delayed .delay-val {
  color: rgba(192,57,43,0.9);
  text-shadow: 0 0 8px rgba(192,57,43,0.5);
  animation: blink-delay 1.8s step-end infinite;
}

.board-row--big-delay .delay-val {
  color: #e74c3c;
  text-shadow: 0 0 12px rgba(231,76,60,0.7);
}

@keyframes blink-delay {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Grid layout shared between headers and rows */
:root {
  --board-cols: 90px 90px 1fr 70px 72px 1fr;
}

/* Error / loading */
.board-error {
  padding: 2rem 1.6rem;
  font-size: 0.65rem;
  color: rgba(192,57,43,0.7);
  letter-spacing: 0.16em;
}

/* ── STORY DRAWER ────────────────────────────────────────────────── */
.story-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72vh;
  background: rgba(14,12,22,0.98);
  border-top: 1px solid rgba(123,94,167,0.4);
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.8);
}

.story-drawer.open {
  transform: translateY(0);
}

.story-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* DRAWER HEADER */
.story-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.story-drawer-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--green);
  text-transform: uppercase;
  flex-wrap: wrap;
}

.story-drawer-train {
  font-family: 'Doto', monospace;
  font-size: 0.78rem;
  color: var(--green);
  text-shadow: 0 0 10px rgba(74,140,92,0.4);
}

.story-drawer-sep {
  color: var(--accent);
  opacity: 0.5;
}

.story-drawer-time {
  font-family: 'Doto', monospace;
  color: var(--green);
}

.story-drawer-delay {
  display: none;
  background: rgba(192,57,43,0.15);
  border: 1px solid rgba(192,57,43,0.4);
  color: rgba(231,76,60,0.9);
  padding: 0.1rem 0.5rem;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
}

.story-drawer-close {
  font-family: 'Doto', monospace;
  background: none;
  border: 1px solid rgba(74,140,92,0.4);
  color: var(--green);
  font-size: 0.65rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 0;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.story-drawer-close:hover { border-color: var(--green); background: rgba(74,140,92,0.1); }

/* DRAWER TITLE AREA */
.story-drawer-title-wrap {
  padding: 1.2rem 2rem 1rem;
  border-bottom: 1px solid rgba(123,94,167,0.3);
  flex-shrink: 0;
}

.story-drawer-dest {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.story-drawer-quote {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--green);
  border-left: 2px solid rgba(74,140,92,0.5);
  padding-left: 0.75rem;
  font-style: italic;
}

/* STORY BODY */
.story-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.8rem 2rem 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(123,94,167,0.3) transparent;
}

.story-body-scroll::-webkit-scrollbar { width: 4px; }
.story-body-scroll::-webkit-scrollbar-track { background: transparent; }
.story-body-scroll::-webkit-scrollbar-thumb { background: rgba(123,94,167,0.3); border-radius: 2px; }

.story-body-text {
  max-width: 680px;
  margin: 0 auto;
}

.story-body-text p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.84rem;
  line-height: 2.1;
  color: rgba(200,210,205,0.9);
  margin-bottom: 1.4em;
  text-align: justify;
}

/* First paragraph: slightly brighter */
.story-body-text p:first-child {
  color: #eeeae0;
  font-size: 0.88rem;
}

.story-loading {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  color: rgba(255,255,255,0.4);
  padding: 2rem 0;
  animation: blink-delay 1s step-end infinite;
}

.story-load-err {
  color: rgba(192,57,43,0.7);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

/* ── BACKDROP ────────────────────────────────────────────────────── */
.story-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.story-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── NAV ACTIVE STATE ────────────────────────────────────────────── */
.nav-active {
  color: var(--green) !important;
}

.nav-active::before {
  opacity: 1 !important;
}

/* ── MOBILE ROW CARD (hidden always — unused) ────────────────────── */
.row-mobile { display: none; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stories-header {
    padding: 1.6rem 1.4rem 1rem;
  }

  .departures-wrap {
    margin: 1.2rem 0;
    border-left: none;
    border-right: none;
  }

  :root {
    --board-cols: 58px 3fr 58px 58px;
  }

  /* Hide train and info columns on mobile */
  .col-train, .col-info, .info-val { display: none; }
  .board-row > .col-train { display: none; }

  .board-col-headers,
  .board-row {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .board-header {
    padding: 0.65rem 1rem;
  }

  .story-drawer {
    height: 85vh;
  }

  .story-drawer-header,
  .story-drawer-title-wrap,
  .story-body-scroll {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .bd-val { font-size: 0.7rem; }
  .dest-name { font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .board-station { font-size: 0.68rem; }
  .board-time { font-size: 0.82rem; }
}
