/* Layout, renders, charts, and disclosure styling for /why, using the Big Blue palette. */

.why-main {
  max-width: var(--site-width);
}

.why-toc,
.why-section {
  max-width: 70rem;
}

.why-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.why-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0.35rem;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s;
}

.why-toc a:hover {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.why-section {
  margin-bottom: 4rem;
  scroll-margin-top: 5rem;
}

.why-section:last-child {
  margin-bottom: 0;
}

.why-section > h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--brand-navy);
}

.why-section-intro {
  max-width: 46rem;
}

/* Split opening section (prose + kitchen render) */
.why-gap-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 2.5rem;
}

.why-photo {
  margin: 0;
}

.why-photo-stage {
  overflow: hidden;
  border-radius: 5px;
  background: var(--site-image);
  border: 1px solid var(--border);
}

.why-photo--hero .why-photo-stage {
  aspect-ratio: 1 / 1;
}

.why-photo-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.why-photo figcaption,
.why-fig figcaption {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-3);
  text-wrap: pretty;
}

/* Data figures & SVG diagrams */
.why-fig {
  margin: 2rem 0 0;
}

.why-deep-body .why-fig {
  margin: 0.25rem 0 1.5rem;
}

.why-deep-body .why-fig + p,
.why-deep-body .why-fig + ul {
  margin-top: 0;
}

.why-deep-body ul + .why-fig {
  margin-top: 1.5rem;
}

.why-fig-frame {
  padding: 1.125rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.why-fig--alternatives-matrix .why-fig-frame {
  padding: 0;
}

.wf-svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
  font-family: var(--font-sans);
}

.wf-title {
  fill: var(--brand-navy);
  font-size: 13px;
  font-weight: 600;
}

.wf-sub {
  fill: #455b83;
  font-size: 11.5px;
  font-weight: 500;
}

.wf-axis {
  fill: #526790;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.wf-axis-title {
  fill: #3f557e;
  font-size: 11.5px;
  font-weight: 600;
}

.wf-band {
  fill: #2c4c96;
  font-size: 11px;
  font-weight: 600;
}

.wf-zone {
  fill: #455b83;
  font-size: 11px;
  font-weight: 600;
}

.wf-zone-cold {
  fill: #1749d1;
}

.wf-zone-warm {
  fill: #b84a11;
}

.wf-label-blue {
  fill: #1749d1;
  font-size: 12.5px;
  font-weight: 600;
}

.wf-callout-blue {
  fill: #1749d1;
  font-size: 12px;
  font-weight: 600;
}

.wf-callout-warm {
  fill: #b84a11;
  font-size: 12px;
  font-weight: 600;
}

.wf-danger {
  fill: #ab3030;
  font-size: 11.5px;
  font-weight: 600;
}

.wf-bar-label {
  fill: var(--brand-navy);
  font-size: 12px;
  font-weight: 600;
}

.wf-bar-in {
  fill: var(--brand-navy);
  font-size: 11.5px;
  font-weight: 700;
}

.wf-seg-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wf-seg-cap {
  fill: var(--brand-navy);
  font-size: 11.5px;
  font-weight: 600;
}

.wf-box-muted {
  fill: #3f557e;
  font-size: 11.5px;
  font-weight: 600;
}

.wf-box-blue {
  fill: #10319c;
  font-size: 11.5px;
  font-weight: 600;
}

.wf-tiny {
  fill: #526790;
  font-size: 9.5px;
  font-weight: 600;
}

.wf-tiny-blue {
  fill: #10319c;
  font-size: 9.5px;
  font-weight: 600;
}

.wf-halo {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* Comparison visual matrix */
.wm-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wm-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.wm-table th,
.wm-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid #e2eaf6;
  text-align: left;
  vertical-align: middle;
}

.wm-table thead th {
  background: #f7f9fd;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.wm-table tbody tr:last-child th,
.wm-table tbody tr:last-child td {
  border-bottom: 0;
}

.wm-table tbody th {
  color: var(--brand-navy);
  font-weight: 600;
  white-space: nowrap;
}

.wm-table .wm-ours {
  background: #eef3fe;
}

.wm-table thead th.wm-ours {
  background: var(--brand-blue);
  color: #fff;
}

.wm-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.wm-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  flex: none;
}

.wm-ok {
  color: #19562e;
}

.wm-ok .wm-glyph {
  background: #ddf2e4;
  color: #19562e;
}

.wm-mid {
  color: #6e4510;
}

