/* ============================================================================
   Maker Radio — ever-present "LISTEN LIVE" bar. Loaded on EVERY page; injected
   once by site-player.js and pinned to the bottom, surviving client-side (pjax)
   navigation so audio keeps playing as you move around the site. The bar is the
   only place to start the live stream — there is no separate Listen Live page in
   the nav; the "Playlist" link opens the full now-playing / recently-played view.

   Layout: a two-row CSS grid. Row 1 has three columns — [now-playing] [PLAY]
   [controls] — with equal-width (1fr) side columns so the center play/pause is
   ALWAYS perfectly centered regardless of how long the track title is. Row 2 is a
   full-width "just played" strip underneath, so everything fits without crowding
   the center. Built on main.css tokens.
   ============================================================================ */

/* Keep page content clear of the fixed two-row bar (≈112px tall) */
body { padding-bottom: 160px; }

#maker-player-bar.transport {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);   /* equal, shrinkable sides → center never drifts */
  grid-template-rows: auto auto;
  align-items: center; column-gap: clamp(8px, 1.6vw, 16px); row-gap: 10px;
  padding: 13px clamp(12px, 3vw, 22px) 14px; min-height: 86px;
  background: rgba(8,8,10,.95); backdrop-filter: blur(12px); border-top: 1px solid #1f1f26;
  font-family: 'Heebo', sans-serif;
}
.transport-left   { grid-column: 1; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 11px; min-width: 0; max-width: 100%; overflow: hidden; }
.transport-center { grid-column: 2; grid-row: 1; justify-self: center; display: flex; align-items: center; gap: 13px; }
/* Playlist + volume + station live in the BOTTOM-RIGHT (row 2), under the controls */
.transport-right  { grid-column: 3; grid-row: 2; justify-self: end; display: flex; align-items: center; gap: 13px; min-width: 0; max-width: 100%; overflow: hidden; }

