/* AFN Organizational Effectiveness — synthesis of the AFN Accepted Risk Register
   Visual language matched to risks.dx1.dev: navy header, warm paper background,
   red/amber/blue severity system, Playfair Display + Lora + IBM Plex Mono. */

@import url('fonts.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1B3872;
  --red:     #C8111A;
  --amber:   #8B6000;
  --blue:    #2C6E9E;
  --ink:     #111118;
  --paper:   #F8F7F4;
  --surface: #FFFFFF;
  --border:  #E2DDD8;
  --muted:   #717178;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Lora', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
}

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ─── HEADER ─── */
.site-header {
  background: var(--navy);
  border-bottom: 6px solid var(--red);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
}

.afn-mark {
  background: #fff;
  border-radius: 3px;
  padding: 0.4rem 0.65rem 0.35rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}

.afn-mark .letters {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--navy);
  line-height: 1;
}

.afn-mark .name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.34rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1;
  margin-top: 3px;
}

.header-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200,17,26,0.9);
  margin-bottom: 0.5rem;
}

.header-title-block h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3.1rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 760px;
}

.header-subtitle {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  margin-top: 0.9rem;
  max-width: 620px;
}

.header-summary {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  max-width: 700px;
  line-height: 1.75;
}

.header-summary strong { color: rgba(255,255,255,0.85); font-weight: 600; }

/* ─── MAIN ─── */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

section { margin-bottom: 3.5rem; }

.section-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.7rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.section-lede {
  font-size: 0.95rem;
  color: #3A3A42;
  max-width: 760px;
  margin-bottom: 1.75rem;
}

/* ─── REGISTER METADATA BAR ─── */
.register-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.25rem;
  align-items: flex-end;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1.75rem 0;
}

.meta-stat { display: flex; flex-direction: column; gap: 0.2rem; }

.meta-stat .value {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--ink);
}

.meta-stat.is-critical .value { color: var(--red); }
.meta-stat.is-high .value { color: var(--amber); }
.meta-stat.is-significant .value { color: var(--blue); }

.meta-stat .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── CALLOUT ─── */
.callout-strip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(200,17,26,0.05);
  border-left: 4px solid var(--red);
  padding: 0.9rem 1.25rem;
  margin: 1.75rem 0;
}

.pull-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  border-left: 3px solid var(--navy);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 1.75rem 0;
  max-width: 760px;
}

/* ─── FRAMING LIST ─── */
.framing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 2.5rem;
  margin-top: 1.5rem;
}

.framing-item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #26262E;
}

.framing-item .mark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: var(--blue);
  flex-shrink: 0;
}

/* ─── FINDINGS ─── */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.finding-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.finding-card[data-active="true"] {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}

body.has-selection .finding-card:not([data-active="true"]) {
  opacity: 0.42;
}

.finding-side {
  width: 6.25rem;
  flex-shrink: 0;
  background: rgba(27,56,114,0.05);
  border-right: 2px solid var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 0.5rem 1.25rem;
  gap: 0.6rem;
}

.finding-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1;
  color: var(--navy);
}

.finding-num-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
}

.finding-main { flex: 1; padding: 1.75rem 2rem 2rem; min-width: 0; }

.finding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.6rem;
}

.finding-title-btn {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.finding-title-btn:hover,
.finding-title-btn:focus-visible { color: var(--navy); }

.finding-authority {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.finding-diagnosis {
  font-style: italic;
  font-size: 1rem;
  color: #26262E;
  margin-bottom: 1.1rem;
  max-width: 780px;
}

.finding-risks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.risk-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.risk-chip[data-active="true"] { color: #fff; }

.risk-chip.sev-critical { border-color: var(--red); color: var(--red); }
.risk-chip.sev-critical[data-active="true"] { background: var(--red); color: #fff; }
.risk-chip.sev-high { border-color: var(--amber); color: var(--amber); }
.risk-chip.sev-high[data-active="true"] { background: var(--amber); color: #fff; }
.risk-chip.sev-significant { border-color: var(--blue); color: var(--blue); }
.risk-chip.sev-significant[data-active="true"] { background: var(--blue); color: #fff; }

.risk-chip:hover, .risk-chip:focus-visible { background: var(--paper); }

.finding-divider { border: none; border-top: 1px solid var(--border); margin-bottom: 1.1rem; }

.finding-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.1rem 2rem;
}

.field-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.field-text { font-size: 0.87rem; line-height: 1.7; color: #1E1E26; }

/* ─── CROSS-CUTTING: DECISION LATENCY ─── */
.latency-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  padding: 1.75rem 2rem;
}

.latency-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 1.25rem 0 1rem;
  font-family: 'IBM Plex Mono', monospace;
}

.latency-step {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}

.latency-arrow { color: var(--blue); font-weight: 700; }

.latency-metric {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--blue);
  text-transform: uppercase;
}

/* ─── STAKEHOLDER CALLOUT ─── */
.stakeholder-panel {
  background: rgba(44,110,158,0.05);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  padding: 1.75rem 2rem;
}

.analogy {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  margin-top: 1.1rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--blue);
}

/* ─── MATRIX ─── */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--border); }

