/* Guide pages (src/site/guides.js): gift guide, STEM hub, explainers, comparison. Loaded after site.css on those pages
   only (layout opts.css) and built from its tokens (--green, --ink, --r, --gutter...). Mobile first; 760 / 900 / 1000 px.
   Colours keep the manual's jobs: blue = how it works, orange = test and modify, yellow = games, green = building. */

/* ------------------------------------------------------------------------------------------------ page head */
.g-head .lede { font-size: 1.0625em; }
.g-byline { margin: -4px 0 12px; font-size: var(--fs-sm); color: var(--muted); }
.g-head .lede + .lede { margin-top: .75em; }
.g-head .page-head-media { min-width: 0; }
@media (min-width: 900px) { .g-head.has-media .page-head-grid { align-items: start; } .g-head.has-media .page-head-media { padding-top: 44px; } }

/* the four kits (gift guide) or the four mechanisms (hub), each a link */
.g-shelf { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-shelf a { display: flex; align-items: center; gap: 10px; min-height: 64px; height: 100%; padding: 6px 10px 6px 6px; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.g-shelf a:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.g-shelf-img { width: 56px; height: 56px; min-height: 0; border-radius: 12px; background: var(--tint); display: block; padding: 4px; flex: none; overflow: hidden; }
.g-shelf-img img { width: 100%; height: 100%; object-fit: contain; }
.g-shelf-name { font: 700 .9375rem/1.2 var(--display); }
@media (min-width: 900px) {
  .g-shelf { gap: 12px; }
  .g-shelf a { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; }
  .g-shelf { max-width: 480px; margin-left: auto; }
  .g-shelf-img { width: 100%; height: auto; aspect-ratio: 16 / 11; border-radius: 10px; padding: 8px; }
  .g-shelf-name { padding: 2px 6px 4px; font-size: 1.0625rem; }
}
.g-life { max-width: 460px; }

/* ------------------------------------------------------------------------------------------------ sections */
/* reading width for text; tables, cards and boxes use the full column */
.g-prose > p, .g-prose > .g-list, .g-prose > .g-steps, .g-prose > .g-h3, .g-prose > .g-flow, .g-prose > .g-sq { max-width: 68ch; }
.g-prose > p:last-child, .g-box > p:last-child, .g-qa-i > p:last-child { margin-bottom: 0; }
.g-h3 { font-size: var(--h3); margin: 1.5em 0 .6em; }
.g-split { display: grid; gap: 24px; }
.g-split > * { min-width: 0; }
.g-after { margin-top: 24px; }
.g-tail { margin-top: 12px; }
.g-note { margin-top: 12px; }
.g-sec .sec-head { margin-bottom: 20px; }
@media (min-width: 900px) {
  .g-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .g-split.g-media-first { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .g-aside { position: sticky; top: calc(var(--header-h) + 24px); }
  .g-tail { margin-top: 16px; }
}
.g-part + .g-part { margin-top: 40px; }
.g-part-h { font-size: var(--h3); margin-bottom: 14px; }
.g-steps { margin-bottom: 18px; }
.g-steps li > div { padding-top: 3px; }

/* inline: the worked sums ("2 × 2 = 4") */
.g-math { font: 700 1.04em/1 var(--display); color: var(--blue-dark); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ------------------------------------------------------------------------------------------------ "→" links */
.g-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 22px; }
.g-links.is-cards { display: grid; gap: 8px; }
.g-links.is-cards a { display: flex; justify-content: space-between; width: 100%; min-height: 52px; padding: 6px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); }
@media (min-width: 700px) { .g-links.is-cards { grid-template-columns: 1fr 1fr; max-width: 780px; } }

/* ------------------------------------------------------------------------------------------------ tables -> cards */
.g-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
.g-table th, .g-table td { text-align: left; vertical-align: top; }
.g-table td a, .g-table th a { font-weight: 600; }
.c-in { display: flex; align-items: center; gap: 12px; }
.c-name { min-width: 0; }
.c-name .badge { margin-left: 4px; vertical-align: 2px; font-size: .6875rem; padding: 3px 8px; }
.g-thumb { width: 48px; height: 48px; border-radius: 12px; background: var(--tint); display: grid; place-items: center; padding: 4px; flex: none; }
.g-thumb img { max-height: 100%; width: auto; object-fit: contain; }
.g-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.g-chips li { padding: 3px 10px; border-radius: 999px; background: var(--t-blue); color: var(--blue-dark); font-weight: 600; font-size: .875rem; line-height: 1.35; }
.g-chips li::first-letter { text-transform: uppercase; }
.g-table .lvl { color: inherit; font-size: inherit; }

@media (max-width: 759px) {
  .g-table, .g-table tbody, .g-table tr, .g-table th, .g-table td { display: block; }
  .g-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .g-table tbody { display: grid; gap: 10px; }
  .g-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 14px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
  .g-table .c-title, .g-table .c-wide, .g-table .c-chips { grid-column: 1 / -1; }
  .g-table .c-title { font: 800 1.1875rem/1.2 var(--display); padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
  .g-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; font: 600 var(--fs-sm)/1.3 var(--font); color: var(--muted); }
  .g-table td.is-empty { display: none; }
}
@media (min-width: 760px) {
  .g-table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
  .g-table th, .g-table td { padding: 14px 16px; border-top: 1px solid var(--line-2); }
  .g-table thead th { border-top: 0; background: var(--cream); font: 600 var(--fs-sm)/1.3 var(--font); color: var(--ink-2); }
  .g-table .c-title { font: 700 1.0625rem/1.3 var(--display); width: 24%; }
  .g-table:has(.c-pick) .c-title { width: 20%; }
  .g-table .c-pick { width: 22%; }
  .g-table .c-why { width: 30%; }
  .g-table .c-lvl, .g-table .c-half { white-space: nowrap; }
}

/* the same tables on the blueprint band (hub) */
.blueprint .g-table tr { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); }
.blueprint .g-table td::before { color: rgba(255, 255, 255, .7); }
.blueprint .g-table .c-title { color: #fff; border-color: rgba(255, 255, 255, .16); }
.blueprint .g-table a { color: #fff; }
.blueprint .g-chips li { background: var(--yellow); color: var(--ink); }
.blueprint .g-h3 { color: #fff; }
.blueprint .g-thumb { background: var(--tint); }
@media (min-width: 760px) {
  .blueprint .g-table-wrap { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .22); }
  .blueprint .g-table tr { background: none; }
  .blueprint .g-table th, .blueprint .g-table td { border-color: rgba(255, 255, 255, .14); }
  .blueprint .g-table thead th { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); }
}

/* worksheets to fill in (stay a table on phones) */
.g-fill-wrap { overflow-x: auto; margin: 4px 0 16px; }
.g-fill { width: 100%; border-collapse: collapse; background: var(--card); font-size: .9375rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.g-fill th, .g-fill td { border: 1px solid var(--line-strong); padding: 9px 10px; text-align: left; }
.g-fill thead th { background: var(--cream); font-weight: 600; font-size: var(--fs-sm); }
.g-fill tbody th { font-weight: 600; }
.g-fill td.is-blank { color: var(--muted); letter-spacing: .02em; }
.g-ratio { max-width: 360px; }
.g-ratio td { font-weight: 600; }

/* ------------------------------------------------------------------------------------------------ media */
.g-fig { margin: 0; }
.g-fig figcaption { padding-top: 10px; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
.g-3d .v3d-block { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--studio); }
.g-hint { display: block; margin-top: 2px; color: var(--muted); }
.g-still img { width: 100%; border-radius: var(--r-lg); background: var(--studio); }
.g-pair { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter); }
.g-pair::-webkit-scrollbar { display: none; }
.g-pair > * { scroll-snap-align: start; }
@media (min-width: 700px) { .g-pair { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 24px; overflow: visible; margin: 0; padding: 0; } }
@media (min-width: 1000px) { .g-pair { max-width: 980px; } }
.g-photo { margin: 0; }

/* ------------------------------------------------------------------------------------------------ kit cards in a guide */
.g-kits { display: grid; gap: 12px; margin-top: 4px; }
@media (max-width: 699px) {
  .g-kits .kc-grid { flex-direction: row; }
  .g-kits .kc-grid .kc-img { width: 36%; flex: none; aspect-ratio: auto; padding: 6px; }
  .g-kits .kc-grid .kc-body { padding: 12px 12px 12px 14px; gap: 6px; }
  .g-kits .kc-grid .fisa-row { font-size: .8125rem; gap: 4px; }
  .g-kits .kc-grid .fisa-row li { padding: 2px 7px; }
  .g-kits .kc-grid .kc-actions { gap: 4px 12px; }
  .g-kits .kc-grid .btn-buy { padding-inline: 16px; }
}
@media (min-width: 700px) { .g-kits { grid-template-columns: repeat(auto-fill, minmax(240px, 300px)); } }
@media (min-width: 900px) { .g-aside .g-kits.is-2 { grid-template-columns: 1fr 1fr; } .g-aside .g-kits:not(.is-2) { max-width: 320px; } }

/* ------------------------------------------------------------------------------------------------ boxes */
.g-box { position: relative; margin: 0 0 16px; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.g-box-title { font-size: 1.25rem; margin: 0 0 .5em; }
.g-box .g-fill-wrap:last-child { margin-bottom: 0; }
/* the worked calculation: graph paper */
.g-box-calc { border-color: rgba(28, 100, 196, .3); background-color: #fbfdff;
  background-image: linear-gradient(rgba(28, 100, 196, .075) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 100, 196, .075) 1px, transparent 1px);
  background-size: 20px 20px; background-position: -1px -1px; }
/* the home test ("Testează și modifică": orange) and the game to try ("Jocuri": yellow) */
.g-box-test { border-left: 5px solid var(--orange); }
.g-box-try { background: #fff8e8; border-color: rgba(217, 154, 18, .35); border-left: 5px solid var(--yellow); }
.g-box-try b { color: var(--ink); }
@media (min-width: 700px) { .g-box { padding: 22px 24px 20px; } }
.g-prose > .g-box { max-width: 72ch; }

/* ------------------------------------------------------------------------------------------------ questions */
.g-qa { border-top: 1px solid var(--line); max-width: 72ch; }
.g-qa-i { padding: 18px 0; border-bottom: 1px solid var(--line); }
.g-qa-i h3 { display: flex; gap: 10px; font-size: 1.1875rem; margin-bottom: .45em; }
.g-qa-i h3::before { content: ""; flex: none; width: 12px; height: 10px; margin-top: .42em; background: var(--green); clip-path: var(--hex); }
.g-qa-i > p, .g-qa-i > ul { margin-left: 22px; }
.g-qa-i .g-list { margin-top: -4px; gap: 8px; }

/* "Cum alegi": five questions */
.g-q5 { list-style: none; display: grid; gap: 10px; }
.g-q5 > li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.g-q5 h3 { font-size: 1.1875rem; margin: 3px 0 .4em; }
.g-q5 p:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .g-q5 { grid-template-columns: 1fr 1fr; gap: 14px; } .g-q5 > li { padding: 20px; } }

/* occasions, with a small tear-off calendar date */
.g-occ { list-style: none; display: grid; gap: 10px; }
.g-occ li { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.g-occ p { margin: 0; }
.g-occ-tag { display: grid; justify-items: center; align-content: center; height: 62px; padding-top: 10px; position: relative; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); line-height: 1; }
.g-occ-tag::before { content: ""; position: absolute; inset: 0 0 auto; height: 11px; background: var(--green); }
.g-occ-tag b { font: 800 1.375rem/1 var(--display); }
.g-occ-tag small { font-size: .8125rem; font-weight: 600; color: var(--muted); }
@media (min-width: 900px) { .g-occ { grid-template-columns: repeat(3, 1fr); gap: 14px; } }

/* ------------------------------------------------------------------------------------------------ hub: games, articles */
.g-games { display: grid; gap: 12px; margin-top: 8px; }
@media (min-width: 800px) { .g-games { grid-template-columns: 1fr 1fr; gap: 16px; } }
.g-game { padding: 14px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.g-game header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.g-game h3 { font-size: 1.1875rem; margin: 0; }
.g-game h3 a { text-decoration: none; }
.g-game h3 a:hover { text-decoration: underline; }
.g-game ul { list-style: none; display: grid; gap: 10px; }
.g-game li { position: relative; padding-left: 24px; }
.g-game li::before { content: ""; position: absolute; left: 0; top: .45em; width: 13px; height: 11px; clip-path: var(--hex); background: var(--yellow-deep); }
.g-game li.is-test::before { background: var(--orange); }

.g-arts { list-style: none; display: grid; gap: 10px; }
.g-arts a { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 10px 14px 10px 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); text-decoration: none; font: 700 1.0625rem/1.25 var(--display); transition: box-shadow .15s; }
.g-arts a:hover { box-shadow: var(--shadow-lift); }
.g-arts .g-thumb { width: 64px; height: 64px; padding: 4px; overflow: hidden; }
.g-arts .g-thumb img { width: 100%; height: 100%; object-fit: contain; }
.g-art-t { flex: 1; }
.g-arts .ico { color: var(--green); }
@media (min-width: 900px) {
  .g-arts { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
  .g-arts a { flex-direction: column; align-items: flex-start; padding: 12px 16px 16px; font-size: 1.1875rem; }
  .g-arts .g-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; padding: 10px; }
}

/* ------------------------------------------------------------------------------------------------ comparison */
.g-cmp { display: grid; gap: 12px; }
.g-cmp-labels { display: none; }
.g-cmp-col { padding: 14px 16px 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.g-cmp-col h3 { font-size: 1.1875rem; margin: 0 0 8px; }
.g-cmp-col dl { margin: 0; }
.g-cmp-col dl > div { padding: 9px 0; border-top: 1px solid var(--line-2); }
.g-cmp-col dt { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.g-cmp-col dd { margin: 0; }
/* ours: the page's one element with the ink border and offset shadow */
.g-cmp-col.is-ours { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); background: #fffdf7; }
.g-cmp-col.is-ours h3 { color: var(--green-dark); }
@media (min-width: 700px) and (max-width: 999px) { .g-cmp { grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (min-width: 1000px) {
  .g-cmp { grid-template-columns: 9.5em repeat(4, minmax(0, 1fr)); grid-template-rows: auto repeat(8, auto); gap: 0 10px; }
  .g-cmp-labels, .g-cmp-col { display: grid; grid-row: 1 / span 9; grid-template-rows: subgrid; }
  .g-cmp-labels span { display: flex; align-items: flex-start; padding: 12px 4px 12px 0; border-top: 1px solid var(--line); font: 700 .9375rem/1.3 var(--display); }
  .g-cmp-labels span:first-child { border-top: 0; }
  .g-cmp-col { padding: 0; }
  .g-cmp-col h3 { margin: 0; padding: 14px 16px 12px; font-size: 1.0625rem; line-height: 1.2; }
  .g-cmp-col dl, .g-cmp-col dl > div { display: contents; }
  .g-cmp-col dt { display: none; }
  .g-cmp-col dd { padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: .9375rem; line-height: 1.45; }
}
.g-cta { margin-top: 20px; }

/* ------------------------------------------------------------------------------------------------ small drawings */
/* energy, from the batteries to the disc */
.g-flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; margin: 0 0 1em; padding: 12px 14px; border-radius: var(--r); background: var(--t-blue); }
.g-flow li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font: 700 .9375rem/1.2 var(--display); }
.g-flow li span { padding: 5px 12px; border-radius: 999px; background: var(--card); }
.g-flow li + li::before { content: "→"; color: var(--blue); font-weight: 700; }

/* energy grows with the square: 1, 2 × 2, 3 × 3 wooden nuts */
.g-sq { display: flex; align-items: flex-end; gap: 28px; margin: 4px 0 1.1em; }
.g-sq-i { display: grid; justify-items: center; gap: 8px; }
.g-sq-grid { display: grid; grid-template-columns: repeat(var(--n), 18px); gap: 3px; }
.g-sq-grid i { width: 18px; height: 16px; clip-path: var(--hex); background: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow-deep); }
.g-sq small { font: 700 .9375rem/1 var(--display); color: var(--blue-dark); font-variant-numeric: tabular-nums; }

/* two meshing gears (50 and 14 teeth) that turn as the page scrolls */
.g-gears { margin: 0 auto; max-width: 300px; overflow: clip; }
.g-gears svg { width: 100%; height: auto; overflow: visible; }
.g-gears text { font: 700 13px var(--font); fill: var(--ink-2); }
.g-gear-big path { fill: var(--yellow); stroke: var(--burnt); stroke-width: 1.2; stroke-linejoin: round; }
.g-gear-small path { fill: var(--blue); stroke: #0c3266; stroke-width: 1.2; stroke-linejoin: round; }
.g-gear-ring { fill: none; stroke: rgba(107, 74, 43, .35); stroke-width: 1.2; }
.g-gear-knob, .g-gear-nut { fill: var(--plywood); stroke: var(--burnt); stroke-width: 1.2; }
.g-gear-big, .g-gear-small { transform-box: view-box; }
@keyframes g-turn { from { transform: rotate(0deg); } to { transform: rotate(var(--spin)); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .g-gear-big, .g-gear-small { animation: g-turn linear both; animation-timeline: view(); }
  }
}
@media (min-width: 900px) { .g-head .g-gears { max-width: 420px; } }

/* the age table (gift guide): on phones the audience is a small label, the kit to choose is the card's title */
.g-table .c-pick a { font-weight: 700; }
@media (max-width: 759px) {
  .g-table .c-pick, .g-table .c-why { grid-column: 1 / -1; }
  .g-table tr:has(.c-pick) { gap: 8px 16px; }
  .g-table tr:has(.c-pick) .c-title { font: 700 var(--fs-sm)/1.3 var(--font); color: var(--green-dark); letter-spacing: .01em; padding-bottom: 0; border: 0; }
  .g-table .c-pick::before, .g-table .c-why::before { content: none; }
  .g-table .c-pick { font: 800 1.25rem/1.25 var(--display); }
  .g-table .c-pick a { font-weight: 800; }
  .g-table .c-why { color: var(--ink-2); padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
}
@media (min-width: 760px) { .g-table .c-pick { font: 700 1.0625rem/1.3 var(--display); } }
.g-fill .g-fill-group { text-align: center; border-bottom-color: var(--line); }
.g-fill .g-fill-n { text-align: center; width: 22%; }
.g-fill td.is-blank { text-align: center; }
@media (min-width: 900px) { .g-shelf:has(> li:only-child) { grid-template-columns: 1fr; max-width: 340px; } }
