/* ═══════════════════════════════════════════════════════════════════════
   BrkrOps Learning — styles for the curriculum section (layered on site.css).
   ═══════════════════════════════════════════════════════════════════════ */

/* top padding clears the position:fixed header (~80px); bottom clears the position:fixed
   footer (taller when it wraps on narrow screens) so no content hides under it */
.lrn-wrap { max-width: 1080px; margin: 0 auto; padding: 96px 22px 130px; }
.lrn-narrow { max-width: 820px; }

.lrn-hero { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 26px; }
.lrn-eyebrow { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; font-size: 13px; color: var(--gold); }
.lrn-hero h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 42px; line-height: 1.05; margin: 4px 0 8px; color: var(--text); }
.lrn-hero p { font-size: 16.5px; color: var(--text-dim); max-width: 72ch; margin: 0; }

/* ── track switcher ──────────────────────────────────────────────────── */
.lrn-tracks { display: flex; gap: 8px; align-items: center; margin: 18px 0 28px; flex-wrap: wrap; }
.lrn-tracks .lbl { font-size: 13px; color: var(--text-dim); margin-right: 4px; }
.lrn-track { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text-dim); cursor: pointer; }
.lrn-track.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.lrn-track[disabled] { cursor: not-allowed; opacity: 0.6; }
.lrn-track .soon { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-left: 6px; opacity: 0.8; }

