/* The list of paints with links to buy them (paintList.ts), the print dialog (printDialog.ts) and what
   they add to the printed page: the editor's Paint Names, print and download dialogs, and the /d page. */

.brand-filters-room {
  container: brand-filters / inline-size;
}

.brand-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.85em;
}

/* A brand's checkbox and name, in the paint list (--row) and in the fill picker's Paint Brands
   (--menu, fill-picker.css). Each variant sets its own spacing and tap area. */
.brand-filter {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}

.brand-filter--row {
  gap: 4px;
  --tap-y: -12px;
  --tap-x: -7px;
}

.brand-filter-box {
  position: relative;
  z-index: 1;
  margin: 0;
}

/* All on one line, or two even lines: a short last line reads as a leftover. The rows sit closer than a
   tap is tall, so each row's tap area grows away from the other row, and the margin keeps the
   lower one clear of the paints. */
@container brand-filters (max-width: 392px) {
  .brand-filters {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    margin-bottom: 18px;
  }

  .brand-filter--row.brand-filter--upper { --tap-y: -16px; --tap-bottom: -7px; }
  .brand-filter--row.brand-filter--lower { --tap-y: -7px; --tap-bottom: -16px; }
}

.paint-checklist {
  list-style: none;
  padding: 0;
  margin: 0.5em 0;
  clear: both;
}

.paint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.95em;
}

.paint-row + .paint-row {
  border-top: 1px solid var(--line-1);
}

.paint-checklist-empty {
  color: var(--ink-2);
  font-style: italic;
}

.paint-label {
  flex: 1;
  min-width: 0;
}

/* Buy's tap area fills the paint's row, short of the rows around it. A touch screen gives the row
   the height of a tap (and its border). */
.paint-buy-link {
  --tap-y: -6px;
  --tap-x: -4px;
  padding: 2px 8px;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--surface);
  background-color: #f0960e;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (pointer: coarse) {
  .paint-row {
    box-sizing: border-box;
    min-height: calc(var(--tap-size) + 1px);
  }

  .paint-buy-link {
    --tap-y: var(--tap-to-size);
  }
}

@media (hover: hover) {
  .paint-buy-link:hover {
    background-color: #d4820a;
  }
}

.paint-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--shadow);
  vertical-align: middle;
  flex-shrink: 0;
}

/* "(≈ swatch)": a row of its own, centred like the paint's row, so its swatch sits level with the first. */
.paint-approx-inline {
  display: inline-flex;
  align-items: center;
  color: var(--ink-2);
  font-size: 0.85em;
  white-space: nowrap;
}

.affiliate-disclosure {
  margin-top: 0.75em;
  font-size: 0.7em;
  color: var(--ink-3);
  text-align: center;
}

.paint-report-link {
  font-size: 0.75em;
  color: var(--ink-2);
  text-align: center;
  margin-top: 4px;
}

.paint-report-mailto {
  --tap-y: var(--tap-to-size);
  color: var(--ui-accent);
  text-decoration: none;
}

@media (hover: hover) {
  .paint-report-mailto:hover {
    text-decoration: underline;
  }
}

.paint-checklist-legend {
  margin-top: 0.5em;
  font-size: 0.75em;
  color: var(--ink-2);
  text-align: center;
}

/* The "Made with" line that signs a printout, pinned to the foot of the page; never on screen. The
   editor's sits in #printContainer, which prints only in one of its print modes (a plain Ctrl+P
   there turns design mode on, so it is signed too). */
.print-signature {
  display: none;
}

@media print {
  .print-signature {
    display: block;
    position: fixed;
    bottom: 0.15in;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 9pt;
    color: var(--ink-3);
    font-family: "Playpen Sans", cursive;
  }
}

/* The paint list, notes and QR code on the printed page, in a panel beside the design. It never shows
   on screen, even while the page waits to print with it filled. Each page's print layout says where it
   starts with --print-side-panel-left, a distance across the page (vw), and sizes the artwork to end
   --print-side-gutter short of it. */
