/* ============================================================
   B8 — Skill page strata 1 (identity extras) + 2 ("The Rulebooks")
   Design: plan/skill-page-design.md §1–§2 (as amended by the B8 decisions).

   Consumes css/codex.css tokens ONLY — no :root here. Two scopes live in
   this file:
     .sp-kicker / .sp-medallion*  — sit inside the dark .skillHeader panel,
                                     so their palette is light-on-dark.
     .sp-orgband*                 — the light "ledger strip" below the header.
   ============================================================ */

/* ---- §1 identity header: kicker line -------------------------------- */
/* Mono masthead line: APPARATUS · CODE · VALUE (VALUE suppressed on vault). */
.sp-kicker {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 11px;
}
.sp-kicker .sp-kicker-sep { color: rgba(244, 241, 234, .38); margin: 0 2px; }

.skillHeader .titleMain { min-width: 0; }
/* X6d — .sp-nickname removed: the nickname IS the <h1> now, so the parenthesised subtitle it
   styled no longer exists. The CoP name it was displacing moved to the "Also known as" block. */

/* ---- §1 identity header: level medallions --------------------------- */
/* Replaces B7's "Xcel B S G ..." chip. One circle per legal division; the
   detail view is the org band's legality table below. */
.sp-medallions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.sp-medallion-group { display: inline-flex; align-items: center; gap: 8px; }
.sp-medallion-group + .sp-medallion-group { margin-left: 6px; }
.sp-medallion-plabel {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(244, 241, 234, .5);
}
.sp-meds { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.sp-med {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  cursor: default; user-select: none;
}
/* F5 — medallions link through to that division's event page. Overrides the base
   `cursor: default` and strips the anchor underline; the circle IS the affordance. */
.sp-med--link {
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.sp-med--link:hover, .sp-med--link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}
.sp-med--link:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; }
/* allowed — filled gold (reads clearly on the charcoal panel) */
.sp-med--on {
  background: var(--gold-soft); color: var(--gold-deep);
  border: 1px solid var(--gold-line);
}
/* restricted (legal-with-conditions) — outlined, muted, diagonal strike.
   Unreachable at launch (0 'restricted' rows) but built per the states matrix. */
.sp-med--restricted { background: transparent; color: rgba(244, 241, 234, .55); border: 1px dashed rgba(244, 241, 234, .42); }
.sp-med--restricted::after {
  content: ''; position: absolute; left: 5px; right: 5px; top: 50%;
  border-top: 1.5px solid rgba(244, 241, 234, .55); transform: rotate(-45deg);
}
/* empty state — no verified levels */
.sp-med-empty {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; color: rgba(244, 241, 234, .55);
  border: 1px dashed rgba(244, 241, 234, .3); border-radius: var(--r-pill);
  padding: 7px 14px;
}

/* ---- §1 identity header: category tag row (B5d chips, relocated) ----- */
.sp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ============================================================
   §2 · "The Rulebooks" org band — a light ledger strip
   ============================================================ */
.sp-orgband {
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
  overflow: hidden;
  border-left: 4px solid var(--ev, var(--gold));
}
.sp-orgband-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
/* Single-org launch label: "XCEL · 2022–2028 CYCLE". At >=2 programs a tab row
   (styled like a rulebook's thumb-tabs) replaces this — see .sp-orgtabs. */
.sp-orgband-label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}
.sp-orgband-label .sp-orgband-cycle { color: var(--muted); }
.sp-orgband-body { padding: 18px 20px 20px; background: var(--card); }

/* Org thumb-tabs (>=2 live programs; not rendered at launch). Deliberately
   NOT styled like the content tabs — mono/uppercase/small vs Fraunces. */
.sp-orgtabs { display: flex; flex-wrap: wrap; gap: 4px; }
.sp-orgtab {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 13px; border-radius: var(--r-sm);
  color: var(--ink-soft); background: transparent; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
}
.sp-orgtab:hover { border-color: var(--line-2); }
.sp-orgtab.active { background: var(--ink); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }

/* ---- legality table ------------------------------------------------- */
.sp-legality { width: 100%; border-collapse: collapse; }
.sp-legality th {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 4px 14px 8px 0; border-bottom: 1px solid var(--line);
}
.sp-legality th.sp-col-value { text-align: right; }
.sp-legality td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); vertical-align: middle; }
.sp-legality tr:last-child td { border-bottom: none; }
.sp-lvl-name { font-weight: 600; }
/* F5 — division name links to its level+event page. Underline on hover only, so the
   table still reads as data at rest rather than a wall of links. */
.sp-lvl-name--link { color: inherit; text-decoration: none; }
.sp-lvl-name--link:hover, .sp-lvl-name--link:focus-visible {
  color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px;
}
.sp-col-value, td.sp-col-value { text-align: right; }
.sp-sv { font-family: var(--font-mono); font-weight: 700; color: var(--gold-deep); }
.sp-restriction-note { display: block; color: var(--ink-soft); font-size: 12px; font-style: italic; margin-top: 3px; }

.sp-status {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .02em; padding: 3px 11px; border-radius: var(--r-pill);
}
.sp-status--good { background: var(--good-soft); color: var(--good); border: 1px solid #a9cfae; }
.sp-status--bad  { background: var(--bad-soft);  color: var(--bad);  border: 1px solid #e3b3a6; }

/* ---- band sub-blocks: counts-toward, source, history, timeline ------ */
.sp-band-block { margin-top: 18px; }
.sp-band-sublabel {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px;
}
.sp-sr-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-sr-pill {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; font-size: 12px; font-weight: 600; color: var(--gold-deep);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
  border-radius: var(--r-pill); padding: 5px 12px;
  transition: background .15s, border-color .15s;
}
.sp-sr-pill:hover { background: #f0e0b8; border-color: var(--gold); }
.sp-sr-pill .sp-sr-lvl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.sp-source {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .02em;
}
.sp-source a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold-line); }

/* rule-change timeline — always rendered (empty state teaches the feature exists) */
.sp-timeline { list-style: none; margin: 0; padding: 0; }
.sp-timeline-item { position: relative; padding: 2px 0 12px 18px; border-left: 2px solid var(--line-2); }
.sp-timeline-item:last-child { padding-bottom: 0; }
.sp-timeline-item::before {
  content: ''; position: absolute; left: -5px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--card);
}
.sp-timeline-date { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sp-timeline-summary { font-size: 13px; color: var(--ink); margin-top: 2px; }
.sp-empty-line { color: var(--muted); font-style: italic; font-size: 13px; }

/* past-cycles disclosure */
.sp-history { margin-top: 14px; }
.sp-history > summary {
  list-style: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep);
}
.sp-history > summary::-webkit-details-marker { display: none; }
.sp-history[open] > summary { margin-bottom: 10px; }
.sp-history-empty { color: var(--muted); font-style: italic; font-size: 13px; }
.sp-cycle-block { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.sp-cycle-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bad); background: var(--bad-soft); border: 1px solid #e3b3a6; border-radius: var(--r-sm); padding: 2px 8px;
}

/* ---- mobile --------------------------------------------------------- */
@media (max-width: 600px) {
  .sp-orgband-body { padding: 14px 14px 16px; }
  .sp-orgband-head { padding: 10px 14px; }
  .sp-legality th, .sp-legality td { font-size: 12.5px; }
  .sp-med { width: 30px; height: 30px; font-size: 11px; }
}
