/**
 * NHI Archive | Case File Report Card Styles
 * ───────────────────────────────────────────
 * Uses locked palette variables from visual-palette.md.
 * No hardcoded hex values. All colours via CSS custom properties.
 *
 * Companion to: /js/report-card.js
 */


/* ═══════════════════════════════════
   INTEGRATION ADDENDUM (Cowork, 18 June 2026)
   The component references var(--cyan) for the archival-blue accent
   (depth segments, evidence bar fills, coordinate values, programme
   tags, mobile pips). main.css does not define a --cyan token; the
   live palette uses --brass and --accent instead. Rather than add a
   global token (and risk touching unrelated pages), --cyan is scoped
   to the report card containers here, using the values the visual
   spec specifies: archival blue #1E3A5F in light, bright teal #00D4C8
   in dark. This block is additive and reversible: delete it and the
   only effect is the cyan accents falling back to the browser default.
   Flagged for Lee: if a global --cyan is later added to main.css, this
   scoped override can be removed.
   ═══════════════════════════════════ */

.rc,
.rc-mobile,
.rc-layout,
.rc-exh-layout {
  --cyan: #1E3A5F;
}

[data-theme="dark"] .rc,
[data-theme="dark"] .rc-mobile,
[data-theme="dark"] .rc-layout,
[data-theme="dark"] .rc-exh-layout {
  --cyan: #00D4C8;
}


/* ═══════════════════════════════════
   LAYOUT: TWO-COLUMN GRID
   ═══════════════════════════════════ */

/* Standard case file page layout */
.rc-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 28px;
  align-items: start;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.rc-content-col {
  min-width: 0;
}

.rc-sidebar-col {
  position: relative;
}

/* Exhibition page deferred layout */
.rc-exh-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 310px;
  gap: 32px;
  align-items: start;
  justify-content: center;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.rc-exh-narrative {
  min-width: 0;
  max-width: 720px;
}


/* ═══════════════════════════════════
   REPORT CARD CONTAINER
   ═══════════════════════════════════ */

.rc {
  position: sticky;
  top: 20px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: none;
}


/* ═══════════════════════════════════
   CLASSIFICATION HEADER BAR
   ═══════════════════════════════════ */

.rc-class-bar {
  padding: 10px 16px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rc-class-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
}

.rc-class-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
}


/* ═══════════════════════════════════
   FOLDER TAB + STATUS STAMP
   ═══════════════════════════════════ */

.rc-folder-tab {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rc-folder-label {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brass-dk);
}

.rc-stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px 2px;
  border: 2px solid;
  border-radius: 2px;
  transform: rotate(-2deg);
}

.rc-stamp.documented {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(30, 58, 95, 0.06);
}

.rc-stamp.witness {
  border-color: var(--brass-dk);
  color: var(--brass-dk);
  background: rgba(138, 111, 45, 0.06);
}

.rc-stamp.review {
  border-color: var(--muted);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.03);
}

/* Dark-mode neutral grey for the under-review stamp. The scoped block
   above defines --cyan but not --muted, so the review stamp gets an
   explicit dark equivalent here. */
[data-theme="dark"] .rc-stamp.review {
  border-color: #A0A0A0;
  color: #A0A0A0;
  background: rgba(255, 255, 255, 0.04);
}

.rc-stamp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.rc-stamp.documented .rc-stamp-dot { background: var(--cyan); }
.rc-stamp.witness .rc-stamp-dot { background: var(--brass-dk); }
.rc-stamp.review .rc-stamp-dot { background: var(--muted); }
[data-theme="dark"] .rc-stamp.review .rc-stamp-dot { background: #A0A0A0; }


/* ═══════════════════════════════════
   CARD BODY
   ═══════════════════════════════════ */

.rc-body {
  background: var(--surface);
  padding: 0 16px 16px;
}


/* ═══════════════════════════════════
   QUICK FACTS GRID
   ═══════════════════════════════════ */

.rc-facts-section {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--rule);
}

.rc-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.rc-fact-cell {
  padding: 6px 8px;
  background: var(--parch);
  border: 1px solid rgba(0,0,0,0.04);
}

.rc-fact-cell:nth-child(1) { border-radius: 3px 0 0 0; }
.rc-fact-cell:nth-child(2) { border-radius: 0 3px 0 0; }
.rc-fact-cell:nth-child(3) { border-radius: 0 0 0 3px; }
.rc-fact-cell:nth-child(4) { border-radius: 0 0 3px 0; }

