/* SassaHelp depth and scroll layer.
   Every rule that moves something sits behind html.fx-motion, which fx.js only
   adds when the visitor has not asked for reduced motion. Blur, the costly part,
   sits behind :not(.fx-lite), so slow phones and Save-Data users never pay for it. */

/* ---------- Make the sticky header actually stick ----------
   The pages set overflow-x: hidden on both html and body. That turns body into
   its own scroll box, and position: sticky silently stops working. clip stops
   sideways scrolling the same way without creating a scroll box. Browsers that
   don't know clip keep the old hidden value. */
html, body { overflow-x: clip; }

/* ---------- Numbers never split across lines ----------
   The site-wide overflow guard lets long words break so nothing spills off a
   phone screen. That also let "R2,400" break into "R2,40 / 0" in narrow stat
   boxes. Amounts and codes stay whole, and shrink slightly on small phones instead. */
.stat-num, .ussd-val, .info-value, .contact-val, .tile-val, .fact-val, .mc-val,
.date-num, .row-date-num, .box-value, .cunit-num { overflow-wrap: normal; word-break: keep-all; white-space: nowrap; }
@media (max-width: 400px) {
  .stat-num { font-size: min(1.3rem, 4.6vw); }
}

/* ---------- Reading progress (long pages and articles) ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1001;
  background: #f5a623; transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

/* ---------- Header: lifts off the page once you start scrolling ---------- */
header { transition: box-shadow .35s ease, background-color .35s ease; }
html.fx-scrolled header { box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 10px 30px -12px rgba(5,12,30,.55); }
@media (min-width: 761px) {
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html.fx-scrolled:not(.fx-lite) header {
      background-color: rgba(15,34,64,.82);
      -webkit-backdrop-filter: saturate(150%) blur(14px);
      backdrop-filter: saturate(150%) blur(14px);
    }
  }
}

/* ---------- Layered elevation: two soft shadows read as depth, one hard one reads as a box ---------- */
.fx-lift {
  box-shadow: 0 1px 2px rgba(15,34,64,.05), 0 8px 24px -14px rgba(15,34,64,.22);
  transition: box-shadow .4s ease, translate .4s cubic-bezier(.2,.7,.2,1);
}
@media (hover: hover) and (pointer: fine) {
  a.fx-lift:hover, .fx-lift.fx-link:hover {
    translate: 0 -3px;
    box-shadow: 0 2px 4px rgba(15,34,64,.06), 0 22px 40px -18px rgba(15,34,64,.35);
  }
}

/* ---------- Hero: the photo drifts slower than the text and falls out of focus ---------- */
html.fx-motion .hero::before {
  translate: 0 var(--fx-y, 0px);
  scale: 1.04;
  animation: fx-settle 1.8s cubic-bezier(.2,.7,.2,1) both;
  will-change: translate;
}
html.fx-motion:not(.fx-lite) .hero::before { filter: blur(var(--fx-b, 0px)); }
html.fx-motion .hero-inner {
  translate: 0 var(--fx-lift, 0px);
  opacity: var(--fx-o, 1);
  will-change: translate, opacity;
}
@keyframes fx-settle { from { scale: 1.12; } to { scale: 1.04; } }

/* Phones (80% of visitors): same depth effect, but driven by the browser's own
   scroll timeline so it never stutters behind the finger. Where unsupported,
   the hero simply stays still. No blur on phones. */
@supports (animation-timeline: scroll()) {
  html.fx-motion.fx-lite .hero::before {
    animation: fx-settle 1.8s cubic-bezier(.2,.7,.2,1) both, fx-drift linear both;
    animation-timeline: auto, scroll(root);
    animation-range: normal, 0px 100vh;
  }
  html.fx-motion.fx-lite .hero-inner {
    animation: fx-fade-up linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 100vh;
  }
}
@keyframes fx-drift { from { translate: 0 0; } to { translate: 0 30%; } }
@keyframes fx-fade-up { from { translate: 0 0; opacity: 1; } to { translate: 0 -36px; opacity: .6; } }

/* Hero text rises into place on load. Transform only, never opacity,
   so the headline still counts as painted for Core Web Vitals. */
html.fx-motion .hero-inner > * { animation: fx-rise .9s cubic-bezier(.2,.7,.2,1) both; }
html.fx-motion .hero-inner > *:nth-child(2) { animation-delay: .06s; }
html.fx-motion .hero-inner > *:nth-child(3) { animation-delay: .12s; }
html.fx-motion .hero-inner > *:nth-child(4) { animation-delay: .18s; }
html.fx-motion .hero-inner > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes fx-rise { from { translate: 0 16px; } to { translate: 0 0; } }

/* ---------- Content comes into focus as it scrolls into view ---------- */
html.fx-motion [data-fx] {
  opacity: 0; translate: 0 22px;
  transition: opacity .6s cubic-bezier(.2,.7,.2,1), translate .6s cubic-bezier(.2,.7,.2,1), filter .6s ease;
  transition-delay: var(--fx-d, 0s);
}
html.fx-motion:not(.fx-lite) [data-fx] { filter: blur(6px); }
/* Phones: a shorter, lighter arrival so fast thumb-scrolling never meets empty space */
html.fx-motion.fx-lite [data-fx] { translate: 0 12px; transition-duration: .45s; }
html.fx-motion.fx-lite [data-fx].fx-in { translate: 0 0; }
html.fx-motion [data-fx].fx-in { opacity: 1; translate: 0 0; filter: none; }

/* Never animate ads or anything inside them */
ins.adsbygoogle, .adsbygoogle [data-fx] { opacity: 1 !important; translate: none !important; filter: none !important; }

@media (prefers-reduced-motion: reduce) {
  .fx-progress { display: none; }
  .fx-lift, header { transition: none; }
}
