/* The labs page (templates/labkit/hub.html), made simple for someone new:
   search, one row of topics, then one clear card per lab (picture, name, one line, one button).
   Colours come from the site tokens, so palettes and dark mode follow.
   Phone: topics swipe sideways, cards are full-width rows. Tablet: 2 cards a row.
   Laptop: 3. Monitor: 4. TV: 5. Tap targets are at least 44px. */
.hub { max-width: 1180px; margin: 0 auto; }
@media (min-width: 1536px) { .hub { max-width: 1400px; } }
@media (min-width: 1920px) { .hub { max-width: 1680px; } }
.hub-head { text-align: center; }
.hub-head .eyebrow { justify-content: center; display: flex; }
.hub-title { margin-top: .3rem; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.1; letter-spacing: -.02em; color: rgb(var(--c-ink)); }
.hub-sub { margin: .7rem auto 0; max-width: 42rem; color: rgb(var(--c-slate-500)); }
.hub-search { display: flex; align-items: center; gap: .7rem; max-width: 36rem; min-height: 56px; margin: 1.4rem auto 0; padding: 0 1.1rem; border-radius: 16px;
  background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 4px; }
.hub-search:focus-within { border-color: rgb(var(--c-accent-2-light)); }
.hub-search svg { flex: none; width: 22px; height: 22px; color: rgb(var(--c-slate-500)); }
.hub-search input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 1.05rem; font-weight: 600; color: rgb(var(--c-ink)); outline: none; box-shadow: none; }

