/* ==========================================================================
   Context Visualised · page styles for How we see it, Bring your own AI, Blog
   Linked only from how-we-see-it.html, ai.html and blog.html (S23).
   Uses the site.css tokens. No shadows, no pure white.
   ========================================================================== */

/* ---- Shared: Halden risk class colours (as the risk taxonomy report) ---- */
.c-ir { background: #17797A; color: var(--surface); border-color: #17797A; }
.c-cr { background: #6EF06E; color: var(--ink); border-color: #6EF06E; }
.c-or { background: #1F4651; color: var(--surface); border-color: #1F4651; }
.c-mr { background: #9EC0CC; color: var(--ink); border-color: #9EC0CC; }
.c-sr { background: #F3F3A6; color: var(--ink); border-color: #B3B344; }
.cbadge { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1.5px solid; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-data); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; }

/* ---- Residual rating box (S23 G6): letter (likelihood A to E) + number (impact 1 to 5),
   coloured to match its 5x5 cell band, as the risk taxonomy heat map. ---- */
.rt { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 6px; font-family: var(--font-data); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; border: 1px solid transparent; }
.rt-h { background: var(--ink); color: var(--lemon); }
.rt-m { background: #9EC0CC; color: var(--ink); }
.rt-l { background: #DDF7DD; color: var(--ink); border-color: #A9D8A9; }
.b-h { background: var(--ink); }
.b-m { background: #9EC0CC; }
.b-l { background: #DDF7DD; outline: 1px solid #A9D8A9; outline-offset: -1px; }
.legend i.b-h, .legend i.b-m, .legend i.b-l { width: 12px; height: 12px; }
.pg-key .rt { margin-right: 2px; }

/* ---- "What we think": no hard rule above, no line beside the label (S23 home item 11, kept consistent) ---- */
.band-think { border-top: 0; }

/* ---- Hero with a visual ---- */
.pg-hero .page-hero .lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.pg-hero > figure { margin: 0; justify-self: end; max-width: 480px; width: 100%; }

/* ---- How we see it: risk by category (hero) ---- */
.cat-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cat-rows li { display: grid; grid-template-columns: 40px 112px minmax(0, 1fr); grid-template-areas: "b n bar" "b n v"; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cat-rows li:last-child { border-bottom: 0; }
.cat-rows .cbadge { grid-area: b; }
.cat-n { grid-area: n; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; }
.cat-n .m { font-size: 12.5px; color: var(--ink-2); }
.cat-bar { grid-area: bar; display: flex; gap: 2px; height: 12px; }
.cat-bar span { height: 100%; border-radius: 3px; }
.cat-v { grid-area: v; font-size: 12.5px; color: var(--ink-2); }
.cat-v b { color: var(--ink); }

/* ---- How we see it: risk taxonomy board ---- */
.pg-fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pg-board { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.pg-board-head { display: flex; flex-direction: column; gap: 6px; }
.pg-board-head .label { color: var(--ink); }
.pg-board-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.pg-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pg-tiles li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-tile); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pg-tiles .num { font-size: calc(22px * var(--num-scale)); }
.pg-tiles .t { font-size: 14px; color: var(--ink-2); }
.pg-tiles .is-ink { background: var(--ink); border-color: var(--ink); }
.pg-tiles .is-ink .num { color: var(--lemon); }
.pg-tiles .is-ink .t { color: var(--on-ink-body); }
.pg-scr { border: 1px solid var(--border); border-radius: var(--radius-tile); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.pg-scr-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pg-scrbar { display: flex; gap: 2px; height: 14px; border-radius: 99px; overflow: hidden; }
.pg-scrbar span { height: 100%; }
.pg-board .legend i { width: 12px; height: 10px; }
.pg-hint { margin: 0; }
.tx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tx-item { border: 1px solid var(--border); border-radius: var(--radius-tile); background: var(--surface); }
.tx-item.is-open { border-color: var(--border-strong); }
.tx-h { margin: 0; font: inherit; }
.tx-btn { width: 100%; display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 14px 16px; border: 0; border-radius: var(--radius-tile); background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.tx-btn:hover { background: var(--surface-2); }
.tx-n { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tx-n b { font-size: 16.5px; font-weight: 700; }
.tx-n .m { font-size: 13.5px; color: var(--ink-2); }
.tx-chev { flex: none; transition: transform .15s ease; }
.tx-btn[aria-expanded="true"] .tx-chev { transform: rotate(90deg); }
.tx-panel { padding: 0 12px 12px; }
.tx-t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: var(--tabular); }
.tx-t th, .tx-t td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tx-t tbody tr:last-child th, .tx-t tbody tr:last-child td { border-bottom: 0; }
.tx-t thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tx-t tbody th { font-weight: 600; }
.tx-t td:nth-child(2) { white-space: nowrap; font-weight: 700; }
.tx-t td:last-child, .tx-t thead th:last-child { text-align: right; }
.pg-after { max-width: 46em; }

/* ---- How we see it: syndicate GWP (belief 02) ---- */
.syn-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.syn-rows li { display: grid; grid-template-columns: minmax(0, 1fr) 58px; grid-template-areas: "n c" "bar bar"; gap: 6px 10px; align-items: center; }
.syn-rows .sn { grid-area: n; display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.syn-rows .sn span { font-weight: 700; }
.syn-rows .bar { grid-area: bar; height: 10px; }
.chg { grid-area: c; justify-self: end; font-size: 12.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); white-space: nowrap; }
.chg-up { background: var(--change-up); color: var(--ink); }
.chg-down { background: var(--change-down); color: var(--ink); }
.chg-none { background: transparent; padding: 0; }

/* ---- How we see it: counterparty snapshot (belief 04) ---- */
.cr-head { display: flex; align-items: center; gap: 12px; }
.cr-hn { display: flex; flex-direction: column; gap: 2px; }
.cr-t tbody th { display: flex; flex-direction: column; gap: 1px; }
.cr-t tbody th .m { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.cr-kri { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 10px; }

/* ---- Tube map pulse on the failed stop (respects reduced motion) ---- */
.mt-pulse { opacity: 0; transform-origin: 202px 50px; transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
  .mt-pulse { animation: pg-pulse 2.4s ease-out infinite; }
}
@keyframes pg-pulse { 0% { opacity: .8; transform: scale(.7); } 80% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }

/* ---- How we see it: Halden call-out in "Partners, not roadblocks" ---- */
.pg-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-radius: var(--radius-card); background: var(--ink); color: var(--surface); text-decoration: none; min-height: var(--tap); }
.pg-callout:hover { background: #193a43; }
.pg-callout:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.pg-callout-t { display: flex; flex-direction: column; gap: 6px; }
.pg-callout-t .label { color: var(--on-ink-2); }
.pg-callout-t b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--lemon); }
.pg-callout-t .m { font-size: 15px; color: var(--on-ink-body); }
.pg-callout-go { font-size: 28px; color: var(--lemon); flex: none; }

/* ---- AI: rotating marks (CSS only; all four names stay in the HTML) ---- */
.ai-rot { gap: 16px; }
.rot { list-style: none; margin: 0; padding: 0; display: grid; min-height: 132px; border: 1px solid var(--border); border-radius: var(--radius-tile); background: var(--surface-2); }
.rot-i { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink); padding: 20px; }
.rot-g { width: 44px; height: 44px; flex: none; }
.rot-w { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rot-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .rot-i { opacity: 0; animation: pg-rot 12s infinite; }
  .rot-i:nth-child(2) { animation-delay: 3s; }
  .rot-i:nth-child(3) { animation-delay: 6s; }
  .rot-i:nth-child(4) { animation-delay: 9s; }
  .ai-rot:hover .rot-i { animation-play-state: paused; }
}
@keyframes pg-rot { 0% { opacity: 0; transform: translateY(8px); } 4%, 22% { opacity: 1; transform: none; } 26%, 100% { opacity: 0; transform: translateY(-8px); } }
/* Reduced motion: show all four at once, in a 2 by 2 grid */
@media (prefers-reduced-motion: reduce) {
  .rot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rot-i { grid-area: auto; padding: 14px; gap: 10px; justify-content: flex-start; }
  .rot-g { width: 28px; height: 28px; }
  .rot-w { font-size: 18px; }
}

/* ---- Blog: four symmetrical steps ---- */
.pg-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-steps .belief { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.pg-steps .h3 { margin: 0; }
.pg-steps p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }

/* ---- Breakpoints ---- */
@media (max-width: 1100px) {
  .pg-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959px) {
  .pg-hero > figure { justify-self: start; max-width: 560px; }
  .tx-grid2 { grid-template-columns: minmax(0, 1fr); }
  .pg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* G4: on phones, less text and the visual leads. Hidden copy stays in the HTML for crawlers. */
@media (max-width: 599px) {
  .m-hide { display: none; }
  .pg-hero { gap: 24px; }
  .pg-hero > figure { order: -1; }
  .pg-hero .page-hero .lead { font-size: 17px; }
  .pr.pr-vis .belief-vis { order: -1; }
  .pr.pr-vis .pr-text .pr-n { display: none; }
  .pg-board { padding: 16px; gap: 14px; }
  .pg-board-title { font-size: 22px; }
  .pg-tiles { gap: 8px; }
  .pg-tiles li { padding: 10px 12px; }
  .pg-tiles .num { font-size: 22px; }
  .pg-tiles .t { font-size: 12.5px; }
  .tx-btn { padding: 12px; gap: 12px; }
  .tx-panel { padding: 0 6px 8px; }
  .tx-t { font-size: 13px; }
  .tx-t th, .tx-t td { padding: 7px 4px; }
  .cat-rows li { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "b n" "b bar" "b v"; }
  .rot { min-height: 104px; }
  .rot-w { font-size: 24px; }
  .pg-callout { padding: 18px; }
  .pg-callout-t b { font-size: 19px; }
  .pg-steps { grid-template-columns: minmax(0, 1fr); }
  .pg-steps .belief { padding: 18px; }
}