.wm-mid .wm-glyph {
  background: #fff1dc;
  color: #8b4a11;
}

.wm-no {
  color: #8f2626;
}

.wm-no .wm-glyph {
  background: #fbe4e4;
  color: #9e2929;
}

.wm-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wm-bar-track {
  flex: 1 1 auto;
  min-width: 3rem;
  height: 7px;
  border-radius: 999px;
  background: #e2eaf6;
  overflow: hidden;
}

.wm-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.wm-bar-fill.is-ours {
  background: var(--brand-blue);
}

.wm-bar-fill.is-mid {
  background: #6f86ae;
}

.wm-bar-fill.is-warn {
  background: #d45d1a;
}

.wm-bar-val {
  flex: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brand-navy);
}

/* Prose */
.why-prose p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-2);
  text-wrap: pretty;
}

.why-prose p:last-child {
  margin-bottom: 0;
}

.why-prose strong {
  color: var(--brand-navy);
  font-weight: 600;
}

.why-prose code {
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--brand-navy);
  font-size: 0.875em;
}

.why-prose a {
  color: var(--brand-blue);
  font-weight: 500;
  text-underline-offset: 3px;
}

.why-prose a:hover {
  color: var(--brand-navy);
}

.why-prose ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.875rem;
}

.why-prose li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-2);
  text-wrap: pretty;
}

/* 2x2 visual pillar cards */
.why-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.why-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 5rem;
}

.why-pillar-art {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--site-image);
  border-bottom: 1px solid #e2eaf6;
  overflow: hidden;
}

.why-pillar-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.why-pillar-body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.why-pillar-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 0 0.75rem;
  border: 1px solid #b1c0da;
  border-radius: 50%;
  color: var(--brand-navy);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.why-pillar h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.why-pillar .why-prose p {
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Alternatives cards with metric chips & expandable disclosures */
.why-alts {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.why-alt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  scroll-margin-top: 5rem;
}

.why-alt-main {
  padding: 1.5rem 1.75rem;
}

.why-alt-main h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.why-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.why-chips li {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #edf2fb;
  border: 1px solid #d5e0f2;
  color: #264073;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}

.why-alt-main .why-prose {
  max-width: 72ch;
}

.why-deep {
  border-top: 1px solid #e2eaf6;
  background: #f8fafd;
}

.why-deep > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  list-style: none;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  user-select: none;
  transition: background-color 0.15s, color 0.15s;
}

.why-deep > summary::-webkit-details-marker {
  display: none;
}

.why-deep > summary:hover {
  background: #edf3fc;
  color: var(--brand-navy);
}

.why-chevron {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: var(--brand-orange);
  transition: transform 0.16s ease;
}

.why-deep[open] > summary .why-chevron {
  transform: rotate(90deg);
}

.why-deep[open] > summary {
  border-bottom: 1px solid #e2eaf6;
}

.why-deep-body {
  padding: 1.25rem 1.75rem 1.6rem;
}

.why-deep-body > p,
.why-deep-body > ul {
  max-width: 72ch;
}

/* Closing callout */
.why-section--closing {
  padding: 2rem;
  background: var(--brand-blue);
  border-radius: 5px;
  color: #fff;
}

.why-section--closing > h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.why-section--closing .why-prose p {
  color: var(--brand-ice);
}

.why-section--closing .why-prose a {
  color: #fff;
}

.why-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-top: 1.5rem;
}

.why-next-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.why-next-link svg {
  width: 1rem;
  height: 1rem;
  color: var(--brand-orange);
  flex: none;
}

.why-next-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.why-section--closing a:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 4px;
  border-radius: 3px;
}

@media (max-width: 860px) {
  .why-gap-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .why-photo--hero .why-photo-stage {
    max-width: 30rem;
  }
}

@media (max-width: 760px) {
  .why-pillars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .why-toc {
    gap: 0.25rem 1.125rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
  }

  .why-section {
    margin-bottom: 2.75rem;
  }

  .why-fig-frame {
    padding: 0.75rem;
  }

  .why-pillar-body {
    padding: 1.125rem 1.25rem 1.25rem;
  }

  .why-alt-main {
    padding: 1.25rem;
  }

  .why-deep > summary {
    padding: 0.75rem 1.25rem;
  }

  .why-deep-body {
    padding: 1rem 1.25rem 1.25rem;
  }

  .why-section--closing {
    padding: 1.5rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .why-toc a,
  .why-deep > summary,
  .why-chevron {
    transition: none;
  }
}
