/* ==========================================================================
   Mwanga wa Elimu — orbit rings (motion around card photos)
   v1.0 · CSS only · no dependencies

   Three rings turn around any photo:
     1. dotted outer ring + white satellite dot   (slow, clockwise)
     2. clock-tick ring                            (slower, anticlockwise)
     3. teal arc                                   (faster, clockwise)

   Use it in one of two ways (see mwanga-orbit-demo.html):
     A. Paste the markup snippet around an <img>.
     B. Add the class  mwe-orbit-auto  to any element that contains an <img>
        (e.g. an Elementor Image widget → Advanced → CSS Classes) and load
        mwanga-orbit.js — it builds the rings for you.

   Tune with the custom properties below, on .mwe-orbit or any parent.
   ========================================================================== */

.mwe-orbit {
  --mwe-orbit-size: 200px;      /* overall diameter */
  --mwe-orbit-ring: #123262;    /* dotted ring + arc */
  --mwe-orbit-tick: var(--mwe-orbit-ring); /* clock ticks */
  --mwe-orbit-sat: var(--mwe-orbit-ring);  /* satellite dot */
  --mwe-orbit-rim: var(--mwe-orbit-ring);  /* thin rim around the photo */
  --mwe-orbit-photo-bg: #79D0CF;/* behind the photo / initials */
  --mwe-orbit-ink: #123262;     /* initials colour */
  --mwe-orbit-slow: 60s;        /* outer ring, one full turn */
  --mwe-orbit-ticks: 90s;       /* tick ring, one full turn */
  --mwe-orbit-arc: 14s;         /* arc, one full turn */

  position: relative;
  display: inline-block;
  flex: none;
  width: var(--mwe-orbit-size);
  height: var(--mwe-orbit-size);
}

.mwe-orbit__rings {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* each ring rotates around the centre of the SVG */
.mwe-orbit__spin,
.mwe-orbit__ticks,
.mwe-orbit__arc {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: mwe-orbit-turn linear infinite;
  animation-delay: var(--mwe-orbit-phase, 0s);   /* set by the JS so cards don't move in lockstep */
}
.mwe-orbit__spin  { animation-duration: var(--mwe-orbit-slow); }
.mwe-orbit__ticks { animation-duration: var(--mwe-orbit-ticks); animation-direction: reverse; }
.mwe-orbit__arc   { animation-duration: var(--mwe-orbit-arc); }

.mwe-orbit__spin circle:first-child { fill: none; stroke: var(--mwe-orbit-ring); stroke-width: 1.5; stroke-dasharray: 2 7; }
.mwe-orbit__spin circle:last-child  { fill: var(--mwe-orbit-sat); }
.mwe-orbit__ticks circle { fill: none; stroke: var(--mwe-orbit-tick); stroke-opacity: .3; stroke-width: 7; stroke-dasharray: 1 5; }
.mwe-orbit__arc path { fill: none; stroke: var(--mwe-orbit-ring); stroke-width: 3.5; stroke-linecap: round; }

/* the photo (or initials) sits inside the rings */
.mwe-orbit__photo {
  position: absolute; inset: 12%;
  width: 76%; height: 76%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--mwe-orbit-photo-bg);
  box-shadow: 0 0 0 3px var(--mwe-orbit-rim);
}
span.mwe-orbit__photo {
  display: flex; align-items: center; justify-content: center;
  color: var(--mwe-orbit-ink);
  font: 700 calc(var(--mwe-orbit-size) * .2) / 1 'Poppins', system-ui, sans-serif;
}

/* a gentle lift on the photo when its card is hovered (speed-up is done by the JS) */
.mwe-orbit-host .mwe-orbit__photo,
.mwe-orbit .mwe-orbit__photo { transition: transform .4s ease, box-shadow .4s ease; }
.mwe-orbit-host:hover .mwe-orbit__photo,
.mwe-orbit-host:focus-within .mwe-orbit__photo {
  transform: scale(1.03);
  box-shadow: 0 0 0 3px var(--mwe-orbit-rim), 0 0 28px rgba(121, 208, 207, .55);
}

@keyframes mwe-orbit-turn { to { transform: rotate(360deg); } }

/* respect people who switch off motion */
@media (prefers-reduced-motion: reduce) {
  .mwe-orbit__spin, .mwe-orbit__ticks, .mwe-orbit__arc { animation: none; }
  .mwe-orbit-host .mwe-orbit__photo, .mwe-orbit .mwe-orbit__photo { transition: none; }
}

/* --- auto mode: always centred in its container ------------------------- */
.mwe-orbit-auto { text-align: center; }
.mwe-orbit-auto .mwe-orbit { display: block; margin-left: auto; margin-right: auto; }
.mwe-orbit-auto a { display: block; }
.mwe-orbit-auto img.mwe-orbit__photo {
  position: absolute; inset: 12%; width: 76% !important; height: 76% !important; max-width: none !important;
  margin: 0 !important; aspect-ratio: 1; object-fit: cover; object-position: center top; border-radius: 50%;
}
/* a wrapper that Salient puts around a lazy-loaded image must not offset it */
.mwe-orbit-auto .img-with-aniamtion-wrap, .mwe-orbit-auto .inner, .mwe-orbit-auto figure { margin: 0 !important; padding: 0 !important; }

/* no photo: the ring wraps whatever the element contains */
.mwe-orbit--wrap .mwe-orbit__content {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: var(--mwe-orbit-content-max, 220px);
  text-align: center; color: var(--mwe-orbit-ink); line-height: 1.25;
}
