/* ---------- "Wirehouse or independent" cluster ----------
   Figures, placeholders and the small interactive pieces the nine pages
   share. Everything is drawn from the site's tokens so dark mode follows.
   Behaviour lives in js/wirehouse.js; every widget reads fine without it. */

/* a block that steps outside the 68ch measure of .article */
.article .wh-wide { width: min(calc(100% + 30ch), calc(100vw - 2 * var(--gutter) - 20px)); max-width: none; }

/* ---------- figures ---------- */
.wh-fig { margin: 2.2em 0; }
.wh-fig img { width: 100%; height: auto; border-radius: 2px; }
.wh-fig figcaption { margin-top: 12px; font-size: 0.875rem; line-height: 1.5; color: var(--text-mid); max-width: 62ch; }
.wh-fig-box {
  position: relative; aspect-ratio: var(--ratio, 16 / 9);
  display: grid; align-content: center; justify-items: center; gap: 10px;
  padding: 28px; text-align: center;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: 2px; overflow: hidden;
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(91,158,116,0.07) 14px 15px);
}
.wh-fig-box::after { content: ""; position: absolute; inset: 12px; border: 1px dashed var(--line); border-radius: 2px; pointer-events: none; }
.wh-fig-tag { font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.wh-fig-title { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.2; color: var(--text); max-width: 26ch; }
.wh-fig-spec { font-size: 0.8125rem; line-height: 1.5; color: var(--text-mid); max-width: 48ch; }
.wh-fig-live { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 2px; padding: clamp(16px, 3vw, 28px); }
.wh-fig-live svg { width: 100%; height: auto; display: block; }

/* inline SVG the pages draw themselves */
.wh-svg text { font-family: var(--sans); font-size: 13px; fill: var(--text-soft); }
.wh-svg .serif { font-family: var(--serif); font-size: 20px; fill: var(--text); }
.wh-svg .faint { fill: var(--text-faint); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.wh-svg .ln { stroke: var(--line); fill: none; }
.wh-svg .ln-ink { stroke: var(--text-mid); fill: none; }
.wh-svg .ln-acc { stroke: var(--accent); fill: none; }
.wh-svg .box { fill: var(--surface-lift); stroke: var(--line); }
.wh-svg .box-acc { fill: var(--surface-lift); stroke: var(--accent); }
.wh-svg .fill-acc { fill: var(--accent); }
.wh-svg .fill-soft { fill: var(--line); }
.wh-svg .fill-ink { fill: var(--text); }

/* ---------- callouts, pairs ---------- */
.wh-callout { border-left: 2px solid var(--accent); padding: 6px 0 6px 22px; margin: 1.8em 0; color: var(--text-soft); }
.wh-callout p { margin: 0; }
.wh-callout p + p { margin-top: 0.8em; }
.wh-callout em { font-family: var(--serif); font-style: italic; font-size: 1.25em; color: var(--text); }
.wh-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 1.6em 0; }
.wh-duo > div { border: 1px solid var(--line); background: var(--surface-lift); padding: 22px 24px; border-radius: 2px; }
.wh-duo h3, .wh-kicker { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 400; color: var(--text-faint); margin: 0 0 10px; }
.wh-duo p { margin: 0; font-size: 0.9375rem; }
.wh-duo p + p { margin-top: 0.7em; }
.wh-duo ul { margin: 0; padding-left: 18px; font-size: 0.9375rem; color: var(--text-soft); }
.wh-duo li + li { margin-top: 6px; }

/* ---------- segmented switch: two ways of seeing the same thing ---------- */
.wh-switch { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-lift); }
.wh-switch button {
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.03em; line-height: 1;
  padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-mid); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.wh-switch button[aria-pressed="true"] { background: var(--selected-bg); color: var(--selected-fg); }
.wh-switch button:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
[data-wh-switch].wh-ready:not([data-view="a"]) [data-when="a"] { display: none; }
[data-wh-switch].wh-ready:not([data-view="b"]) [data-when="b"] { display: none; }
[data-wh-switch]:not(.wh-ready) .wh-switch { display: none; }
[data-wh-switch]:not(.wh-ready) [data-when]::before { content: attr(data-label); display: block; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }

/* ---------- tabs ---------- */
.wh-tabs { margin: 1.6em 0; }
.wh-tabs [role="tablist"] { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.wh-tabs [role="tab"] {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  padding: 12px 16px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--text-mid); cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease;
}
.wh-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.wh-tabs [role="tab"]:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
.wh-tabs [role="tabpanel"] { padding-top: 22px; }
.wh-tabs [role="tabpanel"] > :first-child { margin-top: 0; }
.wh-tabs:not(.wh-ready) [role="tablist"] { display: none; }
.wh-tabs:not(.wh-ready) [role="tabpanel"]::before { content: attr(aria-label); display: block; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }

