/*
 * sdl-hairline.css · Seedlings Early Learning line figures (sdl-hairline.js)
 *
 *   <span class="sdl-hl" data-sdl-hl="lunchbox" aria-hidden="true"></span>
 *
 * The slot fills its container's width at 5:4 (set width/height on it to size it;
 * 96 to 220px wide). Set on the slot or any ancestor (a section):
 *   --hairline-plate   the ground the figure sits on; plates are filled with it (default #FFFFFF)
 *   --hairline-ink     the line colour (default #1E1A14)
 *   --hairline-accent  the one small fill per figure (default #92C84A)
 */
.sdl-hl {
  --sdl-hl-ink: var(--hairline-ink, #1E1A14);
  --sdl-hl-ground: var(--hairline-plate, #FFFFFF);
  --hairline-hi: var(--sdl-hl-ink);
  --hairline-edge: color-mix(in srgb, var(--sdl-hl-ink) 80%, var(--sdl-hl-ground));
  --hairline-mid: color-mix(in srgb, var(--sdl-hl-ink) 58%, var(--sdl-hl-ground));
  --hairline-lo: color-mix(in srgb, var(--sdl-hl-ink) 34%, var(--sdl-hl-ground));
  --hairline-stroke: 1.2;
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  container-type: size;
  -webkit-tap-highlight-color: transparent;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .sdl-hl { --hairline-edge: var(--sdl-hl-ink); --hairline-mid: var(--sdl-hl-ink); --hairline-lo: var(--sdl-hl-ink); }
}

/* The stage keeps 5:4 inside whatever box the slot has, centred. */
.sdl-hl > .sdl-hl-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100cqw, 125cqh);
  height: min(80cqw, 100cqh);
  aspect-ratio: auto;
  transform: translate(-50%, -50%);
}
@supports not (width: 1cqw) {
  .sdl-hl > .sdl-hl-stage { left: 0; top: 0; width: 100%; height: 100%; transform: none; }
}

/* The one accent fill each figure has. */
.sdl-hl .sdl-hl-acc { fill: var(--hairline-accent, #92C84A); }

/* Reduced motion: drawn at rest, no gestures. */
@media (prefers-reduced-motion: reduce) {
  .sdl-hl > .sdl-hl-stage { pointer-events: none; }
}