/* ── module cards ────────────────────────────────────────────────────── */
.lrn-modules { display: grid; gap: 14px; }
.lrn-mod { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 16px 20px; }
.lrn-mod.locked { opacity: 0.72; }
.lrn-mod-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 30px; color: var(--gold-dim); line-height: 1; text-align: center; }
.lrn-mod-body h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 21px; margin: 0 0 2px; color: var(--text); }
.lrn-mod-body p { margin: 0; font-size: 14px; color: var(--text-dim); }
.lrn-mod-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.lrn-badge { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.lrn-badge.active { background: var(--gold-glow); color: var(--gold-dim); }
.lrn-badge.soon { background: var(--bg3); color: var(--text-dim); }
.lrn-badge.done { background: #e3f3e8; color: #1e7a44; }
.lrn-badge.locked { background: var(--bg3); color: var(--text-dim); }
.lrn-mod a.lrn-go { text-decoration: none; }

.lrn-note { font-size: 13px; color: var(--text-dim); background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 22px 0; }
.lrn-note.warn { border-left: 3px solid var(--gold); }

/* ── buttons ─────────────────────────────────────────────────────────── */
.lrn-btn { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  padding: 10px 22px; border-radius: var(--radius); border: 1px solid var(--gold); background: var(--gold); color: #fff; cursor: pointer; text-decoration: none; }
.lrn-btn:hover { background: var(--gold-dim); border-color: var(--gold-dim); }
.lrn-btn.ghost { background: transparent; color: var(--gold-dim); }
.lrn-btn.ghost:hover { background: var(--gold-glow); color: var(--gold-dim); }
.lrn-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── chunk / module nav ──────────────────────────────────────────────── */
.lrn-chunklist { display: grid; gap: 10px; margin: 20px 0; }
.lrn-chunk-item { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; text-decoration: none; background: var(--bg); }
.lrn-chunk-item:hover { border-color: var(--gold); background: var(--bg2); }
.lrn-chunk-item .n { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; color: var(--gold-dim); font-size: 18px; min-width: 34px; }
.lrn-chunk-item .ti { font-weight: 500; color: var(--text); flex: 1; }
.lrn-chunk-item .st { font-size: 12px; color: var(--text-dim); }
.lrn-chunk-item .st.done { color: #1e7a44; font-weight: 600; }

/* ── chunk prose (classes emitted by the build) ──────────────────────── */
.ch-article { font-size: 16px; line-height: 1.62; color: #1c1c1c; }
.ch-article p { margin: 12px 0; }
.ch-h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 26px; margin: 30px 0 8px; color: var(--text); }
.ch-h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; margin: 26px 0 6px; color: var(--text); }
.ch-article code { font-family: 'Consolas', 'JetBrains Mono', monospace; font-size: 0.88em; background: var(--bg2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }
.ch-article a { color: #2e6da4; text-decoration: none; border-bottom: 1px solid rgba(46,109,164,0.3); }
.ch-list { margin: 12px 0 12px 4px; padding-left: 22px; }
.ch-list li { margin: 5px 0; }
.ch-list li.ch-sub { list-style: circle; margin-left: 18px; }
.ch-callout { border-radius: var(--radius); padding: 12px 18px; margin: 16px 0; border-left: 4px solid; }
.ch-callout-label { font-weight: 700; margin: 0 0 6px; font-size: 14.5px; }
.ch-callout p { margin: 6px 0; font-size: 15px; }
/* Lab callout lists (keybox/safety): bullet at the label's first letter, and the text hanging-indented
   so wrapped lines align to the text itself, not to the bullet. */
.ch-callout ul { margin: 6px 0; padding-left: 0; list-style: none; }
.ch-callout li { position: relative; padding-left: 1.3em; margin: 5px 0; }
.ch-callout li::before { content: "\2022"; position: absolute; left: 0; top: 0; }
.ch-fact { background: #eaf2f8; border-left-color: #2e75b6; }
.ch-fact .ch-callout-label { color: #1f4e79; }
.ch-key { background: #eaf4e6; border-left-color: #4e8542; }
.ch-key .ch-callout-label { color: #2f5e28; }
.ch-gotcha { background: #fbeaec; border-left-color: #c0392b; }
.ch-gotcha .ch-callout-label { color: #962b21; }
.ch-safety { background: #fdf3e0; border-left-color: #e0a106; }
.ch-safety .ch-callout-label { color: #8a6400; }
.ch-code { background: #f5f5f5; border-left: 3px solid #2e75b6; border-radius: 3px; padding: 12px 16px; overflow-x: auto; margin: 14px 0; }
.ch-code code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.5; }
.ch-code-caption { font-style: italic; color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.ch-table-wrap { overflow-x: auto; margin: 16px 0; }
.ch-table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.ch-table th, .ch-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.ch-table thead th { background: #1f3a5f; color: #fff; font-family: 'Barlow', sans-serif; }
.ch-table tbody th { background: #eef3f8; font-weight: 600; }
.ch-figure { margin: 20px 0; text-align: center; }
.ch-figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.ch-figure figcaption { font-size: 13.5px; color: var(--text-dim); margin-top: 8px; text-align: left; }
.ch-figure-pending, .ch-shot-slot { border: 1px dashed var(--gold); background: var(--bg2); border-radius: var(--radius); padding: 18px; margin: 18px 0; }
.ch-shot-label { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 12px; color: var(--gold-dim); }
.ch-shot-desc { font-size: 14px; color: var(--text-dim); margin-top: 6px; }

/* ── questions (chunk practice + exam share these) ───────────────────── */
.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; background: var(--bg); }
.q-card .q-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; color: var(--gold-dim); font-size: 15px; }
.q-card .q-text { font-weight: 500; font-size: 16.5px; margin: 4px 0 12px; color: var(--text); }
.q-type { font-size: 12px; color: var(--text-dim); font-style: italic; margin-bottom: 10px; }
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.q-opt:hover { background: var(--bg2); }
.q-opt input { margin-top: 3px; }
.q-opt.correct { border-color: #1e7a44; background: #eef7f0; }
.q-opt.incorrect { border-color: #c0392b; background: #fbeef0; }
.q-grade-row { margin-top: 12px; display: flex; gap: 12px; align-items: center; }
.q-verdict { font-weight: 700; font-size: 14px; }
.q-verdict.right { color: #1e7a44; }
.q-verdict.wrong { color: #c0392b; }
.q-reveal { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; display: none; }
.q-reveal.show { display: block; }
.q-reveal .q-ans { font-weight: 600; color: var(--text); }
.q-reveal .q-expl { font-size: 14.5px; color: var(--text-dim); margin-top: 6px; }

/* ── match interaction (drag-drop + dropdown fallback) ───────────────── */
.q-match { display: grid; gap: 10px; }
.q-match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.q-match-left { font-size: 15px; }
.q-match-drop { min-width: 220px; min-height: 38px; border: 1px dashed var(--gold); border-radius: var(--radius); padding: 6px 10px; background: var(--bg2);
  display: flex; align-items: center; font-size: 14px; color: var(--text-dim); }
.q-match-drop.filled { border-style: solid; color: var(--text); background: var(--bg); }
.q-match-drop.dragover { background: var(--gold-glow); }
.q-match-bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.q-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); cursor: grab; font-size: 14px; }
.q-chip:focus { outline: 2px solid var(--gold); }
.q-match-select { font-size: 14px; line-height: 1.4; border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; min-width: 0; box-sizing: border-box;
  /* Let a long selected answer wrap to multiple lines instead of truncating, and mark the
     wrap with a hanging (overhang) indent so continuation lines sit in from the first line. */
  white-space: normal; height: auto;
  padding: 7px 10px; padding-left: calc(10px + 1.4em); text-indent: -1.4em; }
.q-match-select option { white-space: normal; }

/* ── exam shell + progress ───────────────────────────────────────────── */
.exam-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 0; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.exam-bar .meta { font-size: 14px; color: var(--text-dim); }
.exam-bar .answered { font-weight: 700; color: var(--text); }
.exam-warn { font-size: 13px; color: var(--text-dim); background: var(--bg2); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: var(--radius); margin: 14px 0; }

/* ── results + per-chunk bar graph ───────────────────────────────────── */
.res-head { text-align: center; padding: 14px 0 8px; }
.res-badge { display: inline-block; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 16px; border-radius: 999px; }
.res-badge.pass { background: #e3f3e8; color: #1e7a44; }
.res-badge.fail { background: #fbeaec; color: #962b21; }
.res-score { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 52px; line-height: 1; margin: 14px 0 4px; color: var(--text); }
.res-score small { font-size: 22px; color: var(--text-dim); font-weight: 600; }
.res-graph { margin: 26px 0; }
.res-graph h3 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; margin: 0 0 14px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 64px; gap: 12px; align-items: center; margin: 7px 0; }
.bar-row .lab { font-size: 13.5px; color: var(--text-dim); }
.bar-track { background: var(--bg3); border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--gold); transition: width 0.5s ease; }
.bar-fill.low { background: #c0392b; }
.bar-fill.mid { background: #e0a106; }
.bar-fill.high { background: #1e8c4e; }
.bar-row .pct { font-size: 13px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.res-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.res-banner { border: 1px solid var(--gold); background: var(--gold-glow); border-radius: var(--radius); padding: 18px 22px; margin: 22px 0; }
.res-banner h3 { margin: 0 0 6px; font-family: 'Barlow Condensed', sans-serif; font-size: 20px; }
.res-banner p { margin: 0 0 12px; font-size: 14.5px; color: var(--text-dim); }

.lrn-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); }
.lrn-pager a { text-decoration: none; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; color: var(--gold-dim); font-size: 15px; }
.lrn-pager a .dir { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.lrn-pager .lrn-pager-mid { font-size: 13px; text-align: center; }
.lrn-pager .lrn-pager-next { text-align: right; }
/* Same bar duplicated at the top of the section: no top border, sits above the hero. */
.lrn-pager-top { margin-top: 0; margin-bottom: 22px; padding-top: 0; border-top: none; }

@media (max-width: 720px) {
  .lrn-mod { grid-template-columns: 44px 1fr; }
  .lrn-mod .lrn-mod-right { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 96px 1fr 50px; }
  .q-match-row { grid-template-columns: 1fr; }
}

/* ── sticky module bar: persistent module identity + nav under the fixed header ── */
.lrn-modbar {
  position: sticky; z-index: 40; display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  margin: 0 0 10px; padding: 9px 0;
}
.lrn-modbar-mod {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 15px; color: var(--gold); text-decoration: none;
}
.lrn-modbar-home { color: var(--gold-dim); text-decoration: none; font-size: 14px; }
.lrn-modbar-sep { color: var(--border); }
.lrn-modbar a:hover { text-decoration: underline; }

/* ── glossary term: hoverable/focusable definition popup (e.g. Red Forest) ── */
.ch-term { position: relative; border-bottom: 1px dotted #3a7afe; cursor: help; font-weight: 600; }
.ch-term > .ch-term-mark { color: #3a7afe; font-size: .72em; vertical-align: super; margin-left: 1px; }
.ch-term > .ch-tip {
  position: absolute; right: 0; left: auto; top: calc(100% + 6px); z-index: 30; display: none;
  width: min(360px, 84vw); background: #12161c; color: #e8edf2; border: 1px solid #2a313b;
  border-radius: 6px; padding: 11px 13px; font-size: 13.5px; font-weight: 400; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28); white-space: normal;
}
.ch-term:hover > .ch-tip, .ch-term:focus > .ch-tip, .ch-term:focus-within > .ch-tip { display: block; }
