/* abr.css — read-along reader. Override the custom properties on .abr to restyle. */
.abr {
  --abr-accent: #ffd366;
  --abr-highlight-bg: rgba(255, 211, 102, 0.10);
  --abr-bar-bg: rgba(18, 18, 18, 0.96);
  --abr-bar-fg: #f2f2f2;
  --abr-bar-height: 72px;
  --abr-stage-top: 16px;
  --abr-stage-radius: 10px;
  --abr-gap: 32px;
  --abr-word-bg: var(--abr-accent);
  --abr-word-fg: #111;
  --abr-sentence-bg: rgba(255, 211, 102, 0.28);
  position: relative;
  padding-bottom: calc(var(--abr-bar-height) + 32px);
}

.abr-audio { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* stage: pinned scene art */
.abr-stage { position: sticky; top: 0; z-index: 2; width: 100%; height: min(40vh, 56.25vw); overflow: hidden; background: #000; border-radius: 0 0 var(--abr-stage-radius) var(--abr-stage-radius); }
.abr-stage__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.abr-stage__img.is-front { opacity: 1; }

/* blocks */
.abr-text [data-abr-i] { cursor: pointer; border-radius: 6px; padding-left: 0.6em; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.abr-text [data-abr-i].is-active { background: var(--abr-highlight-bg); box-shadow: inset 3px 0 0 var(--abr-accent); }
.abr-text [data-abr-i]:focus-visible { outline: 2px solid var(--abr-accent); outline-offset: 2px; }

/* word / sentence highlight */
.abr-w { border-radius: 3px; transition: background-color 0.12s ease, color 0.12s ease; }
.abr-w.is-word { background: var(--abr-word-bg); color: var(--abr-word-fg); box-shadow: 0 0 0 2px var(--abr-word-bg); }
.abr-w.is-sentence { background: var(--abr-sentence-bg); }

/* resume pill */
.abr-resume { position: fixed; left: 50%; bottom: calc(var(--abr-bar-height) + 16px); transform: translateX(-50%); z-index: 30; padding: 0.5em 1.1em; border: 1px solid var(--abr-accent); border-radius: 999px; background: var(--abr-bar-bg); color: var(--abr-accent); font: inherit; font-size: 14.4px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }

@media (min-width: 900px) {
  .abr--sticky { display: grid; grid-template-columns: 42fr 58fr; gap: var(--abr-gap); align-items: start; }
  .abr--sticky .abr-stage { top: var(--abr-stage-top); height: auto; aspect-ratio: 16 / 9; border-radius: var(--abr-stage-radius); }
}

/* inline mode (default): scene art sits in the text and scrolls by */
.abr--inline .abr-text figure.chapter-scene { margin: 1.75em 0; padding: 0; cursor: default; }
.abr--inline .abr-text figure.chapter-scene img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--abr-stage-radius); }

@media (prefers-reduced-motion: reduce) {
  .abr-stage__img, .abr-text [data-abr-i], .abr-w { transition: none; }
}

/* transport bar */
.abr-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; min-height: var(--abr-bar-height); display: flex; align-items: center; gap: 8px; padding: 9.6px clamp(12px, 3vw, 32px); background: var(--abr-bar-bg); color: var(--abr-bar-fg); backdrop-filter: blur(8px); border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 15.2px; }
.abr-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 38.4px; height: 38.4px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; line-height: 1; cursor: pointer; text-decoration: none; }
.abr-btn:hover { background: rgba(255, 255, 255, 0.08); }
.abr-btn:focus-visible { outline: 2px solid var(--abr-accent); outline-offset: 1px; }
.abr-btn small { font-size: 0.65em; margin: 0 0.15em; }
.abr-play { width: 44.8px; height: 44.8px; background: var(--abr-accent); color: #111; font-size: 17.6px; }
.abr-play:hover { background: var(--abr-accent); filter: brightness(1.08); }
.abr-time { font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0.85; }
.abr-time__sep { margin: 0 0.3em; opacity: 0.5; }
.abr-scrub { flex: 1 1 128px; min-width: 64px; accent-color: var(--abr-accent); cursor: pointer; }
.abr-rate { min-width: 48px; font-variant-numeric: tabular-nums; }
.abr-title { flex: 0 1 auto; max-width: 288px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.75; }
.abr-msg { font-size: 12.8px; color: var(--abr-accent); white-space: nowrap; }
.abr-msg:empty { display: none; }
@media (max-width: 640px) {
  .abr-title { display: none; }
  .abr-bar { gap: 4.8px; }
}
