/* Results page demo. Page-only pieces, prefixed erp-. */

.erp-bench { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); gap: var(--space-xl); align-items: start; }

/* Left column: what to try, plus Saved / Undo / Start again. Stays in view on desktop. */
.erp-side { position: sticky; top: calc(var(--bar-h) + var(--space-m)); display: grid; gap: var(--space-l); }
.erp-try { display: grid; gap: var(--space-m); }
.erp-try__item { font-size: var(--text-body); line-height: 1.45; padding-left: var(--space-s); border-left: 3px solid var(--stage); }
.erp-try__item b { display: block; }
.erp-tools { display: grid; gap: var(--space-s); padding-top: var(--space-m); border-top: var(--rule-w) solid var(--rule); }
.erp-tools__btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-m); }
.erp-tools .saved { justify-self: start; }

/* The finished page itself. */
.erp-doc { border: var(--rule-w) solid var(--rule); border-radius: var(--radius-s); padding: var(--space-xl); }
.erp-doc__meta { color: var(--ink-2); font-size: var(--text-s); }
.erp-doc__title { margin-top: var(--space-2xs); font-size: clamp(30px, 3vw, 40px); letter-spacing: -0.03em; line-height: 1.12; }
.erp-doc__summary { margin-top: var(--space-m); font-size: 20px; line-height: 1.6; max-width: 40ch; }
.erp-doc .editable { transition: background-color var(--dur-fast) var(--ease); }
.erp-doc .editable:hover { background: color-mix(in srgb, var(--stage) 22%, var(--white)); outline-color: transparent; }
.erp-doc .editable:focus { background: var(--pale-2); }

/* Locked figures: real buttons that never open for editing. */
.erp-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-s); margin-top: var(--space-xl); }
.erp-fig {
  display: grid; justify-items: start; align-content: start; gap: 2px;
  min-height: var(--tap); padding: var(--space-s); text-align: left;
  background: var(--white); border: var(--rule-w) solid var(--rule); border-radius: var(--radius-s);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.erp-fig:hover { border-color: var(--ink); }
.erp-fig.is-on { background: var(--stage); border-color: var(--ink); }
.erp-fig__value { font-size: clamp(32px, 3vw, 40px); font-weight: var(--weight-medium); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.erp-fig__label { font-size: var(--text-s); }
.erp-fig .tag { margin-top: var(--space-xs); }
.erp-fig.is-on .tag { background: var(--white); }

.erp-lock {
  display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-s);
  min-height: var(--tap); font-size: var(--text-body); font-weight: var(--weight-medium);
}
.erp-lock:empty { min-height: 0; margin-top: 0; }
.erp-lock::before {
  content: ""; flex: none; width: 20px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 22'%3E%3Crect x='2' y='9' width='16' height='12' rx='2' fill='%23161614'/%3E%3Cpath d='M5.5 9V6.5a4.5 4.5 0 0 1 9 0V9' fill='none' stroke='%23161614' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.erp-lock:empty::before { content: none; }

/* "Photos": flat tints of the stage colour with a plain caption. */
.erp-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-m) var(--space-s); margin-top: var(--space-xl); }
.erp-photo { display: grid; gap: var(--space-2xs); align-content: start; }
.erp-photo--wide { grid-column: 1 / -1; }
.erp-photo__img { display: block; aspect-ratio: 4 / 3; border-radius: 4px; background: color-mix(in srgb, var(--stage) var(--tint, 40%), var(--white)); }
.erp-photo--wide .erp-photo__img { aspect-ratio: 21 / 8; }
.erp-photo__cap { font-size: var(--text-s); line-height: 1.4; justify-self: start; }

@media (max-width: 900px) {
  .erp-bench { grid-template-columns: 1fr; gap: var(--space-l); }
  .erp-side { display: contents; }
  .erp-try { grid-template-columns: 1fr 1fr; gap: var(--space-m); }
  /* Saved / Undo stay in view while you scroll the page you are editing. */
  .erp-tools {
    position: sticky; top: var(--bar-h); z-index: 5; background: var(--white);
    grid-template-columns: auto 1fr; align-items: center;
    padding: var(--space-xs) 0; border-top: 0; border-bottom: var(--rule-w) solid var(--rule);
  }
  .erp-tools .saved { order: 2; justify-self: end; }
}
@media (max-width: 600px) {
  .erp-try { grid-template-columns: 1fr; gap: var(--space-s); }
  .erp-doc { padding: var(--space-m) var(--space-s); }
  .erp-doc__summary { font-size: 18px; }
  .erp-figs { grid-template-columns: 1fr; gap: var(--space-xs); }
  .erp-fig { grid-template-columns: auto 1fr; align-items: baseline; column-gap: var(--space-s); }
  .erp-fig .tag { grid-column: 1 / -1; margin-top: var(--space-2xs); }
  .erp-photos { grid-template-columns: 1fr 1fr; }
  .erp-photo--wide { grid-column: auto; }
  .erp-photo--wide .erp-photo__img { aspect-ratio: 4 / 3; }
}
