/* what every page shares: colors, the symbol font, the reset. style.css is the studio's, stitch/stitch.css the stitch page's. */
:root {
  --ink: #111111;
  --ink-2: #333333;
  --ink-3: #777777;
  --stone: #beb8ad;
  --sand: #e6e1d7;
  --paper: #f6f4ee;
  --line: #d9d3c7;
  --fabric: #f2ecde;         /* Aida, same as render.FABRIC_RGB */
  --empty-cell: #e6e0d4;     /* cells of the piece with no stitch */
  --mono: "DM Mono", "PixelStitch Symbols", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --pixel: 400 16px/1.3 "NeoDunggeunmo", var(--sans);   /* Neo둥근모 (style.css) is drawn on a 16px grid: any other size breaks its pixels */
  --text-lift: 1px;   /* Noto Sans KR inks ~.06em below its line box's middle: a chip lifts its text this much (padding) to look centred.
                        a whole pixel: the browser snaps the line to pixels, so a fraction moves it 0 or 1 by where the chip sits */
}

/* the chart symbols past the letters (quantize.GLYPHS): DM Mono has none, so the browser falls to this */
@font-face { font-family: "PixelStitch Symbols"; src: url(PixelStitchSymbols.ttf?v=2db2593e9715) format("truetype"); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* components below set display; hidden must still win */
html { background: var(--paper); }

/* a phone zooms the page in on a field typed in at under 16px (iOS Safari) and stays zoomed: on a touch screen
   every field is at least that, whatever a page sets (no larger than its surroundings' size otherwise) */
@media (pointer: coarse) {
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select { font-size: max(16px, 1em) !important; }
}

/* a dialog's close: an × in its top right corner, the same on every page (a dialog is the box it sits in) */
.dialog-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); font: 300 24px/1 var(--sans); cursor: pointer;
}
.dialog-close:hover { background: var(--sand); color: var(--ink); }
.dialog-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
dialog:has(.dialog-close) h2:first-of-type { padding-right: 32px; }   /* the title stays clear of it */

/* the PDF dialogs' choice of kind, past Pattern Keeper's colors (stitch/pdfsave.js markPkLimit): the count on
   the black and white choice, a red dot before it and before the note under the choices */
.pk-count { margin-left: auto; font: 400 12px var(--mono); color: var(--ink); white-space: nowrap; }
.pk-count::before, .pk-note::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%;
  background: #b5483b; vertical-align: middle;
}
.pk-note { margin: 2px 2px 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
