/* =============================================================
   Spacetoon Education brand layer
   Taken from "Spacetoon Edu Overview (Dec 2025)":
   - Navy #14146C and cyan #28A8E0 (sampled from the Stoon Education logo)
   - Magra Bold headings with a short cyan bar underneath, Helvetica/Arial body
   - White pages, cyan half-circles on the page edges, light-blue network sphere,
     line-art space doodles, rounded white cards, navy call-out banners
   Loaded AFTER styles.css: it only re-paints, it does not change layout or geometry
   (except tap targets, raised to 48 px for touch screens / smart boards).
   Science Street rules kept: flat chrome (no gradients or glow outside the 3D stage),
   brand colours used as fills not as text, no letter-spacing/uppercase on Arabic.
   ============================================================= */
:root {
  --navy: #14146C;
  --cyan: #28A8E0;
  --cyan-tint: #E3F4FC;
  --ink: var(--navy);
  --text: #1C1C33;
  --muted: #4E5873;
  --line: #D5E3EE;
  --panel: #FFFFFF;
  --bg: #FFFFFF;
  --knob: var(--navy);
  --accent: var(--cyan);
  --radius: 20px;
  --font-head: 'Magra', 'Tajawal', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, 'Tajawal', sans-serif;
  font-family: var(--font-body);
  color: var(--text);
}
[dir="rtl"] { --font-head: 'Tajawal', 'Magra', sans-serif; --font-body: 'Tajawal', 'Helvetica Neue', Arial, sans-serif; }
body { background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input { font-family: var(--font-body); }

/* ---------- Headings: Magra Bold, navy, cyan bar ---------- */
h1, h2, h3, .vs-label, .big, .vs-value b, .temp-badge, .seg-btn, .pill-btn, .tog, .chip, .gt b {
  font-family: var(--font-head);
}
h1, h2, h3 { color: var(--navy); font-weight: 700; }
.brand h1 { font-size: clamp(26px, 3.4vw, 40px); }
.brand h1::after, .chain-wrap h2::after, .dlg h2::after {
  content: ''; display: block; width: 72px; height: 5px; border-radius: 3px; background: var(--cyan); margin-top: 8px;
}
.card h3::after { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--cyan); margin-top: 6px; }
.subtitle { color: var(--navy); font-style: italic; font-size: 15px; margin-top: 8px; }
[dir="rtl"] .subtitle { font-style: normal; }

/* ---------- Page decorations ---------- */
.edge-dot { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: var(--cyan); z-index: 0; pointer-events: none; }
.edge-dot-start { top: 640px; left: -84px; }
.topbar { position: relative; padding-top: 22px; padding-inline-start: clamp(70px, 9vw, 120px); }
.sphere { position: absolute; top: -34px; inset-inline-start: -58px; width: 150px; height: auto; pointer-events: none; z-index: 0; }
.brand { position: relative; z-index: 1; }
.logos { display: flex; align-items: center; gap: 18px; margin-inline-start: auto; }
.logos img { display: block; height: auto; }
.logo-stoon { width: 118px; }
.topbar { flex-wrap: wrap; }
.toolbar { order: 3; flex-basis: 100%; }
.presets { padding-inline-start: clamp(70px, 9vw, 120px); }
.doodle { position: absolute; pointer-events: none; opacity: .85; }
.chain-wrap { position: relative; }
.doodle-planet { width: 92px; top: 4px; inset-inline-end: clamp(16px, 4vw, 48px); }

