/* ==========================================================================
   SiriusXM Classic Rewind Takeover — chapter player
   Used by djset.html (data-mode="full") and index.html (data-mode="compact").
   ========================================================================== */

.djp {
  --djp-orange: var(--orange, #D9863D);
  --djp-dark: var(--dark, #1a1a1a);
  --djp-light: var(--light, #f5f5f5);
  --djp-secondary: var(--secondary, #6c757d);
  --djp-talk: #5b6b7a;
  --djp-ad: #c9ccd0;
  font-family: inherit;
}

/* ---------- now playing ---------- */

.djp-now { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 22px; }
.djp-art {
  flex: 0 0 auto;
  width: 148px; height: 148px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--djp-light);
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}
.djp-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.3s ease; }
.djp-now-text { min-width: 0; padding-top: 4px; }
.djp-kicker {
  font-size: 10px; font-weight: 200; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--djp-secondary); margin-bottom: 7px;
}
.djp[data-seg-type="song"] .djp-kicker { color: var(--djp-orange); }
.djp-title { font-size: 21px; font-weight: 900; color: var(--djp-dark); line-height: 1.25; margin-bottom: 5px; }
.djp-sub { font-size: 13px; font-weight: 400; color: var(--djp-secondary); line-height: 1.6; }
.djp-blurb { font-size: 13px; font-weight: 400; color: var(--djp-dark); line-height: 1.75; margin-top: 11px; max-width: 46em; }

/* ---------- segmented timeline ---------- */

.djp-bar {
  position: relative;
  display: flex;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--djp-light);
  cursor: pointer;
  margin-bottom: 9px;
}
.djp-seg {
  position: relative;
  height: 100%;
  min-width: 2px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--djp-orange);
  opacity: 0.42;
  transition: opacity 0.18s ease;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.75);
}
.djp-seg-talk { background: var(--djp-talk); }
.djp-seg-ad { background: var(--djp-ad); }
.djp-bar:hover .djp-seg { opacity: 0.3; }
.djp-bar .djp-seg:hover,
.djp-bar:hover .djp-seg.active { opacity: 0.85; }
.djp-seg.active { opacity: 0.8; }
.djp-seg:focus-visible { outline: 2px solid var(--djp-dark); outline-offset: -2px; }

.djp-progress {
  position: absolute; top: 0; left: 0; height: 100%; width: 0;
  background: rgba(0,0,0,0.26);
  pointer-events: none;
}
.djp-playhead {
  position: absolute; top: -3px; left: 0;
  width: 2px; height: calc(100% + 6px);
  background: var(--djp-dark);
  pointer-events: none;
  transform: translateX(-1px);
}
.djp-tip {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  transform: translateX(-50%);
  background: var(--djp-dark); color: #fff;
  font-size: 11px; font-weight: 400; white-space: nowrap;
  padding: 5px 9px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
  z-index: 5;
}
.djp-tip.visible { opacity: 1; }

.djp-times {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--djp-secondary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}

/* ---------- legend ---------- */

.djp-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11px; color: var(--djp-secondary); margin-bottom: 20px; }
.djp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.djp-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; opacity: 0.75; }
.djp-legend .k-song { background: var(--djp-orange); }
.djp-legend .k-talk { background: var(--djp-talk); }
.djp-legend .k-ad { background: var(--djp-ad); }

/* ---------- transport ---------- */

.djp-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.djp-btn {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--djp-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.18s ease, transform 0.18s ease;
}
.djp-btn:hover { color: var(--djp-orange); }
.djp-btn:active { transform: scale(0.94); }
.djp-btn:focus-visible { outline: 2px solid var(--djp-orange); outline-offset: 4px; border-radius: 3px; }
.djp-btn svg { width: 20px; height: 20px; display: block; }

.djp-btn-play {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--djp-orange); color: #fff;
}
.djp-btn-play:hover { background: var(--djp-orange); color: #fff; transform: scale(1.05); }
.djp-btn-play svg { width: 19px; height: 19px; }
.djp-btn-play .djp-i-pause { display: none; }
.djp.is-playing .djp-btn-play .djp-i-play { display: none; }
.djp.is-playing .djp-btn-play .djp-i-pause { display: block; }

.djp-skip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--djp-secondary); cursor: pointer; user-select: none;
}
.djp-skip input { accent-color: var(--djp-orange); cursor: pointer; margin: 0; }

.djp-count {
  margin-left: auto; display: none; align-items: baseline; gap: 5px;
  font-size: 12px; color: var(--djp-secondary);
}
.djp-count.visible { display: inline-flex; }
.djp-count-n { font-weight: 900; color: var(--djp-orange); font-variant-numeric: tabular-nums; }

/* ---------- chapter list ---------- */