/* how it works: three small steps */
.hub-how { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.6rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.hub-how li { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: rgb(var(--c-slate-600)); }
.hub-how b, .hub-h b { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgb(var(--c-accent-1)); color: #fff;
  font-family: Fredoka, Nunito, sans-serif; font-size: 1.05rem; box-shadow: 0 3px 0 color-mix(in srgb, rgb(var(--c-accent-1)) 70%, #000); }
:root[data-theme="dark"] .hub-how b, :root[data-theme="dark"] .hub-h b { color: #181311; }

/* the helper quiz, folded away */
.hub-finder { max-width: 46rem; margin: 1.4rem auto 0; border-radius: 16px; border: 2px dashed rgb(var(--c-line)); background: rgb(var(--c-card)); }
.hub-finder summary { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .4rem 1rem; cursor: pointer; list-style: none;
  font-weight: 800; color: rgb(var(--c-accent-2)); text-align: center; }
.hub-finder summary::-webkit-details-marker { display: none; }
.hub-finder summary::after { content: "+"; font-size: 1.4rem; line-height: 1; }
.hub-finder[open] summary::after { content: "–"; }
.hub-finder .finder { padding: 0 1.1rem 1.2rem; }

.hub-h { display: flex; align-items: center; gap: .7rem; margin-top: 2.6rem; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.8rem); color: rgb(var(--c-ink)); }

/* topics */
.hub-cats { display: grid; gap: .8rem; margin-top: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hub-cat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 120px; padding: .9rem .6rem; text-align: center; border-radius: 18px;
  background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 5px; transition: transform .1s ease, background .15s ease, border-color .15s ease; }
.hub-cat-ico { font-size: 2.3rem; line-height: 1; }
.hub-cat-name { font-weight: 800; line-height: 1.2; color: rgb(var(--c-ink)); }
.hub-cat small { font-weight: 700; font-size: .78rem; color: rgb(var(--c-slate-500)); }
@media (hover: hover) { .hub-cat:hover { background: rgb(var(--c-accent-2-tint) / .6); } }
.hub-cat:active { transform: translateY(3px); border-bottom-width: 2px; }
.hub-cat.is-on { background: rgb(var(--c-accent-2-tint)); border-color: rgb(var(--c-accent-2-light)); }
.hub-cat.is-on .hub-cat-name { color: rgb(var(--c-accent-2)); }
@media (max-width: 639px) {
  .hub-cats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 136px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .5rem; scrollbar-width: none;
    margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
  .hub-cats::-webkit-scrollbar { display: none; }
  .hub-cat { scroll-snap-align: start; min-height: 108px; }
}

/* one group per topic */
.hub-group { margin-top: 1.8rem; }
.hub-group-head { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: 16px; background: var(--g-tint); }
.hub-group-ico { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: rgb(var(--c-card)); font-size: 1.7rem; box-shadow: 0 3px 0 rgb(0 0 0 / .1); }
.hub-group-head h3 { margin: 0; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 1.35rem; line-height: 1.15; color: rgb(var(--c-ink)); }
.hub-group-head p { margin: .15rem 0 0; font-size: .92rem; color: rgb(var(--c-slate-600)); }
.hub-group:nth-of-type(6n+1) { --g: #8b5e3c; --g-bg: linear-gradient(150deg, #ecd3b4, #c4935f); --g-tint: color-mix(in srgb, #c4935f 22%, rgb(var(--c-card))); }
.hub-group:nth-of-type(6n+2) { --g: #a05214; --g-bg: linear-gradient(150deg, #f6d29f, #dd9548); --g-tint: color-mix(in srgb, #dd9548 22%, rgb(var(--c-card))); }
.hub-group:nth-of-type(6n+3) { --g: #4f7d32; --g-bg: linear-gradient(150deg, #d6e3bd, #8aa765); --g-tint: color-mix(in srgb, #8aa765 24%, rgb(var(--c-card))); }
.hub-group:nth-of-type(6n+4) { --g: #2f6f73; --g-bg: linear-gradient(150deg, #c6dfdf, #6ba1a5); --g-tint: color-mix(in srgb, #6ba1a5 24%, rgb(var(--c-card))); }
.hub-group:nth-of-type(6n+5) { --g: #8a6a12; --g-bg: linear-gradient(150deg, #f1e0a8, #cfaa48); --g-tint: color-mix(in srgb, #cfaa48 24%, rgb(var(--c-card))); }
.hub-group:nth-of-type(6n+6) { --g: #a14a4a; --g-bg: linear-gradient(150deg, #f0cbc3, #cd8479); --g-tint: color-mix(in srgb, #cd8479 22%, rgb(var(--c-card))); }

/* lab cards: a clear picture, a name, one line, one button */
.hub-grid { display: grid; gap: 1rem; margin-top: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (min-width: 1920px) { .hub-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hub-lab { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 5px;
  transition: transform .12s ease, border-color .15s ease; }
.hub-lab-art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 8; background: var(--g-bg); overflow: hidden; }
.hub-lab-art::before { content: ""; position: absolute; inset: 0; opacity: .35;
  background: radial-gradient(circle at 18% 22%, #fff 0 10%, transparent 11%), radial-gradient(circle at 86% 78%, #fff 0 14%, transparent 15%), radial-gradient(circle at 80% 14%, #fff 0 5%, transparent 6%); }
.hub-lab-ico { position: relative; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 24px; background: #fffbf4; font-size: 2.9rem; line-height: 1;
  box-shadow: 0 5px 0 rgb(0 0 0 / .16); transform: rotate(-4deg); transition: transform .2s ease; }
.hub-lab-body { display: flex; flex-direction: column; gap: .25rem; flex: 1; padding: .9rem 1rem 1rem; }
.hub-lab-kind { font-weight: 800; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--g); }
:root[data-theme="dark"] .hub-lab-kind { color: rgb(var(--c-accent-2)); }
.hub-lab-name { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 1.2rem; line-height: 1.2; color: rgb(var(--c-ink)); }
.hub-lab-text { font-size: .92rem; line-height: 1.45; color: rgb(var(--c-slate-500)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-lab-go { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: auto; padding: 0 1rem; border-radius: 12px; font-weight: 800; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase;
  background: rgb(var(--c-accent-1)); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, rgb(var(--c-accent-1)) 70%, #000); }
.hub-lab-body > .hub-lab-text { margin-bottom: .7rem; }
.hub-lab-go.is-pro { background: rgb(var(--c-card)); color: rgb(var(--c-slate-600)); border: 2px solid rgb(var(--c-line)); box-shadow: 0 4px 0 rgb(var(--c-line)); }
:root[data-theme="dark"] .hub-lab-go:not(.is-pro) { color: #181311; }
@media (hover: hover) { .hub-lab:hover { transform: translateY(-3px); border-color: rgb(var(--c-accent-2-light)); } .hub-lab:hover .hub-lab-ico { transform: rotate(4deg) scale(1.06); } }
.hub-lab:active { transform: translateY(2px); border-bottom-width: 3px; }
/* phone: a compact row – picture on the left, words on the right */
@media (max-width: 559px) {
  .hub-grid { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .hub-lab { flex-direction: row; align-items: stretch; }
  .hub-lab-art { flex: none; width: 104px; aspect-ratio: auto; }
  .hub-lab-ico { width: 64px; height: 64px; border-radius: 18px; font-size: 2.2rem; }
  .hub-lab-body { padding: .7rem .8rem .8rem; min-width: 0; }
  .hub-lab-body > .hub-lab-text { margin-bottom: .5rem; }
  .hub-lab-go { min-height: 40px; align-self: flex-start; }
}

.hub-pro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.6rem; padding: 1.3rem 1.4rem; border-radius: 18px;
  background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 5px; }

/* the drawing fills the picture; the lab's own icon sits in the corner as a badge */
.hub-lab-art { aspect-ratio: 2 / 1; }
.hub-lab-art::before { display: none; }
.hub-lab-art .la { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hub-lab-art .hub-lab-image { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.finder-picture { display:block; width:100%; aspect-ratio:320 / 130; object-fit:cover; border-bottom:1px solid rgb(var(--c-line)); }
.hub-lab-art .hub-lab-ico { position: absolute; left: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 14px; font-size: 1.6rem; transform: rotate(-4deg); box-shadow: 0 3px 0 rgb(0 0 0 / .22); }
.la * { transform-box: fill-box; transform-origin: center; }
@media (hover: hover) {
  .hub-lab:hover .la-move { animation: la-move .9s ease-in-out infinite alternate; }
  .hub-lab:hover .la-glow { animation: la-glow .7s ease-in-out infinite alternate; }
  .hub-lab:hover .la-grow { transform-origin: bottom; animation: la-grow .8s ease-in-out infinite alternate; }
}
@keyframes la-move { from { transform: translate(0, 0); } to { transform: translate(6px, -5px); } }
@keyframes la-glow { from { opacity: 1; transform: scale(1); } to { opacity: .6; transform: scale(1.15); } }
@keyframes la-grow { from { transform: scaleY(1); } to { transform: scaleY(.7); } }
.no-motion .la * { animation: none !important; }
@media (max-width: 559px) { .hub-lab-art { aspect-ratio: auto; } .hub-lab-art .hub-lab-ico { width: 36px; height: 36px; font-size: 1.2rem; left: 6px; bottom: 6px; border-radius: 10px; } }
