/* ═══════════════════════════════════════════════════════════════════
   chapter4.css — Birthday Finale: Audio Jukebox
   ═══════════════════════════════════════════════════════════════════ */

/* ── Scrollable wrapper inside the chapter canvas ────────────── */
.ch4-scroller {
  position: relative;
  z-index: 4;
  width: 100%;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   HERO ROW  — left 3 | centre | right 3
   ══════════════════════════════════════════════════════════════ */
.ch4-hero-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Side columns */
.ch4-side-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Centre note/quote card */
.ch4-centre-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════
   CENTRE CARD  (note + quote)
   ══════════════════════════════════════════════════════════════ */
.ch4-centre-card {
  position: relative;
  background: rgba(0,0,0,0.60);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  width: 100%;
}

/* Glowing halo behind the card */
.ch4-centre-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at 50% 50%, var(--ch4-accent, #f9a8d4) 0%, transparent 70%);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: ch4GlowPulse 4s ease-in-out infinite;
}
@keyframes ch4GlowPulse {
  0%, 100% { opacity: 0.10; transform: scale(1); }
  50%       { opacity: 0.18; transform: scale(1.05); }
}

.ch4-centre-card > *:not(.ch4-centre-glow) { position: relative; z-index: 1; }

.ch4-centre-eyebrow {
  font-family: var(--font-body, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.5rem;
}

.ch4-centre-title {
  font-family: var(--font-display, serif);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.ch4-centre-subtitle {
  font-family: var(--font-display, serif);
  font-style: italic;
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.25rem;
}

.ch4-centre-note {
  font-family: var(--font-display, serif);
  font-style: italic;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.85;
  color: rgba(255,255,255,0.80);
  text-align: center;
  margin-bottom: 1.25rem;
  max-width: 42ch;
  margin-inline: auto;
}

.ch4-centre-quote {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 1rem;
  font-family: var(--font-display, serif);
  font-style: italic;
}
.ch4-centre-quote p {
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
  color: rgba(255,255,255,0.70);
  line-height: 1.7;
  max-width: 38ch;
  margin-inline: auto;
  margin-bottom: 0.5rem;
}
.ch4-centre-quote cite {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.40);
  font-style: normal;
}

/* ══════════════════════════════════════════════════════════════
   AUDIO CARD
   ══════════════════════════════════════════════════════════════ */
.ch4-audio-card {
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  box-shadow: 0 4px 16px rgba(0,0,0,0.30);
}

.ch4-audio-card:hover {
  background: rgba(0,0,0,0.65);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 8px 28px rgba(0,0,0,0.40);
}

/* Playing state highlight */
.ch4-audio-card.ch4-playing {
  background: rgba(249,168,212,0.10);
  border-color: rgba(249,168,212,0.30);
  box-shadow: 0 0 0 1px rgba(249,168,212,0.18), 0 8px 28px rgba(0,0,0,0.35);
}

/* ── Card info row ── */
.ch4-card-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ch4-track-icon {
  font-size: 1.1rem;
  opacity: 0.5;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.ch4-audio-card.ch4-playing .ch4-track-icon {
  opacity: 1;
  animation: ch4IconPulse 1.4s ease-in-out infinite;
}
@keyframes ch4IconPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.15); }
}

.ch4-track-meta {
  min-width: 0;
  flex: 1;
}

.ch4-track-title {
  font-family: var(--font-body, sans-serif);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}

.ch4-track-artist {
  font-family: var(--font-body, sans-serif);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.40);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
  line-height: 1.2;
}

/* ── Progress bar ── */
.ch4-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ch4-progress-bg {
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.ch4-progress-bg:hover {
  height: 5px;
  background: rgba(255,255,255,0.18);
}

.ch4-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f9a8d4, #c084fc);
  border-radius: 99px;
  transition: width 0.3s linear;
  pointer-events: none;
}

.ch4-time {
  font-family: var(--font-body, sans-serif);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.04em;
  text-align: right;
  font-feature-settings: "tnum";
}

/* ── Controls ── */
.ch4-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.ch4-ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.38);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.18s ease, background 0.18s ease;
  letter-spacing: 0.02em;
  font-family: var(--font-body, sans-serif);
  line-height: 1;
}
.ch4-ctrl-btn:hover {
  color: rgba(255,255,255,0.80);
  background: rgba(255,255,255,0.07);
}
.ch4-ctrl-btn:active {
  background: rgba(255,255,255,0.12);
}

.ch4-play-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.90);
  cursor: pointer;
  font-size: 0.78rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.ch4-play-btn:hover {
  background: rgba(249,168,212,0.20);
  border-color: rgba(249,168,212,0.40);
  transform: scale(1.08);
}
.ch4-play-btn:active {
  transform: scale(0.95);
}
.ch4-audio-card.ch4-playing .ch4-play-btn {
  background: rgba(249,168,212,0.22);
  border-color: rgba(249,168,212,0.50);
  color: #f9a8d4;
}

/* ══════════════════════════════════════════════════════════════
   BOTTOM GRID  — 2 rows × 4 columns
   ══════════════════════════════════════════════════════════════ */
.ch4-bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .ch4-hero-row {
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 1rem;
  }
  .ch4-bottom-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ch4-hero-row {
    grid-template-columns: 1fr;
  }
  .ch4-centre-wrap {
    order: -1;
  }
  .ch4-bottom-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ch4-scroller {
    padding: 1rem 1rem 2rem;
  }
}

@media (max-width: 480px) {
  .ch4-bottom-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .ch4-audio-card {
    padding: 0.75rem 0.85rem;
  }
}