/* ---- Now playing (row 1 left): cover + title/artist + on-air show line ---- */
.np-cover { flex: 0 0 auto; display: block; line-height: 0; border-radius: 13px; overflow: hidden; box-shadow: 0 3px 11px rgba(0,0,0,.5); }
#mpArt { width: 66px; height: 66px; object-fit: cover; background: #15151b; display: block; }
.np-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0; }
.now-mini { font-size: 14px; color: #cfcfd6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.3; }
.now-mini b { color: var(--white,#fff); font-weight: 800; font-size: 16px; }
.now-mini a { color: inherit; text-decoration: none; }
.now-mini a:hover b { color: var(--pink,#ff52a8); }
/* On-air DJ show pulled from the volunteer portal — only shown while a show is live */
.np-show { font-size: 11px; color: #ffd0e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.np-show-tag {
  display: inline-block; background: #ff3b3b; color: #fff; font-weight: 800; font-size: 9px;
  letter-spacing: .07em; padding: 1px 5px; border-radius: 4px; vertical-align: 1px;
}

/* ---- Center: the LISTEN LIVE button + live status dot -------------------- */
.transport-btn {
  flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  height: 58px; padding: 0 30px 0 24px; border: none; border-radius: 999px;
  background: var(--pink-deep,#e32b87); color: #fff;
  font-family: 'Poppins', sans-serif; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 3px 14px rgba(227,43,135,.34);
  transition: transform .15s cubic-bezier(.2,.7,.3,1), filter .15s ease;
}
.transport-btn:hover { transform: scale(1.04); filter: brightness(1.08); }
.transport-btn:active { transform: scale(.97); }
.transport-btn:focus-visible { outline: 2px solid var(--cyan,#2ee4ea); outline-offset: 3px; }
.transport-btn svg { position: relative; z-index: 1; }
.transport-btn svg[hidden] { display: none; }   /* never show play + pause at once */
.transport-btn .ic-play { transform: translateX(1px); } /* optically center the triangle */
.transport-label { position: relative; z-index: 1; font-size: 15px; text-transform: uppercase; white-space: nowrap; }
.transport-spinner {
  position: absolute; left: 24px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Right: quiet Playlist link, volume + station, then the bold DONATE ---- */
.np-playlist {
  flex: 0 0 auto; text-decoration: none; color: #cfcfd6; font-weight: 600; font-size: 13px;
  letter-spacing: .03em; white-space: nowrap;
}
.np-playlist:hover { color: var(--cyan,#2ee4ea); }
.station { color: var(--muted,#b9b9c5); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* DONATE — a core, ever-present call to action sitting right beside LISTEN LIVE.
   Matched in height, bright solid cyan so it stands apart from the pink play
   button: two equal, centered CTAs that make donation impossible to miss. */
.np-donate {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  height: 58px; padding: 0 26px; border-radius: 999px;
  background: var(--cyan,#2ee4ea); color: #06121a;
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .03em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  box-shadow: 0 3px 16px rgba(46,228,234,.34);
  transition: transform .15s cubic-bezier(.2,.7,.3,1), filter .15s ease;
}
.np-donate svg { flex: 0 0 auto; }
.np-donate:hover { transform: scale(1.05); filter: brightness(1.06); }
.np-donate:active { transform: scale(.97); }
.np-donate:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Volume: speaker toggle + pink-fill slider */
.vol-icon { background: none; border: none; color: var(--muted,#b9b9c5); cursor: pointer; padding: 2px; display: flex; flex: 0 0 auto; }
.vol-icon:hover { color: var(--white,#fff); }
.vol-slider {
  -webkit-appearance: none; appearance: none; width: 92px; height: 5px; border-radius: 999px; cursor: pointer; flex: 0 0 auto;
  background: linear-gradient(to right, var(--pink,#ff52a8) 0%, var(--pink,#ff52a8) var(--fill, 80%), #3a3a44 var(--fill, 80%), #3a3a44 100%);
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.55); cursor: pointer; transition: transform .1s;
}
.vol-slider:hover::-webkit-slider-thumb { transform: scale(1.15); }
.vol-slider::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.55); cursor: pointer; }
.vol-slider::-moz-range-track { background: transparent; }

/* ---- Row 2: "just played" — the last 3, underneath, clean (no divider) ---- */
.np-recent {
  grid-column: 1 / 3; grid-row: 2; min-width: 0;
  display: flex; align-items: center; gap: 14px; overflow: hidden; padding-top: 2px;
}
.np-recent:empty { display: none; }   /* no history yet → collapse the row */
.np-recent-label { flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7c7c88; white-space: nowrap; }
.np-recent-item { display: flex; align-items: center; gap: 7px; text-decoration: none; flex: 0 0 auto; max-width: 180px; }
.np-recent-item img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: #15151b; flex: 0 0 auto; }
.np-recent-title { font-size: 12.5px; color: #b9b9c5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.np-recent-item:hover .np-recent-title { color: #fff; }

/* subtle cue while a pjax navigation is in flight */
html.spa-loading { cursor: progress; }
html.spa-loading body { opacity: .82; transition: opacity .12s; }

/* ---- Responsive: shed secondary pieces, but LISTEN LIVE + DONATE always stay */
@media (max-width: 900px) { .station { display: none; } }
@media (max-width: 760px) { .np-playlist { display: none; } }
@media (max-width: 680px) { .vol-slider, .vol-icon { display: none; } }
@media (max-width: 700px) {
  /* Phone layout: three stacked rows so nothing fights for width —
     [LISTEN  DONATE]  /  [cover + track · artist]  /  [just played ×3].
     The now-playing line sits under the buttons with the FULL bar width. */
  #maker-player-bar.transport { grid-template-rows: auto auto; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .transport-center { grid-column: 1 / -1; grid-row: 1; }
  .transport-left { grid-column: 1 / -1; grid-row: 2; justify-self: center; min-width: 0; max-width: 100%; }
  .np-text { max-width: none; flex: 0 1 auto; }
  .transport-right { display: none; }
  /* Phones show only the CURRENT track — the last-3 strip is desktop/tablet. */
  .np-recent { display: none; }
  body { padding-bottom: 135px; }
}
@media (max-width: 620px) {
  /* Make the centered pair fit: shrink both buttons together. */
  .transport-center { gap: 9px; }
  .transport-btn { height: 48px; padding: 0 18px 0 14px; }
  .transport-label { font-size: 14px; }
  .transport-btn svg { width: 22px; height: 22px; }
  .np-donate { height: 48px; padding: 0 16px; font-size: 14px; }
  .np-donate svg { width: 17px; height: 17px; }
}
@media (max-width: 560px) {
  #mpArt { width: 40px; height: 40px; }
  .now-mini { font-size: 12px; }
  .now-mini b { font-size: 13px; }
}
@media (max-width: 440px) {
  .transport-btn { height: 44px; padding: 0 11px 0 9px; }
  .transport-label { font-size: 13px; }
  .transport-btn svg { width: 20px; height: 20px; }
  .np-donate { height: 44px; padding: 0 10px; gap: 6px; font-size: 13px; }
  .np-donate svg { display: none; }
  #mpArt { width: 36px; height: 36px; }
  body { padding-bottom: 125px; }
}

/* --- Stacking fixes: page UIs vs the fixed player bar (z-index 1200) ---
   The events-copy pages (reserve, etc.) use fixed bottom bars/modals with
   z-index 100-300, which the player bar buried. Lift them above it and keep
   the booking bar clear of the bar itself (--mr-player-h set by site-player.js). */
.booking-bar { bottom: var(--mr-player-h, 112px) !important; z-index: 1300 !important; }
/* The lifted bottom broke the bar's own hide trick (translateY(100%) no longer
   clears the viewport) — a phantom bar with Clear/Book Now floated above the
   player and swallowed clicks. Push the hidden state fully offscreen. */
.booking-bar:not(.visible) { transform: translateY(calc(100% + var(--mr-player-h, 112px) + 24px)) !important; }
.modal-overlay { z-index: 1400 !important; }
.toast { z-index: 1500 !important; }

/* When a page booking bar is up (it sits at --mr-player-h), lift the feedback
   button above it so it never covers the Book button (site feedback #6). */
html:has(.booking-bar.visible) { --mr-fb-extra: 72px; }
