/* PPI calculator only; everything shared lives in shared/site.css. */

/* Inputs are sized to their content by calculator.js. */
.sentence .num { width: 2ch; max-width: 100%; }
/* The sentence about sight distance takes two lines, three where the column is narrowest. */
.answer #distance-text { min-height: 2lh; }
@media (max-width: 339px), (min-width: 1000px) and (max-width: 1119px) { .answer #distance-text { min-height: 3lh; } }
.sentence output { font-weight: 400; font-variant-numeric: tabular-nums; }
/* Below 340 px the sentence takes two or three lines depending on its values, so it keeps
   three, and the density keeps three digits' width so the words around it stay put; from
   340 px up the sentence always takes two. */
@media (max-width: 339px) {
  .sentence { min-height: 3lh; }
  #ppi { display: inline-block; min-width: 3ch; text-align: right; }
}

/* The answer reserves three lines, four where the column is narrowest. */
.answer p { min-height: 3lh; }
@media (max-width: 339px), (min-width: 1000px) and (max-width: 1119px) { .answer p { min-height: 4lh; } }

.wall { position: relative; }
#scene { display: block; width: 100%; }
/* The lens is positioned by calculator.js over the ring the drawing leaves for it. */
#loupe { position: absolute; border-radius: 50%; }
.ring { fill: none; stroke: var(--c); stroke-width: 8; opacity: 0.9; mix-blend-mode: var(--tape-blend); }

/* The sentence under the scaling control. Every step's sentence sits in the same grid cell
   (calculator.js adds the hidden ones), so the cell is as tall as the longest at any width. */
.scale-slot { display: grid; margin-top: 12px; }
.scale-slot > * { grid-area: 1 / 1; }
.scale-slot .ghost { visibility: hidden; }

.actions { align-items: center; }

/* Where each part sits. The order of the parts in the page is the phone order. */
.tool.calc {
  grid-template-areas:
    "title"
    "sentence"
    "note"
    "presets"
    "stage"
    "answer"
    "actions";
}
@media (min-width: 1000px) {
  /* The question column is four of twelve columns, the wall the other eight. */
  .tool.calc {
    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"
      "note note note note stage stage stage stage stage stage stage stage"
      "presets presets presets presets 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(6, auto) 1fr;
  }
}

/* What the browser knew about the visitor's own screen. The page shows the note, and so
   reserves its room, only where the first chip is there. It takes up to three lines, four
   where the column is narrowest. */
.calc > .screen-note { grid-area: note; margin-top: 8px; min-height: 3lh; line-height: 1.45; }
@media (max-width: 349px), (min-width: 1000px) and (max-width: 1119px) { .calc > .screen-note { min-height: 4lh; } }
.screen-note[hidden] { display: none; }
.screen-note .link-button { min-height: 44px; margin: -12px 0; font: inherit; vertical-align: top; }
.screen-note .link-button + .link-button { margin-left: 12px; }
