/* Surgery Bench site -- single stylesheet (light theme, one accent).
   Copied verbatim to dist/assets/style.css by tools/render_site.py. */

:root {
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6e6d68;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --line: #e1e0d9;
  --accent: #0f766e;
  --accent-ink: #0d5d56;
  --accent-soft: #e7f1ef;
  --good-ink: #006300;
  --good-bg: #e9f4e9;
  --bad-ink: #b3261e;
  --bad-bg: #fbebea;
  --wait-ink: #92400e;
  --wait-bg: #fdf3e3;
  --plan-ink: #52514e;
  --plan-bg: #efefed;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface-2);
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--accent-ink);
  padding: 8px 14px; border: 2px solid var(--accent); border-radius: 6px; z-index: 10;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Header and nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; padding-top: 18px; padding-bottom: 10px; }
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.brand a { font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand a:hover { color: var(--accent-ink); }
.brand .tagline { font-size: 13px; color: var(--ink-3); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 2px 14px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: 6px 4px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--accent-ink); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; border-bottom-color: var(--accent); }

main { padding: 32px 20px 8px; }
main.wrap { padding-left: 20px; padding-right: 20px; }

h1 { font-size: clamp(26px, 4.5vw, 36px); line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 22px; margin: 40px 0 10px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
.page-intro { font-size: 17px; color: var(--ink-2); max-width: 62ch; margin: 0 0 10px; }
.section-note { font-size: 14px; color: var(--ink-3); margin: -4px 0 12px; }

/* Callouts and notes */
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 12px 16px; margin: 16px 0; font-size: 15px; }
.callout.warn { border-left-color: var(--wait-ink); }
.callout p { margin: 6px 0; }
.gap { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* Stat tiles (KPI row) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile .v { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; }
.tile .l { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.tile .sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 8px 2px; border-radius: 999px; white-space: nowrap; }
.badge.green { background: var(--good-bg); color: var(--good-ink); }
.badge.red { background: var(--bad-bg); color: var(--bad-ink); }
.badge.to_build { background: var(--wait-bg); color: var(--wait-ink); }
.badge.plan { background: var(--plan-bg); color: var(--plan-ink); }

/* Tables */
.table-scroll { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }
tbody th { font-weight: 600; white-space: nowrap; }
tbody th a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sticky-col th:first-child, .sticky-col td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; border-right: 1px solid var(--line); }
.mini td, .mini th { font-size: 13px; padding: 5px 10px; }

/* Filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 8px; font-size: 14px; }
.filter-bar label { color: var(--ink-2); font-size: 13px; }
select, input[type="search"] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 240px; }
input[type="search"] { flex: 1 1 180px; max-width: 320px; }
.filter-count { font-size: 13px; color: var(--ink-3); }

/* Cards (pillars, gallery items) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.card h3 { margin-top: 0; }
.card p { font-size: 14px; color: var(--ink-2); margin: 6px 0; }

/* Gallery */
.gallery-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 20px 0; }
.gallery-item video { display: block; width: 100%; height: auto; background: #000; border-radius: 8px; }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 4px; }
.stills figure { margin: 0; }
.stills img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.stills figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.label-block { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; white-space: pre-wrap; margin: 10px 0; }
.meta-line { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.meta-line strong { color: var(--ink); }

/* Prose blocks converted from markdown */
.doc h1, .doc h2, .doc h3, .doc h4 { margin: 22px 0 8px; }
.doc h1 { font-size: 22px; }
.doc h2 { font-size: 18px; }
.doc h3, .doc h4 { font-size: 15px; }
.doc p, .doc li { font-size: 15px; max-width: 78ch; }
.doc pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font-size: 13px; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.doc pre code { background: none; padding: 0; }
.doc table { font-size: 13px; }
.doc img { max-width: 100%; }

details { margin: 2px 0; }
summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
details[open] summary { margin-bottom: 4px; }
details .detail-body { font-size: 13px; color: var(--ink-2); padding: 6px 10px; background: var(--surface-2); border-radius: 6px; max-width: 70ch; }
.detail-body p { margin: 6px 0; }

code.inline-path, .path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; word-break: break-all; }

.axes td.measured { font-weight: 600; }

/* Keep the env table's Details column compact so the table stays readable */
td.details { max-width: 240px; }
td.details summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 230px; vertical-align: bottom; }
@media (max-width: 900px) { td.details { max-width: 170px; } td.details summary { max-width: 160px; } }

footer.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 20px 0 40px; font-size: 13px; color: var(--ink-2); background: var(--surface); }
footer.site-footer p { margin: 4px 0; }

@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 4px; }
  .site-nav { margin-left: 0; }
  .site-nav a { padding: 6px 2px; }
  .tile .v { font-size: 24px; }
  td, th { padding: 7px 9px; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media print {
  .site-nav, .filter-bar, .skip-link { display: none; }
  body { background: var(--surface); }
  .table-scroll { overflow: visible; }
}
