/* fhg-lesson-ux.css — section rail, focus mode, terms and word bank.
 *
 * JS-GATED, same pattern as fhg-premium.js: nothing here hides content unless
 * the script that provides a way to reveal it has loaded. .is-hidden-step only
 * applies under html.fhg-steps, which only exists while step-through is on.
 * If the script fails, the page is an ordinary scroll with everything visible.
 */

/* Structural hook. lesson.html wraps each rendered section in this so the rail
   and focus mode have something to address. Deliberately minimal: the prose keeps
   whatever style.css already gives it, and this must never change how a lesson
   looks with the script absent. */
.lesson-section { display: block; }

/* ---- section rail ---- */
.lesson-rail { position: sticky; top: 0; z-index: 5; padding: 10px 0 12px;
  margin: 0 0 18px; background: var(--bg, #0d0b08); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08)); }
.lesson-rail ol { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0 0 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.lesson-rail ol::-webkit-scrollbar { display: none; }
.lesson-rail a { white-space: nowrap; font-size: var(--fs-small); letter-spacing: .02em;
  color: var(--text-dim, #9a9086); text-decoration: none; padding-bottom: 4px;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.lesson-rail a:hover { color: var(--text, #efe9e1); }
.lesson-rail a.is-current { color: var(--gold, #c9a227); border-bottom-color: var(--gold, #c9a227); }

.focus-toggle { margin-top: 8px; background: none; border: 1px solid var(--border, #333);
  color: var(--text-dim, #9a9086); font: inherit; font-size: var(--fs-fine); padding: 4px 12px;
  border-radius: 999px; cursor: pointer; }
.focus-toggle[aria-pressed="true"] { color: var(--gold, #c9a227); border-color: var(--gold, #c9a227); }

/* ---- step-through (default from 24 Oct 2026) ----
   .is-hidden-step only applies under html.fhg-steps, which the script sets.
   No script, no class: every section shows. */
html.fhg-steps .is-hidden-step { display: none; }
.step-head { margin: 4px 0 6px; }
.st-row { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap;
  font-size: var(--fs-small); letter-spacing: .03em; color: var(--text-faint, #8f8572); margin-bottom: 8px; text-align: center; }
.st-title { color: var(--text-dim, #a89f92); }
.st-bar { height: 4px; border-radius: 999px; background: var(--bg-elev-2, #221c15); overflow: hidden; }
.st-bar span { display: block; height: 100%; width: 0; background: var(--gold, #c9a24d);
  border-radius: 999px; transition: width .25s ease; }
html.fhg-steps .lesson-prose .lesson-section > h2:first-child { margin-top: 26px; }
.step-nav-inline { display: flex; justify-content: space-between; gap: 14px; margin: 34px 0 8px;
  padding-top: 22px; border-top: 1px solid var(--border, rgba(255,255,255,.08)); }
html:not(.fhg-steps) .step-nav-inline { display: none; }
.step-nav-inline button { display: flex; flex-direction: column; gap: 3px; max-width: 48%;
  background: none; border: 1px solid var(--border, #333); color: var(--text, #f3ede2);
  font: inherit; text-align: left; padding: 11px 16px; border-radius: 8px; cursor: pointer; }
.step-nav-inline .st-next { margin-left: auto; text-align: right; align-items: flex-end;
  background: var(--gold, #c9a24d); border-color: var(--gold, #c9a24d); color: var(--bg, #14100c); }
.step-nav-inline button:disabled { visibility: hidden; }
.step-nav-inline button[hidden] { display: none; }
.step-nav-inline .st-dir { font-size: var(--fs-body); font-weight: 700; }
.step-nav-inline .st-label { font-size: var(--fs-small); opacity: .85; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step-nav-inline .st-label:empty { display: none; }
.step-nav-inline button:focus-visible { outline: 2px solid var(--gold, #c9a24d); outline-offset: 2px; }
@media (max-width: 560px) {
  .step-nav-inline button { max-width: none; flex: 1; }
  .step-nav-inline .st-label { display: none; }
}
@media print {
  html.fhg-steps .is-hidden-step { display: block !important; }
  .step-head, .step-nav-inline, .lesson-rail { display: none !important; }
}

/* ---- terms ---- */
.term { color: var(--gold, #c9a227); border-bottom: 1px dotted currentColor;
  cursor: help; font-weight: 400; }
.term:focus { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }
.term::after { content: attr(data-def); position: absolute; left: 50%; transform: translateX(-50%);
  margin-top: 1.7em; max-width: 320px; padding: 10px 13px; border-radius: 8px; z-index: 30;
  background: var(--panel, #171310); border: 1px solid var(--border, #333);
  color: var(--text, #efe9e1); font-size: var(--fs-small); font-weight: 400; line-height: 1.5;
  text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.term:hover::after, .term:focus::after { opacity: 1; visibility: visible; }
.term { position: relative; }

/* ---- exam objective line and checklist (release 50) ----
   One quiet, centered line above a mapped section, opening to CompTIA's
   wording and the other sections that teach it; at the end of the module, the
   objectives as a checklist. Owner's rule: simplicity wins. */
.xo-line { margin: 34px 0 0; text-align: center; }
html.fhg-steps .lesson-prose .lesson-section > .xo-line:first-child { margin-top: 26px; }
.xo-toggle { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: var(--fs-small); line-height: 1.5;
  color: var(--text-dim, #a89f92); cursor: pointer; border-radius: 6px; }
.xo-toggle .xo-k { color: var(--gold, #c9a24d); }
.xo-toggle:hover { color: var(--text, #f3ede2); }
.xo-toggle:focus-visible { outline: 2px solid var(--gold, #c9a24d); outline-offset: 2px; }
.xo-toggle::after { content: " \25BE"; font-size: var(--fs-fine); color: var(--text-dim, #a89f92); }
.xo-toggle[aria-expanded="true"]::after { content: " \25B4"; }
.xo-more { margin: 8px auto 26px; max-width: 600px; padding: 12px 16px; border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 8px; background: var(--bg-elev, #1c1712); font-size: var(--fs-body); line-height: 1.6; color: var(--text-dim, #a89f92); text-align: center; }
.xo-more[hidden] { display: none; }
.xo-more p { margin: 0 auto; max-width: none; }
.xo-more p + p { margin-top: 6px; }
.xo-more .xo-title { color: var(--text-dim, #a89f92); }
.xo-more .xo-also { font-size: var(--fs-small); color: var(--text-dim, #a89f92); }
.xo-more .xo-k { color: var(--text, #f3ede2); }
.xo-more a, .xo-links a { color: var(--gold, #c9a24d); }
.lesson-prose .lesson-section > .xo-line + h2 { margin-top: 4px; }
.xo-check { text-align: center; }
.xo-check .xo-intro { font-size: var(--fs-body); color: var(--text-dim, #a89f92); margin: -6px auto 12px; }
.xo-check .xo-list li { justify-content: center; text-align: left; }
.xo-check .xo-id { color: var(--gold, #c9a24d); font-weight: 700; margin-right: 4px; }
.xo-check .xo-list li.checked label { text-decoration: none; color: var(--text-dim, #a89f92); }
.xo-check .xo-links { margin: 14px auto 0; font-size: var(--fs-body); line-height: 1.7; }
.lesson-rail .rail-gloss { display: inline-block; margin: 8px 0 0 10px; font-size: var(--fs-small); color: var(--text-dim, #9a9086); }
.lesson-rail .rail-gloss:hover { color: var(--gold, #c9a227); }

/* ---- word bank ---- */
.word-bank dl { margin: 0; }
.word-bank dt { color: var(--gold, #c9a227); font-weight: 700; margin-top: 14px; }
.word-bank dd { margin: 3px 0 0; color: var(--text-dim, #9a9086); line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .lesson-rail a, .term::after, .st-bar span { transition: none; }
}
