/* ============================================================
   NadoeStation — Global Stylesheet
   ============================================================
   Color palette and design tokens are defined at the top in
   :root {} so they're easy to find and change in one place.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  /* Background / surface colors — warm paper white */
  --bg:           #f5f3ee;
  --bg-surface:   rgba(245, 243, 238, 0.93); /* slightly transparent for cards/nav over the bg image */
  --bg-player:    rgba(245, 243, 238, 0.98); /* near-opaque for the bottom player bar */

  /* Text colors */
  --text:         #0a0a0a;   /* near-black, main text */
  --text-muted:   #555;      /* secondary / label text */

  /* Border — solid black like ink lines */
  --border:       #0a0a0a;
  --border-light: #bbb;      /* used for subtle separators */

  /* Player bar height — change this if the bar feels too tall/short */
  --player-h:     72px;

  /* No border-radius — we want sharp, raw corners like drawn lines */
  --radius: 0;

  /* Transition speed for hover effects */
  --transition: 0.15s ease;
}

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

/* ── Body & background image ─────────────────────────────── */
body {
  /* The ink artwork image is set as a fixed background so it
     stays in place when the user scrolls — like looking through
     a window at the artwork below the content. */
  background-color: var(--bg);
  background-image: url('res/bunker_background.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* keeps art stationary while content scrolls */

  color: var(--text);
  font-family: 'Courier New', Courier, monospace; /* typewriter feel */
  font-size: 16px;
  line-height: 1.6;

  /* Bottom padding is added by JS (class player-visible) when the
     player bar is shown, so content isn't hidden behind it. */
}

/* Disable fixed background on mobile — it can cause rendering issues */
@media (max-width: 700px) {
  body { background-attachment: scroll; }
}

a { color: var(--text); text-decoration: underline; }
a:hover { opacity: 0.6; }

/* ── Top navigation bar ──────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);  /* frosted-glass effect — blurs bg art behind nav */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
}

.site-nav .logo {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.site-nav ul a {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  transition: color var(--transition);
}

.site-nav ul a:hover { color: var(--text); }

/* The "active" link has an underline to show the current page */
.site-nav ul a.active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ON AIR / LIVE badge in the nav and now-playing strip */
.on-air-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.on-air-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  animation: blink 1.4s infinite;
  flex-shrink: 0;
  transition: background 0.3s;
}

/* Stream is offline — gray static dot */
.on-air-dot.off {
  background: #aaa;
  animation: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Small play button that appears next to the live badge in the nav
   when the stream is actually broadcasting. Hidden when off-air. */
.nav-live-play-btn {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  font-size: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--transition);
  font-family: inherit;
  margin-left: 2px;
}

.nav-live-play-btn:hover { opacity: 0.7; }

/* Body gains this class when the player bar is visible, so the
   page content is pushed up and not hidden behind the fixed bar. */
body.player-visible {
  padding-bottom: calc(var(--player-h) + 24px);
}

/* ── Main page wrapper ───────────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Hero banner (home page only) ───────────────────────── */
.hero {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 4rem 3rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.hero h1 {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--text);
  color: var(--bg);
}

.btn:hover { opacity: 0.75; color: var(--bg); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--text);
}

.btn-outline:hover { background: var(--text); color: var(--bg); opacity: 1; }

/* ── Section headings with rule ─────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Featured show cards (home page) ────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;          /* 1px gap gives a "grid lines" effect */
  border: 1px solid var(--border);
  background: var(--border); /* border color fills the 1px gap between cards */
}

.card {
  background: var(--bg-surface);
  padding: 1.5rem;
  transition: background var(--transition);
}

.card:hover { background: rgba(0,0,0,0.06); }

.card .card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card p { font-size: 0.88rem; color: var(--text-muted); }

