/* Text story reader (stories without audio) — ReadAloudStatusCard + ReaderDock from mobile.
   Shared reader pieces (tab strip, cards, tools row, sheets) live in audio.css. */
.reading-cover { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 16px; margin: 4px 0 12px; }
.reading-status { margin: 0; font-size: 13px; color: var(--sn-hero); }
.reading-status:empty { display: none; }
.reading-status:not(:empty) { padding: 0 0 10px; }
.reading-tip-slot:empty { display: none; }
.reading-tip-slot .story-tip { margin-bottom: 10px; }

/* "Nghe toàn bài · 8 đoạn · giọng Anh - Mỹ" / "Đang đọc · đoạn 1/8" */
.reading-aloud-bar { margin: 0 0 10px; }
.reading-aloud-bar[hidden] { display: none; }
.story-aloud { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 16px; background: var(--sn-container); color: var(--sn-on-container); text-align: left; font-family: system-ui, sans-serif; }
.story-aloud:hover:not(:disabled) { background: #cfe9e3; }
.story-aloud:disabled { opacity: .6; cursor: default; }
.story-aloud-icon { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--sn-appbar); color: #fff; }
.story-aloud-icon svg { width: 12px; height: 12px; margin-left: 1px; }
.story-aloud-bars { display: none; align-items: center; justify-content: center; gap: 2px; width: 28px; height: 28px; flex-shrink: 0; }
.story-aloud-bars i { display: block; width: 3px; height: 16px; border-radius: 2px; background: var(--sn-appbar); transform: scaleY(.35); transform-origin: center; }
.story-aloud.is-active .story-aloud-icon { display: none; }
.story-aloud.is-active .story-aloud-bars { display: flex; }
.story-aloud.is-playing .story-aloud-bars i { animation: story-level .45s ease-in-out infinite alternate; }
.story-aloud.is-playing .story-aloud-bars i:nth-child(2) { animation-delay: .15s; }
.story-aloud.is-playing .story-aloud-bars i:nth-child(3) { animation-delay: .3s; }
@keyframes story-level { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.story-aloud-title { flex: 1; min-width: 0; font: 600 14px/20px system-ui, sans-serif; }
.story-aloud-meta { flex-shrink: 0; font: 300 13px/18px Mali, sans-serif; color: var(--sn-hero); }
.reading-detail .story-cards .story-para { line-height: 1.6; }
.reading-detail .story-cards[lang="vi"] .story-para > p { line-height: 1.25; }

/* ReaderDock transport: stop · previous · play/pause · next · speed chip */
.story-transport { display: flex; align-items: center; justify-content: space-evenly; gap: 4px; padding: 4px 12px; }
.story-tbtn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--sn-ink); }
.story-tbtn svg { width: 26px; height: 26px; }
.story-tbtn:hover:not(:disabled) { background: var(--sn-soft); }
.story-tbtn:disabled { opacity: .38; cursor: default; }
.story-transport-play { display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: var(--sn-appbar); color: #fff; box-shadow: 0 3px 8px #00796b40; }
.story-transport-play:hover:not(:disabled) { background: var(--sn-hero); }
.story-transport-play svg { width: 22px; height: 22px; }
.story-transport-play[aria-label="Đọc cả bài"] svg, .story-transport-play[aria-label="Tiếp tục đọc"] svg { margin-left: 3px; }
.story-transport-play:disabled { opacity: .5; cursor: default; }
.story-rate select { appearance: none; -webkit-appearance: none; width: auto; min-height: 36px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--sn-soft); color: var(--sn-hero); font: 700 14px/20px system-ui, sans-serif; text-align: center; cursor: pointer; }
.story-rate select:hover { background: var(--sn-container); }
.reading-detail .story-toolsrow { border-top: 0; position: relative; }
.reading-detail .story-toolsrow::before { content: ''; position: absolute; top: 0; left: 12px; right: 12px; height: 1px; background: var(--sn-line); }

.reading-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 0; }
.reading-community > [data-discussion] { min-height: 40px; padding: 6px 16px; border-radius: 999px; font-size: 14px; }
@media (max-width: 1023px) { .reading-tools input:not([type=range]), .reading-tools select { font-size: 16px; } }
.story-game-done { display: grid; justify-items: center; gap: 8px; margin: 16px 0; padding: 20px 16px; text-align: center; }
.story-game-done .story-empty-mam { width: 120px; height: auto; }
.story-game-done h2 { margin: 0; font: 600 20px/26px Mali, sans-serif; }
@media (prefers-reduced-motion: reduce) { .story-aloud.is-playing .story-aloud-bars i { animation: none; transform: scaleY(.7); } }

/* A narrated lesson of "Truyện ngắn" (story-hub.js): the audio reader's waveform and player bar
   (audio.css) in place of the read-aloud bar, docked at the bottom on desktop like the audio reader. */
.story-pbtn[data-reader="repeat"] svg { width: 20px; height: 20px; }
@media (min-width: 768px) {
  .audio-player [data-reader="close"] { display: none; }
  .audio-player .story-pbtn[data-reader="repeat"] { order: 3; }
}
@media (min-width: 1024px) {
  .reading-detail.has-audio .story-dock { display: block; }
  .reading-detail.has-audio .audio-reader-layout > .audio-tools { max-height: calc(100dvh - var(--story-topbar, 64px) - 132px); }
}

