/* ==========================================================================
   BibleSlide design system — tokens, type scale and accessible base (Core).
   One source of truth for the public site, sign-in, dashboards and the /app.
   Loaded by Core on every front-end page, the sign-in pages and the app shell.
   Rules of use:
   - Components read semantic tokens (var(--brand-primary)…); never copy a hex value into a new component.
   - Everything here has zero specificity (:where) or is a custom property, so no existing component is overridden.
   - Colours of the official logo: royal blue, golden yellow, deep navy (checked on brand-logo.png: blue #0040A8–#0048B8,
     gold #D89818–#D8A020, navy #002870 — the tokens below are within that range, slightly lifted for screens).
   - Worship/presentation output (slides, projector, stage, themes chosen by users) does NOT use these tokens.
   ========================================================================== */

:root {
  /* ---- brand ---- */
  --brand-primary: #0649b8;
  --brand-primary-hover: #043a96;
  --brand-primary-active: #032d75;
  --brand-primary-soft: #eff6ff;
  --brand-gold: #e5a51b;
  --brand-gold-hover: #c98a0a;
  --brand-gold-soft: #fef6e0;
  --brand-gold-text: #8a5a00; /* gold as TEXT on white / light surfaces (>= 5:1); never #e5a51b for small text */
  --brand-navy: #0b2454;

  /* ---- surfaces ---- */
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-secondary: #f1f5f9;
  --surface-hover: #eff6ff;

  /* ---- text ---- */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;
  --text-on-gold: #0b2454; /* navy on gold: 7:1 */

  /* ---- borders and states ---- */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --focus-ring: #2563eb;

  /* ---- semantic status (always with an icon or a label: never colour alone) ---- */
  --success: #15803d;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --error: #b91c1c;
  --error-soft: #fef2f2;
  --error-border: #fecaca;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --info-border: #bfdbfe;

  /* ---- typography ---- */
  --font-heading: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-display: clamp(2.25rem, 1.6rem + 2.6vw, 3rem);
  --fs-h1: clamp(1.875rem, 1.5rem + 1.5vw, 2.25rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --fs-h4: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-meta: 0.75rem;
  --lh-tight: 1.15;
  --lh-heading: 1.25;
  --lh-body: 1.6;

  /* ---- spacing (4px scale) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- shape and depth ---- */
  --radius-sm: 8px; /* small controls */
  --radius-md: 10px; /* inputs, cards */
  --radius-lg: 14px; /* feature cards, dialogs */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(11, 36, 84, 0.35);

  /* ---- layout and layers ---- */
  --content-max: 1180px;
  --content-narrow: 760px;
  --z-dropdown: 50;
  --z-sticky: 100;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 1100;
  /* Breakpoints (documented; CSS custom properties cannot be used in @media): sm 640px · md 820px · lg 1100px · xl 1440px */
}

/* Ready for a future dark theme (not enabled anywhere): set data-theme="dark" on <html> to try it. */
:root[data-theme="dark"] {
  --background: #0b1220;
  --surface: #111a2e;
  --surface-secondary: #16223b;
  --surface-hover: #1b2a49;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #243352;
  --border-strong: #34476d;
  --brand-primary-soft: #14264d;
  --brand-gold-text: #f2be45;
}

/* ---- accessible base (zero specificity: every component can still override) ---- */
:where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  line-height: var(--lh-heading);
  text-wrap: balance;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

:where(.sr-only, .screen-reader-text, .bs-sr) {
  clip-path: inset(50%);
}

/* Long translated labels never push a control out of its box. */
:where(button, .btn, [class*="-btn"], [role="tab"]) {
  overflow-wrap: anywhere;
}

/* Reduced motion for the website and dashboards (presentation, projector and remote screens keep their own motion). */
@media (prefers-reduced-motion: reduce) {
  html:not(.bs-route-screen):not(.bs-route-remote):not(.bs-director-mode) *,
  html:not(.bs-route-screen):not(.bs-route-remote):not(.bs-director-mode) *::before,
  html:not(.bs-route-screen):not(.bs-route-remote):not(.bs-director-mode) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