.rc-fact-cell label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-dim);
  margin-bottom: 1px;
}

.rc-fact-cell .val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.3;
}

.rc-fact-cell .val.coords {
  color: var(--cyan);
  font-size: 11px;
}


/* ═══════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════ */

.rc-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
}

.rc-section-hdr::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.rc-section-hdr span {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brass-dk);
  white-space: nowrap;
}


/* ═══════════════════════════════════
   SOURCE DEPTH METER
   ═══════════════════════════════════ */

.rc-depth {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.rc-depth-num {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--txt);
}

.rc-depth-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.rc-depth-bar {
  height: 6px;
  background: var(--parch);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
  display: flex;
  gap: 1px;
}

.rc-depth-seg {
  height: 100%;
  border-radius: 1px;
  flex: 1;
  transition: background 0.3s ease;
}

.rc-depth-seg.filled { background: var(--cyan); }
.rc-depth-seg.empty { background: var(--parch-dk); opacity: 0.3; }


/* ═══════════════════════════════════
   EVIDENCE INVENTORY ROWS
   ═══════════════════════════════════ */

.rc-evidence {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rc-ev-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  margin-bottom: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--parch);
  border: 1px solid rgba(0,0,0,0.04);
  transition: background 0.15s ease;
}

.rc-ev-row:hover { background: var(--surface-2); }

.rc-ev-row.absent {
  opacity: 0.38;
  background: transparent;
  border-color: rgba(0,0,0,0.06);
}

.rc-ev-row.absent:hover { opacity: 0.55; background: var(--parch); }

.rc-ev-ico {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--cyan);
}

.rc-ev-row.absent .rc-ev-ico {
  background: var(--muted-dim);
  color: rgba(255,255,255,0.6);
}

.rc-ev-name {
  flex: 1;
  padding: 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.rc-ev-meter {
  width: 70px;
  padding-right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rc-ev-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.rc-ev-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--cyan);
  min-width: 2px;
}

.rc-ev-ct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--txt);
  min-width: 22px;
  text-align: right;
}

.rc-ev-row.absent .rc-ev-ct {
  font-weight: 400;
  color: var(--muted-dim);
}

.rc-ev-row.absent .rc-ev-bar-fill { background: transparent; }


/* ═══════════════════════════════════
   GOVERNMENT PROGRAMMES
   ═══════════════════════════════════ */

.rc-progs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 2px;
}

.rc-prog-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  padding: 3px 8px;
  background: rgba(30, 58, 95, 0.06);
  border: 1px solid rgba(30, 58, 95, 0.15);
  border-radius: 1px;
  color: var(--cyan);
}


/* ═══════════════════════════════════
   CROSS-REFERENCES
   ═══════════════════════════════════ */

.rc-xrefs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rc-xref {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rc-xref-lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}

.rc-xref-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt);
}

.rc-exhibition-tag {
  font-family: 'Oswald', sans-serif;
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 1.5px solid var(--brass);
  color: var(--brass-dk);
  background: rgba(176, 141, 60, 0.08);
  border-radius: 1px;
  text-decoration: none;
  transition: background 0.15s;
}

.rc-exhibition-tag:hover { background: rgba(176, 141, 60, 0.16); }


/* ═══════════════════════════════════
   FOOTER
   ═══════════════════════════════════ */

.rc-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.rc-footer-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--muted-dim);
}


/* ═══════════════════════════════════
   BRASS CORNER ORNAMENTS
   ═══════════════════════════════════ */

.rc-corners { position: relative; }

.rc-corners::before,
.rc-corners::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--brass);
  border-style: solid;
  opacity: 0.4;
  pointer-events: none;
}

.rc-corners::before {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 1.5px 1.5px;
}

.rc-corners::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1.5px 1.5px 0;
}


/* ═══════════════════════════════════
   MOBILE COMPACT CARD
   ═══════════════════════════════════ */