/* ---------- timeline: a rail that fills as you read ---------- */
.wh-timeline { position: relative; margin: 2em 0; padding-left: 40px; list-style: none; }
.wh-timeline::before, .wh-timeline::after { content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.wh-timeline::after { background: var(--accent); bottom: auto; height: calc(var(--wh-progress, 0) * (100% - 16px)); transition: height 0.15s linear; }
.wh-step { position: relative; padding: 0 0 34px; }
.wh-step:last-child { padding-bottom: 0; }
.wh-step::before {
  content: ""; position: absolute; left: -33px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--text-faint); box-sizing: border-box; transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.wh-step.is-done::before { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.wh-step-when { display: block; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.wh-step h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); margin: 0 0 8px; color: var(--text); }
.wh-step p { margin: 0; color: var(--text-soft); }
.wh-step p + p { margin-top: 0.7em; }

/* ---------- cards you tap to turn over ---------- */
.wh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 1.4em 0 0.6em; }
.wh-card {
  display: grid; align-content: start; gap: 8px; text-align: left;
  font: inherit; color: inherit; padding: 18px 18px 16px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface-lift); cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.wh-card:hover { border-color: var(--accent); }
.wh-card:active { transform: translateY(1px); }
.wh-card:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
.wh-card-front { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.15; color: var(--text); }
.wh-card-hint { display: block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.wh-card-back { display: none; font-size: 0.875rem; line-height: 1.5; color: var(--text-mid); }
.wh-card-verdict { display: block; width: fit-content; margin-bottom: 8px; padding: 3px 9px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; }
.wh-card[data-answer="yes"] .wh-card-verdict { color: var(--accent); }
.wh-card[data-answer="no"] .wh-card-verdict { color: var(--error); }
.wh-card[data-answer="depends"] .wh-card-verdict { color: var(--text-mid); }
.wh-card.is-open .wh-card-back, [data-wh-sorter]:not(.wh-ready) .wh-card-back { display: block; }
.wh-card.is-open .wh-card-hint, [data-wh-sorter]:not(.wh-ready) .wh-card-hint { display: none; }
.wh-cards-tools { display: flex; justify-content: flex-end; margin: 0 0 1.4em; }
[data-wh-sorter]:not(.wh-ready) .wh-cards-tools { display: none; }
.wh-ghost {
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.03em;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--text-mid); cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.wh-ghost:hover { border-color: var(--accent); color: var(--accent); }
.wh-ghost:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

/* ---------- checklist with a progress rule ---------- */
.wh-checklist { margin: 1.6em 0; border: 1px solid var(--line); border-radius: 2px; background: var(--surface-lift); overflow: hidden; }
.wh-progress { height: 3px; background: var(--line); }
.wh-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.35s ease; }
.wh-progress-label { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--line); }
.wh-checklist.is-complete .wh-progress-label { color: var(--accent); }
.wh-check { display: flex; gap: 14px; align-items: flex-start; padding: 15px 20px; border-top: 1px solid var(--line); cursor: pointer; }
.wh-check:first-of-type { border-top: 0; }
.wh-check input { flex: none; width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--accent); }
.wh-check strong { display: block; font-weight: 500; color: var(--text); transition: color 0.2s ease; }
.wh-check span { display: block; font-size: 0.9063rem; color: var(--text-mid); }
.wh-check input:checked ~ div strong { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--line); }
[data-wh-checklist]:not(.wh-ready) .wh-progress, [data-wh-checklist]:not(.wh-ready) .wh-progress-label { display: none; }

