/* YS-024 stage 3: static pedal, pedalboard and brand pages (scripts/lib/catalog-pages.mjs).
   Direction: exact, calm, a little warm. World: a workbench drawing on grid paper.
   Moment: the item drawn to scale with dimension lines. Signature: dimension line with end ticks.
   The pages run under a CSP without inline styles, so every rule lives here. */
:root { --grid-bg: #eeebe4; --grid-line: #c8c2b5; --dim: #6b6459; }
@media (prefers-color-scheme: dark) { :root { --grid-bg: #1f2326; --grid-line: #3a4146; --dim: #a8b0b8; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--yds-bg); color: var(--yds-fg); font-family: var(--yds-font); font-size: var(--yds-text-md); line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
/* Links read as text; the accent stays on the one primary action per page. */
body.yds-root a:not(.yds-btn) { color: inherit; text-decoration-color: var(--yds-border-strong); }
.num { font-family: var(--yds-font-mono); font-variant-numeric: tabular-nums; }

.site-top { display: flex; align-items: center; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 16px 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 32px; border: 2px solid var(--yds-primary); border-radius: 8px; color: var(--yds-primary); font-weight: 600; transform: rotate(-6deg); }
.site-nav { display: flex; gap: 20px; color: var(--yds-muted); }
.site-nav a { text-decoration: none; }
body.yds-root .site-nav a[aria-current] { color: var(--yds-fg); }
.site-top .yds-btn { margin-left: auto; }
.rule-top { margin: 0; border: 0; border-top: 1px solid var(--yds-border); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; color: var(--yds-muted); font-size: var(--yds-text-sm); }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a { text-decoration: none; }

.item { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; }
/* The grid is drawn inside the SVG in mm, so the caption can state its real size. */
.drawing { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--yds-border); border-radius: var(--yds-radius-lg); background: var(--grid-bg); }
.drawing svg { display: block; width: 100%; height: auto; }
.drawing .caption { position: absolute; right: 16px; bottom: 12px; color: var(--dim); font-size: var(--yds-text-xs); }
.grid-cell { fill: none; stroke: var(--grid-line); }
.dim line { stroke: var(--dim); }
.dim text { fill: var(--dim); font-family: var(--yds-font-mono); }
.jack rect { fill: var(--yds-panel); stroke: var(--yds-fg); }
.jack text { fill: var(--yds-fg); font-family: var(--yds-font); font-weight: 500; }
.shape { stroke: var(--yds-border-strong); }
.slot { fill: color-mix(in srgb, var(--yds-primary) 16%, transparent); stroke: var(--yds-primary); }

/* Under the drawing: credit only for brands that asked to be named, the render note, and two links. */
.media-note { margin: 12px 0 0; color: var(--yds-muted); font-size: var(--yds-text-sm); line-height: 1.55; }
.media-note p { margin: 0 0 4px; }
.media-note .credit { color: var(--yds-fg); }
.media-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
body.yds-root .media-links a { color: var(--yds-muted); }

.info h1 { margin: 0; font-size: var(--yds-text-2xl); font-weight: 500; line-height: 1.3; }
.info .kicker { margin: 0 0 8px; color: var(--yds-muted); }
.info .size { margin: 8px 0 0; font-size: var(--yds-text-lg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px 16px; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--yds-border); }
.facts dt { color: var(--yds-muted); }
.facts dd { margin: 0; }
.facts small { display: block; color: var(--yds-muted); font-size: var(--yds-text-sm); }
.status { color: var(--yds-muted); font-size: var(--yds-text-sm); }
.status.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--yds-success); vertical-align: 2px; }

/* Where to buy, with the affiliate disclosure right under the links it covers. */
.buy { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--yds-border); }
.buy h2 { margin: 0 0 8px; font-size: var(--yds-text-md); font-weight: 500; }
.buy ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.buy li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--yds-border); border-radius: var(--yds-radius-panel); text-decoration: none; }
.buy li a:hover { background: var(--yds-surface); }
.buy li small { color: var(--yds-muted); font-size: var(--yds-text-sm); }
.buy .disclosure { margin: 12px 0 0; color: var(--yds-muted); font-size: var(--yds-text-xs); line-height: 1.5; }
.buy .disclosure + .disclosure { margin-top: 4px; }

.related { margin-top: 48px; }
.related h2, .list h2 { margin: 0 0 12px; font-size: var(--yds-text-lg); font-weight: 500; }
.lead { margin: 0 0 16px; color: var(--yds-muted); }
.rows { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rows .row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; min-height: 56px; padding: 8px 12px; border-radius: var(--yds-radius-panel); text-decoration: none; }
.rows.boards .row { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.rows a.row:hover { background: var(--yds-surface); }
.rows img, .rows .thumb { width: 40px; height: 40px; object-fit: contain; }
.rows.boards img, .rows.boards .thumb { width: 56px; }
.rows .thumb { border: 1px solid var(--yds-border); border-radius: 4px; }
.rows .name small { display: block; color: var(--yds-muted); font-size: var(--yds-text-sm); }
.rows .num { color: var(--yds-muted); }

.page-head { display: grid; gap: 8px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: var(--yds-text-2xl); font-weight: 500; }
.page-head p { margin: 0; color: var(--yds-muted); }
.types { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 32px; padding: 12px 0; border-block: 1px solid var(--yds-border); list-style: none; }
body.yds-root .types a { color: var(--yds-muted); text-decoration: none; }
.list { scroll-margin-top: 16px; }
.list + .list { margin-top: 40px; }

.page-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--yds-border); color: var(--yds-muted); font-size: var(--yds-text-sm); }
body.yds-root .page-foot a { margin-left: 16px; color: var(--yds-muted); }

@media (max-width: 720px) {
  .site-top { padding: 12px 16px; gap: 12px; }
  .site-nav { display: none; }
  main { padding: 16px 16px 48px; }
  .item { grid-template-columns: 1fr; gap: 24px; }
  .facts { grid-template-columns: 96px minmax(0, 1fr); }
  .drawing .caption { position: static; display: block; padding: 0 16px 12px; text-align: right; }
  .rows .row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .rows.boards .row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .rows .row .status { display: none; }
}
