/* Board and case usage (js/usage.js): the slots of the motherboard and of the
   case and the part that sits in each. Used under the build on konfiguracija.html
   (a --tint panel) and on the board and case pages (plain, no panel). Loaded after
   css/style.css and css/parts.css. Light theme only. */

.usage { margin-top: 48px; padding: 36px 36px 28px; background: var(--tint); border-radius: var(--r-l); min-width: 0; }
.usage-none { display: grid; gap: 6px; padding: 20px 28px; font-size: 15px; color: var(--ink-2); }
.usage-pdp { margin-top: 0; padding: 0; background: none; border-radius: 0; }

.use-head { margin-bottom: 22px; }
.use-head h2 { font-size: 28px; font-weight: 700; }
.use-head p { margin-top: 4px; color: var(--ink-2); font-size: 14.5px; }
.use-head p a { color: var(--ink); font-weight: 600; text-decoration-color: var(--line-2); }
.use-head p a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* a part missing from the build: one sentence whose first words open the picking list */
.use-missing { font-size: 15px; color: var(--ink-2); }
.use-missing a { font-weight: 600; }
.usage:not(.usage-none) > .use-missing:not(:first-child) { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line-2); }

/* the drawing at the left (it stays in view while the lists scroll), the lists at the right */
.use-board-wrap { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 36px; align-items: start; }
.usage-pdp .use-board-wrap { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 28px; }
.use-fig { margin: 0; position: sticky; top: 96px; }
.use-fig figcaption { margin-top: 10px; max-width: 34ch; font-size: 12.5px; color: var(--ink-3); }
.use-board { display: block; width: 100%; height: auto; overflow: visible; }
.use-board .b-pcb { fill: var(--ill-light); stroke: var(--ill-mid); stroke-width: .8; }
.use-board .b-slot { fill: var(--ill-pale); stroke: var(--ill-mid); stroke-width: .7; transition: fill .15s, stroke .15s; }
.use-board .b-slot.on { fill: var(--accent); stroke: var(--accent-2); }
.use-board .b-mount { fill: none; stroke: var(--ill-mid); stroke-width: .9; stroke-dasharray: 3 2.2; }
.use-board .b-mount.on { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: none; }
.use-board .hl { stroke: var(--ink); stroke-width: 1.6; }
.use-board .b-slot.on.hl { fill: var(--accent-2); }
.use-board .b-txt { font: 600 6.5px var(--font-body); fill: var(--ink-2); }
.use-board .b-sock { font-size: 7.5px; }
.use-board .b-sock.on { fill: var(--on-accent); }
.use-board .b-q { font-weight: 500; fill: var(--ink-3); font-size: 8px; }
.use-board .b-screw { fill: var(--ill-mid); }

.use-lists { min-width: 0; display: grid; gap: 22px; }
.use-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 26px 32px; min-width: 0; }
.use-group { min-width: 0; }
.use-group h3 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 7px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); font-size: 16.5px; font-weight: 650;
}
.use-count { font: 500 13px var(--font-body); letter-spacing: 0; color: var(--ink-3); }
.use-rows { list-style: none; margin: 0; padding: 0; }
.use-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2px 14px;
  padding: 7px 8px; margin: 0 -8px; border-radius: var(--r-m); font-size: 13.5px; transition: background-color .15s;
}
.use-row.hl { background: var(--accent-soft); }
/* a small square: cobalt when the slot is in use, red when the build asks too much of it */
.use-id b { font-weight: 600; overflow-wrap: anywhere; }
.use-id b::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px;
  background: var(--ill-pale); box-shadow: inset 0 0 0 1px var(--ill-mid); vertical-align: 1px;
}
.use-row.on .use-id b::before { background: var(--accent); box-shadow: none; }
.use-row.bad .use-id b::before { background: var(--bad); box-shadow: none; }
.use-id small, .use-part small { display: block; font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.use-id small { padding-left: 16px; }
.use-part { min-width: 0; }
.use-part a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink); font-weight: 550; text-decoration-color: var(--line-2); overflow-wrap: anywhere;
}
.use-part a:hover { color: var(--accent); text-decoration-color: currentColor; }
.use-free { color: var(--ink-3); }
.use-row.bad .use-free { color: var(--bad); font-weight: 550; }
.use-unknown { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.use-note, .use-other { margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* problems come first, in the same red as a failed check */
.use-warns { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.use-warns li { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--r-s); background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 550; }
.use-warns .ico { flex: none; margin-top: 2px; }

.use-case { display: grid; gap: 0; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line-2); }
.use-case.first { margin-top: 32px; }
.use-case > .use-warns { margin-bottom: 20px; }
.use-case .use-groups, .usage-pdp > .use-groups { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.use-case > .use-other { margin-top: 20px; }
.use-source { margin-top: 28px; font-size: 12.5px; color: var(--ink-3); }
.usage-pdp .use-source { margin-top: 18px; }

/* the drawing goes above the lists */
@media (max-width: 900px) {
  .use-board-wrap, .usage-pdp .use-board-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .use-fig { position: static; max-width: 340px; }
}
@media (max-width: 600px) {
  .usage { margin-top: 36px; padding: 24px 16px 20px; border-radius: var(--r-m); }
  .usage-none { padding: 16px; }
  .usage-pdp { padding: 0; }
  .use-head h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .use-board .b-slot, .use-row { transition: none; }
}
