/* features.css: owned by F3. Styles for pinyin ruby, native-language respelling, sound guide, shortcuts overlay. Loaded after app.css. */

/* ---------- pinyin ruby inside headings (headings are uppercase + pink text-shadow, which smeared the <rt>) ---------- */
:is(h1, h2, h3, .page-title, .section-title, .modal-title) ruby[lang=zh] rt {
  text-shadow: none; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: max(.5em, 12px); color: var(--muted);
}
:is(h1, h2, h3, .page-title, .section-title, .modal-title):has(ruby) { line-height: 1.5; }
.class-title-box .row { flex-wrap: nowrap; align-items: flex-start; }

/* ---------- 'Say it like this' (native-language respelling; approximate - beta) ---------- */
.say { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; width: 100%; }
.list-row .say, .words-item .say { justify-content: flex-start; }
.say-label { font-size: 12px; }
.say-text { font-family: var(--font-ui), "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif; font-weight: 700; font-size: 1.35rem; line-height: 1.3; }
.say-syl { white-space: nowrap; }
.say-beta { font: 400 12px/1.2 var(--font-mono); color: var(--muted); }
.flash-body .say { margin-top: 2px; }

/* first-run language prompt (Learn / Review / Words) */
.lang-prompt { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.lang-prompt .input { min-height: 44px; max-width: 320px; }
.lang-prompt-text { margin: 0; }
.card-lilac .muted, .lang-prompt .muted { color: var(--on-accent); }

/* import review / Wispr list: the whole row is a <label> (large tap target) */
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%; cursor: pointer; }
.check-row input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
.check-row-main { flex: 1 1 180px; min-width: 0; }
.check-row:focus-within { outline: 4px solid var(--focus); outline-offset: 2px; }

/* shortcuts overlay */
.shortcuts-overlay .sc-group { margin-bottom: 14px; }
.shortcuts-overlay .sc-key { width: 8rem; white-space: nowrap; }

/* ---------- sound guide (#/sounds) ---------- */
.sounds > .card, .sounds > section { margin-bottom: 16px; }
.snd-langs .chip { min-width: 44px; }
.snd-notice { display: flex; flex-direction: column; gap: 6px; }
.snd-notice p { margin: 0; }
.snd-big { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 4px; }
.snd-say-big { font-size: 1.75rem; }
.snd-tips { margin: 8px 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 8px; }
.snd-hanzi { font-size: 1.75rem; }
.snd-sound { font-family: var(--font-mono); font-size: 1.1rem; white-space: nowrap; }
.snd-act { text-align: right; }
.snd-act .btn { white-space: nowrap; }
.snd-all summary { cursor: pointer; margin: 0; min-height: 44px; display: flex; align-items: center; }
.snd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin-top: 12px; }
.snd-cell { font-size: .95rem; }
.snd-cell-py { font-family: var(--font-mono); color: var(--muted); }
@media (max-width: 560px) {
  .snd-tbl, .snd-tbl tbody { display: block; }
  .snd-tbl tr { display: grid; grid-template-columns: 3.4rem 1fr auto; grid-template-areas: "s e a" "s y a"; align-items: center; border-bottom: 2px solid var(--ink); }
  .snd-tbl tr:last-child { border-bottom: 0; }
  .snd-tbl th, .snd-tbl td { border-bottom: 0 !important; padding: 6px 10px; }
  .snd-tbl .snd-sound { grid-area: s; align-self: stretch; display: flex; align-items: center; }
  .snd-tbl .snd-ex { grid-area: e; }
  .snd-tbl .snd-say { grid-area: y; padding-top: 0; }
  .snd-tbl .snd-act { grid-area: a; }
}

/* ---------- R3: long unbroken class names / notes (80 / 200 chars, or a pasted URL) must wrap, not widen the page ---------- */
#app :is(h1, h2, h3, h4, p, li, .class-note, .sticker, .badge-class) { overflow-wrap: anywhere; }
.class-title-box, .class-title-box .row > :first-child, .list-row > *, .card > * { min-width: 0; }
.class-title-box .row > [data-rename] { flex: none; }

/* R3: neighbouring pinyin ran together ("yīn wèisuǒ yǐ"); a hair of space around each annotation keeps words apart */
ruby[lang=zh] rt { padding-inline: .14em; }

/* Learn quick check: breathing room between the hanzi, its pinyin and the Hear button */
.quiz-pinyin { margin: 2px 0 10px; font-size: 1.25rem; }

/* "Made for NSLY": decorative mark, Home only. Desktop: bottom right under the floating star. Phone: in the top bar gap. */
.nsly-mark {
  display: none; position: fixed; z-index: 45; pointer-events: none; user-select: none;
  top: 24px; right: 104px; white-space: nowrap;
  font: 800 1.05rem/1 var(--font-ui); letter-spacing: -.01em;
  color: var(--yellow); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--pink);
  transform: rotate(-4deg); transform-origin: right center;
}
html[data-route=""] .nsly-mark { display: block; }
@media (min-width: 700px) {
  .nsly-mark {
    z-index: -1; top: auto; bottom: calc(14% - 26px); right: calc(6% + 26px);
    font-size: clamp(1.3rem, 3.6vw, 2.1rem); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--pink);
    transform: rotate(-6deg);
  }
}