.djp-list { margin-top: 34px; border-top: 1px solid #eceef0; }
.djp-row {
  display: flex; align-items: baseline; gap: 14px; width: 100%;
  padding: 11px 10px; text-align: left;
  background: none; border: none; border-bottom: 1px solid #f2f3f4;
  cursor: pointer; font-family: inherit; font-size: 13px;
  transition: background 0.15s ease;
}
.djp-row:hover { background: var(--djp-light); }
.djp-row.active { background: rgba(217,134,61,0.09); }
.djp-row.active .djp-row-title { color: var(--djp-orange); }
.djp-row-time {
  flex: 0 0 56px; font-size: 11px; color: var(--djp-secondary);
  font-variant-numeric: tabular-nums;
}
.djp-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 3px 9px; align-items: baseline; }
.djp-row-title { font-weight: 700; color: var(--djp-dark); }
.djp-row-artist { color: var(--djp-secondary); }
.djp-row-kind {
  flex: 0 0 auto; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--djp-secondary); padding: 2px 7px; border-radius: 3px; background: var(--djp-light);
}
.djp-row-song .djp-row-kind { color: var(--djp-orange); }
.djp-row-len {
  flex: 0 0 48px; text-align: right; font-size: 11px;
  color: var(--djp-secondary); font-variant-numeric: tabular-nums;
}
.djp-row-ad .djp-row-title { color: var(--djp-secondary); font-weight: 400; }

/* ---------- error state ---------- */

.djp-error { display: none; font-size: 12px; color: var(--djp-secondary); margin-top: 16px; line-height: 1.6; }
.djp.has-error .djp-error { display: block; }
.djp.has-error .djp-controls, .djp.has-error .djp-bar { opacity: 0.35; pointer-events: none; }

/* ---------- compact variant (portfolio home page) ---------- */

.djp[data-mode="compact"] {
  max-width: 720px; background: var(--djp-light);
  border-left: 3px solid var(--djp-orange);
  border-radius: 0 6px 6px 0; padding: 22px 26px;
}
.djp[data-mode="compact"] .djp-art { width: 92px; height: 92px; }
.djp[data-mode="compact"] .djp-now { gap: 18px; margin-bottom: 18px; }
.djp[data-mode="compact"] .djp-title { font-size: 16px; }
.djp[data-mode="compact"] .djp-bar { height: 20px; }
.djp[data-mode="compact"] .djp-btn-play { width: 44px; height: 44px; }
.djp[data-mode="compact"] .djp-blurb { display: none; }

/* ---------- row types: stories read differently from tracks ---------- */

/* Stories carry a slate rule and an italic title, matching the timeline key.
   These come last so they win over the generic .active colour. */
.djp-row-talk {
  box-shadow: inset 3px 0 0 var(--djp-talk);
  background: rgba(91, 107, 122, 0.035);
}
.djp-row-talk .djp-row-title {
  color: var(--djp-talk);
  font-style: italic;
  font-weight: 700;
}
.djp-row-talk .djp-row-time { color: var(--djp-talk); opacity: 0.85; }
.djp-row-talk .djp-row-kind { color: var(--djp-talk); background: rgba(91, 107, 122, 0.1); }
.djp-row-talk:hover { background: rgba(91, 107, 122, 0.085); }
.djp-row-talk.active { background: rgba(91, 107, 122, 0.14); }
.djp-row-talk.active .djp-row-title { color: var(--djp-talk); }

/* Ad breaks stay deliberately quiet. */
.djp-row-ad { box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.07); }
.djp-row-ad .djp-row-title { font-size: 12px; }

/* ---------- responsive ---------- */

/* On narrow screens the artwork sits above the text so the description
   gets the full width instead of competing with it. */
@media (max-width: 620px) {
  .djp-now { flex-direction: column; gap: 16px; }
  /* Full-bleed cover, the way a music app would show it. */
  .djp-art {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
  }
  .djp-now-text { padding-top: 0; }
  .djp-title { font-size: 21px; }
  .djp-blurb { margin-top: 10px; }
  .djp-bar { height: 26px; }
  .djp-controls { gap: 11px; }
  .djp-count { margin-left: 0; width: 100%; }
  .djp-row-kind { display: none; }
  .djp-row-time { flex-basis: 48px; }
  .djp-row { padding-left: 13px; }
  .djp[data-mode="compact"] { padding: 18px; }
  .djp[data-mode="compact"] .djp-art { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}
@media (max-width: 420px) {
  .djp-title { font-size: 20px; }
  .djp-legend { gap: 12px; font-size: 10px; }
}

/* ---------- download ---------- */

.djp-dl {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  color: var(--djp-secondary); text-decoration: none;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
  padding: 7px 12px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.djp-dl:hover { color: #fff; background: var(--djp-orange); border-color: var(--djp-orange); }
.djp-dl:focus-visible { outline: 2px solid var(--djp-orange); outline-offset: 3px; }
.djp-dl svg { width: 14px; height: 14px; display: block; }
.djp-dl .djp-dl-size { font-weight: 200; opacity: 0.8; }
@media (max-width: 620px) {
  .djp-dl .djp-dl-size { display: none; }
}
