/* THE VOICE — the listening panel, Haute Lumière.
 *
 * Drawn only where a recording actually exists: the component asks
 * /api/voiced/<book> and renders nothing at all when the answer is an empty
 * list. A play control over silence is the one thing this house will not put on
 * a page, so the affordance is built from what is in R2 and from nothing else.
 *
 * Radius zero. Gold is a mark and never a fill. Every target is 44px. Motion is
 * opacity and transform only, on the one house curve, and a reader who has asked
 * for less motion gets none.
 */
.hl-listen{
  --curve:cubic-bezier(.165,.84,.44,1);
  margin:0 0 clamp(28px,4cqi,56px);
  border-top:1px solid var(--rule,rgba(58,46,34,.18));
  border-bottom:1px solid var(--rule,rgba(58,46,34,.18));
  padding:clamp(24px,3.4cqi,40px) 0;
  container-type:inline-size;
}
.hl-listen[hidden]{display:none!important}

.hl-listen .lk{
  display:block;font-family:"Manrope",ui-sans-serif,system-ui,sans-serif;
  font-size:10px;letter-spacing:.24em;text-transform:uppercase;font-weight:600;
  color:var(--muted,#8B7A64);
}
.hl-listen h2{
  margin:.32em 0 0;font-family:"Cormorant Garamond",Georgia,serif;
  font-size:clamp(24px,3.2cqi,34px);line-height:1.06;font-weight:300;letter-spacing:-.012em;
}
.hl-listen .say{
  margin:.7em 0 0;max-width:38em;font-family:"Cormorant Garamond",Georgia,serif;
  font-size:clamp(16px,1.9cqi,19px);line-height:1.5;color:var(--muted,#8B7A64);
}

/* the transport */
.hl-listen .pl{margin-top:26px;display:grid;grid-template-columns:44px 1fr auto;gap:16px;align-items:center}
.hl-listen .pl button.go{
  width:44px;height:44px;min-width:44px;padding:0;border-radius:0;cursor:pointer;
  background:transparent;border:1px solid var(--gold,#B88F4A);color:var(--gold,#B88F4A);
  display:inline-flex;align-items:center;justify-content:center;
  transition:background-color 200ms var(--curve),color 200ms var(--curve);
}
.hl-listen .pl button.go:hover{background:var(--ink,#3A2E22);border-color:var(--ink,#3A2E22);color:var(--paper,#FBF4EA)}
.hl-listen .pl button.go:focus-visible{outline:2px solid var(--gold,#B88F4A);outline-offset:3px}
.hl-listen .pl button.go svg{width:12px;height:12px;fill:currentColor}

.hl-listen .track{position:relative;height:44px;cursor:pointer;display:flex;align-items:center;touch-action:none}
.hl-listen .track:focus-visible{outline:2px solid var(--gold,#B88F4A);outline-offset:2px}
.hl-listen .rail{position:absolute;left:0;right:0;height:1px;background:var(--rule,rgba(58,46,34,.28))}
.hl-listen .done{position:absolute;left:0;height:1px;width:0;background:var(--gold,#B88F4A);
  transition:width 200ms linear}
.hl-listen .head{position:absolute;left:0;width:7px;height:7px;margin-left:-3px;
  background:var(--gold,#B88F4A);transition:left 200ms linear}
.hl-listen .time{font-family:"Manrope",ui-sans-serif,system-ui,sans-serif;font-size:11px;
  letter-spacing:.09em;color:var(--muted,#8B7A64);font-variant-numeric:tabular-nums;white-space:nowrap}

/* the chapters */
.hl-listen .chs{margin:24px 0 0;padding:0;list-style:none;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(3.2rem,1fr));gap:1px;
  background:var(--rule,rgba(58,46,34,.18));border:1px solid var(--rule,rgba(58,46,34,.18))}
.hl-listen .chs li{margin:0}
.hl-listen .chs button{
  width:100%;min-height:44px;padding:0;border:0;border-radius:0;cursor:pointer;
  background:var(--paper,#FBF4EA);color:var(--muted,#8B7A64);
  font-family:"Manrope",ui-sans-serif,system-ui,sans-serif;font-size:12px;
  letter-spacing:.06em;font-variant-numeric:tabular-nums;
  transition:color 200ms var(--curve),background-color 200ms var(--curve);
}
.hl-listen .chs button:hover{color:var(--ink,#3A2E22)}
.hl-listen .chs button:focus-visible{outline:2px solid var(--gold,#B88F4A);outline-offset:-3px}
.hl-listen .chs button[aria-current="true"]{color:var(--gold,#B88F4A)}

/* the skeleton — never a spinner, and it holds the height the panel will take,
   so nothing on the page moves when the answer lands */
.hl-listen .wait{margin-top:26px;height:44px;border:1px solid var(--rule,rgba(58,46,34,.14))}
@media (prefers-reduced-motion:no-preference){
  .hl-listen .wait{animation:hl-breathe 2400ms var(--curve) infinite}
  @keyframes hl-breathe{0%,100%{opacity:.45}50%{opacity:.9}}
}
.hl-listen audio{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.hl-listen .fallback{font-family:"Manrope",ui-sans-serif,system-ui,sans-serif;font-size:12px;
  letter-spacing:.06em;color:var(--muted,#8B7A64)}
.hl-listen .fallback a{color:var(--gold,#B88F4A)}

@media (prefers-reduced-motion:reduce){
  .hl-listen .done,.hl-listen .head{transition:none}
}
@container (max-width:420px){
  .hl-listen .pl{grid-template-columns:44px 1fr;gap:12px}
  .hl-listen .time{grid-column:1 / -1;text-align:right}
}

/* OPERATION AVA — the word being spoken.
 *
 * A hairline under it and nothing else. No tint block, no karaoke, no colour
 * sweeping across the paragraph: a reader is reading, and a mark that competes
 * with the sentence is a mark that stops them finishing it. Painted with the
 * browser's own Highlight API over a Range, so not one span is inserted into his
 * markup — the same way a kept passage is painted in _hl/marks.js.
 */
::highlight(hl-along){
  text-decoration:underline;
  text-decoration-color:var(--gold,#B88F4A);
  text-decoration-thickness:1.5px;
  text-underline-offset:.2em;
}

.hl-listen .along{
  margin:18px 0 0;display:flex;gap:14px;align-items:center;flex-wrap:wrap;
  font-family:"Manrope",ui-sans-serif,system-ui,sans-serif;font-size:11px;
  letter-spacing:.09em;color:var(--muted,#8B7A64);
}
.hl-listen .along[hidden]{display:none!important}
.hl-listen .along label{
  display:inline-flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;
  transition:color 200ms var(--curve);
}
.hl-listen .along label:hover{color:var(--ink,#3A2E22)}
.hl-listen .along input{
  appearance:none;-webkit-appearance:none;margin:0;width:13px;height:13px;border-radius:0;
  border:1px solid var(--rule,rgba(58,46,34,.34));background:transparent;cursor:pointer;
  transition:border-color 200ms var(--curve),background-color 200ms var(--curve);
}
/* The tick is a MARK inside the box, not the box filled with gold. */
.hl-listen .along input:checked{border-color:var(--gold,#B88F4A)}
.hl-listen .along input:checked::after{content:"";display:block;width:5px;height:5px;
  margin:3px;background:var(--gold,#B88F4A)}
.hl-listen .along input:focus-visible{outline:2px solid var(--gold,#B88F4A);outline-offset:3px}
.hl-listen .along .q{font-size:10px;letter-spacing:.1em}

/* The retry offered when the panel could not ask. Furniture, so Manrope; a
   hairline, because it is an invitation and not an alarm. No red anywhere. */
.hl-listen .again{
  appearance:none;background:transparent;cursor:pointer;border:0;border-bottom:1px solid var(--gold,#B88F4A);
  padding:0 0 2px;min-height:44px;color:var(--gold,#B88F4A);
  font-family:"Cormorant Garamond",Georgia,serif;font-size:inherit;font-style:italic;
  transition:color 200ms var(--curve),border-color 200ms var(--curve);
}
.hl-listen .again:hover{color:var(--ink,#3A2E22);border-color:var(--ink,#3A2E22)}
.hl-listen .again:focus-visible{outline:2px solid var(--gold,#B88F4A);outline-offset:3px}
