/* =========================================================
   STEM Education for Kids CIC — design system
   Colours sampled from the supplied logo (yellow / red / green / blue
   building blocks, blue wordmark). Adjust tokens here if the brand
   is refined later — every page reads from these variables.
   ========================================================= */

:root {
  --blue: #2158C4;        /* deep logo blue — nav, headings, primary buttons */
  --blue-dark: #163E8F;   /* hover/active state for blue elements */
  --red: #E5433A;         /* accent — used sparingly for tags/icons/card edges */
  --yellow: #F6C338;      /* accent */
  --green: #3FA64E;       /* accent */
  --ink: #17324D;         /* body text */
  --ink-soft: #4B6076;    /* secondary text */
  --paper: #FFFDF8;       /* page background */
  --mist: #EEF6FC;        /* pale blue section background */
  --cream: #FFF9EA;       /* pale yellow section background */
  --line: #D8E2EC;        /* borders/dividers */
  --white: #FFFFFF;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(23, 50, 77, .10);
  --shadow-sm: 0 2px 8px rgba(23, 50, 77, .08);
  --focus: 3px solid #163E8F;
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: 68ch; }
ul, ol { padding-left: 1.25em; }
a { color: var(--blue); text-decoration-thickness: 2px; }
a:hover { color: var(--blue-dark); }
button { font-family: inherit; }

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--blue);
  color: var(--white);
  padding: .75em 1.25em;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section--mist { background: var(--mist); }
.section--cream { background: var(--cream); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .5em;
}
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  justify-content: center;
  padding: .85em 1.5em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  min-height: 48px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); color: var(--white); }
.btn--secondary { background: var(--white); color: var(--blue); border-color: var(--blue); }
.btn--secondary:hover { background: var(--mist); color: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.btn--ghost:hover { background: var(--mist); }
.btn--sm { padding: .55em 1.1em; min-height: 40px; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.15;
}
.brand img { height: 48px; width: auto; display: block; }
.brand__name span { display: block; }
.brand__name .sub { font-weight: 600; color: var(--blue); font-size: .85em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .96rem;
  padding: .4em .1em;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--yellow);
}
.header-cta { display: flex; align-items: center; gap: .75rem; }
/* The nav's own copy of the CTA is for the mobile slide-out menu only;
   the desktop CTA (.header-cta--desktop, outside <nav>) covers wide screens. */
.main-nav > .header-cta { display: none; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 880px) {
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    box-shadow: -8px 0 24px rgba(23,50,77,.15);
    transform: translateX(100%);
    transition: transform .2s ease;
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: .25rem; margin-top: 1rem; }
  .main-nav a { display: block; padding: .75em .25em; }
  .header-cta.header-cta--desktop { display: none; }
  .main-nav > .header-cta { display: flex; margin-top: 1.5rem; flex-direction: column; align-items: stretch; }
  .nav-toggle { display: inline-flex; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(23,50,77,.35);
    z-index: 90;
  }
  .nav-backdrop.is-open { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--mist) 0%, var(--paper) 100%);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero__art {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-soft);
}
.hero__art.hero__art--photo { padding: 0; overflow: hidden; }
.hero__art .placeholder-box {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, var(--mist), var(--mist) 12px, var(--white) 12px, var(--white) 24px);
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-weight: 600;
  font-size: .95rem;
}
.hero__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------- Real photography: page and gallery photos ---------- */
.page-photo {
  margin: 0 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.page-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center top;
}
.gallery-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
}
.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Status panel ---------- */
.status-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.status-panel dt {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: .2em;
}
.status-panel dd { margin: 0; font-weight: 600; }
.status-panel--full { grid-column: 1 / -1; }
.status-note {
  font-size: .85rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  margin-top: .75rem;
  padding-top: .75rem;
}
.status-note strong { color: var(--ink); }

/* status chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .78rem;
  font-weight: 700;
  padding: .3em .8em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.chip--current { background: #E4F5E7; color: #1F6B2B; }
.chip--development { background: #FFF3D6; color: #8A6210; }
.chip--planned { background: var(--mist); color: var(--blue-dark); }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.card--accent-red { border-top: 5px solid var(--red); }
.card--accent-yellow { border-top: 5px solid var(--yellow); }
.card--accent-green { border-top: 5px solid var(--green); }
.card--accent-blue { border-top: 5px solid var(--blue); }
.card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--mist);
  margin-bottom: 1rem;
}
.card__icon svg { width: 26px; height: 26px; color: var(--blue); }

.route-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Video card ---------- */
.video-card {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}
.video-card p { color: rgba(255,255,255,.85); margin-left: auto; margin-right: auto; }
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* The whole card is the link when no single video is featured yet,
   so the "watch on YouTube" action is impossible to miss. */
.video-channel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: var(--mist);
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.video-channel-card:hover {
  background: var(--white);
  border-color: var(--yellow);
}
.video-channel-card:hover .video-channel-card__play { transform: scale(1.08); }
.video-channel-card__play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.video-channel-card__play svg { width: 30px; height: 30px; margin-left: 3px; }
.video-channel-card__label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.video-channel-card__note {
  font-size: .85rem;
  color: var(--ink-soft);
}

/* ---------- Definition list (session facts) ---------- */
.fact-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2rem;
  margin: 0;
}
@media (max-width: 640px) { .fact-list { grid-template-columns: 1fr; } }
.fact-list dt {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.fact-list dd { margin: .15em 0 0; }

/* ---------- Accordion ---------- */
.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 1.1rem .25rem;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  color: var(--ink);
}
.accordion-trigger .plus {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  transition: transform .15s ease;
}
.accordion-trigger[aria-expanded="true"] .plus { transform: rotate(45deg); }
.accordion-panel {
  padding: 0 .25rem 1.25rem;
}
.accordion-panel[hidden] { display: none; }

/* ---------- Placeholder imagery ---------- */
.placeholder-photo {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  background: var(--mist);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
  padding: 1.25rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.85);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}
.site-footer a { color: var(--white); }
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 720px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
}
.site-footer h3 { color: var(--white); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5em; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.15);
  margin-top: 2rem;
  padding-top: 1.5rem;
  font-size: .85rem;
  color: rgba(255,255,255,.65);
}
.footer-legal p { max-width: none; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: var(--mist);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { color: var(--blue-dark); }

/* ---------- Misc ---------- */
.list-check { list-style: none; padding: 0; }
.list-check li {
  display: flex;
  gap: .6em;
  margin-bottom: .6em;
}
.list-check li::before {
  content: "";
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: .15em;
  border-radius: 50%;
  background: var(--green);
  -webkit-mask: url('../assets/icons.svg#check') center / contain no-repeat;
  mask: url('../assets/icons.svg#check') center / contain no-repeat;
}
.divider { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.notice {
  background: var(--cream);
  border: 1px solid #F0DFA0;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: .95rem;
}
.notice--policy {
  background: var(--mist);
  border-color: var(--line);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.table-scroll { overflow-x: auto; }