/* ---------- Buttons: navy pills, 48 px tap targets ---------- */
.seg { border: 2px solid var(--navy); background: #fff; }
.seg-btn, .pill-btn, .chip, .tog { min-height: 48px; min-width: 48px; font-weight: 700; }
.seg-btn { color: var(--navy); padding-inline: 18px; font-size: 15px; }
.seg-btn.is-on { background: var(--navy); color: #fff; }
.seg-label { color: var(--muted); }
.pill-btn { border: 2px solid var(--navy); color: var(--navy); background: #fff; font-size: 15px; padding-inline: 20px; }
.pill-btn:hover { background: var(--cyan-tint); }
.pill-dark { background: var(--navy); color: #fff; }
.pill-dark:hover { background: #22228a; }
.chip { border: 2px solid var(--line); color: var(--navy); background: #fff; font-size: 15px; padding-inline: 18px; }
.chip:hover { border-color: var(--cyan); background: var(--cyan-tint); }
.presets > span { color: var(--muted); }
.tog { border: 2px solid var(--navy); color: var(--navy); background: #fff; padding-inline: 16px; }
.tog[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg-sm .seg-btn { min-height: 44px; padding-inline: 14px; font-size: 14px; }

/* ---------- Sliders: logo navy knob on a light track ---------- */
.vs-track { background: #EEF3F8; border-color: var(--navy); }
.vs-fill { background: color-mix(in srgb, var(--c) 38%, #fff); }
.vs-knob { background: var(--navy); border: 4px solid #fff; box-shadow: 0 0 0 2.5px var(--navy); }
.vs-track:focus-visible { box-shadow: 0 0 0 4px var(--cyan); }
.vs-mark { border-top-color: rgba(20, 20, 108, .55); }
.vs-label { color: var(--navy); }
.vs-value b { color: var(--navy); }
.vs-help { border-color: var(--navy); color: var(--navy); width: 30px; height: 30px; }
.vs-tip { background: var(--navy); }
.vs-linked { background: #fff; border-color: var(--cyan); color: var(--navy); }
.vslider.linked .vs-knob { box-shadow: 0 0 0 2.5px var(--navy), 0 0 0 8px var(--cyan); }

/* ---------- Globe area ---------- */
.temp-badge { border-color: var(--navy); text-shadow: none; font-size: 24px; }
.mood { background: var(--navy); color: #fff; border: 0; border-radius: 18px; font-weight: 700; padding: 10px 18px; }
.legend { color: var(--muted); }
.drag-hint { color: var(--muted); }
.heat-legend, .hs-panel { border-color: var(--navy); border-radius: 18px; }
.hs-panel h3::after { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--cyan); margin-top: 6px; }
.gtag { border-color: var(--navy); min-height: 40px; }
.gtag.mini { min-width: 40px; justify-content: center; }
.gi { background: var(--navy); }
.gtag.gcoast { border-color: var(--navy); }
.gtag.gcoast .gi { background: var(--cyan); }
.gt b { color: var(--navy); }

/* ---------- Cause → effect chain ---------- */
.chain li span { border-color: var(--navy); color: var(--navy); background: color-mix(in srgb, #F08A3C calc(var(--on) * 100%), var(--cyan-tint)); }
.chain li:not(:last-child)::after { color: var(--cyan); }

/* ---------- Cards: white, rounded, hairline border ---------- */
.card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.card .big { color: var(--navy); }
.card-temp .big { color: inherit; }
.coast, .mountain { border: 1.5px solid var(--line); border-radius: 14px; }
.card svg text { fill: var(--navy); }
.lvl { border-color: var(--navy); }
.tips li { border-bottom-color: var(--line); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 24px; }
dialog::backdrop { background: rgba(20, 20, 108, .45); }
.sources a { color: var(--navy); text-decoration-color: var(--cyan); text-underline-offset: 3px; }

/* ---------- Footer, as on the deck ---------- */
.site-footer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px 36px; border-top: 1.5px solid var(--line); margin: 0 clamp(16px, 4vw, 48px); text-align: center; }
.footer-logo { width: 140px; height: auto; }
.site-footer p { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--navy); }
.site-footer small { color: var(--muted); font-size: 12px; }
.doodle-galaxy { width: 80px; top: 18px; inset-inline-start: 8%; }

/* never stretch Arabic */
[dir="rtl"] * { letter-spacing: 0 !important; text-transform: none !important; }

@media (max-width: 900px) {
  .edge-dot { display: none; }
}
@media (max-width: 640px) {
  .topbar, .presets { padding-inline-start: 16px; }
  .sphere { width: 96px; top: -26px; inset-inline-start: -40px; opacity: .7; }
  .logos { gap: 10px; }
  .logo-stoon { width: 84px; }

  .doodle-planet { width: 60px; }
  .brand h1 { font-size: 24px; }
}
.card-temp .big { color: var(--navy) !important; }
.thermo { width: 150px; }
.doodle-planet { top: 10px; width: 66px; } /* stays inside "What is happening?" so it never covers the slider labels above */
.chain-wrap { padding-top: 28px; }
@media (max-width: 520px) { .temp-badge { top: 58px; } }
.seg-sm .seg-btn { min-height: 48px; }
.vs-help::before { content: ''; position: absolute; inset: -9px; } /* 48 px touch area around the small "?" */

/* ---------- The 4 consequence groups ---------- */
.cards { display: flex; flex-direction: column; gap: 34px; }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.group-head h2 { font-size: clamp(20px, 2.4vw, 26px); }
.group-head h2::after { content: ''; display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--cyan); margin-top: 6px; }
.group-num { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.group-icon { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--cyan-tint); color: var(--navy); display: grid; place-items: center; }
.group-icon svg { width: 26px; height: 26px; }
.group-intro { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 70ch; }
.group-lvl { margin-inline-start: auto; font-size: 14px; padding: 4px 14px; align-self: center; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* regional warming bars */
.rbars { display: flex; flex-direction: column; gap: 10px; }
.rbar { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 8px; font-size: 14px; }
.rbar-name { color: var(--navy); font-weight: 700; }
.rbar-track { height: 16px; border-radius: 8px; background: #EEF3F8; overflow: hidden; }
.rbar-track i { display: block; height: 100%; border-radius: 8px; transition: width .3s; }
.rbar b { font-family: var(--font-head); color: var(--navy); font-size: 18px; text-align: end; direction: ltr; }

/* storms, rain */
.storm-ico { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--cyan-tint); color: var(--navy); display: grid; place-items: center; }
.storm-ico svg { width: 40px; height: 40px; }
.card-storms .card-body .row { margin-bottom: 6px; }
.decade.wet { --fill: #3a86c8; }

/* animals list */
.animals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.animals li { display: flex; align-items: center; gap: 10px; }
.animals .gi { width: 36px; height: 36px; }
.animals .gi svg { width: 26px; height: 26px; }
.an-name { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.an-name b { color: var(--navy); font-size: 14px; }
.an-name small { color: var(--muted); font-size: 12px; }
.card-animals { grid-row: span 2; }

/* greenhouse-gas detail under the first slider */
.vs-detail { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; min-height: 14px; }
@media (max-width: 520px) { .group-lvl { display: none; } .rbar { grid-template-columns: 84px 1fr 46px; } }
/* "today" marks point away from the neighbouring slider */
.slider-group:first-child .vslider:last-child .vs-mark span { inset-inline-end: auto; inset-inline-start: calc(100% + 4px); }
.slider-group:last-child .vslider:first-child .vs-mark span { inset-inline-start: auto; inset-inline-end: calc(100% + 4px); }

/* ---------- No highlighting or dragging of text and images ---------- */
html, body, body * { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg, canvas { -webkit-user-drag: none; user-drag: none; }
input, textarea { -webkit-user-select: auto; user-select: auto; }
.site-footer a { color: var(--navy); text-decoration-color: var(--cyan); text-underline-offset: 3px; }

.sea-note { display: block; max-width: 190px; margin-top: 4px; padding: 6px 10px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.25; }
.sea-note[hidden] { display: none; }
@media (max-width: 520px) {
  .vs-help { position: relative; top: auto; inset-inline-end: auto; order: 10; margin-top: 2px; }
  .vs-label { font-size: 13px; overflow-wrap: anywhere; }
  .vs-value b { font-size: 18px; }
}
@media (max-width: 520px) {
  .vslider { width: 80px; }
  .slider-group { gap: 4px; }
  .stage { padding-inline: 8px; column-gap: 0; }
  .vs-label { font-size: 12px; overflow-wrap: normal; hyphens: auto; }
}

/* ---------- Labels show/hide button ---------- */
.tog-icon { display: inline-flex; align-items: center; gap: 8px; }
.tog-icon svg { width: 22px; height: 22px; flex: none; }
.tog-icon .ico-eye-off { display: none; }
.tog-icon[aria-pressed="false"] .ico-eye { display: none; }
.tog-icon[aria-pressed="false"] .ico-eye-off { display: block; }
.tog-icon[aria-pressed="false"] { background: #fff; color: var(--navy); }

/* ---------- Zoom magnifier buttons ---------- */
.zoom-ctrls { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 6; }
.zoom-btn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--navy); background: #fff; color: var(--navy); display: grid; place-items: center; padding: 0; cursor: pointer; }
.zoom-btn svg { width: 28px; height: 28px; }
.zoom-btn:hover { background: var(--cyan-tint); }
.zoom-btn:active { background: var(--navy); color: #fff; }
.globe-wrap.hs-mode .zoom-ctrls { display: flex; top: auto; bottom: 26px; transform: none; }
@media (max-width: 520px) {
  .zoom-ctrls { top: auto; bottom: 70px; transform: none; gap: 6px; }
  .zoom-btn { width: 48px; height: 48px; }
}
.zoom-ctrls { top: auto; bottom: 96px; transform: none; }
@media (max-width: 520px) { .temp-badge { top: 114px; } }

/* ---------- Live "What is happening?" steps ---------- */
.chain-hint { margin: 6px 0 12px; color: var(--muted); font-size: 15px; }
.csteps { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 26px; }
.csteps li { position: relative; flex: 1 1 0; min-width: 0; display: flex; }
.csteps li:not(:last-child)::after { content: '→'; position: absolute; inset-inline-end: -21px; top: 50%; transform: translateY(-50%); color: var(--cyan); font-weight: 800; font-size: 20px; }
[dir="rtl"] .csteps li:not(:last-child)::after { content: '←'; }
.cstep { width: 100%; min-height: 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: start; padding: 12px 12px 10px; border: 2px solid var(--navy); border-radius: 18px; background: #fff; color: var(--navy); cursor: pointer; transition: background-color .35s, box-shadow .2s, transform .15s; }
.cstep:hover { transform: translateY(-2px); }
.cstep:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--cyan); }
.cstep.active { box-shadow: 0 0 0 4px var(--cyan); }
.cs-icon { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--navy); border: 1.5px solid rgba(20,20,108,.2); }
.cs-icon svg { width: 22px; height: 22px; }
.cs-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.15; }
.cs-val { font-family: var(--font-head); font-size: 26px; line-height: 1.05; unicode-bidi: plaintext; }
.cs-sub { font-size: 12.5px; color: var(--text); line-height: 1.2; }
.cs-lvl { margin-top: auto; font-size: 12px; font-weight: 700; border: 1.5px solid var(--navy); border-radius: 999px; padding: 1px 10px; background: #fff; }
.cstep.lvl-bg-0 { background: #DDF2E0; }
.cstep.lvl-bg-1 { background: #FDF0C4; }
.cstep.lvl-bg-2 { background: #FBD3AE; }
.cstep.lvl-bg-3 { background: #F4B4A9; }
.cstep.lvl-bg-c { background: #D4EBFB; }
.cstep.pulse { animation: cs-pulse .8s ease-out; }
@keyframes cs-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cstep.pulse { animation: none; } .cstep:hover { transform: none; } }

/* ---------- Show more ---------- */
.more-wrap { display: flex; justify-content: center; margin-top: 18px; }
.more-btn { display: inline-flex; align-items: center; gap: 8px; padding-inline: 26px; font-size: 16px; }
.more-btn svg { width: 20px; height: 20px; transition: transform .25s; }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.cards[hidden] { display: none; }

@media (max-width: 900px) {
  .csteps { flex-wrap: wrap; gap: 14px; }
  .csteps li { flex: 1 1 calc(50% - 14px); }
  .csteps li:not(:last-child)::after { display: none; }
}
@media (max-width: 520px) {
  .csteps li { flex-basis: 100%; }
  .cstep { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; }
  .cs-title { flex: 1; }
  .cs-val { font-size: 22px; }
  .cs-sub { flex-basis: 100%; }
  .cs-lvl { margin-top: 0; }
}

/* ---------- Label close-up panel ---------- */
.tag-panel .pill-btn { align-self: flex-start; font-size: 13px; padding: 3px 12px; }
.tag-panel .tp-val { margin: 0; font-family: var(--font-head); font-size: 20px; color: var(--navy); unicode-bidi: plaintext; }
.tag-panel .tp-x { margin: 0; font-size: 14px; line-height: 1.35; }
.tag-panel .tp-x:empty { display: none; }
.globe-wrap.tag-mode .mood, .globe-wrap.tag-mode .legend { display: none; }

/* ---------- Galaxy doodle in the top-right corner (in place of the logo) ---------- */
.logo-galaxy { width: 96px; opacity: .85; }
@media (max-width: 520px) { .logo-galaxy { width: 64px; } }
body { padding-bottom: 32px; } /* breathing room now that the footer is gone */
