/* Too Much Room: styles for one post. The prose uses the site's own type; this
   file covers the figures, their controls, the table and the equations.
   The figure scripts read the colours below from :root to paint their canvases. */
:root {
  --bg: #fdf6e3; --panel: #fffbf0; --ink: #1c1a17; --soft: #625b50; --faint: #cfc6b6; --rule: #ddd4c4;
  --blue: #2b5fad; --red: #cf4a2a; --teal: #1c8577; --gold: #bd870f;
}

.post-content .dek { font-size: 1.25rem; line-height: 1.45; text-wrap: pretty; }
.post-content .by { font-size: 14px; color: #93a1a1; margin-bottom: 30px; }
.post-content p { text-wrap: pretty; }

/* equations */
.post-content .eq { margin: 1.4rem 0 1.5rem; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.post-content .eq .katex-display { margin: 0; }

.post-content .claim { border-left: 3px solid var(--gold); padding: 0.15rem 0 0.15rem 1.1rem; margin: 1.5rem 0; font-size: 1.07em; }
.post-content .aside { font-size: 0.875rem; line-height: 1.55; color: var(--soft); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.9rem 0; margin: 1.6rem 0; }

/* figures: wider than the text column where the window allows */
.post-content figure, .post-content figure * { box-sizing: border-box; }
.post-content figure { margin: 2rem 0 2.2rem; }
@media (min-width: 800px) {
  .post-content figure { position: relative; left: 50%; width: min(100vw - 48px, 60rem); transform: translateX(-50%); }
}
.post-content canvas { display: block; width: 100%; border-radius: 10px; touch-action: auto; }
.r-hero { aspect-ratio: 16 / 10; background: transparent; }
.r-3d { aspect-ratio: 16 / 9.4; background: var(--panel); border: 1px solid var(--rule); }
.r-pair { aspect-ratio: 2 / 1.04; }
.r-triple { aspect-ratio: 3 / 1.28; }
.r-wide { aspect-ratio: 16 / 7.6; }
@media (max-width: 651px) {
  .r-hero { aspect-ratio: 1 / 1; }
  .r-3d { aspect-ratio: 1 / 0.95; }
  .r-pair { aspect-ratio: 1 / 2.06; }
  .r-triple { aspect-ratio: 1 / 1.6; }
  .r-wide { aspect-ratio: 1 / 0.92; }
}

/* controls under a figure */
.post-content figure .controls { display: flex; flex-wrap: wrap; gap: 0.55rem 1.3rem; align-items: center; margin-top: 0.8rem; font-size: 0.82rem; line-height: 1.3; }
.post-content figure label { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 15rem; min-width: 0; color: var(--soft); white-space: nowrap; }
.post-content figure label.short { flex: 0 1 13rem; }
.post-content figure input[type=range] { flex: 1; min-width: 6rem; accent-color: var(--ink); height: 1.6rem; margin: 0; }
.post-content figure button { font-family: inherit; font-weight: 600; font-size: 0.8rem; line-height: 1; color: var(--ink); background: var(--panel); border: 1px solid var(--faint);
  border-radius: 999px; padding: 0.55rem 0.95rem; cursor: pointer; }
.post-content figure button:hover { border-color: var(--ink); }
.post-content figure button:focus-visible, .post-content figure input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.post-content figure .seg { display: inline-flex; border: 1px solid var(--faint); border-radius: 999px; overflow: hidden; background: var(--panel); }
.post-content figure .seg button { border: 0; border-radius: 0; background: transparent; padding: 0.55rem 0.85rem; font-weight: 500; }
.post-content figure .seg button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.post-content figure .readout { font-size: 0.88rem; line-height: 1.45; font-variant-numeric: tabular-nums; color: var(--ink); margin: 0.75rem 0 0; min-height: 1.45em; }
.post-content figcaption { font-size: 0.84rem; line-height: 1.5; color: var(--soft); margin-top: 0.7rem; max-width: 46rem; }
.post-content figcaption b { color: var(--ink); font-weight: 600; }
.sw { display: inline-block; width: 0.78em; height: 0.78em; border-radius: 2px; border: 1px solid var(--faint); vertical-align: -0.04em; margin-right: 0.25em; }
.key { font-weight: 600; }
.k-blue { color: var(--blue); } .k-red { color: var(--red); } .k-teal { color: var(--teal); } .k-gold { color: var(--gold); }

/* the table of surfaces: plain rules in place of the site's boxed, striped table */
.post-content .table-wrap { overflow-x: auto; margin: 1.4rem 0 1.6rem; }
.post-content .table-wrap table { display: table; width: 100%; margin: 0; border: 0; font-size: 0.875rem; line-height: 1.4; color: inherit; }
.post-content .table-wrap tr:nth-child(even) { background: none; }
.post-content .table-wrap th, .post-content .table-wrap td { text-align: left; padding: 0.5rem 0.7rem; border: 0; border-bottom: 1px solid var(--rule); background: none; vertical-align: top; }
.post-content .table-wrap th { font-weight: 600; color: var(--soft); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.post-content .table-wrap td.yes { color: var(--teal); font-weight: 600; }
.post-content .table-wrap td.no { color: var(--red); font-weight: 600; }
.post-content .table-wrap tr.hl td { background: color-mix(in srgb, var(--gold) 14%, transparent); }

.post-content ol.src { font-size: 0.875rem; line-height: 1.5; color: var(--soft); }
.post-content ol.src li { margin-bottom: 0.5rem; }