.matrix {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  font-family: 'IBM Plex Mono', monospace;
}

.matrix caption { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; }

.matrix th, .matrix td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: center;
  font-size: 0.72rem;
}

.matrix thead th {
  background: var(--paper);
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: bottom;
  padding-top: 0.75rem;
}

.matrix .col-finding-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  min-width: 2.4rem;
  max-width: 2.4rem;
  height: 8rem;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
}

.matrix .row-head {
  text-align: left;
  background: var(--paper);
  white-space: nowrap;
}

.matrix .risk-row-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 0.72rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
}

.matrix .risk-row-btn:hover, .matrix .risk-row-btn:focus-visible { color: var(--navy); }

.matrix .sev-swatch {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.sev-swatch.sev-critical { background: var(--red); }
.sev-swatch.sev-high { background: var(--amber); }
.sev-swatch.sev-significant { background: var(--blue); }

.matrix .risk-title-abbr {
  font-family: 'Lora', serif;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: normal;
}

.matrix .dot-cell { cursor: default; }

.matrix .dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--ink);
}

.matrix td[data-active="true"], .matrix th[data-active="true"] { background: rgba(27,56,114,0.09); }
.matrix tr[data-active="true"] .row-head { background: rgba(27,56,114,0.09); }

body.has-selection .matrix td.dot-cell:not([data-active="true"]) .dot { opacity: 0.25; }
body.has-selection .matrix tr:not([data-active="true"]) .dot { opacity: 0.25; }

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.matrix-legend .legend-item { display: flex; align-items: center; gap: 0.4rem; }

.matrix-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.clear-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
.clear-btn:hover { color: var(--ink); border-color: var(--muted); }

.synthesis-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 0.85rem;
  line-height: 1.6;
}

.synthesis-note a { color: var(--blue); text-decoration: underline; }

/* ─── FOOTER ─── */
.site-footer {
  text-align: center;
  padding: 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
  line-height: 2;
}

.site-footer a { color: var(--muted); }

/* ─── PRINT ─── */
@page { size: letter landscape; margin: 0.55in 0.6in 0.65in; }

@media print {
  *, *::before, *::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    transition: none !important;
  }
  html, body { background: #fff !important; }
  .skip-link, .clear-btn, .site-footer .print-note { display: none !important; }
  .site-header .header-inner { padding: 1rem 0.75rem 0.85rem; max-width: 100%; }
  .header-title-block h1 { font-size: 1.9rem; }
  .header-subtitle { font-size: 0.85rem; }
  .header-summary { font-size: 0.78rem; padding-top: 0.8rem; }
  .main { max-width: 100%; padding: 0.9rem 0.4rem; }
  section { margin-bottom: 1.4rem; }
  .finding-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; }
  .finding-body { grid-template-columns: repeat(3, 1fr); gap: 0.6rem 1.25rem; }
  .field-text { font-size: 0.76rem; line-height: 1.55; }
  .matrix-wrap { break-inside: avoid; }
  body::after {
    content: "afnreview.dx1.dev  \2022  American Forces Network  \2022  For Official Use";
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #ddd;
    margin-top: 0.75rem;
  }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .finding-body { grid-template-columns: 1fr; }
  .framing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .header-title-block h1 { font-size: 2.1rem; }
  .finding-card { flex-direction: column; }
  .finding-side {
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-bottom: 2px solid var(--navy);
    padding: 0.75rem 1.25rem;
  }
  .register-meta { gap: 1.25rem 2rem; }
}

/* ─── 404 ─── */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
}

.error-page .code {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 5rem;
  color: var(--navy);
  line-height: 1;
}

.error-page p { margin-top: 1rem; color: var(--muted); font-size: 0.95rem; }
.error-page a { color: var(--blue); text-decoration: underline; }
