/* ===== Reading library ===================================== */

/* ---- filters ---- */
.filters { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flab { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); min-width: 56px; }
.fchip { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 999px;
  padding: 8px 15px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.fchip.on { background: var(--navy); color: #fff; }
.frow select { flex: 0 1 260px; width: auto; font-size: 14px; padding: 8px 11px; }

/* ---- a text card ---- */
.tcard { text-align: start; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 18px; cursor: pointer; display: block; width: 100%;
  transition: border-color .2s, transform .2s, box-shadow .2s; }
.tcard:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.tcard .top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tcard h3 { margin: 0 0 6px; color: var(--navy); font-size: 17px; line-height: 1.4; }
.tcard .src { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 10px; }
.tcard .facts { color: var(--muted); font-size: 12.5px; }
.pill.ac { background: #EAF1FB; color: var(--blue); }
.pill.ge { background: #FFF4DF; color: #8A6410; }
.pill.lv { background: var(--surface-2); color: var(--ink); }

/* ---- the reader ---- */
.rmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.drill-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; }
.speed { display: flex; align-items: center; gap: 10px; flex: 0 1 320px; }
.speed label { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.speed input[type=range] { flex: 1 1 140px; width: auto; accent-color: var(--navy); }
.speed b { color: var(--navy); font-variant-numeric: tabular-nums; min-width: 76px; text-align: end; }
.drill-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .12s linear; }

/* ---- the passage itself ----
   Wide line-height and a measure of about 66 characters: skimming falls apart
   on long lines, because the eye loses the start of the next one. */
.passage { font-size: 18px; line-height: 2; color: var(--ink); max-width: 68ch; margin-inline: auto; }
.passage p { margin: 0 0 1.15em; }
.passage p:last-child { margin-bottom: 0; }

/* each word is its own span so the fade can be timed to a reading speed */
.passage .w { transition: opacity .5s ease, filter .5s ease; }
.passage .w.gone { opacity: 0; filter: blur(2px); }
.passage.running .w { will-change: opacity; }

/* ---- the reveal ---- */
.passage mark.key { background: #FFF3CF; color: inherit; padding: 2px 0; box-shadow: 0 0 0 3px #FFF3CF; border-radius: 2px; }
.idea { background: #F4FBF7; border: 1.5px solid #BBE3CC; border-radius: var(--radius); padding: 18px 20px; margin-top: 18px; }
.idea h3 { margin: 0 0 8px; color: #1B6E45; font-size: 15px; }
.idea p { margin: 0; line-height: 1.95; font-size: 16px; }

/* ---- glossary ---- */
#glossBox summary { cursor: pointer; list-style: none; }
#glossBox summary::-webkit-details-marker { display: none; }
#glossBox summary::before { content: "▸ "; color: var(--gold-600); font-weight: 700; }
#glossBox[open] summary::before { content: "▾ "; }
.gloss { border-top: 1px solid var(--line); padding: 13px 0; }
.gloss:first-child { border-top: 0; }
.gloss .hw { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.gloss .hw b { color: var(--navy); font-size: 16px; }
.gloss .ipa { color: var(--muted); font-size: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.gloss .tag { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted); padding: 3px 8px; border-radius: 999px; }
.gloss .def { margin: 5px 0 0; line-height: 1.8; }
.gloss .ex { margin: 4px 0 0; color: var(--muted); font-style: italic; line-height: 1.8; }

@media (max-width: 720px) {
  .passage { font-size: 17px; line-height: 1.95; }
  .speed { flex: 1 1 100%; }
  .speed b { min-width: 68px; }
}
