/* Gem age slider (js/gem-age.js), Liminal Ed logo and draft notice. Shared by every Gem: it takes the page's own
   colours (--ga-bg, --ga-ink, set by gem-age.js), so it fits light, dark and every palette. */
:root { --ga-accent: #f2b134; }

/* ---------------------------------------------------------------- the strip with the slider */
.age-strip { background: var(--as-bg, #222); color: var(--as-fg, #fff); padding: 8px 16px 6px; display: flex; justify-content: center; }
.age-switch { flex: 1 1 340px; max-width: 560px; margin: 0 auto; }
.as { display: grid; gap: 2px; justify-items: center; width: 100%; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.as-title { font-weight: 800; font-size: .95rem; }
.as-track { --thumb: 30px; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); width: 100%; position: relative; }
/* the input is as wide as the stops' centres, so the thumb sits exactly over each stop */
.as-track input {
  grid-column: 1 / -1; grid-row: 1; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; height: 34px; margin: 0;
  width: calc(100% * (var(--n) - 1) / var(--n) + var(--thumb)); margin-left: calc(50% / var(--n) - var(--thumb) / 2);
}
.as-track input::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--ga-accent) calc(var(--p, 0) * 100%), color-mix(in srgb, var(--as-fg, #fff) 30%, transparent) 0); }
.as-track input::-moz-range-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--as-fg, #fff) 30%, transparent); }
.as-track input::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--ga-accent); }
.as-track input::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -11px; border-radius: 50%; background: var(--ga-accent); border: 4px solid var(--as-fg, #fff); box-shadow: 0 2px 0 #0005; }
.as-track input::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ga-accent); border: 4px solid var(--as-fg, #fff); }
.as-track input:focus-visible { outline: 3px solid var(--as-fg, #fff); outline-offset: 3px; border-radius: 99px; }
.as-stop { grid-row: 2; display: grid; justify-items: center; padding: 2px 0 4px; border: 0; background: none; color: inherit; cursor: pointer; font: 700 .85rem/1.2 system-ui, sans-serif; border-radius: 12px; opacity: .75; }
.as-stop:hover { opacity: 1; background: color-mix(in srgb, var(--as-fg, #fff) 12%, transparent); }
.as-stop.on { opacity: 1; color: var(--ga-accent); }
.as-ico { font-size: 1.5rem; line-height: 1.1; transition: transform .2s; }
.as-stop.on .as-ico { transform: scale(1.25); }
.as-lbl { white-space: nowrap; }

/* ---------------------------------------------------------------- the small copy that floats */
.as-float { position: fixed; right: 12px; bottom: 12px; z-index: 2147482000; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--as-bg, #222); box-shadow: 0 4px 14px #0004; }
.as-float[hidden] { display: none; }
.as-float button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 1.3rem; cursor: pointer; opacity: .55; padding: 0; }
.as-float button[aria-pressed="true"] { background: var(--ga-accent); opacity: 1; }
.as-float button:focus-visible { outline: 3px solid var(--as-fg, #fff); outline-offset: 1px; }
.as-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 899px) {
  .as-float { bottom: 10px; right: 10px; }
  .as-float:not(.open) button:not([aria-pressed="true"]) { display: none; }
  .as-float:not(.open) button { opacity: 1; }
  .as-stop { font-size: .78rem; }
}

/* ---------------------------------------------------------------- what changes with the age */
.age-swap .hero, .age-swap .chap, .age-swap .step, .age-swap .wide { animation: ga-in .5s ease-out; }
@keyframes ga-in { from { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .age-swap .hero, .age-swap .chap, .age-swap .step, .age-swap .wide { animation: none; } }
html[data-age-big] .hero-text, html[data-age-big] .chap, html[data-age-big] .step, html[data-age-big] .wide { font-size: 1.12em; }
.kid { font-size: 1.08em; }
.kid-pic { font-size: 2.6rem; line-height: 1.2; margin: .2em 0; letter-spacing: .1em; }
.ga-more { border-left: 5px solid var(--ga-accent); padding: .2em 0 .2em 14px; margin: .9em 0; }
.ga-more-t { display: block; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.ga-debate { background: color-mix(in srgb, var(--ga-accent) 18%, transparent); border-radius: 14px; padding: 12px 16px; margin: .9em 0; }
.ga-debate p { margin: 0; }

/* ---------------------------------------------------------------- Liminal Ed logo, next to the ☰ button */
.gem-brand, .gem-brand:hover { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 3px 2px !important; border: 0 !important; border-radius: 8px; background: none !important; box-shadow: none !important; line-height: 0; }
.gem-brand img { display: block; height: 22px; width: auto; }
.gem-brand .gb-light { display: none; }
.gem-brand.on-dark .gb-light { display: block; }
.gem-brand.on-dark .gb-dark { display: none; }
.gem-brand:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
/* in a centred top bar the logo goes to the left, and an empty box of the same width on the right keeps the rest centred */
.has-brand > .gem-brand { margin-right: auto; }
.has-brand::after { content: ""; flex: 0 0 var(--gb-w, 130px); margin-left: auto; }
@media (max-width: 899px) { .has-brand::after { display: none; } .has-brand > .gem-brand { margin-right: auto; } }
@media (max-width: 640px) { .gem-brand img { height: 19px; } }

/* ---------------------------------------------------------------- draft notice at the very bottom */
.gem-disclaimer { max-width: 760px; margin: 28px auto 8px; padding: 12px 16px; border-radius: 14px; border: 2px dashed var(--ga-accent); background: color-mix(in srgb, var(--ga-accent) 10%, var(--ga-bg, #fff)); color: var(--ga-ink, inherit); font-size: .9rem; line-height: 1.5; text-align: left; box-sizing: border-box; }
.gem-disclaimer p { margin: 0 0 6px; }
.gem-disclaimer p:last-child { margin: 0; }
.gem-disclaimer a { color: inherit; font-weight: 700; }
@media print { .as-float, .age-strip { display: none !important; } }
