/* base.css — theme-agnostic shared behavior loaded on EVERY Hub page.
   Per THEMING-SPEC Rule 2, cross-page behavior that isn't a theme token lives in
   this shared layer, never in the frozen theme files (Rule 1). Loaded before the
   theme/module CSS on each page.

   Reduced-motion: the whole Hub animates (per-module CSS carries 200+ motion decls
   total — home 70, jobs 69, purchases 46 …) with no global opt-out. One universal
   block neutralizes travel everywhere at once, honoring the OS setting. Keeps color
   state changes; only the motion travel/duration collapses. Supersedes the partial
   per-module blocks that already existed (finances, purchases, vault-map). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- global focus-visible ring ----------------
   #1 recurring a11y finding (10/12 pages): custom controls set
   outline:none or never style focus at all. One rule, every page,
   keyboard-only (focus-visible ignores mouse clicks). */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="checkbox"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------- themed modal ----------------
   Replacement for native alert/confirm/prompt. Mirrors the existing
   .launch-scrim/.launch-panel pattern in chrome.css (same tokens),
   generalized under a hub- prefix so any page can use it. */
.hub-modal-scrim {
  position: fixed;
  inset: 0;
  background: var(--launch-scrim);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
/* the scrim ships in HTML with [hidden]; an author display:flex beats the UA
   [hidden]{display:none} at equal specificity, so without this the empty scrim
   renders as a blank blurred overlay on load until JS hides it. */
.hub-modal-scrim[hidden] { display: none; }
.hub-modal {
  width: min(480px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--modal-shadow);
  padding: var(--s-5);
}
.hub-modal-title {
  font-family: var(--font);
  font-feature-settings: var(--feat-display);
  font-size: 18px;
  color: var(--fg);
  margin: 0 0 var(--s-3);
}
.hub-modal-body {
  font-family: var(--font-body);
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 var(--s-4);
}
.hub-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
}
.hub-modal-btn {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-2) var(--s-4);
  cursor: pointer;
}
.hub-modal-btn:hover { background: var(--bg-hover); }
.hub-modal-btn--danger {
  border-color: var(--alert-dim);
  color: var(--alert);
}

/* ---------------- inline error state ----------------
   For fetches that currently fail silently. */
.hub-error {
  background: color-mix(in srgb, var(--alert-dim) 20%, transparent);
  border: 1px solid var(--alert-dim);
  border-radius: var(--r-card);
  color: var(--alert);
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
}
.hub-error-retry {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  margin-left: var(--s-2);
}

/* ---------------- status dot ----------------
   Color-with-text helper: caller sets --dot-color and MUST pair
   this with a visible text label — the dot alone is not a state
   indicator (color-only conveys nothing to colorblind/SR users). */
.hub-dot {
  display: inline-flex;
  align-items: center;
}
.hub-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--fg-dim));
  margin-right: var(--s-2);
}
