/* /simulations: the list, and the one simulation opened from it. The list
   draws static SVG thumbnails; only an opened simulation runs a canvas. */
.sim-lab-hero { padding-block: var(--s-6) 0; margin: 0; }
.sim-lab-hero h1 { max-width: 20ch; }
.sim-lab-hero .lead { max-width: 65ch; margin-bottom: 0; }
.sim-lab-catalogue { margin-top: var(--s-7); }
.sim-lab-catalogue-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-5); margin-bottom: var(--s-5); }
.sim-lab-catalogue-head h2 { margin: 0; font-size: var(--fs-c-h2); }
/* With nothing open the page heading already names the list, so this one is
   left to screen readers. Under an open simulation it is shown. */
body:not(.lab-is-open) .sim-lab-catalogue-head h2 {
  position: absolute; width: 1px; height: 1px; margin: calc(-1 * var(--s-0)); padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.sim-lab-count { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lab-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-7); }
.lab-entry { min-width: 0; border-block-start: 1px solid var(--border); }
.lab-entry[hidden], .lab-workspace[hidden] { display: none; }
.lab-entry-link { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: var(--s-5); padding: var(--s-6) 0; height: 100%; text-decoration: none; color: var(--text); }
.lab-entry-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.lab-preview { border: 1px solid var(--rule); background: var(--instrument-bg); border-radius: var(--r-sm); overflow: hidden; }
.lab-preview svg { display: block; width: 100%; stroke: var(--muted); stroke-width: 1.4; }
.preview-measured { stroke: var(--accent-2); }
.preview-marker { fill: var(--accent); stroke: var(--accent); }
.preview-sun { fill: var(--history-accent-line); stroke: none; }
.preview-moon { fill: var(--text-soft); stroke: none; }
.preview-shadow { fill: var(--instrument-bg); stroke: var(--muted); }
.lab-entry-kind { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lab-entry h3 { margin: var(--s-2) 0 var(--s-3); font-size: var(--fs-c-h2); line-height: 1.25; }
.lab-entry p { margin: 0; font-size: 15px; color: var(--text-soft); line-height: 1.55; }
.lab-entry-link:hover h3 { color: var(--accent-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lab-workspace { scroll-margin-top: 85px; padding-block: var(--s-6) var(--s-8); }
.lab-is-open .sim-lab-hero { display: none; }
.lab-is-open { overflow-anchor: none; }
.lab-workspace-head { display: grid; grid-template-columns: 1fr auto; gap: var(--s-4); margin-bottom: var(--s-6); }
.lab-back { color: var(--accent-2); min-height: 44px; display: inline-flex; align-items: center; width: fit-content; }
.lab-kind { align-self: center; color: var(--muted); font-size: 14px; }
.lab-workspace h1 { grid-column: 1 / -1; margin: 0; font-size: var(--fs-h1); line-height: 1.15; }
.lab-objective { grid-column: 1 / -1; margin: 0; max-width: 65ch; color: var(--text-soft); font-size: 18px; }
.lab-instrument { display: grid; grid-template-columns: minmax(0, 1fr) 260px; border-block: 1px solid var(--border); }
.lab-aperture { min-width: 0; padding-block: var(--s-5); }
.lab-fieldnotes { border-inline-start: 1px solid var(--border); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-6); }
.lab-fieldnotes h2, .lab-fieldnotes summary { font: 700 15px var(--font-body); color: var(--accent-2); margin: 0; }
.lab-fieldnotes p { font-size: 15px; line-height: 1.65; color: var(--text-soft); margin: var(--s-3) 0 0; }
.lab-fieldnotes summary { cursor: pointer; min-height: 44px; align-content: center; }
.lab-fieldnotes details p { margin-top: 0; }
.lab-lesson { margin-top: auto; padding-block: var(--s-4); border-block-start: 1px solid var(--border); min-height: 44px; color: var(--accent-2); }
.lab-viz.viz { border: 0; border-radius: var(--r-sm); }
.lab-viz.viz.moonphase { aspect-ratio: auto; height: auto; }
.lab-viz.moonphase .moonphase-canvas { aspect-ratio: 1.5; height: auto; max-height: 460px; }
.lab-viz .moonphase-controls { padding: var(--s-5); }
.lab-viz .moonphase-label { font-size: 20px; }
.lab-viz .moonphase-slider { min-height: 44px; }
html[lang="ar"] .lab-entry h3 { line-height: 1.6; }
html[lang="ar"] .lab-fieldnotes p { line-height: 1.9; }
@media (max-width: 1365px) {
  .lab-instrument { grid-template-columns: minmax(0, 1fr); }
  .lab-fieldnotes { border-inline-start: 0; border-block-start: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; }
  .lab-fieldnotes details, .lab-lesson { grid-column: 1 / -1; }
  .lab-entry-link { grid-template-columns: 88px minmax(0,1fr); }
}
@media (max-width: 980px) {
  .lab-index { grid-template-columns: minmax(0,1fr); }
  .lab-entry-link { grid-template-columns: 96px minmax(0,1fr); }
  .sim-lab-hero h1 { font-size: var(--fs-h1); }
  .lab-workspace-head { grid-template-columns: 1fr; }
  .lab-kind { grid-row: 2; }
  .lab-workspace h1 { font-size: var(--fs-h1); }
  .lab-fieldnotes { padding: var(--s-5) 0; gap: var(--s-5); }
  .lab-viz.moonphase .moonphase-canvas { aspect-ratio: 1.3; }
}
@media (max-width: 560px) {
  .lab-entry-link { grid-template-columns: 72px minmax(0,1fr); gap: var(--s-4); }
  .lab-fieldnotes { grid-template-columns: minmax(0,1fr); }
}

.lab-workspace, .sim-lab-catalogue { overflow-anchor: none; }
