/* family-listen.css: the listening page's additions (UI/UX review 2026-10-02, C2 and C4), on
   top of the lsn- rules in family-book.css, which are unchanged. Loaded by pages/listen only.
   Colours: white on Night #2A2350 14.2:1; Night soft #D6D1F0 on Night 10.1:1; Night text
   #C4BEE6 on Night 8.6:1; coral #C9401F with white 4.96:1; ink #221A17 on white 16.9:1;
   muted #6E605A on white 6.0:1. */

/* The site header is opaque on this page: its 97% white let the dark player and the parts list
   show through it while scrolling. */
body:has(.lsn) .f2-header { background: #fff; }

/* "Continue: part 12, 14:05", in the player, only when this browser kept a place. */
.lsn-resume { display: flex; align-items: stretch; gap: 6px; align-self: center; max-width: 100%; }
.lsn-resume[hidden] { display: none; }
.lsn .lsn-resume__go {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 16px; box-sizing: border-box;
  border-radius: var(--f2-r-pill); background: #fff; color: var(--f2-night); font: 700 15px/1.25 var(--f2-ui);
  text-decoration: none; overflow-wrap: anywhere;
}
.lsn .lsn-resume__go::before {
  content: ""; flex: 0 0 auto; width: 0; height: 0; margin-left: 4px;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--f2-coral);
}
.lsn .lsn-resume__go:hover { background: var(--f2-audio-tint); color: var(--f2-night); }
.lsn-resume__no {
  display: grid; place-items: center; flex: 0 0 auto; width: 48px; min-height: 48px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.lsn-resume__no:hover { background: rgba(255, 255, 255, .22); }
.lsn :is(.lsn-resume__go, .lsn-resume__no):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (min-width: 768px) { .lsn-resume { align-self: flex-start; } }

/* The sleep pill says when it is armed. */
.lsn .lsn-pill--cycle[aria-pressed="true"] { background: #fff; color: var(--f2-night); }
.lsn .lsn-pill--cycle[aria-pressed="true"]:hover { background: var(--f2-audio-tint); color: var(--f2-night); }

/* The small player: fixed above the tab bar on a phone, at the foot of the window elsewhere. */
.lsn-mini {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: var(--f2-z-tabbar);
  box-sizing: border-box; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto;
  min-height: 64px; padding: 8px 14px 8px 8px; overflow: hidden;
  border-radius: 20px; background: var(--f2-night); color: #fff; box-shadow: 0 16px 40px -12px rgba(42, 35, 80, .55);
  animation: lsn-mini-in .22s var(--f2-ease);
}
.lsn-mini[hidden] { display: none; }
@media (max-width: 767px) {
  /* The tab bar is 70 px tall, 12 px off the bottom. */
  .lsn-mini { bottom: calc(12px + 70px + 8px + env(safe-area-inset-bottom)); }
}
.lsn.has-mini { padding-bottom: 96px; }
@keyframes lsn-mini-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lsn-mini__bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255, 255, 255, .16); }
.lsn-mini__bar > span { display: block; height: 100%; background: var(--f2-accent); transform: scaleX(0); transform-origin: left center; }
.lsn-mini__play {
  display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: var(--f2-coral); color: #fff; cursor: pointer; transition: background-color .16s var(--f2-ease);
}
.lsn-mini__play:hover { background: var(--f2-coral-dark); }
.lsn-mini__icon { display: none; }
.lsn-mini__play[data-state="paused"] .lsn-mini__icon[data-icon="play"],
.lsn-mini__play[data-state="playing"] .lsn-mini__icon[data-icon="pause"] { display: block; }
.lsn-mini__icon[data-icon="play"] { margin-left: 2px; }
.lsn-mini__back {
  display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-width: 0; min-height: 48px;
  padding: 0 4px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer;
  font-family: var(--f2-ui);
}
.lsn-mini__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.lsn-mini__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--f2-night-soft); font-size: 12.5px; line-height: 1.3; }
.lsn-mini__time { flex: 0 0 auto; color: var(--f2-night-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .lsn-mini__time { display: none; } }
.lsn-mini :is(.lsn-mini__play, .lsn-mini__back):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .lsn-mini { animation: none; }
  .lsn-mini__play { transition: none; }
}
