/* Planning tools — shared styles.
   Layers on top of site.css; every colour, radius and easing token comes from
   there (site.css :root). No new brand colours are declared here.

   Two kinds of class live in this file:
     1. The section landing page (/planning/): .planning-hero, .planning-grid,
        .planning-card.
     2. A reusable shell every individual tool page (/planning/<tool>/) uses so
        it needs little or no CSS of its own: .tool, .tool-head, .tool-controls
        and its controls, .tool-output, .chart, .tool-disclaimer.

   Mobile-first; nothing drops below 16px on a phone; prefers-reduced-motion is
   honoured wherever a transition or transform is used. */

/* ============================================================
   Section landing (/planning/)
   ============================================================ */

.planning-hero {
  padding: clamp(40px, 8vw, 88px) 0 clamp(24px, 4vw, 40px);
  max-width: 760px;
}
.planning-hero h1 {
  font-size: clamp(40px, 6.4vw, 74px);
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 20px;
}
.planning-hero .lede {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--ink-soft);
  margin-bottom: 16px;
  max-width: 60ch;
}

/* Six tool cards. Auto-fit so the grid reflows from three columns to one
   without a media query per breakpoint. */
.planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
  margin: clamp(28px, 5vw, 48px) 0;
}

.planning-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 28px 26px 30px;
  color: inherit;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.planning-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--gold) 34%, var(--hairline));
}
@media (prefers-reduced-motion: reduce) {
  .planning-card:hover { transform: none; }
}
/* The whole card is the link, so its focus ring should frame the card. */
.planning-card:focus-visible { outline: 2.5px solid var(--navy); outline-offset: 3px; }

.planning-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--gold-tint);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--hairline));
  display: grid;
  place-items: center;
  color: var(--gold-ink);
  flex: none;
}
.planning-card-icon svg { display: block; }
.planning-card h2,
.planning-card h3 { font-size: clamp(20px, 2vw, 24px); letter-spacing: -0.01em; } /* DESIGN.md → typography.title */
.planning-card p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }
.planning-card .planning-card-more {
  margin-top: auto;
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gold-ink);
}
.planning-card .planning-card-more svg { transition: transform .35s var(--ease); }
.planning-card:hover .planning-card-more svg { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .planning-card:hover .planning-card-more svg { transform: none; }
}

/* ============================================================
   Tool page shell (/planning/<tool>/)
   ============================================================ */

.tool { padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }

.tool-head { max-width: 680px; margin-bottom: clamp(28px, 5vw, 48px); }
.tool-head h1 {
  font-size: clamp(40px, 6.4vw, 74px); /* DESIGN.md → typography.display */
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 16px;
}
.tool-head .lede { font-size: clamp(17px, 1.8vw, 19px); color: var(--ink-soft); max-width: 58ch; }

/* The eyebrow is plain text on every tool page. It was briefly a link on two of
   the six — and #28 briefly made it a link on all six — but the way back to the
   section is `.tool-back` below, which #53 added: a labelled, chevroned control
   above the title, arriving with the "More planning tools" strip at the foot.
   Two links to /planning/ stacked one above the other is one too many, so the
   eyebrow went back to being a label. `test/site-navigation.test.mjs` asserts
   that each tool page has *a* link to /planning/ inside its .tool-head, without
   caring which element carries it, so either design satisfies it and losing the
   way back entirely does not. */

/* The workspace: a controls panel beside (or above, on a phone) the output.
   Tools drop their own markup inside; this just sets the two-up rhythm. */
.tool-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

/* ---------- Controls panel ---------- */
.tool-controls {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 30px);
  box-shadow: var(--shadow);
}
.tool-controls > h2,
.tool-controls > legend {
  font-family: "Figtree", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--neutral);
  margin: 0 0 18px;
  padding: 0;
}

/* One labelled input. .control stacks the label over the field; help text sits
   under it. */
.control { margin-bottom: 22px; }
.control:last-child { margin-bottom: 0; }
.control > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
/* A label that also shows the current value (slider read-out) sits on one row. */
.control-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.control-label-row label { font-size: 14px; font-weight: 600; color: var(--ink); }
.control-value {
  font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--gold-ink);
  font-variant-numeric: lining-nums proportional-nums;
  font-feature-settings: "tnum" 0, "lnum" 1;
}
.control-help { font-size: 13px; color: var(--neutral); margin-top: 7px; line-height: 1.5; }

/* Number / select fields — mirror site.css .field inputs so they read as one
   family with the contact and newsletter forms. */
.tool-controls input[type="number"],
.tool-controls input[type="text"],
.tool-controls select {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--ground);
  color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.tool-controls input[type="number"]:focus,
.tool-controls input[type="text"]:focus,
.tool-controls select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 18%, transparent);
}

/* Range slider — themed track and thumb on both WebKit and Firefox, with a
   visible focus ring the browser default would otherwise hide. */