.print-side-panel {
  display: none;
}

@media print {
  /* The artwork starts --print-artwork-inset from the page's left edge and may be
     --print-artwork-width wide, ending --print-side-gutter short of the panel. */
  body[data-print-paint-list] {
    --print-side-gutter: 0.2in;
    --print-artwork-inset: 0.25in;
    --print-artwork-width: calc(var(--print-side-panel-left) - var(--print-artwork-inset) - var(--print-side-gutter));
  }

  body[data-print-paint-list] .print-side-panel {
    display: block;
    position: fixed;
    top: 0.4in;
    right: 0.3in;
    left: var(--print-side-panel-left);
    color: var(--ink);
    font-family: system-ui, -apple-system, sans-serif;
    overflow: hidden;
  }

  /* The heading of each block in the panel: the paint list, the notes. */
  .print-panel-heading {
    font-size: 13pt;
    font-weight: 700;
    margin: 0 0 6pt;
    color: var(--ink);
  }

  .print-panel-heading--compact {
    font-size: 11pt;
  }

  .print-panel-heading--roomy {
    margin-bottom: 8pt;
  }

  .print-paint-items {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .print-paint-row {
    display: flex;
    align-items: center;
    gap: 5pt;
    padding: 2.5pt 0;
    font-size: 8.5pt;
    color: var(--ink);
    border-bottom: 0.5pt solid var(--line-1);
  }

  .print-paint-swatch {
    display: inline-block;
    width: 10pt;
    height: 10pt;
    border-radius: 2pt;
    border: 0.5pt solid var(--line-4);
    flex-shrink: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-paint-swatch--approx {
    opacity: 0.6;
  }

  .print-paint-approx {
    color: var(--ink-2);
    font-size: 7.5pt;
  }

  .print-paint-legend {
    margin-top: 6pt;
    font-size: 7.5pt;
    color: var(--ink-2);
  }

  .print-paint-checkbox {
    display: inline-block;
    width: 8pt;
    height: 8pt;
    border: 0.75pt solid var(--ink-2);
    border-radius: 1.5pt;
    flex-shrink: 0;
  }

  .print-paint-footer {
    margin-top: 8pt;
    font-size: 8pt;
    color: var(--ink-3);
    font-family: "Playpen Sans", cursive;
  }

  .print-notes-block {
    margin-top: 10pt;
  }

  .print-notes-line {
    border-bottom: 0.5pt solid var(--line-4);
    height: 16pt;
  }

  /* Notes with the whole side to themselves (a coloring page) are larger. */
  .print-notes-block--roomy .print-notes-line {
    height: 20pt;
  }

  .print-qr-block {
    margin-top: 12pt;
    display: flex;
    align-items: center;
    gap: 8pt;
  }

  .print-qr-code svg {
    width: 64pt;
    height: 64pt;
  }

  .print-qr-label {
    font-size: 8pt;
    color: var(--ink-6);
    line-height: 1.3;
    margin: 0;
  }
}

/* The "Print Your Design" dialog (printDialog.ts). */

.print-interstitial-intro {
  font-size: 0.9em;
  color: var(--ink-6);
  margin-bottom: 0.75em;
  text-align: center;
}

.print-interstitial-controls {
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--line-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.print-interstitial-check {
  --tap-y: calc(-1 * var(--option-tap-y));
  font-size: 0.9em;
  color: var(--ink-6);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.print-interstitial-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.print-interstitial-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: var(--brand);
  color: var(--surface);
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

@media (hover: hover) {
  .print-interstitial-btn:hover {
    background: var(--brand-strong);
  }
}

/* Options that wrap keep a row gap as tall as their tap areas reach, so the areas don't overlap. */
.print-interstitial-toggles {
  --option-tap-y: 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(2 * var(--option-tap-y)) 16px;
}
