/* YTE G13 public homepage — redesign directions (Issue #8).
   Two compositions share one component system:
     .dir-a  "Official YTE Innovation Portal" — editorial, institutional
     .dir-b  "Youth Innovation Live"          — video-forward, energetic
   The public homepage is served without the authenticated CSP, but every asset
   here is still local, and no inline event handlers are used. */

:root {
  --yte-navy: #071447;
  --yte-navy-2: #0d2263;
  --yte-ink: #16233f;
  --yte-muted: #5b6b88;
  --yte-line: #dfe4ef;
  --yte-orange: #e85b18;
  --yte-orange-2: #ff7a33;
  --yte-paper: #ffffff;
  --yte-cream: #f7f5f1;
  --yte-radius: 14px;
  --yte-max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  color: var(--yte-ink);
  background: var(--yte-paper);
  font-family: "Manrope", "Segoe UI", system-ui, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; }

/* The HTML `hidden` attribute must win over component display rules
   (.challenge-card uses display:flex, which would otherwise defeat filtering). */
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--yte-navy); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

.container { width: min(100% - 40px, var(--yte-max)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--yte-orange); outline-offset: 3px; border-radius: 4px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 13px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 750; letter-spacing: .01em; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-orange { background: var(--yte-orange); color: #fff; box-shadow: 0 10px 24px #e85b1833; }
.btn-orange:hover { background: #d2500f; }
.btn-outline { border-color: #ffffff55; color: #fff; }
.btn-outline:hover { background: #ffffff14; }
.btn-navy { background: var(--yte-navy); color: #fff; }
.btn-navy:hover { background: var(--yte-navy-2); }
.btn-ghost { border-color: var(--yte-line); color: var(--yte-navy); background: #fff; }
.btn-ghost:hover { border-color: var(--yte-navy); }
.btn-sm { min-height: 40px; padding: 9px 16px; font-size: 13px; }

/* ---------------- header ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 90;
  background: #fffffff2; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--yte-line);
}
.head-inner { display: flex; align-items: center; gap: 22px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 116px; height: auto; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 14px; letter-spacing: .02em; color: var(--yte-navy); }
.brand-name span { font-size: 11px; color: var(--yte-muted); letter-spacing: .04em; }

.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.primary-nav a { text-decoration: none; font-size: 14px; font-weight: 650; color: var(--yte-ink); }
.primary-nav a:hover { color: var(--yte-orange); }

.head-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none; align-items: center; gap: 8px; margin-left: auto;
  background: #fff; border: 1px solid var(--yte-line); border-radius: 10px;
  padding: 10px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--yte-navy); cursor: pointer;
}

/* ---------------- hero ---------------- */
.hero { position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.hero-eyebrow::before { content: none; }

.hero-title { margin: 18px 0 0; font-size: clamp(42px, 6.4vw, 86px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.hero-title em { font-style: normal; color: var(--yte-orange); }

.hero-lead { margin: 22px 0 0; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.65; color: var(--yte-muted); max-width: 52ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-media { position: relative; overflow: hidden; background: #050d2c; }
.hero-media > * {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-media video { z-index: 1; opacity: 0; transition: opacity .6s ease; }
.hero-media video.is-playing { opacity: 1; }
.hero-media img { z-index: 0; }

.media-caption {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--yte-muted);
}

/* ---------------- section scaffolding ---------------- */
.section { padding: 92px 0; }
.section--tight { padding: 64px 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; margin-bottom: 40px; }
.section-num { font-size: 12px; font-weight: 800; letter-spacing: .18em; color: var(--yte-orange); text-transform: uppercase; }
.section-title { margin: 10px 0 0; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; color: var(--yte-navy); }
.section-sub { margin: 12px 0 0; max-width: 62ch; color: var(--yte-muted); font-size: 15px; line-height: 1.65; }

/* ---------------- how it works ---------------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.step {
  position: relative; padding: 24px 22px 22px; border: 1px solid var(--yte-line); border-radius: var(--yte-radius);
  background: #fff; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.step:hover { border-color: var(--yte-navy); transform: translateY(-3px); box-shadow: 0 16px 32px #07144712; }
.step-index { font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--yte-orange); }
.step h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; color: var(--yte-navy); }
.step p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--yte-muted); }
.step-link { margin-top: auto; font-size: 12.5px; font-weight: 750; color: var(--yte-orange); }

/* ---------------- regions ---------------- */
.regions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.regions > * { min-width: 0; }
.region {
  border: 1px solid var(--yte-line); border-radius: var(--yte-radius); background: #fff;
  padding: 22px 18px; display: flex; flex-direction: column; gap: 8px; min-height: 190px;
}
.region-index { font-size: 11px; font-weight: 800; letter-spacing: .18em; color: var(--yte-orange); }
.region h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; color: var(--yte-navy); }
.region-venue { font-size: 13px; line-height: 1.5; color: var(--yte-muted); }
.region-date { font-size: 12.5px; font-weight: 700; color: var(--yte-ink); }
.status {
  margin-top: auto; display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  max-width: 100%; flex-wrap: wrap;
  font-size: 11px; font-weight: 750; letter-spacing: .02em; padding: 5px 10px; border-radius: 999px;
  background: #f1f4fa; color: #4a5c7d; border: 1px solid #dde4f0;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8b9ab5; }

/* ---------------- challenges ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filter-btn {
  font: inherit; font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--yte-line); background: #fff; color: var(--yte-ink); cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--yte-navy); border-color: var(--yte-navy); color: #fff; }

.challenges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.challenge-card {
  text-align: left; font: inherit; cursor: pointer; background: #fff; padding: 0;
  border: 1px solid var(--yte-line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.challenge-card:hover, .challenge-card:focus-visible {
  transform: translateY(-3px); border-color: #c3cfdf; box-shadow: 0 18px 38px #07144714;
}
.challenge-media { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #e6ebf3; }
.challenge-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.challenge-card:hover .challenge-media img { transform: scale(1.035); }
.challenge-media.is-missing { display: grid; place-items: center; background: linear-gradient(135deg, #eef2f8, #dde5f0); }
.challenge-media.is-missing img { display: none; }
.challenge-body { display: flex; flex-direction: column; gap: 8px; padding: 17px 18px 18px; flex: 1; }
.challenge-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.challenge-num { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; color: var(--yte-orange); }
.challenge-cat { font-size: 10.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: #6a7a97; }
.challenge-title { font-size: 17px; line-height: 1.3; letter-spacing: -.015em; font-weight: 750; color: var(--yte-navy); }
.challenge-question { font-size: 13px; line-height: 1.55; color: var(--yte-muted); }
.challenge-cta { margin-top: auto; padding-top: 4px; font-size: 12.5px; font-weight: 750; color: var(--yte-orange); }
.photo-credit { margin: 22px 0 0; font-size: 12px; color: #7b8aa3; }

.regions-note { margin: 18px 0 0; font-size: 13px; color: var(--yte-muted); }

.updates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.update-card { display: flex; flex-direction: column; gap: 8px; padding: 24px 22px; border: 1px solid var(--yte-line); border-radius: 14px; background: #fff; text-decoration: none; }
a.update-card:hover { border-color: #c3cfdf; box-shadow: 0 14px 30px #07144710; }
.update-source { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--yte-orange); }
.update-title { font-size: 17px; font-weight: 750; letter-spacing: -.015em; color: var(--yte-navy); }
.update-copy { font-size: 13px; line-height: 1.6; color: var(--yte-muted); }
.update-link { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 750; color: var(--yte-orange); }
.update-card--note { background: #f7f9fc; }

/* ---------------- pulse band ---------------- */
.pulse-band { background: var(--yte-navy); color: #fff; border-radius: 20px; padding: 46px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.pulse-band h2 { margin: 8px 0 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.03em; line-height: 1.1; }
.pulse-band p { margin: 12px 0 0; max-width: 58ch; color: #c3d1ec; font-size: 14.5px; line-height: 1.65; }
.pulse-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--yte-orange-2); }

/* ---------------- registration ---------------- */
.register { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 46px; align-items: start; }
.reg-card { background: #fff; border: 1px solid var(--yte-line); border-radius: 18px; padding: 28px; box-shadow: 0 20px 46px #07144714; }
.reg-card h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.02em; color: var(--yte-navy); }
.reg-card > p { margin: 0 0 18px; font-size: 13.5px; line-height: 1.6; color: var(--yte-muted); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #46567a; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; min-height: 46px; padding: 11px 13px; font: inherit; font-size: 14.5px;
  border: 1px solid #cfd8e8; border-radius: 9px; background: #fff; color: var(--yte-ink);
}
.form-row input:focus, .form-row select:focus { border-color: var(--yte-navy); }
.btn-full { width: 100%; }
.form-note { margin: 12px 0 0; font-size: 12px; line-height: 1.55; color: var(--yte-muted); }
.form-feedback { display: none; margin-bottom: 12px; padding: 11px 13px; border-radius: 9px; background: #fdecec; color: #9c2424; font-size: 13px; font-weight: 650; }

/* ---------------- footer ---------------- */
.site-foot { background: var(--yte-navy); color: #dbe3f4; padding: 64px 0 30px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
.site-foot h4 { margin: 0 0 14px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: #8fa2c4; }
.site-foot p { margin: 0 0 10px; font-size: 13px; line-height: 1.7; color: #b9c6e4; }
.site-foot a { color: #dbe3f4; text-decoration: none; font-size: 13px; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.foot-links { display: flex; flex-direction: column; gap: 9px; }
.foot-marks { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.foot-marks img { height: 34px; width: auto; background: #fff; border-radius: 7px; padding: 5px; }
.foot-marks .gauteng { height: 46px; }
.foot-marks img.no-plate { background: transparent; padding: 0; height: 30px; }
.foot-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid #ffffff1f; font-size: 12px; color: #93a4c6; }

/* ---------------- challenge dialog ---------------- */
.challenge-dialog { border: 0; border-radius: 18px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 30px 80px #00000040; }
.challenge-dialog::backdrop { background: #071447aa; }
.dialog-inner { padding: 30px; }
.dialog-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--yte-orange); }
.dialog-inner h3 { margin: 10px 0 8px; font-size: 24px; letter-spacing: -.025em; color: var(--yte-navy); }
.dialog-inner p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.65; color: var(--yte-muted); }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dialog-close { position: absolute; top: 12px; right: 12px; background: #fff; border: 1px solid var(--yte-line); border-radius: 50%; width: 36px; height: 36px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--yte-ink); }

/* =====================================================================
   DIRECTION A — "Official YTE Innovation Portal" (editorial, institutional)
   ===================================================================== */
.dir-a { background: var(--yte-cream); }
.dir-a .hero { background: linear-gradient(180deg, #fff 0%, var(--yte-cream) 100%); padding: 72px 0 84px; }
.dir-a .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 56px; align-items: center; }
.dir-a .hero-media { border-radius: 18px; aspect-ratio: 2 / 1; border: 1px solid #d8d2c7; box-shadow: 0 30px 70px #0714471f; }
.dir-a .media-caption { margin-top: 14px; }

/* Region ribbon: a quiet, factual strip that anchors the five rounds
   immediately under the hero instead of a loud podium grid. */
.hero-ribbon { background: #fff; border-top: 1px solid #e2ded6; border-bottom: 1px solid #e2ded6; }
.hero-ribbon .container { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; padding: 15px 0; }
.hero-ribbon strong { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--yte-orange); }
.hero-ribbon span { font-size: 12.5px; font-weight: 650; color: var(--yte-muted); }
.dir-a .section--alt { background: #fff; }
.dir-a .section-head { border-top: 1px solid #e2ded6; padding-top: 26px; }
.dir-a .region { background: #fff; }
.dir-a .pulse-band { background: var(--yte-navy); }

/* =====================================================================
   DIRECTION B — "Youth Innovation Live" (video-forward, energetic)
   ===================================================================== */
.dir-b { background: #fff; }
.dir-b .site-head { background: #071447; border-bottom-color: #ffffff1f; }
.dir-b .brand-name strong { color: #fff; }
.dir-b .brand-name span { color: #9fb0d3; }
.dir-b .primary-nav a { color: #dbe3f4; }
.dir-b .primary-nav a:hover { color: var(--yte-orange-2); }
.dir-b .menu-toggle { background: #ffffff14; border-color: #ffffff2e; color: #fff; }
.dir-b .btn-ghost { background: transparent; border-color: #ffffff33; color: #fff; }

.dir-b .hero { background: #050d2c; color: #fff; padding: 0; overflow: hidden; }
.dir-b .hero-grid { display: block; position: relative; min-height: min(86vh, 760px); }
.dir-b .hero-media { position: absolute; inset: 0; z-index: 0; }
.dir-b .hero-media::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  /* Stronger left-to-right scrim: the artwork's "YTE" letters sat directly
     behind the headline and hurt legibility. The right side keeps the imagery. */
  /* Solid behind the headline so the source footage's large YTE lettering never
     shows through, opening up on the right so the statue and video stay visible. */
  background: linear-gradient(90deg, #050d2c 0%, #050d2c 60%, #050d2ce6 72%, #050d2c8a 86%, #050d2c1f 100%),
              linear-gradient(0deg, #050d2ce6 0%, #050d2c33 55%, transparent 78%);
}
.dir-b .hero-media video, .dir-b .hero-media .hero-still { object-fit: cover; }
.dir-b .hero-copy { position: relative; z-index: 3; padding: 96px 0 84px; max-width: 720px; }
.dir-b .hero-title { color: #fff; font-size: clamp(46px, 7.4vw, 104px); }
.dir-b .hero-lead { color: #c9d5ec; }
.dir-b .hero-eyebrow { color: var(--yte-orange-2); }
.dir-b .hero-actions .btn-outline { border-color: #ffffff5c; background: #ffffff1a; }
.dir-b .hero-actions .btn-outline:hover { background: #ffffff2e; border-color: #ffffff85; }
.dir-b .stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: #ffffff1a; position: relative; z-index: 3; }
.dir-b .stats-strip div { background: #071447; padding: 22px 24px; }
.dir-b .stats-strip strong { display: block; font-size: 26px; letter-spacing: -.03em; color: #fff; }
.dir-b .stats-strip span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #9fb0d3; }

.dir-b .section--alt { background: #f6f8fc; }
.dir-b .region { scroll-snap-align: start; background: #fff; border-color: #dbe3f2; min-height: 210px; }
.dir-b .region h3 { font-size: 22px; }
.dir-b .challenge-card { border-width: 1px; }
.dir-b .pulse-band { background: linear-gradient(120deg, #071447, #122f7a); }
.dir-b .reg-card { border-color: #dbe3f2; }
.dir-b .site-foot { background: #050d2c; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .updates-grid { grid-template-columns: 1fr 1fr; }
  .dir-a .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .challenges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .register { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .dir-b .hero-copy { padding: 72px 0 60px; }
}

@media (max-width: 900px) {
  /* Phones: the headline spans the full width, so darken the hero further while
     keeping some of the artwork visible. */
  .dir-b .hero-media::after {
    background: linear-gradient(180deg, #050d2cf2 0%, #050d2ce0 58%, #050d2cf2 100%);
  }
}

@media (max-width: 820px) {
  .primary-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .head-actions { display: none; }
  .site-head.menu-open .primary-nav {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--yte-line); padding: 8px 20px 18px;
  }
  .dir-b .site-head.menu-open .primary-nav { background: #071447; border-bottom-color: #ffffff1f; }
  .site-head.menu-open .primary-nav a { padding: 13px 0; border-bottom: 1px solid var(--yte-line); font-size: 15px; }
  .dir-b .site-head.menu-open .primary-nav a { border-bottom-color: #ffffff1f; color: #dbe3f4; }
  .site-head.menu-open .primary-nav .btn { margin-top: 14px; }
  .section { padding: 62px 0; }
  .regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse-band { padding: 30px; }
  .dir-b .stats-strip { grid-template-columns: 1fr; }
  .dir-b .hero-grid { min-height: 0; }
}

@media (max-width: 560px) {
  .updates-grid { grid-template-columns: 1fr; }
  .container { width: min(100% - 28px, var(--yte-max)); }
  .steps, .challenges { grid-template-columns: 1fr; }
  .regions { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .brand img { width: 92px; }
  .reg-card { padding: 20px; }
  }