.card .card-meta {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

/* ── Now playing strip (home page) ──────────────────────── */
.now-playing-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.now-playing-strip .info { flex: 1; min-width: 0; }
.now-playing-strip .info .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.now-playing-strip .info .title {
  font-weight: 900;
  font-size: 1rem;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing-strip .info .artist { font-size: 0.85rem; color: var(--text-muted); }

/* ── Archive list ────────────────────────────────────────── */
.archive-list { display: flex; flex-direction: column; }

.archive-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: none;  /* stacked items share borders — no double lines */
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: background var(--transition);
  cursor: pointer;
}

/* First item gets a top border since there's nothing above it */
.archive-item:first-child { border-top: 1px solid var(--border); }

.archive-item:hover { background: rgba(0,0,0,0.05); }

.archive-item .ep-num {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.archive-item .ep-info { flex: 1; min-width: 0; }
.archive-item .ep-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.1rem;
}
.archive-item .ep-info span { font-size: 0.78rem; color: var(--text-muted); }

.archive-item .ep-duration {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

/* Play button for archive items */
.archive-play-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
}

.archive-play-btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* Filter buttons above the archive list */
.filter-bar {
  display: flex;
  gap: 0;  /* buttons share borders */
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  width: fit-content;
}

.filter-btn {
  padding: 0.45rem 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:last-child { border-right: none; }

.filter-btn:hover,
.filter-btn.active {
  background: var(--text);
  color: var(--bg);
}

/* ── Schedule: month navigation ─────────────────────────── */
.month-nav {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Large pixel-font month name — matches the "MARCH" style in the reference image */
.cal-month-name {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  line-height: 1;
  color: var(--text);
  text-transform: uppercase;
}

.cal-year {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* Prev / Next month buttons */
.month-nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 4px;
  transition: all var(--transition);
}

.month-nav-btn:hover { background: var(--text); color: var(--bg); }

/* ── Calendar grid ───────────────────────────────────────── */
/* This is the 7-column wall-calendar grid on the schedule page.
   It closely mirrors the visual in the reference image:
   thin black borders on white cells, date numbers in corners. */

/* Day-of-week header row (SUN, MON, TUE …) */
.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.cal-header-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  background: rgba(0,0,0,0.04);
}

/* The grid itself — cells share borders so there are no double lines */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
}

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 90px;
  padding: 5px 6px;
  background: var(--bg-surface);
  position: relative;
  vertical-align: top;
  transition: background var(--transition);
}

.cal-cell:hover { background: rgba(0,0,0,0.04); }

/* Empty cells before the first day or after the last day of the month */
.cal-cell.empty {
  background: rgba(245, 243, 238, 0.5);
}

/* Today's cell gets a subtle background tint */
.cal-cell.today {
  background: rgba(0, 0, 0, 0.07);
}

/* The date number sits in the top-left corner of each cell */
.cal-day-num {
  font-size: 0.68rem;
  font-weight: 900;
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

/* Today's date number is underlined */
.cal-cell.today .cal-day-num { text-decoration: underline; text-underline-offset: 2px; }

/* Individual show entries inside a calendar cell */
.cal-show-entry {
  font-size: 0.6rem;
  line-height: 1.3;
  padding: 1px 3px;
  border: 1px solid var(--border-light);
  margin-bottom: 2px;
  background: rgba(255,255,255,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Live player bar (fixed at bottom of every page) ─────── */
/* This bar uses a flat, minimal style to match the ink-art aesthetic:
   white background, thin black top border, no gradients or shadows. */
.live-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-h);
  background: var(--bg-player);
  border-top: 2px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

/* Left section: station name */
.player-left {
  flex-shrink: 0;
}

.player-station-name {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* Center section: play button + track info */
.player-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

/* Play/pause button — flat square with black border */
#play-pause-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  font-family: inherit;
}

#play-pause-btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* Track info text next to the play button */
.player-track-info { min-width: 0; }

.player-live-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.player-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  animation: blink 1.4s infinite;
  flex-shrink: 0;
}

#player-track-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close button — always visible, outside .player-right so it
   remains accessible even when volume is hidden on mobile. */
.player-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  font-family: inherit;
  margin-left: auto;
}

.player-close-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--border);
}

/* Right section: volume */
.player-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.player-right label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Custom volume slider — thin black track, square thumb */
#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 0;   /* square thumb — no rounded corners */
  background: var(--text);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--text);
  cursor: pointer;
  border: none;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  bottom: 0;
  width: 100%;
  position: absolute;
  display: flex;
  justify-content: center;
  padding: 1.0rem 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
  background: var(--bg-surface);
  text-transform: uppercase;
}

/* ── Responsive (mobile) ─────────────────────────────────── */
@media (max-width: 700px) {
  .site-nav { padding: 0 1rem; }
  .site-nav ul { gap: 1rem; }
  .hero { padding: 2.5rem 1.25rem; }

  /* On mobile the player hides the volume control to save space */
  .live-player { padding: 0 1rem; gap: 1rem; }
  .player-right { display: none; }

  /* Calendar cells shrink on mobile */
  .cal-cell { min-height: 50px; }
  .cal-show-entry { display: none; } /* hide show details — too small to read */
}