.rc-mobile {
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.rc-mobile-body {
  background: var(--surface);
  padding: 10px 12px 0;
}

.rc-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rc-mobile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.rc-mobile-fact {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}

.rc-mobile-fact strong {
  font-weight: 600;
  color: var(--txt);
}

/* Evidence strip (pip indicators) */
.rc-ev-strip {
  display: flex;
  gap: 3px;
  padding-bottom: 10px;
}

.rc-ev-pip {
  flex: 1;
  height: 24px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  position: relative;
  transition: transform 0.15s;
}

.rc-ev-pip.active {
  background: var(--cyan);
  color: #fff;
}

.rc-ev-pip.inactive {
  background: var(--parch);
  color: var(--muted-dim);
  border: 1px solid rgba(0,0,0,0.06);
  opacity: 0.4;
}

.rc-ev-pip .pip-ct {
  position: absolute;
  top: -6px;
  right: -3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7px;
  font-weight: 600;
  background: var(--txt);
  color: var(--surface);
  border-radius: 4px;
  padding: 0 3px;
  line-height: 1.5;
}

.rc-ev-pip.inactive .pip-ct { display: none; }

/* Expand/collapse button */
.rc-expand {
  display: block;
  width: 100%;
  border: none;
  background: var(--parch);
  padding: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}

.rc-expand:hover { background: var(--surface-2); }

/* Expanded section within mobile card */
.rc-mobile-expanded {
  background: var(--surface);
  border-top: 1px solid var(--rule);
}


/* ═══════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════ */

@media (max-width: 860px) {
  .rc-layout {
    grid-template-columns: 1fr;
  }

  .rc-exh-layout {
    grid-template-columns: 1fr;
  }

  .rc-sidebar-col .rc {
    position: static;
  }

  .rc-exh-narrative {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .rc-ev-strip {
    gap: 2px;
  }

  .rc-ev-pip {
    font-size: 7px;
    height: 22px;
  }

  .rc-mobile-facts {
    gap: 2px 8px;
  }
}


/* ═══════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .rc-ev-row,
  .rc-ev-pip,
  .rc-expand,
  .rc-exhibition-tag,
  .rc-depth-seg {
    transition: none;
  }

  .rc-stamp {
    transform: rotate(0deg);
  }
}

/* High contrast: ensure absent rows remain perceptible */
@media (forced-colors: active) {
  .rc-ev-row.absent {
    opacity: 1;
    border: 1px dashed;
  }
}


/* ═══════════════════════════════════
   DELIVERABLE 8: ARTICLE IMAGE WRAPPING
   ───────────────────────────────────
   Exhibition narrative figures float within the body text to create a
   weaving reading flow. Alternating floats, 45% column width, with a
   full-width fallback below 640px. CSS only this round; the exhibition
   templates are not modified here. Classes are applied by the template
   (or via :nth-of-type) when the float treatment is wired in.
   ═══════════════════════════════════ */

.ex-figure--float-r {
  float: right;
  width: 45%;
  margin: 0 0 16px 20px;
}

.ex-figure--float-l {
  float: left;
  width: 45%;
  margin: 0 20px 16px 0;
}

/* Alternating floats when classes are not applied explicitly: odd
   figures float right, even figures float left, within a section. */
.ex-narrative .ex-figure:nth-of-type(odd),
.rc-exh-narrative .ex-figure:nth-of-type(odd) {
  float: right;
  width: 45%;
  margin: 0 0 16px 20px;
}

.ex-narrative .ex-figure:nth-of-type(even),
.rc-exh-narrative .ex-figure:nth-of-type(even) {
  float: left;
  width: 45%;
  margin: 0 20px 16px 0;
}

/* Floated figure caption sits below the image, inside the float. */
.ex-figure--float-r figcaption,
.ex-figure--float-l figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted-dim);
  max-width: 100%;
  padding-top: 8px;
  text-align: left;
}

/* Clear behaviour: prevent collisions with headings, pull quotes,
   consecutive figures, and separators. */
.ex-figure--clear { clear: both; }

.ex-narrative h2,
.ex-narrative h3,
.ex-narrative .ex-pullquote,
.ex-narrative hr,
.rc-exh-narrative h2,
.rc-exh-narrative h3,
.rc-exh-narrative .ex-pullquote,
.rc-exh-narrative .ex-section-header,
.rc-exh-narrative .ex-doc-callout,
.rc-exh-narrative .ex-archive-ref,
.rc-exh-narrative hr {
  clear: both;
}

.ex-figure + .ex-figure { clear: both; }

/* Mobile fallback: stack figures full width below 640px. */
@media (max-width: 640px) {
  .ex-figure--float-r,
  .ex-figure--float-l,
  .ex-narrative .ex-figure:nth-of-type(odd),
  .ex-narrative .ex-figure:nth-of-type(even),
  .rc-exh-narrative .ex-figure:nth-of-type(odd),
  .rc-exh-narrative .ex-figure:nth-of-type(even) {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 16px auto;
  }
}