.tool-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--hairline);
  margin: 6px 0;
  cursor: pointer;
}
.tool-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--ground);
  box-shadow: 0 1px 3px rgba(28,34,48,.35);
}
.tool-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--ground);
  box-shadow: 0 1px 3px rgba(28,34,48,.35);
}
.tool-controls input[type="range"]:focus-visible {
  outline: 2.5px solid var(--navy);
  outline-offset: 6px;
}

/* Segmented control — a row of options where one is chosen. Built from real
   radios/buttons by the tool; this styles the group. */
.preset-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.preset-toggle label,
.preset-toggle button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
/* Works for both a <button aria-pressed> pattern and a radio-driven pattern
   (the radio is visually hidden, its label carries .is-active via :checked). */
.preset-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.preset-toggle .is-active,
.preset-toggle button[aria-pressed="true"],
.preset-toggle input:checked + label {
  background: var(--navy);
  color: #F6F2E9;
}
.preset-toggle input:focus-visible + label { outline: 2.5px solid var(--navy); outline-offset: 2px; }

/* ---------- Output ---------- */
.tool-output { min-width: 0; } /* let a chart shrink inside the grid track */

/* The big headline figure — always paired with a caption that frames it as
   illustrative. */
.result-figure {
  font-family: "Schibsted Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 6vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--navy);
  font-variant-numeric: lining-nums proportional-nums;
  font-feature-settings: "tnum" 0, "lnum" 1;
}
.result-caption {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 52ch;
}
/* A row of headline figures (e.g. a low / central / high range). */
.result-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(16px, 3vw, 28px);
  margin-bottom: clamp(20px, 3vw, 32px);
}
.result-figures .result-figure { font-size: clamp(28px, 4vw, 40px); }
.result-figures .result-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 6px;
}

/* ---------- Chart container ---------- */
/* Responsive; sensible default height; full width. Highcharts sizes to this
   box, so a tool rarely needs its own chart CSS. */
.chart {
  width: 100%;
  min-height: 320px;
  height: clamp(320px, 42vw, 440px);
  margin: clamp(18px, 3vw, 28px) 0;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 12px;
}

/* The text alternative every chart must carry. Visually present but quiet — a
   plain-English summary of what the chart shows, so the tool is usable without
   the SVG and satisfies the a11y requirement. */
.chart-summary {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 clamp(18px, 3vw, 28px);
  padding: 14px 16px;
  background: var(--ground-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.chart-summary strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   Compliance blocks
   ============================================================ */

/* Per-tool disclaimer. Same idiom as the Risk Profiler's .quiz-disclaimer:
   never collapsed, never behind a toggle — it is what keeps each tool an
   illustrative aid rather than a regulated projection or a recommendation. */
.tool-disclaimer {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin: clamp(28px, 4vw, 44px) 0 0;
}
.tool-disclaimer h2,
.tool-disclaimer h3 {
  font-family: "Figtree", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--neutral);
  margin-bottom: 10px;
}
.tool-disclaimer p { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.tool-disclaimer p + p { margin-top: 9px; }
.tool-disclaimer a { text-decoration: underline; text-underline-offset: 2px; }

/* The "Illustrative — not a forecast, not advice, not a real portfolio" stamp.
   Small, gold-tinted, sits on top of any result or chart. */
.illustrative-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Figtree", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-ink);
  background: var(--gold-tint);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--hairline));
  border-radius: 999px;
  padding: 6px 13px;
}
.illustrative-stamp::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  .tool-workspace { grid-template-columns: 1fr; }
  .tool-controls { position: static; }
}

/* ============================================================
   Tool navigation — back to the hub, and across to siblings.
   A tool page is otherwise a dead end: the only route out is the
   crowded top nav. These give an unmistakable way back and a way
   to move between tools without returning to the landing page.
   ============================================================ */

/* Mark the current section in the top nav (site.css only shows the
   underline on hover, so an aria-current page reads as inactive). */
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* "‹ Planning tools" back-link, sitting above the tool's title. */
.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-ink);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.tool-back svg { display: block; }
.tool-back:hover { color: var(--navy); }
.tool-back:focus-visible { outline: 2.5px solid var(--navy); outline-offset: 3px; border-radius: 4px; }

/* "More planning tools" strip at the foot of every tool page. */
.more-tools { border-top: 1px solid var(--hairline); padding: clamp(28px, 5vw, 44px) 0 4px; }
.more-tools-title {
  margin: 0 0 16px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral);
}
.more-tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.more-tools-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--raised);
  color: var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.more-tools-list a::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  color: var(--gold-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.more-tools-list a:hover { border-color: var(--gold); transform: translateY(-1px); }
.more-tools-list a:focus-visible { outline: 2.5px solid var(--navy); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .more-tools-list a:hover { transform: none; }
}
