/* ==========================================================================
   Product page photos and charts. Loaded only by pages that use them.
   Colours come from the tokens in site.css. No raw colour values here.
   ========================================================================== */

/* ---------- Text beside a photo ---------- */
.split { display: grid; gap: 28px; align-items: center; }
.split .section-head { margin-bottom: 0; }
.split .section-head + .btn-row { margin-top: 24px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 7fr 5fr; gap: 48px; }
  .split-flip { grid-template-columns: 5fr 7fr; }
  .split-flip > .photo { order: -1; }
}

.photo { margin: 0; }
.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-edge);
}
.photo figcaption {
  margin-top: 10px;
  font-size: var(--t-small);
  color: var(--blue);
}
.band-dark .photo figcaption { color: var(--steel-soft); }

/* ---------- Chart frame ---------- */
.chart {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 18px;
}
.chart-head { margin-bottom: 16px; }
.chart-title {
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 4px;
}
.chart-sample {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.chart-note {
  margin: 16px 0 0;
  font-size: var(--t-small);
  color: var(--blue);
}

.chart-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .chart-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .chart-wide { grid-column: 1 / -1; }
}

/* ---------- Horizontal bars ---------- */
.bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  font-size: var(--t-small);
  color: var(--blue);
}
.bar-label { grid-column: 1 / -1; }
.bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  min-width: 4.5ch;
}
.bar-track { height: 12px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--v) / var(--max) * 100%);
  background: var(--tier-1);
  border-radius: 999px;
}
.bar-fill.is-benchmark { background: var(--tier-5); }
@media (min-width: 560px) {
  .bar-row { grid-template-columns: 11rem 1fr auto; }
  .bar-label { grid-column: auto; }
}

/* ---------- Stacked bar for the tiers ---------- */
.stack { display: grid; gap: 14px; }
.stack-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  font-size: var(--t-small);
  color: var(--blue);
}
.stack-row .bar-label { font-weight: 600; color: var(--navy); }
.stack-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; }
.stack-seg {
  width: calc(var(--v) / var(--max) * 100%);
  border-right: 2px solid var(--white);
}
.stack-seg:last-child { border-right: 0; }
.stack-gap { background: var(--paper); }
@media (min-width: 560px) {
  .stack-row { grid-template-columns: 9rem 1fr auto; }
}

.t1 { background: var(--tier-1); }
.t2 { background: var(--tier-2); }
.t3 { background: var(--tier-3); }
.t4 { background: var(--tier-4); }
.t5 { background: var(--tier-5); }
.tc { background: var(--tier-c); }

.legend {
  display: grid;
  gap: 8px 20px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-small);
  color: var(--blue);
}
@media (min-width: 560px) { .legend { grid-template-columns: repeat(3, auto); justify-content: start; } }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .tc { box-shadow: inset 0 0 0 1px var(--steel-soft); }
.legend b { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---------- Cash ladder (inline SVG) ---------- */
.ladder svg { display: block; width: 100%; height: auto; }
.ladder-body { display: grid; gap: 8px; }
@media (max-width: 559px) {
  /* The chart shrinks on a phone, so its text is drawn larger to stay readable. */
  .ladder svg { overflow: visible; padding-left: 10px; }
  .ladder svg text { font-size: 16px; }
}
@media (min-width: 900px) {
  .ladder-body { grid-template-columns: 3fr 2fr; gap: 40px; align-items: center; }
  .ladder-body .legend { grid-template-columns: 1fr; margin-top: 0; }
}
.ladder text { font-family: inherit; font-size: 12px; fill: var(--blue); }
.ladder .grid { stroke: var(--rule); stroke-width: 1; }
.ladder .floor { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ladder .before { fill: none; stroke: var(--tier-4); stroke-width: 2; stroke-dasharray: 3 3; }
.ladder .plan { fill: none; stroke: var(--tier-1); stroke-width: 2.5; stroke-linejoin: round; }
.ladder .breach { fill: var(--orange); fill-opacity: 0.25; }
.ladder .breach-dot { fill: var(--orange); }
.ladder .breach-label { font-weight: 600; fill: var(--orange-ink); }
.ladder .legend .line {
  width: 18px; height: 0; flex: none;
  border-top: 2.5px solid var(--tier-1);
}
.ladder .legend .line.is-before { border-top: 2px dashed var(--tier-4); }
.ladder .legend .line.is-floor { border-top: 1.5px dashed var(--navy); }

/* ---------- Print ---------- */
@media print {
  .chart, .photo, .stack-row, .bar-row { break-inside: avoid; }
}

/* ---------- PDF-only text ---------- */
/* Shown only in the PDF built by scripts/build-liquisprint-pdf.sh. */
.print-only { display: none; }
