/* TV viewing distance calculator only; everything shared lives in shared/site.css. */

.sentence .num { width: 2ch; max-width: 100%; }

/* Where each part sits. The order of the parts in the page is the phone order. */
.tool.distance {
  grid-template-areas:
    "title"
    "sentence"
    "limit"
    "presets"
    "stage"
    "gauges"
    "answer"
    "actions";
}
.distance > .limit-note { grid-area: limit; }
@media (min-width: 1000px) {
  .tool.distance {
    grid-template-areas:
      "title title title title stage stage stage stage stage stage stage stage"
      "sentence sentence sentence sentence stage stage stage stage stage stage stage stage"
      "limit limit limit limit stage stage stage stage stage stage stage stage"
      "presets presets presets presets stage stage stage stage stage stage stage stage"
      "gauges gauges gauges gauges stage stage stage stage stage stage stage stage"
      "answer answer answer answer stage stage stage stage stage stage stage stage"
      "actions actions actions actions stage stage stage stage stage stage stage stage"
      "rest rest rest rest stage stage stage stage stage stage stage stage";
    grid-template-rows: repeat(7, auto) 1fr;
  }
}

/* ---------- gauges ---------- */

/* Read-only scales: a flat bar, marked zones and a labelled line. Nothing sticks out of the
   bar and nothing has a handle, so they do not read as sliders. */
.gauges { grid-area: gauges; display: grid; gap: 12px; margin-top: 20px; }
.gauge { margin: 0; }
.gauge figcaption { font-size: var(--t-small); color: var(--ink-soft); }
.gauge svg { display: block; width: 100%; height: 58px; overflow: visible; }
.gauge .bar { fill: color-mix(in srgb, var(--ink) 8%, var(--paper)); }
.gauge .zone { fill: color-mix(in srgb, var(--ink) 26%, var(--paper)); }
.gauge .zone.pixels { fill: color-mix(in srgb, var(--tape-3) 32%, var(--paper)); }
.gauge .edge { fill: var(--c); }
.gauge .mark { fill: var(--ink); }
.gauge text { font: 400 13px var(--font); font-variant-numeric: tabular-nums; fill: var(--ink-soft); }
.gauge text.mark-label { font-weight: 600; fill: var(--ink); }
@media (max-width: 999px) { .gauges { margin-top: 16px; } }

/* Each answer line reserves the most lines it takes at that width, so new values never move what follows. */
.distance .answer p { display: grid; grid-template-columns: auto 1fr; min-height: 2lh; }
.distance .answer p .swatch { margin-top: 0.62em; }
.distance .answer #answer-pixels { min-height: 4lh; }
@media (max-width: 459px), (min-width: 1000px) and (max-width: 1119px) {
  .distance .answer #answer-view, .distance .answer #answer-range { min-height: 3lh; }
  .distance .answer #answer-pixels { min-height: 5lh; }
}

/* ---------- the room ---------- */

.room { border-bottom: 0; box-shadow: none; background: var(--room-side); }
:root { --room-side: color-mix(in srgb, var(--wall) 92%, var(--ink)); --floor: color-mix(in srgb, var(--skirting-edge) 84%, #B98A5A); }
#scene { display: block; width: 100%; }
#scene .back { fill: var(--wall); }
#scene .side { fill: var(--room-side); }
#scene .ceiling { fill: color-mix(in srgb, var(--skirting) 96%, var(--ink)); }
#scene .floor { fill: var(--floor); }
#scene .board { stroke: color-mix(in srgb, var(--floor) 82%, var(--ink)); stroke-width: 1; }
#scene .skirting { fill: var(--skirting); }
#scene .skirting-edge, #scene .furniture { stroke: var(--skirting-edge); stroke-width: 1.5; }
#scene .furniture { fill: var(--skirting); }
#scene .furniture.top { fill: color-mix(in srgb, var(--skirting) 96%, var(--ink)); }
#scene .door { fill: color-mix(in srgb, var(--skirting) 97%, var(--ink)); stroke: var(--skirting-edge); stroke-width: 2; }
#scene .knob { fill: var(--skirting-edge); }
#scene .lamp { fill: var(--ink); }
#scene .lamp-pole { stroke: var(--ink); }
#scene .shade { fill: color-mix(in srgb, var(--skirting) 65%, #F2D9A0); stroke: var(--skirting-edge); stroke-width: 1.5; }
#scene .glass-label { font-size: 14px; }
/* The tape lies over the TV's black glass, where multiplying would make it vanish. */
#scene .tape { mix-blend-mode: normal; }

/* ---------- how it is worked out ---------- */

#plan { display: block; width: 100%; height: auto; background: var(--paper); }
#plan .floor { fill: color-mix(in srgb, var(--skirting-edge) 30%, var(--paper)); }
#plan .wall-band { fill: var(--wall); }
#plan .furniture { fill: var(--skirting); stroke: var(--skirting-edge); stroke-width: 1.5; }
#plan .sofa { fill: color-mix(in srgb, var(--skirting) 88%, var(--ink)); stroke: var(--skirting-edge); stroke-width: 1.5; }
#plan .cone { fill: var(--c); opacity: 0.1; }
#plan .sight { stroke: var(--c); stroke-width: 1.5; }
#plan .sight.yours { stroke: var(--ink); stroke-width: 2; }
#plan .glass { fill: var(--glass); }
#plan .head { fill: var(--ink); }
#plan .angle-label { font: 600 13px var(--font); fill: var(--ct, var(--ink)); paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
#plan .dim line { stroke: var(--ink); }
#plan .dim text { fill: var(--ink); stroke: var(--paper); }

