/* listen.css -- the audio briefing player (listen.html). Site palette (measure.css). */
:root {
  --ink: #1b2330; --ink-soft: #55606f; --line: #e7e2d6;
  --brand: #1f5f8b; --brand-dark: #164667; --navy: #14304f;
  --gold: #c69a3f; --gold-deep: #a9781f; --accent: #cdee6b;
  --marble: #f6f4ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .lp-wait etc. set display, which beats the attribute */
html, body { margin: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--marble); -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--brand); }

.lp-top {
  background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px;
  padding: 12px max(16px, env(safe-area-inset-left));
}
.lp-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none;
  font-weight: 800; letter-spacing: .04em; font-size: 1.05rem; }
.lp-brand img { border-radius: 22%; box-shadow: 0 0 0 1px #c69a3f; display: block; }
.lp-tag { color: #b9c6d6; font-size: .82rem; }

.lp-wrap { max-width: 640px; margin: 0 auto; padding: 28px 16px 40px; }

/* ---------------------------------------------------------------- the card */
.lp-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1d4670 0%, var(--navy) 55%, #0f2540 100%);
  color: #fff; border-radius: 22px; padding: 24px 24px 22px;
  box-shadow: 0 18px 40px -18px rgba(20, 48, 79, .55);
}
/* a soft gold glow in the corner, behind everything */
.lp-card::before {
  content: ""; position: absolute; right: -80px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(198,154,63,.35), transparent 65%);
  pointer-events: none;
}
.lp-head { position: relative; display: flex; align-items: center; gap: 16px; }
.lp-badge { width: 64px; height: 64px; border-radius: 14px; background: #fff; padding: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); flex: 0 0 auto; object-fit: contain; }
.lp-kicker { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); }
.lp-title { margin: 2px 0 2px; font-size: 1.45rem; line-height: 1.2; }
.lp-sub { margin: 0; color: #c7d3e0; font-size: .92rem; }

.lp-about { position: relative; margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.lp-subject { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.4; }
.lp-facts { margin: 4px 0 0; color: #c7d3e0; font-size: .82rem; }

/* ---------------------------------------------------------------- waiting */
.lp-wait { position: relative; display: flex; gap: 16px; align-items: center; margin-top: 22px;
  padding: 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.lp-wait-h { margin: 0 0 4px; font-weight: 700; }
.lp-wait-p { margin: 0; color: #c7d3e0; font-size: .88rem; line-height: 1.5; }
.lp-eq { display: flex; gap: 4px; align-items: flex-end; height: 34px; flex: 0 0 auto; }
.lp-eq i { width: 6px; border-radius: 3px; background: var(--gold); animation: lp-eq 1.1s ease-in-out infinite; }
.lp-eq i:nth-child(2) { animation-delay: -.2s; } .lp-eq i:nth-child(3) { animation-delay: -.45s; }
.lp-eq i:nth-child(4) { animation-delay: -.7s; } .lp-eq i:nth-child(5) { animation-delay: -.9s; }
@keyframes lp-eq { 0%, 100% { height: 8px; } 50% { height: 34px; } }
.lp-bad { position: relative; margin: 20px 0 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(208,55,43,.18); border: 1px solid rgba(208,55,43,.45); }

/* ---------------------------------------------------------------- controls */
.lp-controls { position: relative; margin-top: 24px; }
.lp-track {
  position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.16);
  cursor: pointer; touch-action: none; outline: none;
}
.lp-track:focus-visible { box-shadow: 0 0 0 3px rgba(205,238,107,.6); }
.lp-buf, .lp-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; width: 0; }
.lp-buf { background: rgba(255,255,255,.22); }
.lp-fill { background: linear-gradient(90deg, var(--gold), #e6c26f); }
.lp-thumb {
  position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35), 0 0 0 4px rgba(198,154,63,.45);
  transition: transform .12s;
}
.lp-track:hover .lp-thumb, .lp-track.is-drag .lp-thumb { transform: scale(1.15); }
.lp-times { display: flex; justify-content: space-between; margin-top: 8px;
  font-size: .82rem; color: #c7d3e0; font-variant-numeric: tabular-nums; }

.lp-row { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 14px; }
button { font: inherit; }
.lp-btn { background: none; border: 0; color: #fff; cursor: pointer; border-radius: 12px; padding: 8px; }
.lp-btn:hover { background: rgba(255,255,255,.1); }
.lp-btn:focus-visible, .lp-play:focus-visible, .lp-sp:focus-visible, .lp-dl:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; }
.lp-btn svg { width: 30px; height: 30px; fill: currentColor; display: block; }
.lp-skip { position: relative; }
.lp-skip b { position: absolute; left: 0; right: 0; top: 50%; margin-top: -5px; font-size: .62rem;
  font-weight: 800; text-align: center; pointer-events: none; }

.lp-play {
  position: relative; width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #e7c579, var(--gold) 55%, var(--gold-deep));
  color: var(--navy); box-shadow: 0 10px 24px -6px rgba(198,154,63,.7), inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform .12s;
}
.lp-play:active { transform: scale(.96); }
.lp-play svg { width: 36px; height: 36px; fill: currentColor; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); }
.lp-play .i-play { margin-left: 2px; }
.lp-play .i-pause, .lp-play.is-playing .i-play { display: none; }
.lp-play.is-playing .i-pause { display: block; }
.lp-spin { display: none; position: absolute; inset: -5px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent); animation: lp-spin .8s linear infinite; }
.lp-play.is-loading .lp-spin { display: block; }
@keyframes lp-spin { to { transform: rotate(360deg); } }

.lp-extras { justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.lp-speed { display: inline-flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; }
.lp-sp { border: 0; background: none; color: #c7d3e0; font-size: .8rem; font-weight: 700;
  padding: 6px 10px; border-radius: 999px; cursor: pointer; font-variant-numeric: tabular-nums; }
.lp-sp.is-on { background: #fff; color: var(--navy); }
.lp-vol { display: inline-flex; align-items: center; gap: 4px; }
.lp-mute svg { width: 24px; height: 24px; }
.lp-mute .i-muted, .lp-mute.is-muted .i-vol { display: none; }
.lp-mute.is-muted .i-muted { display: block; }
/* a volume slider you can see -- always visible on desktop */
.lp-volr { -webkit-appearance: none; appearance: none; width: 110px; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255,255,255,.22) var(--v, 100%)); cursor: pointer; }
.lp-volr::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.lp-volr::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.lp-dl { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none;
  font-size: .84rem; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3); }
.lp-dl:hover { background: rgba(255,255,255,.1); }
.lp-dl svg { width: 16px; height: 16px; fill: currentColor; }
.lp-resume { margin: 12px 0 0; text-align: center; font-size: .84rem; color: #c7d3e0; }
.lp-resume button { background: none; border: 0; color: var(--accent); text-decoration: underline;
  cursor: pointer; padding: 0; }

/* ---------------------------------------------------------------- library */
.lp-lib { margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; }
.lp-lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.lp-lib-head h2 { margin: 0; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-dark); }
.lp-lib-n { font-size: .8rem; color: var(--ink-soft); }
.lp-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.lp-item { border-bottom: 1px solid #f0ede5; }
.lp-item:last-child { border-bottom: 0; }
.lp-pick { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; padding: 12px 18px; cursor: pointer;
  color: var(--ink); }
.lp-pick:hover { background: var(--marble); }
.lp-pick:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.lp-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #eef2f7; color: var(--brand-dark); }
.lp-ico svg { width: 20px; height: 20px; fill: currentColor; }
.lp-item.is-ready .lp-ico { background: var(--navy); color: var(--gold); }
.lp-item.is-current { background: #fbf6ea; box-shadow: inset 4px 0 0 var(--gold); }
.lp-item.is-current .lp-pick:hover { background: #f8f0dc; }
.lp-it-t { display: block; font-weight: 700; font-size: .92rem; }
.lp-it-s { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lp-pill.ready { background: #e8f3ec; color: #276749; }
.lp-pill.pending { background: #fbf1dc; color: #8a5a00; }
.lp-pill.error { background: #fdeceb; color: #b42318; }
.lp-pill.test { background: #eef2f7; color: var(--brand-dark); margin-right: 4px; }
.lp-dots::after { content: ""; animation: lp-dots 1.4s steps(4) infinite; }
@keyframes lp-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.lp-signin { margin: 18px 4px 0; text-align: center; font-size: .9rem; }

.lp-keep { margin: 14px 0 0; text-align: center; font-size: .78rem; color: #aebdcd; line-height: 1.45; }
.lp-keep-dl { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; white-space: nowrap; }

.lp-note { margin: 18px 4px 0; font-size: .8rem; color: var(--ink-soft); line-height: 1.55; text-align: center; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 520px) {
  .lp-tag { display: none; }
  .lp-wrap { padding: 16px 12px 32px; }
  .lp-card { padding: 20px 16px 18px; border-radius: 18px; }
  .lp-badge { width: 52px; height: 52px; }
  .lp-title { font-size: 1.2rem; }
  .lp-row { gap: 16px; }
  .lp-play { width: 80px; height: 80px; }      /* a bigger target for a thumb */
  .lp-track { height: 14px; }
  /* phones control volume with their own buttons; a slider there just confuses */
  .lp-volr { display: none; }
  .lp-extras { justify-content: center; }
  .lp-pick { grid-template-columns: 34px 1fr; padding: 12px 14px; }
  .lp-pick .lp-pills { grid-column: 2; justify-self: start; }
  .lp-ico { width: 34px; height: 34px; }
  .lp-list { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-eq i, .lp-spin { animation: none; }
}
