/*
 * Design tokens - Phase 0 baseline.
 * These are DEFAULTS. From Phase 2 the admin Theme Manager overrides the --color-* and
 * font tokens from the database by emitting a :root block after this file.
 * Colour values below are neutral placeholders, not church branding.
 * Body text on --color-surface must keep at least 4.5:1 contrast (WCAG AA).
 */
:root {
  /* Brand (placeholder; admin-configurable) */
  --color-primary: #1f3a5f;
  --color-primary-contrast: #ffffff;
  --color-accent: #b8860b;
  --color-accent-contrast: #1a1a1a;

  /* Neutrals */
  --color-text: #1d2433;
  --color-text-muted: #4b5565;
  --color-surface: #ffffff;
  --color-surface-alt: #f3f6fa;
  --color-border: #d5dbe5;

  /* Status */
  --color-success: #1b7f3b;
  --color-warning: #a06100;
  --color-danger: #b3261e;
  --color-info: #1f5fa8;

  /* Typography. Devanagari-capable fallbacks keep Hindi readable before web fonts load. */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", Mangal, sans-serif;
  --font-heading: var(--font-body);
  --font-size-base: 1rem;
  --line-height-base: 1.6;
  --line-height-hindi: 1.8;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* Shape and depth */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.12);

  /* Layout. Media queries cannot use variables; breakpoints are 480 / 768 / 1024 / 1280 px. */
  --container-max: 72rem;
  --tap-target-min: 44px;

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(31, 95, 168, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-surface);
}

/* Hindi needs more vertical room for matras. */
:lang(hi) { line-height: var(--line-height-hindi); }

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; }

a { color: var(--color-primary); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

img, video { max-width: 100%; height: auto; }

/* Respect reduced motion everywhere (seasonal effects in Phase 12 also honour this). */
@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;
  }
}
