/* THE /kids/ HUB (K3-H, docs/kids/80-k3-milestones-hub-spec.md H.2-H.5, 3.4).
   Loaded by /kids/ only, after site.css. The age chips filter with CSS alone:
   native radios in a fieldset, and :has() hides every card without the chosen
   band and every shelf that is left empty. No :has() or no CSS shows every card.
   No motion. Budget: 2 KB gzip (kids-hub.mjs HUB_CSS_BUDGET). */
.kids-hub { max-width: 1160px; margin: 0 auto; padding: 0 16px 48px; }
.hub-hero { padding: 8px 0 4px; max-width: 760px; }
.hub-eyebrow { display: flex; align-items: center; gap: 8px; }
.hub-mark { flex: none; }
.hub-hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 6vw, 3.2rem); }
.hub-trust { margin: 0 0 6px; font-weight: 700; }
.hub-posture { margin: 0; color: var(--muted); }
.hub-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.hub-chips { border: 0; margin: 20px 0 8px; padding: 0; min-width: 0; }
.hub-chips legend { padding: 0; margin-bottom: 8px; font-weight: 800; }
.hub-chip-row { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.hub-chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.hub-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); font-weight: 800; cursor: pointer; white-space: nowrap; }
.hub-chip-input:checked + .hub-chip { background: var(--ink); color: var(--paper); }
.hub-chip-input:focus-visible + .hub-chip { outline: 3px solid var(--accent); outline-offset: 3px; }
.hub-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: .8rem; }

.hub-shelf { margin: 16px -16px 0; padding: 8px 16px 20px; background: #fbe3d5; border-radius: 24px; }
.hub-shelf h2 { margin: 12px 0 16px; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hub-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.hub-card { position: relative; display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: start; align-content: start; padding: 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--ink); }
.hub-card:hover { outline: 2px solid var(--ink); outline-offset: 2px; }
.hub-card-art { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 10px; }
.hub-card h3 { margin: 2px 0 6px; font-size: 1.2rem; }
.hub-card h3 a { text-decoration: none; }
.hub-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.hub-card-line { margin: 0 0 8px; font-size: .95rem; }
.hub-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .8rem; font-weight: 800; }
.hub-pill, .hub-verb, .hub-duration { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.hub-pill { background: var(--paper-2); border-color: var(--paper-2); }
.hub-sound { display: inline-flex; color: var(--sea); }
.hub-about { max-width: 760px; margin-top: 32px; }
.hub-about h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }

@media (min-width: 360px) {
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-card { grid-template-columns: 1fr; }
}
@media (min-width: 720px) { .hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hub-shelf { margin-inline: 0; padding-inline: 24px; } }

/* The filter: one rule pair per band (H.3). */
.kids-hub:has(#age-0-1:checked) .hub-card:not([data-bands~="0-1"]) { display: none; }
.kids-hub:has(#age-0-1:checked) .hub-shelf:not(:has([data-bands~="0-1"])) { display: none; }
.kids-hub:has(#age-1-3:checked) .hub-card:not([data-bands~="1-3"]) { display: none; }
.kids-hub:has(#age-1-3:checked) .hub-shelf:not(:has([data-bands~="1-3"])) { display: none; }
.kids-hub:has(#age-3-5:checked) .hub-card:not([data-bands~="3-5"]) { display: none; }
.kids-hub:has(#age-3-5:checked) .hub-shelf:not(:has([data-bands~="3-5"])) { display: none; }
.kids-hub:has(#age-5-7:checked) .hub-card:not([data-bands~="5-7"]) { display: none; }
.kids-hub:has(#age-5-7:checked) .hub-shelf:not(:has([data-bands~="5-7"])) { display: none; }
