/* ==========================================================================
   K10 — Results & Data (kit/results.html)
   Result statements, before/after slider, bar chart, project timeline,
   paired bars, availability heatmap, progress and shop statistics.
   ========================================================================== */

/* ---- Shared card surface -------------------------------------------------- */
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---- 01 Result statements ------------------------------------------------- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result-card__figure {
  position: relative;          /* host for the hand-drawn underline */
  align-self: flex-start;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* The underline is wider than its host (108 %): lift the global
   svg { max-width: 100% } cap from base.css. */
.result-card__figure > .mark {
  max-width: none;
}

.result-card__label {
  font-weight: 600;
}

.result-card__context {
  font-size: 15px;
  color: var(--muted);
}

.result-card__source {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.result-card--featured {
  border-color: var(--ink);
}

.result-card--featured .result-card__label {
  margin-top: 10px;            /* room for the underline stroke */
}

/* ---- 02 Before / after slider ---------------------------------------------
   --ba (0–100 %) is the divider position, set inline and by kit-results.js.
   The invisible range input covers the whole frame for mouse, touch and
   keyboard control. */
.before-after {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid var(--line);
}

.before-after__layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.before-after__layer--after {
  justify-content: flex-end;
  background: repeating-linear-gradient(45deg, var(--line) 0 6px, var(--surface) 6px 12px);
}

.before-after__layer--before {
  background: repeating-linear-gradient(135deg, var(--ph) 0 10px, var(--ph-stripe) 10px 11px);
  filter: grayscale(1);
  clip-path: inset(0 calc(100% - var(--ba)) 0 0);
}

.before-after__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}

.before-after__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
  font-family: var(--f-mono);
  font-size: 14px;
}

.before-after__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

/* ---- 03 Bar chart ----------------------------------------------------------
   Bar height via --h (value / max). */
.bar-chart {
  padding: clamp(20px, 3vw, 32px);
}

.bar-chart__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.bar-chart__title {
  font-weight: 600;
}

.bar-chart__sub {
  font-size: 14px;
  color: var(--muted);
}

.bar-chart__plot,
.bar-chart__axis {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}

.bar-chart__plot {
  position: relative;
  align-items: end;
  height: 220px;
  border-bottom: 1px solid var(--ink);
}

.bar-chart__bar {
  position: relative;
  height: var(--h);
  background: var(--ink);
}

.bar-chart__bar--before {
  opacity: .35;
}

.bar-chart__bar--highlight {
  background: var(--accent);
}

.bar-chart__value {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bar-chart__note {
  position: absolute;
  left: 52%;
  top: -6px;
  font-size: 24px;
  color: var(--accent-text);
  white-space: nowrap;
  transform: rotate(-4deg);
}

.bar-chart__axis {
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ---- 04 Project timeline ---------------------------------------------------
   12-week grid; each phase sets --col (grid-column) and --shade (opacity). */
.timeline {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__phase {
  grid-column: var(--col);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline__bar {
  height: 36px;
  background: var(--ink);
  opacity: var(--shade, 1);
}

.timeline__phase--highlight .timeline__bar {
  background: var(--accent);
}

.timeline__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* ---- 05 Numbered rule list (data honesty) --------------------------------- */
.rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 0 48px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.rule-list__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list__no {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---- 06 Before / after bars ------------------------------------------------
   Before bar width via --w (before / after); the after bar is always 100 %. */
.pair-bars {
  margin: 0;
}

.pair-bars__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pair-bars__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 15px;
}

.pair-bars__label {
  font-weight: 600;
}

.pair-bars__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pair-bars__bar {
  width: var(--w, 100%);
  height: 14px;
  background: var(--ink);
}

.pair-bars__bar--before {
  opacity: .35;
}

.pair-bars__caption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

/* ---- 07 Availability heatmap ----------------------------------------------
   State modifiers (--booked / --hold / --open) are shared by the week cells
   and the legend swatches. */
.heatmap__weeks {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 3px;
}

.heatmap__cell {
  height: 40px;
}

.heatmap__cell--booked {
  background: var(--ink);
}

.heatmap__cell--hold {
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 6px);
}

.heatmap__cell--open {
  border: 1.5px solid var(--accent);
  background: var(--canvas);
}

.heatmap__labels {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
}

.heatmap__labels > span {
  overflow: hidden;
}

.heatmap__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.heatmap__legend > li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.heatmap__swatch {
  width: 14px;
  height: 14px;
}

.heatmap__swatch--open {
  border: 1.5px solid var(--accent);
}

.heatmap__alt {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---- 08 Proofing progress --------------------------------------------------
   Fill width via --w; colour modifiers --info / --success. */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.progress-card {
  --fill: var(--ink);
  padding: 20px;
}

.progress-card--info {
  --fill: var(--info);
}

.progress-card--success {
  --fill: var(--success);
}

.progress-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress-card__label {
  font-weight: 600;
}

.progress-card__count {
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.progress-card__total {
  font-size: 18px;
  color: var(--muted);
}

.progress-card__track {
  height: 6px;
  margin-top: 12px;
  background: var(--line);
}

.progress-card__fill {
  width: var(--w);
  height: 100%;
  background: var(--fill);
}

/* ---- 09 Shop statistics --------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
}

.stat-card__value {
  margin: 6px 0;
  font-size: 28px;
}

.stat-card__note {
  font-size: 14px;
  color: var(--muted);
}

.stat-grid__footnote {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