/* ---------- hotspots on a figure ---------- */
.wh-hot-wrap { position: relative; }
.wh-hot {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: var(--selected-bg); color: var(--selected-fg); font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  cursor: pointer; box-shadow: 0 0 0 4px var(--surface-raised); transition: background 0.2s ease, transform 0.2s ease;
}
.wh-hot:hover, .wh-hot[aria-expanded="true"] { background: var(--accent); transform: translate(-50%, -50%) scale(1.12); }
.wh-hot:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
[data-wh-hotspots]:not(.wh-ready) .wh-hot { display: none; }
.wh-notes { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: note; }
.wh-note { position: relative; padding: 12px 16px 12px 44px; border-left: 2px solid var(--line); font-size: 0.9375rem; line-height: 1.5; color: var(--text-soft); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.wh-note::before { counter-increment: note; content: counter(note); position: absolute; left: 14px; top: 13px; font-family: var(--sans); font-size: 0.75rem; font-weight: 500; color: var(--text-faint); }
.wh-note.is-active { border-left-color: var(--accent); background: var(--surface-lift); }
.wh-note.is-active::before { color: var(--accent); }
.wh-note b { display: block; font-weight: 500; color: var(--text); }

/* ---------- a short decision path ---------- */
.wh-decide { margin: 1.8em 0; padding: 28px 30px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface-lift); }
.wh-q + .wh-q { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.wh-decide.wh-ready .wh-q + .wh-q { margin-top: 0; padding-top: 0; border-top: 0; }
.wh-q h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); margin: 0 0 10px; color: var(--text); }
.wh-q p { margin: 0; color: var(--text-soft); }
.wh-q p + p { margin-top: 0.7em; }
.wh-answers { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.wh-answers button {
  font-family: var(--sans); font-size: 0.9063rem; font-weight: 500; text-align: left;
  padding: 12px 18px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--text); cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.wh-answers button:hover { border-color: var(--accent); color: var(--accent); }
.wh-answers button:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.wh-q-tools { display: flex; gap: 18px; margin-top: 20px; }
.wh-q-tools button { font-family: var(--sans); font-size: 0.8125rem; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text-mid); cursor: pointer; }
.wh-q-tools button:hover { color: var(--accent); border-color: var(--accent); }
.wh-decide:not(.wh-ready) .wh-answers, .wh-decide:not(.wh-ready) .wh-q-tools { display: none; }
.wh-q.is-result { border-left: 2px solid var(--accent); padding-left: 20px; }

/* ---------- the series map ---------- */
.wh-series { margin: 3em 0 0; border-top: 1px solid var(--line); padding-top: 26px; }
.wh-series-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.wh-series-list li { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wh-series-kind { font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.wh-series-label { font-family: var(--serif); font-size: 1.25rem; color: var(--text); text-decoration: none; }
a.wh-series-label:hover { color: var(--accent); }
.wh-series-list li.is-current .wh-series-label { color: var(--accent); }
.wh-series-q { font-size: 0.875rem; color: var(--text-mid); }

/* ---------- second-opinion page ---------- */
.so-hero { background: var(--ink); margin-top: -78px; padding: 170px 0 88px; color: var(--paper); }
.so-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); color: var(--paper); max-width: 18ch; letter-spacing: -0.01em; }
.so-hero .lead { font-size: 1.125rem; color: var(--paper-soft); max-width: 50ch; margin: 24px 0 32px; }
.so-hero .btn + .link-quiet { margin-left: 22px; }
.so-steps { counter-reset: so; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 8px; }
.so-steps > div { position: relative; padding-top: 22px; border-top: 1px solid var(--line); }
.so-steps > div::before { counter-increment: so; content: "0" counter(so); font-family: var(--serif); font-size: 2rem; font-weight: 300; color: var(--accent); line-height: 1; display: block; margin-bottom: 14px; }
.so-steps h3 { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); margin: 0 0 10px; }
.so-steps p { color: var(--text-soft); font-size: 0.9688rem; margin: 0; }
.so-bring { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.so-bring > div { border: 1px solid var(--line); background: var(--surface-lift); padding: 20px 22px; border-radius: 2px; }
.so-bring strong { display: block; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.so-bring span { font-size: 0.9063rem; color: var(--text-mid); }
.so-promise { max-width: 62ch; }
.so-promise li { margin-bottom: 10px; color: var(--text-soft); }

@media (max-width: 900px) {
  .so-steps { grid-template-columns: 1fr; gap: 20px; }
  .wh-series-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .article .wh-wide { width: 100%; }
  .wh-duo, .so-bring { grid-template-columns: 1fr; }
  .wh-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .wh-decide { padding: 22px 20px; }
  .wh-fig-box { padding: 20px; }
  .so-hero .btn + .link-quiet { display: inline-block; margin: 16px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wh-timeline::after, .wh-step::before, .wh-progress i { transition: none; }
}

/* the quiet second door beside a closing button */
.cta-secondary { display: inline-block; margin-left: 22px; white-space: nowrap; vertical-align: middle; }
@media (max-width: 720px) { .cta-secondary { display: block; width: fit-content; margin: 16px 0 0; } }

/* a placeholder that hosts hotspots keeps its title and drops the brief, so the numbers read */
.wh-hot-wrap .wh-fig-spec { display: none; }
.wh-hot-wrap .wh-fig-title { opacity: 0.55; }
