/* ======================================================================
 * ts-loader.css — Overlay 95 (C95-5): the request indicator.
 *
 * ⚠ A NEW FILE rather than an edit to a shared stylesheet, and that was
 * deliberate: Overlay 95 shipped as one lane of a parallel batch in which
 * another lane also owned `static/css/`. A new file cannot conflict.
 * If a later round consolidates the stylesheets, this folds in freely.
 *
 * ⚠ Tokens only — no raw hex, no !important. The spinner rides
 * `--ts-theme-primary`, which `_event_theme_css.html` repaints per event,
 * so on a themed client the spinner is drawn in THEIR colour for free.
 * An uploaded icon overrides the drawn ring through `--ts-loader-image`.
 * ==================================================================== */

.ts-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  /* Sits above page content and below nothing else that matters; Bootstrap's
     modal backdrop is 1050 and this must not cover a dialog. */
  z-index: 1040;
  /* ⚠ Derived from the surface token rather than written as a literal
     `rgba(255, 255, 255, 0.72)`, which is what the first cut used. The
     round's own purity test passed on it because `rgba()` is not hex —
     the test has been widened. It also meant a hard-WHITE scrim over a
     dark-background event. `color-mix` keeps the scrim on whatever the
     surface token is; Chrome-family is the only supported browser here
     (CLAUDE.md, verification limits). Overlay 95 review, LOW-8.
     ⚠ Overlay 111 (C111-7): the surface token is the FALLBACK now. It is
     `#ffffff` on every event, so a dark-themed page still flashed a 72%
     white veil (Overlay 97 measured `color(srgb 1 1 1 / 0.72)` over a
     `#12161f` body). `--ts-theme-page-bg` is the page colour the event's
     theme set, emitted by `_event_theme_css.html` only when it is what the
     body shows. */
  background: color-mix(
    in srgb, var(--ts-theme-page-bg, var(--ts-surface)) 72%, transparent
  );
}

/* ⚠ The ONLY thing the script toggles. Keeping visibility in one class
   means the script never writes inline style and never has to restore it.

   ⚠ Named `ts-loader-on` and NOT `is-active`, which is what the first cut
   used. `reports/tests_overlay85_nav_marks_one_current.py` counts the bare
   substring "is-active" across the WHOLE rendered page to prove the reports
   rail marks exactly one current entry — and this stylesheet's class name
   appears twice in base.html's inline script, so the count went 1 -> 3 and
   that test failed. The class was renamed rather than the test changed: the
   test is right, and a shared token is the house rule about hooks ("give a
   new variant its own hook") applying to CSS class names too. */
.ts-loader.ts-loader-on {
  display: flex;
}

/* Light change, 2026-10-29: the click SHIELD — the veil up but see-through, for
   the quarter second before the icon appears, so a second press cannot get in
   while the first request is on its way. `ts-loader-on` paints it as usual. */
.ts-loader.ts-loader-shield:not(.ts-loader-on) {
  display: flex;
  background: transparent;
}

.ts-loader.ts-loader-shield:not(.ts-loader-on) .ts-loader-mark {
  visibility: hidden;
}

.ts-loader-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--ts-radius-pill);
  background: var(--ts-surface);
  box-shadow: var(--ts-shadow-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ts-loader-spin 0.9s linear infinite;
}

/* The stock mark: a ring in the event's primary colour with one lighter
   quarter, which is what reads as rotation. */
.ts-loader-mark::after {
  content: "";
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--ts-radius-pill);
  border: 0.22rem solid var(--ts-border);
  border-top-color: var(--ts-theme-primary);
}

/* The client's uploaded icon, when the event has one. The drawn ring is
   suppressed rather than layered — two spinners on top of each other is
   what happens if this forgets. */
.ts-loader[data-has-icon="true"] .ts-loader-mark {
  background: transparent;
  box-shadow: none;
  background-image: var(--ts-loader-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.ts-loader[data-has-icon="true"] .ts-loader-mark::after {
  content: none;
}

@keyframes ts-loader-spin {
  to { transform: rotate(360deg); }
}

/* ⚠ Respect the OS setting. A full-screen element spinning at 0.9s is
   exactly what `prefers-reduced-motion` exists for; the indicator still
   APPEARS, it simply does not rotate, so the feedback survives. */
@media (prefers-reduced-motion: reduce) {
  .ts-loader-mark {
    animation: none;
  }
}
