/* kids-surah.css: area D1, the sūrah screens (tools/kids/CONTRACT.md section 0; prefix ks-). Loaded after kids.css.
 * The Qur'anic text is the site's (QPC Hafs v2.0, platform/quran/ayah-text.json) in 'KFGQPC Hafs' (kids.css @font-face: font-display block,
 * no unicode-range), plain: no colour, word spacing only (never kashida), letters never broken, rows at 2.15 times the font size
 * (CLAUDE.md: "The Qur'an needs to be perfect"). The rules for the ported mushaf page stay in kids.css; the ones here only change or add. */

/* ---- the text: rows of 2.15 x the font size, the font's own spacing, nothing coloured, nothing broken ---- */
.scr-surah, .scr-ayat, .sheet.ay-sheet { --lh-mushaf: 2.15; }
:is(.scr-surah, .scr-ayat, .sheet.ay-sheet) .ar-mushaf { line-height: 2.15; }
.scr-surah .ay-run, .scr-surah .ay-bism, .scr-ayat .ay-line, .sheet.ay-sheet .ay-sheet__ayah {
  line-height: 2.15; letter-spacing: 0; word-spacing: normal; text-justify: inter-word; hyphens: none; -webkit-hyphens: none;
  word-break: normal; overflow-wrap: normal; text-decoration: none; font-variant-ligatures: normal; font-kerning: normal;
}
.scr-surah .ay-run .w--run, .scr-ayat .ay-line .w--run { line-height: 2.15; }
.scr-surah .ay-run .w--run > .ar, .scr-ayat .ay-line .w--run > .ar { line-height: inherit; }
.scr-surah .w--wbw > .ar { line-height: 2.15; }
:is(.scr-surah, .scr-ayat, .sheet.ay-sheet) :is(.ar, .w, .ay-ayah) { text-decoration: none; }
:is(.scr-surah, .scr-ayat, .sheet.ay-sheet) :is(.ar, .ar *) { word-break: normal; overflow-wrap: normal; }
/* a word is never cut: the waqf sign that follows it after a space stays with it */
.scr-surah .w > .ar, .scr-ayat .w > .ar { white-space: nowrap; }
.scr-surah .ay-bism__w[role="button"] { display: inline; padding: 0 .06em; border-radius: 8px; }

/* ---- sound: the play keys ---- */
.ks-hear { gap: 8px; }
.ks-hear .ks-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.ks-hear .ks-ic .icon { width: 20px; height: 20px; }
.ks-stopsq { display: block; width: 14px; height: 14px; border-radius: 3px; background: currentColor; }
.ks-hear.is-playing { border-color: var(--l-ink); }
.scr-ayat .ks-hear--line { margin-top: var(--s3); }
.scr-surah .ks-hear--all { min-height: 48px; }
.scr-surah .ks-hear--all.primary { padding-inline: 18px; }
.scr-surah .ks-hear--all.primary[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
.scr-surah .ay-controls__tools > * { flex: none; }

/* a numbered chip per ayah (Hear: 1 2 3), the same size and look as the tick chips */
.scr-surah .ks-hear-row { margin-top: var(--s4); }
.scr-surah .ks-hear-row + .ay-ticks { margin-top: var(--s3); }
.scr-surah .ks-chip {
  min-width: 56px; min-height: 48px; padding: 0 14px 0 10px; gap: 6px; direction: ltr;
  border-width: 1.5px; border-bottom-width: 4px; border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.scr-surah .ks-chip .key__label { font-size: var(--t-btn); }
.scr-surah .ks-chip[aria-pressed="true"] { transform: none; border-bottom-width: 4px; padding-bottom: 0; background: var(--l-fill); border-color: var(--l-ink); }

/* the ayah that is sounding is lit: a soft wash behind its words (the wrapper sits between words, never inside one) */
.scr-surah .ks-ayah { border-radius: .3em; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color 120ms linear; }
.scr-surah .ks-ayah.ks-lit { background: var(--pointer-soft); box-shadow: 0 0 0 .08em var(--pointer-soft); }
.scr-surah .ay-ayah.ks-lit { border-color: var(--pointer-ring); box-shadow: 0 0 0 3px var(--pointer-ring); }
.sheet.ay-sheet .ay-sheet__ayah.ks-lit { background: var(--pointer-soft); border-radius: 12px; }

/* word by word: each ayah's own keys sit in its head */
.scr-surah .ks-hear--ayah { min-height: 44px; padding-inline: 12px; font-size: var(--t-sm); }
.scr-surah .ks-foot { margin-top: var(--s2); }

/* the link into the site's reader (the tajweed colours live there) */
.ks-reader { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.ks-reader .icon { width: 18px; height: 18px; }
.scr-surah .ks-reader--ayah, .sheet.ay-sheet .ks-reader--ayah { min-height: 44px; }

/* the ayah sheet: Hear this ayah, then the reader link */
.sheet.ay-sheet .ks-sheet__hear { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s3); }
.sheet.ay-sheet .ks-hear--sheet { min-height: 48px; }

/* phones: the tools row keeps its keys at 44px and wraps; no sideways scroll */
@media (max-width: 520px) {
  .scr-surah .ks-hear--all { flex: 1 1 100%; justify-content: center; }
  .scr-surah .ay-controls__tools { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .scr-surah .ks-ayah { transition: none; }
}

/* the ayah sheet is a layer outside main: it has no phone/wide switch of its own, so it always shows the full label */
.sheet.ay-sheet .ks-reader .only-phone { display: none; }
.sheet.ay-sheet .ks-reader .hide-phone { display: inline; }
