/* ============================================================
   Reasoning GP — PROVENANCE STRIP
   A visible "Last reviewed · Next review · Sources" band placed
   directly under the page title on protocols, algorithms and cases.
   Paired with assets/provenance.js. Uses site.css variables only.
   Safety state is signalled by GLYPH + WORD as well as colour.
   ============================================================ */

.rgp-prov{
  --pv-accent:var(--teal,#0c4a47); --pv-accent-soft:var(--teal-soft,#d5e6e4);
  display:block;margin:14px 0 20px;padding:12px 14px;
  background:var(--surface-2,#fbf8f1);border:1px solid var(--line,#e7e0d1);border-radius:10px;
  font-family:'DM Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
  font-size:13px;line-height:1.45;color:var(--ink-2,#2a3744);
}
.rgp-prov[hidden]{display:none}

.pv-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px}
.pv-row + .pv-row{margin-top:10px;padding-top:10px;border-top:1px solid var(--line,#e7e0d1)}

/* Algorithm pages mount the strip as a direct child of <body>, where nothing
   constrains it — those pages centre their own blocks in a 1140px column with
   an 8px gutter below that. Protocol (inside #mgRoot) and case (inside
   main.main) placements are already constrained by their container, so this
   must stay scoped to the body-child case. */
body > .rgp-prov{max-width:1140px;margin-left:auto;margin-right:auto}

/* --- status pill: glyph + word, never colour alone --- */
.pv-status{
  display:inline-flex;align-items:center;gap:7px;flex:none;
  padding:4px 11px 4px 9px;border-radius:99px;
  font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  background:var(--pv-accent-soft);color:var(--pv-accent);border:1px solid transparent;
}
.pv-glyph{
  width:15px;height:15px;border-radius:50%;flex:none;
  display:grid;place-items:center;font-size:10px;line-height:1;
  background:var(--pv-accent);color:#fff;font-weight:700;
}
.rgp-prov-current{--pv-accent:#136a65;--pv-accent-soft:#d5e6e4}
.rgp-prov-due{--pv-accent:#7a570c;--pv-accent-soft:#f6e9c8}
.rgp-prov-overdue{--pv-accent:#9b3e22;--pv-accent-soft:#f7e3da}
.rgp-prov-unrecorded{--pv-accent:#525a66;--pv-accent-soft:#e7e0d1}

/* --- fact list --- */
.pv-facts{display:flex;flex-wrap:wrap;gap:6px 22px;margin:0;padding:0;flex:1 1 auto;min-width:0}
.pv-facts > div{min-width:0;display:block}
.pv-facts dt{
  display:block;margin:0 0 1px;padding:0;line-height:1.3;white-space:nowrap;
  font-size:10px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted,#5d6673);
}
.pv-facts dd{display:block;margin:0;padding:0;line-height:1.35;font-size:13px;font-weight:600;color:var(--ink,#15202b);white-space:nowrap}
.pv-facts dd.pv-by{white-space:normal}
.pv-facts dd.pv-unset{font-weight:500;font-style:italic;color:var(--muted,#5d6673);white-space:normal}

.pv-links{flex:none;margin-left:auto;display:flex;gap:16px;flex-wrap:wrap}
.pv-report{
  flex:none;font-size:12px;font-weight:600;
  color:var(--teal-2,#0e5c58);border-bottom:1px solid var(--line-2,#d8cfba);padding-bottom:1px;
}
.pv-report:hover{color:var(--rust,#b54c2b);border-bottom-color:currentColor}

/* --- sources row --- */
.pv-lbl{
  flex:none;font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted,#5d6673);
}
.pv-chips{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 auto;min-width:0}
.pv-chip{
  display:inline-block;padding:2px 9px;border-radius:99px;
  font-size:11.5px;font-weight:600;line-height:1.5;
  background:var(--bg,#f6f2e9);border:1px solid var(--line,#e7e0d1);color:var(--ink-2,#2a3744);
  text-decoration:none;
}
a.pv-chip:hover{border-color:var(--teal-3,#136a65);color:var(--teal,#0c4a47)}
.pv-chip-rest{color:var(--muted,#5d6673);font-weight:500;background:transparent;border-style:dashed}
.pv-more{flex:none;font-size:12px;font-weight:600;color:var(--teal-2,#0e5c58);white-space:nowrap}
.pv-more:hover{color:var(--rust,#b54c2b)}
.pv-note{flex:1 1 100%;font-size:11.5px;color:var(--muted,#5d6673);margin:0}

/* --- focus visibility (WCAG 2.2) --- */
.rgp-prov a:focus-visible{outline:2px solid var(--teal-3,#136a65);outline-offset:2px;border-radius:4px}

/* --- narrow screens --- */
@media (max-width:640px){
  .rgp-prov{padding:11px 12px;font-size:12.5px}
  .pv-row{gap:9px 14px}
  .pv-facts{gap:8px 16px}
  .pv-links{margin-left:0;flex-basis:100%;gap:14px}
  .pv-more{flex-basis:100%}
}

/* --- print: provenance belongs in the PDF --- */
@media print{
  .rgp-prov{background:transparent;border:1px solid #bbb;border-radius:0;padding:6pt 8pt;font-size:8pt;break-inside:avoid}
  .pv-status{border:1px solid #444;background:transparent!important;color:#000!important}
  .pv-glyph{background:#444!important}
  .pv-report{display:none}
  .pv-links{display:none}
  .pv-facts dd{font-size:8pt}
}
