/* ============================================================
   EPHESUS GATHERINGS WORLDWIDE — DIASPORA
   Global Stylesheet
   Version: 1.0
   ============================================================ */

/* --- Google Fonts Import --- */
/* Jost: geometric sans-serif (Futura PT alternative) for headings
   Barlow: clean modern sans-serif (Proxima Nova alternative) for body
   Open Sans: fallback alt font */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700;800;900&family=Anton&family=Barlow:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;500;600;700&display=swap');

/* --- CSS Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

/* --- Universal Select Styling (cross-browser, cross-device) --- */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 40px;
  cursor: pointer;
  border-radius: var(--border-radius-md, 8px);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  background-color: var(--color-bg, #ffffff);
  color: var(--color-text, #1a1a1a);
  line-height: 1.5;
}
select:focus {
  outline: none;
  border-color: var(--color-primary, #000);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
/* Fix for iOS/Safari zoom on focus */
@supports (-webkit-touch-callout: none) {
  select {
    font-size: 16px !important;
  }
}
[data-theme="dark"] select {
  background-color: #1A1A1A;
  border-color: rgba(255,255,255,0.12);
  color: #E8E8E8;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  select {
    background-color: #1A1A1A;
    border-color: rgba(255,255,255,0.12);
    color: #E8E8E8;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* --- Brand Tokens --- */
/* Inspired by New Creation Church: clean, premium, typography-driven.
   Monochrome B&W with navy blue accent. Soft body text, generous spacing. */
:root {
  /* ==========================================================
     9-STEP COLOR SCALES (Refactoring UI: "You need more colors than you think")
     Each ramp: 50 (lightest tint) → 900 (darkest shade).
     Use for subtle hover/active/disabled states, not flat single colors.
     ========================================================== */

  /* Navy — PRIMARY brand ramp (links, CTAs, highlights). Anchor at navy-700 = #1B3A5C */
  --navy-50:  #F0F4FA;
  --navy-100: #D9E2EE;
  --navy-200: #B3C4DD;
  --navy-300: #8BA5C9;
  --navy-400: #5D7FAD;
  --navy-500: #3D5F8E;
  --navy-600: #2A4A74;
  --navy-700: #1B3A5C;               /* ← current brand accent */
  --navy-800: #122948;
  --navy-900: #0B1B32;

  /* Neutral — grayscale ramp (text, borders, surfaces) */
  --neutral-50:  #FAFAFA;
  --neutral-100: #F2F2F2;
  --neutral-200: #E4E4E4;
  --neutral-300: #CFCFCF;
  --neutral-400: #9E9E9E;
  --neutral-500: #707070;
  --neutral-600: #525252;
  --neutral-700: #3A3A3A;
  --neutral-800: #262626;
  --neutral-900: #121212;

  /* Gold — ACCENT ramp (badges, highlights, dark-mode links). Warm amber. */
  --gold-50:  #FFFBF0;
  --gold-100: #FFF4D6;
  --gold-200: #FFE7A8;
  --gold-300: #FFD575;
  --gold-400: #FFBE3D;
  --gold-500: #F5A312;
  --gold-600: #D4850A;
  --gold-700: #A86608;
  --gold-800: #7A4A06;
  --gold-900: #4D2E03;

  /* ==========================================================
     SEMANTIC TOKENS (these are what components should consume)
     Mapped onto the scales above so hover/active/disabled come for free.
     ========================================================== */

  /* Legacy / primary (monochrome brand) — kept black for logo + strong type */
  --color-primary: #000000;
  --color-primary-dark: #000000;
  --color-primary-light: var(--neutral-800);
  --color-secondary: var(--neutral-600);

  /* Navy accent — CTAs, links. Hover/active now resolve to ramp steps. */
  --color-accent:         var(--navy-700);
  --color-accent-hover:   var(--navy-800);
  --color-accent-active:  var(--navy-900);
  --color-accent-subtle:  var(--navy-50);
  --color-accent-light:   var(--navy-500);     /* previously #2F5DA7 — now on-ramp */
  --color-accent-gold:    var(--navy-700);     /* legacy alias preserved */

  /* Gold accent for highlights/badges */
  --color-highlight:        var(--gold-500);
  --color-highlight-hover:  var(--gold-600);
  --color-highlight-subtle: var(--gold-100);

  /* Legacy misc */
  --color-brown: #222222;
  --color-olive: #444444;
  --color-cream: #F7F7F7;
  --color-bg-subtle: var(--neutral-100);
  --color-mauve: #9CA2A4;
  --color-steel: #777D80;

  /* Backgrounds */
  --color-bg:        #FFFFFF;
  --color-bg-alt:    var(--neutral-50);
  --color-bg-muted:  var(--neutral-100);        /* new — for subtle section alternation */
  --color-bg-dark:   #0A0A0A;
  --color-bg-footer: #0A0A0A;

  /* Text */
  --color-text:         var(--neutral-800);
  --color-text-strong:  var(--neutral-900);     /* new — for emphasized body */
  --color-text-light:   #FFFFFF;
  --color-text-muted:   var(--neutral-600);
  --color-text-subtle:  var(--neutral-500);     /* new — for captions, meta */
  --color-text-link:    var(--navy-700);
  --color-text-link-hover: var(--navy-800);     /* new */

  /* Borders */
  --color-border:        rgba(0, 0, 0, 0.08);
  --color-border-strong: var(--neutral-300);    /* new — for emphasized dividers */
  --color-border-subtle: var(--neutral-200);    /* new — hairline dividers */

  /* Interactive states */
  --color-disabled-bg:   var(--neutral-200);
  --color-disabled-text: var(--neutral-400);
  --color-focus-ring:    var(--navy-400);

  /* Typography — Jost (geometric heading) + Barlow (clean body) */
  --font-heading: 'Jost', 'Anton', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-alt: 'Open Sans', sans-serif;

  /* Type scale — Refactoring UI + Practical UI 10-step modular scale:
     12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 48 / 60 */
  --font-size-xs:   0.75rem;     /* 12px — fine print, labels */
  --font-size-sm:   0.875rem;    /* 14px — secondary text, meta */
  --font-size-base: 1rem;        /* 16px — body */
  --font-size-lg:   1.125rem;    /* 18px — emphasized body, lead paragraphs */
  --font-size-xl:   1.25rem;     /* 20px — card titles, large body */
  --font-size-2xl:  1.5rem;      /* 24px — sub-section headings (h4) */
  --font-size-3xl:  1.875rem;    /* 30px — section headings (h3) */
  --font-size-4xl:  2.25rem;     /* 36px — major section titles (h2) */
  --font-size-5xl:  3rem;        /* 48px — page titles */
  --font-size-6xl:  3.75rem;     /* 60px — hero headlines (h1) */

  /* Font-weight scale — #5 Hierarchy through weight + color
     Use weight (not size) to separate primary vs secondary text. */
  --font-weight-light:    300;
  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-black:    800;

  /* Spacing — generous like NCC
     Refactoring UI: "Start with too much white space" */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  --space-6xl: 10rem;               /* hero / marquee sections */
  --space-content-gap: 2.5rem;      /* semantic token: paragraph → next heading */

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --nav-height: 72px;
  --border-radius-sm: 2px;           /* Minimal radius like NCC */
  --border-radius-md: 4px;
  --border-radius-lg: 8px;
  --border-radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* ==========================================================
     SHADOWS — Refactoring UI: "Creating Depth"
     Two-part shadows: ambient (wide, soft, low-opacity) + direct (tight, sharper).
     Emulates a single light source from above-front.
     ========================================================== */
  --shadow-sm:
    0 1px 2px rgba(17, 24, 39, 0.06),           /* direct */
    0 1px 3px rgba(17, 24, 39, 0.08);           /* ambient */
  --shadow-md:
    0 2px 4px rgba(17, 24, 39, 0.06),
    0 4px 8px rgba(17, 24, 39, 0.08);
  --shadow-lg:
    0 4px 6px rgba(17, 24, 39, 0.05),
    0 10px 20px rgba(17, 24, 39, 0.10);
  --shadow-xl:
    0 8px 12px rgba(17, 24, 39, 0.06),
    0 20px 32px rgba(17, 24, 39, 0.12);
  --shadow-2xl:
    0 12px 20px rgba(17, 24, 39, 0.08),
    0 32px 60px rgba(17, 24, 39, 0.18);
  --shadow-glow: 0 0 20px rgba(0,0,0,0.06), 0 0 60px rgba(0,0,0,0.02);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.04);
  --shadow-border: 0 0 0 1px rgba(0,0,0,0.05);

  /* Top-edge highlight — simulates a light source above.
     Apply as a separate layer or combine with elevation tokens. */
  --shadow-top-light:      inset 0 1px 0 rgba(255,255,255,0.6);
  --shadow-top-light-soft: inset 0 1px 0 rgba(255,255,255,0.35);

  /* ==========================================================
     ELEVATION SYSTEM — 5 semantic levels.
     Use these for UI components; they bundle shadow + top-highlight.
     ========================================================== */
  --elevation-flat:
    0 0 0 1px rgba(0,0,0,0.04);                 /* resting, no lift */
  --elevation-card-sm:
    var(--shadow-top-light-soft),
    0 1px 2px rgba(17,24,39,0.05),
    0 2px 4px rgba(17,24,39,0.06);              /* small cards, badges */
  --elevation-card:
    var(--shadow-top-light-soft),
    0 2px 4px rgba(17,24,39,0.06),
    0 6px 14px rgba(17,24,39,0.08);             /* default content cards */
  --elevation-card-hover:
    var(--shadow-top-light),
    0 4px 8px rgba(17,24,39,0.08),
    0 16px 32px rgba(17,24,39,0.14);            /* lifted cards, feature tiles */
  --elevation-dropdown:
    var(--shadow-top-light),
    0 6px 12px rgba(17,24,39,0.10),
    0 20px 40px rgba(17,24,39,0.16);            /* mega menu, dropdowns, popovers */
  --elevation-modal:
    var(--shadow-top-light),
    0 12px 24px rgba(17,24,39,0.14),
    0 40px 80px rgba(17,24,39,0.24);            /* modals, dialogs, sheets */
}

/* --- Dark Mode (Chrome Incognito-inspired palette) ---
 * Base:     #202124 — page background (warm dark grey)
 * Surface:  #292A2D — cards, elevated panels
 * Deeper:   #171717 — footer, deepest layer
 * Toolbar:  #35363A — nav, toolbars
 * Border:   #3C4043 — subtle dividers
 * Text:     #E8EAED — primary text (soft white)
 * Muted:    #9AA0A6 — secondary text
 * Link:     #8AB4F8 — Chrome blue links
 */

/* --- Dark Mode (auto via system preference) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Dark-mode ramps: invert neutral (lighter steps become text),
       flip navy toward lighter shades for legibility on dark bg,
       keep gold warm for accents. */
    --neutral-50:  #121212;
    --neutral-100: #1A1A1A;
    --neutral-200: #262626;
    --neutral-300: #3C3C3C;
    --neutral-400: #5C5C5C;
    --neutral-500: #8A8A8A;
    --neutral-600: #B0B0B0;
    --neutral-700: #D0D0D0;
    --neutral-800: #E8EAED;
    --neutral-900: #FFFFFF;

    --navy-50:  #0B1B32;
    --navy-100: #122948;
    --navy-200: #1B3A5C;
    --navy-300: #2A4A74;
    --navy-400: #3D5F8E;
    --navy-500: #5D7FAD;
    --navy-600: #8BA5C9;
    --navy-700: #B3C4DD;               /* lighter navy reads well on dark bg */
    --navy-800: #D9E2EE;
    --navy-900: #F0F4FA;

    --color-bg: #202124;
    --color-bg-alt: #292A2D;
    --color-bg-dark: #171717;
    --color-bg-footer: #171717;
    --color-text: #E8EAED;
    --color-text-strong: #FFFFFF;
    --color-text-light: #202124;
    --color-text-muted: #9AA0A6;
    --color-text-subtle: #7A7F86;
    --color-text-link: #FFF1D3;
    --color-text-link-hover: #FFF7E6;
    --color-border: #3C4043;
    --color-border-strong: #5A5F66;
    --color-border-subtle: #2D3035;
    --color-primary: #E8EAED;
    --color-primary-dark: #DADCE0;
    --color-primary-light: #BDC1C6;
    --color-accent: #FFF1D3;
    --color-accent-hover: #FFF7E6;
    --color-accent-active: #FFFBED;
    --color-accent-subtle: rgba(255,241,211,0.08);
    --color-accent-light: #FFF7E6;
    --color-highlight: var(--gold-400);
    --color-highlight-hover: var(--gold-300);
    --color-highlight-subtle: rgba(245,163,18,0.12);
    --color-cream: #292A2D;
    --color-bg-subtle: #252629;
    --color-bg-muted: #292A2D;
    --color-mauve: #35363A;
    --color-steel: #3C4043;
    --color-disabled-bg: #2D3035;
    --color-disabled-text: #5A5F66;
    --color-focus-ring: #FFF1D3;
    /* Dark-mode two-part shadows — stronger to read on dark surfaces.
       Top-highlight flips from white to cool glow. */
    --shadow-sm:
      0 1px 2px rgba(0,0,0,0.35),
      0 2px 4px rgba(0,0,0,0.35);
    --shadow-md:
      0 2px 4px rgba(0,0,0,0.30),
      0 6px 12px rgba(0,0,0,0.35);
    --shadow-lg:
      0 4px 6px rgba(0,0,0,0.30),
      0 12px 24px rgba(0,0,0,0.40);
    --shadow-xl:
      0 8px 12px rgba(0,0,0,0.30),
      0 24px 40px rgba(0,0,0,0.45);
    --shadow-2xl:
      0 12px 20px rgba(0,0,0,0.35),
      0 40px 80px rgba(0,0,0,0.55);
    --shadow-glow: 0 0 20px rgba(255,241,211,0.04), 0 0 60px rgba(255,241,211,0.01);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.3);
    --shadow-border: 0 0 0 1px #3C4043;

    --shadow-top-light:      inset 0 1px 0 rgba(255,255,255,0.06);
    --shadow-top-light-soft: inset 0 1px 0 rgba(255,255,255,0.03);

    --elevation-flat:
      0 0 0 1px rgba(255,255,255,0.06);
    --elevation-card-sm:
      var(--shadow-top-light-soft),
      0 1px 2px rgba(0,0,0,0.30),
      0 3px 6px rgba(0,0,0,0.35);
    --elevation-card:
      var(--shadow-top-light-soft),
      0 2px 4px rgba(0,0,0,0.30),
      0 8px 16px rgba(0,0,0,0.40);
    --elevation-card-hover:
      var(--shadow-top-light),
      0 4px 8px rgba(0,0,0,0.35),
      0 20px 40px rgba(0,0,0,0.48);
    --elevation-dropdown:
      var(--shadow-top-light),
      0 8px 14px rgba(0,0,0,0.40),
      0 24px 48px rgba(0,0,0,0.52);
    --elevation-modal:
      var(--shadow-top-light),
      0 12px 24px rgba(0,0,0,0.45),
      0 48px 96px rgba(0,0,0,0.60);
  }
}

/* --- Dark Mode (manual toggle) --- */
[data-theme="dark"] {
  /* Claude.ai-inspired warm dark palette */
  /* Dark-mode ramps — warm neutral, inverted navy, warm gold accent */
  --neutral-50:  #121212;
  --neutral-100: #1F1F1E;
  --neutral-200: #2C2C2A;
  --neutral-300: #3A3935;
  --neutral-400: #5A5850;
  --neutral-500: #8A8778;
  --neutral-600: #C3C2B7;
  --neutral-700: #DDDCD3;
  --neutral-800: #F8F8F6;
  --neutral-900: #FFFFFF;

  --navy-50:  #0B1B32;
  --navy-100: #122948;
  --navy-200: #1B3A5C;
  --navy-300: #2A4A74;
  --navy-400: #3D5F8E;
  --navy-500: #5D7FAD;
  --navy-600: #8BA5C9;
  --navy-700: #B3C4DD;
  --navy-800: #D9E2EE;
  --navy-900: #F0F4FA;

  --color-bg: #1F1F1E;
  --color-bg-alt: #2C2C2A;
  --color-bg-dark: #121212;
  --color-bg-footer: #121212;
  --color-bg-subtle: #252523;
  --color-bg-muted: #2C2C2A;
  --color-text: #F8F8F6;
  --color-text-strong: #FFFFFF;
  --color-text-light: #1F1F1E;
  --color-text-muted: #C3C2B7;
  --color-text-subtle: #8A8778;
  --color-text-link: #FFF1D3;
  --color-text-link-hover: #FFF7E6;
  --color-border: rgba(226, 225, 218, 0.12);
  --color-border-strong: rgba(226, 225, 218, 0.25);
  --color-border-subtle: rgba(226, 225, 218, 0.06);
  --color-primary: #F8F8F6;
  --color-primary-dark: #E2E1DA;
  --color-primary-light: #C3C2B7;
  --color-accent: #FFF1D3;
  --color-accent-hover: #FFF7E6;
  --color-accent-active: #FFFBED;
  --color-accent-subtle: rgba(255,241,211,0.08);
  --color-accent-light: #FFF7E6;
  --color-highlight: var(--gold-400);
  --color-highlight-hover: var(--gold-300);
  --color-highlight-subtle: rgba(245,163,18,0.12);
  --color-cream: #2C2C2A;
  --color-mauve: #35342F;
  --color-steel: #3A3935;
  --color-disabled-bg: #2C2C2A;
  --color-disabled-text: #5A5850;
  --color-focus-ring: #FFF1D3;
  /* Dark-mode (manual toggle) two-part shadows + elevation tokens */
  --shadow-sm:
    0 1px 2px rgba(0,0,0,0.35),
    0 2px 4px rgba(0,0,0,0.35);
  --shadow-md:
    0 2px 4px rgba(0,0,0,0.30),
    0 6px 12px rgba(0,0,0,0.35);
  --shadow-lg:
    0 4px 6px rgba(0,0,0,0.30),
    0 12px 24px rgba(0,0,0,0.40);
  --shadow-xl:
    0 8px 12px rgba(0,0,0,0.30),
    0 24px 40px rgba(0,0,0,0.45);
  --shadow-2xl:
    0 12px 20px rgba(0,0,0,0.35),
    0 40px 80px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 20px rgba(255,241,211,0.06), 0 0 60px rgba(255,241,211,0.02);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.3);
  --shadow-border: 0 0 0 1px rgba(226, 225, 218, 0.12);

  --shadow-top-light:      inset 0 1px 0 rgba(255,255,255,0.07);
  --shadow-top-light-soft: inset 0 1px 0 rgba(255,255,255,0.04);

  --elevation-flat:
    0 0 0 1px rgba(226,225,218,0.08);
  --elevation-card-sm:
    var(--shadow-top-light-soft),
    0 1px 2px rgba(0,0,0,0.30),
    0 3px 6px rgba(0,0,0,0.35);
  --elevation-card:
    var(--shadow-top-light-soft),
    0 2px 4px rgba(0,0,0,0.30),
    0 8px 16px rgba(0,0,0,0.40);
  --elevation-card-hover:
    var(--shadow-top-light),
    0 4px 8px rgba(0,0,0,0.35),
    0 20px 40px rgba(0,0,0,0.48);
  --elevation-dropdown:
    var(--shadow-top-light),
    0 8px 14px rgba(0,0,0,0.40),
    0 24px 48px rgba(0,0,0,0.52);
  --elevation-modal:
    var(--shadow-top-light),
    0 12px 24px rgba(0,0,0,0.45),
    0 48px 96px rgba(0,0,0,0.60);
}

/* Dark mode component overrides */
[data-theme="dark"] .nav {
  background: rgba(31, 31, 30, 0.97);
}

[data-theme="dark"] .mega-dropdown {
  background: #2C2C2A;
  border-bottom-color: rgba(226, 225, 218, 0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

[data-theme="dark"] .mega-col a {
  color: var(--color-text-muted);
}

[data-theme="dark"] .mega-col a:hover {
  color: #ffffff;
}

[data-theme="dark"] .mega-dropdown-bottom {
  border-top-color: rgba(226, 225, 218, 0.12);
}

[data-theme="dark"] .mega-dropdown-marquee-inner {
  color: var(--color-text-muted);
}

[data-theme="dark"] .mega-menu-social span {
  color: var(--color-text-muted);
}

[data-theme="dark"] .nav-right a {
  color: #FFF1D3;
}

[data-theme="dark"] .nav-right a:hover {
  color: #FFF7E6;
}

[data-theme="dark"] .music-player {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .carousel-prev,
[data-theme="dark"] .carousel-next {
  border-color: var(--color-text);
  color: var(--color-text);
}

[data-theme="dark"] .countdown-widget {
  background: rgba(44, 44, 42, 0.97);
  color: var(--color-text);
}

[data-theme="dark"] .countdown-widget h3,
[data-theme="dark"] .countdown-digits {
  color: var(--color-text);
}

/* --- Dark Mode: Button Contrast Fixes --- */
/* In dark mode --color-primary becomes white and --color-text-light becomes dark,
   so we need explicit overrides for every button variant to keep text visible. */

[data-theme="dark"] .btn-primary {
  background-color: #FFF1D3;
  color: #000000;
  border-color: #FFF1D3;
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #FFF7E6;
  border-color: #FFF7E6;
  color: #000000;
}

[data-theme="dark"] .btn-dark {
  background-color: #F8F8F6;
  color: #000000;
  border-color: #F8F8F6;
}

[data-theme="dark"] .btn-dark:hover {
  background-color: #FFFFFF;
  border-color: #FFFFFF;
  color: #000000;
}

[data-theme="dark"] .btn-outline {
  color: #F8F8F6;
  border-color: rgba(226, 225, 218, 0.25);
}

[data-theme="dark"] .btn-outline:hover {
  background-color: #FFF1D3;
  color: #000000;
  border-color: #FFF1D3;
}

[data-theme="dark"] .btn-outline-light {
  color: #F8F8F6;
  border-color: rgba(226, 225, 218, 0.25);
}

[data-theme="dark"] .btn-outline-light:hover {
  background-color: rgba(248, 248, 246, 0.08);
  color: #FFFFFF;
  border-color: #C3C2B7;
}

/* --- Dark Mode: Section Contrast Fixes --- */
[data-theme="dark"] .testimony-partner {
  background: linear-gradient(135deg, #252523 0%, #2C2C2A 100%);
}

[data-theme="dark"] .testimony-partner-item h2 {
  color: #F8F8F6;
}

[data-theme="dark"] .testimony-partner-item p {
  color: #C3C2B7;
}

[data-theme="dark"] .split-cta-item h2 {
  color: #F8F8F6;
}

[data-theme="dark"] .split-cta-item p,
[data-theme="dark"] .split-cta-item li {
  color: #C3C2B7;
}

[data-theme="dark"] .worship-times li {
  color: #C3C2B7;
}

[data-theme="dark"] .about-anchor-nav {
  background: var(--color-bg-alt);
}

[data-theme="dark"] .who-we-are h2,
[data-theme="dark"] .vision-section h2,
[data-theme="dark"] .beliefs-section > .container > h2,
[data-theme="dark"] .leaders-section h2,
[data-theme="dark"] .affiliates-cta h2 {
  color: #FFFFFF;
}

[data-theme="dark"] .events-section h2 {
  color: #FFFFFF;
}

/* Auto dark mode (system preference) — duplicate button fixes */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary {
    background-color: #FFF1D3;
    color: #000000;
    border-color: #FFF1D3;
  }

  :root:not([data-theme="light"]) .btn-primary:hover {
    background-color: #FFF7E6;
    border-color: #FFF7E6;
    color: #000000;
  }

  :root:not([data-theme="light"]) .btn-dark {
    background-color: #F8F8F6;
    color: #000000;
    border-color: #F8F8F6;
  }

  :root:not([data-theme="light"]) .btn-dark:hover {
    background-color: #FFFFFF;
    border-color: #FFFFFF;
    color: #000000;
  }

  :root:not([data-theme="light"]) .btn-outline {
    color: #F8F8F6;
    border-color: rgba(226, 225, 218, 0.25);
  }

  :root:not([data-theme="light"]) .btn-outline:hover {
    background-color: #FFF1D3;
    color: #000000;
  }

  :root:not([data-theme="light"]) .btn-outline-light {
    color: #F8F8F6;
    border-color: rgba(226, 225, 218, 0.25);
  }

  :root:not([data-theme="light"]) .btn-outline-light:hover {
    background-color: rgba(248, 248, 246, 0.08);
    color: #FFFFFF;
    border-color: #C3C2B7;
  }

  :root:not([data-theme="light"]) .testimony-partner {
    background: linear-gradient(135deg, #252523 0%, #2C2C2A 100%);
  }

  :root:not([data-theme="light"]) .testimony-partner-item h2 {
    color: #F8F8F6;
  }

  :root:not([data-theme="light"]) .testimony-partner-item p {
    color: #C3C2B7;
  }

  :root:not([data-theme="light"]) .split-cta-item h2 {
    color: #F8F8F6;
  }

  :root:not([data-theme="light"]) .worship-times li {
    color: #C3C2B7;
  }

  :root:not([data-theme="light"]) .events-section h2 {
    color: #FFFFFF;
  }
}

/* --- Base Typography (NCC-inspired: clean, premium, readable) --- */
body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  /* Refactoring UI: heading line-height 1.1–1.2, never the body value */
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-primary);
  /* Refactoring UI: uniform, intentional spacing below headings */
  margin: 0 0 var(--space-lg);                  /* 24px default; see per-level below */
}

h1 { font-size: var(--font-size-6xl); font-weight: 800; line-height: 1.1;  margin-bottom: var(--space-xl); }  /* 60px */
h2 { font-size: var(--font-size-4xl); font-weight: 700; line-height: 1.15; margin-bottom: var(--space-lg); }  /* 36px */
h3 { font-size: var(--font-size-3xl); font-weight: 700; line-height: 1.2;  margin-bottom: var(--space-md); }  /* 30px */
h4 { font-size: var(--font-size-2xl); font-weight: 600; line-height: 1.2;  margin-bottom: var(--space-md); }  /* 24px */
h5 { font-size: var(--font-size-xl); font-weight: 600; line-height: 1.25; margin-bottom: var(--space-sm); }   /* 20px */
h6 { font-size: var(--font-size-lg); font-weight: 600; line-height: 1.3;  margin-bottom: var(--space-sm); }   /* 18px */

/* Refactoring UI: don't crowd a new heading against preceding content */
p + h2, ul + h2, ol + h2, div + h2,
p + h3, ul + h3, ol + h3, div + h3 {
  margin-top: var(--space-content-gap);         /* 40px */
}

p {
  font-family: var(--font-body);
  font-weight: 400;
  /* Refactoring UI: body line-height 1.6 — tighter than the previous 1.75 */
  line-height: 1.6;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  /* Refactoring UI: cap measure at 65–75 characters for readability.
     Applied as max-inline-size so it still fills narrow containers. */
  max-width: 70ch;
}

/* Allow paragraphs to fill their container when explicitly needed
   (nav copy, form help text, cards, footer blocks, etc.) */
p.is-full,
.card p,
.card-padded p,
.card-padded-lg p,
.card-body p,
nav p,
footer p,
.prose-full p,
.hero p,
.full-width p {
  max-width: none;
}

/* Utility: a readable prose block (articles, devotionals, sermon notes) */
.prose p {
  max-width: 65ch;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container-wide {
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.section {
  padding: var(--space-5xl, 8rem) 0;
}

.section-sm {
  padding: var(--space-4xl) 0;
}

/* --- Grid System --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* Refactoring UI: wider gaps on desktop feel more premium */
  .grid-2, .grid-3, .grid-4 { gap: var(--space-2xl); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Buttons (NCC-inspired: clean, minimal, refined) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1;
}

.btn:focus-visible {
  outline: 3px solid var(--color-text-link);
  outline-offset: 2px;
}

/* #5: primary CTA is one size larger + bolder + stronger color (Von Restorff) */
.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  font-size: var(--font-size-base);            /* one step larger than base .btn */
  font-weight: var(--font-weight-semibold);    /* bolder than .btn-outline's 500 */
  padding: 14px 36px;                          /* slightly chunkier hit target */
  letter-spacing: 0.06em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 6px 18px rgba(0,0,0,0.22),
    0 2px 4px rgba(0,0,0,0.10);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 10px 28px rgba(0,0,0,0.32),
    0 4px 8px rgba(0,0,0,0.12);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.15),
    0 2px 6px rgba(0,0,0,0.18);
}

.btn-dark {
  background-color: var(--color-text);
  color: #FFFFFF;
  border-color: var(--color-text);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.08);
}

.btn-dark:hover {
  background-color: #333;
  border-color: #333;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 4px 8px rgba(0,0,0,0.1);
}

/* #5: secondary buttons stay visually quieter than .btn-primary
   — thinner weight, softer shadow, so the primary CTA clearly wins. */
.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong, var(--color-text));
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background-color: var(--color-text);
  color: #FFFFFF;
  border-color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-light {
  background-color: transparent;
  color: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-outline-light:hover {
  background-color: #FFFFFF;
  color: #0a0a0a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* --- Accent (navy ramp) button — Refactoring UI: hover/active resolve on-ramp --- */
.btn-accent {
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(27,58,92,0.25), 0 2px 4px rgba(0,0,0,0.08);
}
.btn-accent:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27,58,92,0.35), 0 4px 8px rgba(0,0,0,0.1);
}
.btn-accent:active {
  background-color: var(--color-accent-active);
  border-color: var(--color-accent-active);
  transform: translateY(0);
}

/* --- Gold highlight button --- */
.btn-highlight {
  background-color: var(--color-highlight);
  color: var(--neutral-900);
  border-color: var(--color-highlight);
  box-shadow: 0 4px 14px rgba(245,163,18,0.3), 0 2px 4px rgba(0,0,0,0.08);
}
.btn-highlight:hover {
  background-color: var(--color-highlight-hover);
  border-color: var(--color-highlight-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,163,18,0.4), 0 4px 8px rgba(0,0,0,0.1);
}

/* --- Universal disabled state (Refactoring UI) --- */
.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  background-color: var(--color-disabled-bg) !important;
  color: var(--color-disabled-text) !important;
  border-color: var(--color-disabled-bg) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 1;                                   /* use real tokens, not opacity */
}

/* Helper for any non-button disabled element */
.is-disabled, [aria-disabled="true"]:not(.btn) {
  opacity: 0.55;
  pointer-events: none;
}

/* --- Card (3D depth) ---
   Refactoring UI: cards need generous breathing room.
   Base .card stays flush (safe for media cards). Use .card-padded for
   text-only content cards, or add a .card-body inner wrapper. */
.card {
  background: var(--color-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--shadow-border);
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Content padding helpers */
.card-padded { padding: var(--space-xl); }              /* 32px all sides */
.card-padded-lg { padding: var(--space-2xl); }          /* 48px for feature cards */
.card-body { padding: var(--space-xl); }                /* inner text wrapper under a media image */
@media (max-width: 640px) {
  .card-padded { padding: var(--space-lg); }            /* 24px on small screens */
  .card-padded-lg { padding: var(--space-xl); }         /* 32px on small screens */
  .card-body { padding: var(--space-lg); }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

[data-theme="dark"] .card {
  border-color: rgba(226, 225, 218, 0.08);
  background: #2C2C2A;
}

/* --- 3D Elevation Utilities (legacy numeric) --- */
.elevation-1 { box-shadow: var(--shadow-sm), var(--shadow-border); }
.elevation-2 { box-shadow: var(--shadow-md), var(--shadow-border); }
.elevation-3 { box-shadow: var(--shadow-lg), var(--shadow-border); }
.elevation-4 { box-shadow: var(--shadow-xl); }
.elevation-5 { box-shadow: var(--shadow-2xl); }

/* --- Semantic elevation utilities (Refactoring UI: "Creating Depth") ---
   Use these by intent, not by number:
     .elev-flat      → resting, no lift
     .elev-card-sm   → badges, pills, small widgets
     .elev-card      → default content cards
     .elev-card-hover→ hovered / featured cards
     .elev-dropdown  → mega menu, dropdowns, popovers
     .elev-modal     → modals, dialogs, sheets
*/
.elev-flat       { box-shadow: var(--elevation-flat); }
.elev-card-sm    { box-shadow: var(--elevation-card-sm); }
.elev-card       { box-shadow: var(--elevation-card); }
.elev-card-hover { box-shadow: var(--elevation-card-hover); }
.elev-dropdown   { box-shadow: var(--elevation-dropdown); }
.elev-modal      { box-shadow: var(--elevation-modal); }

/* Opt-in top-edge highlight utility — suggests a light source above.
   Safe to combine with any background color. */
.has-top-light      { box-shadow: var(--shadow-top-light),      var(--elevation-card); }
.has-top-light-soft { box-shadow: var(--shadow-top-light-soft), var(--elevation-card-sm); }

/* Lift on hover — Refactoring UI: depth change signals interactivity */
.lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--elevation-card);
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--elevation-card-hover);
}
.lift:active {
  transform: translateY(-1px);
  box-shadow: var(--elevation-card);
}

/* Pressable — scale-down micro-feedback on click */
.pressable {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.pressable:active {
  transform: scale(0.98);
}

.lift-sm {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.lift-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Glass panel effect */
.glass {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .glass {
  background: rgba(30,30,30,0.6);
  border-color: rgba(255,255,255,0.08);
}

/* Subtle 3D border highlight — top edge light, bottom edge dark */
.depth-border {
  border: 1px solid rgba(0,0,0,0.06);
  border-top-color: rgba(255,255,255,0.8);
  border-left-color: rgba(255,255,255,0.4);
}

[data-theme="dark"] .depth-border {
  border-color: rgba(255,255,255,0.06);
  border-top-color: rgba(255,255,255,0.1);
  border-left-color: rgba(255,255,255,0.08);
}

/* Pressed/inset effect */
.inset {
  box-shadow: var(--shadow-inner);
  border: 1px solid rgba(0,0,0,0.06);
}

[data-theme="dark"] .inset {
  border-color: rgba(255,255,255,0.04);
}

/* --- Studio Links (in nav-right-group) --- */
/* Hidden by default; only shown at 1440px+ to avoid intercepting main nav */
.nav-studio-links {
  display: none;
  align-items: center;
  gap: 1rem;
}
.nav-studio-links a {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.nav-studio-links a:hover {
  color: var(--color-primary);
}
[data-theme="dark"] .nav-studio-links a {
  color: #9CA2A4;
}
[data-theme="dark"] .nav-studio-links a:hover {
  color: #FFF1D3;
}
/* Hide studio links below 1440px to prevent overlap with main nav */
.nav-studio-links {
  display: none;
}
@media (min-width: 1440px) {
  .nav-studio-links {
    display: flex;
  }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-bg-alt, #f7f7f7);
  z-index: 1000;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-lg);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
}

.nav-logo { flex-shrink: 0; z-index: 2; }

.nav-logo img {
  height: 64px;
  width: auto;
  transition: filter var(--transition-fast);
}

/* Nav Links (center of header row) */
.nav-links {
  display: none;
  align-items: center;
  gap: 1.2rem;
}

@media (min-width: 1024px) {
  .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
  }
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: color var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a.active {
  color: var(--color-primary);
}

/* Right-side group: utility links + toggle + hamburger */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  z-index: 2;
}

.nav-right {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-right a {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent, #1B3A5C);
  transition: color var(--transition-fast);
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-right a:hover {
  color: var(--color-accent-light, #2F5DA7);
}

/* ===== MEGA DROPDOWN (smooth expand, aligned under nav links) ===== */
.mega-dropdown {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.mega-dropdown.open {
  max-height: 600px;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

/* Flex row — JS will size each column to match its parent nav link */
.mega-dropdown-inner {
  display: flex;
  align-items: flex-start;
  padding: 12px 0 28px;
  /* width & position set by JS to match .nav-links */
}

/* Each mega column */
.mega-col {
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Staggered fade-in when menu opens — #7 Hick's Law: faster cap so the
   full choice-set appears sooner (less waiting = less perceived load) */
.mega-dropdown.open .mega-col { opacity: 1; transform: translateY(0); }
.mega-dropdown.open .mega-col[data-col="0"] { transition-delay: 0.02s; }
.mega-dropdown.open .mega-col[data-col="1"] { transition-delay: 0.04s; }
.mega-dropdown.open .mega-col[data-col="2"] { transition-delay: 0.06s; }
.mega-dropdown.open .mega-col[data-col="3"] { transition-delay: 0.08s; }
.mega-dropdown.open .mega-col[data-col="4"] { transition-delay: 0.10s; }
.mega-dropdown.open .mega-col[data-col="5"] { transition-delay: 0.12s; }
.mega-dropdown.open .mega-col[data-col="6"] { transition-delay: 0.14s; }
.mega-dropdown.open .mega-col[data-col="7"] { transition-delay: 0.16s; }

/* #7 Hick's Law — focus-narrowing: when the user hovers any column,
   soften the others so the active choice-set shrinks to ~1 column. */
.mega-dropdown-inner:hover .mega-col,
.mega-dropdown-inner:focus-within .mega-col {
  opacity: 0.45;
  transition: opacity var(--transition-fast);
}
.mega-dropdown-inner .mega-col:hover,
.mega-dropdown-inner .mega-col:focus-within {
  opacity: 1;
}

/* Sub-link styles */
.mega-col a {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.55;
  letter-spacing: -0.2px;
  transition: color 0.2s ease, padding-left 0.2s ease;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.mega-col a:hover {
  color: var(--color-primary);
  padding-left: 4px;
}

/* --- Bottom bar: marquee + social icons (JS sets width to match nav) --- */
.mega-dropdown-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding: 10px 0;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
  /* width set by JS to match nav-links */
}

.mega-dropdown.open .mega-dropdown-bottom {
  opacity: 1;
  transform: translateY(0);
}

.mega-dropdown-marquee {
  flex: 0 1 55%;
  max-width: 55%;
  overflow: hidden;
  margin-right: var(--space-lg);
}

.mega-dropdown-marquee-inner {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  animation: mega-marquee 20s linear infinite;
}

@keyframes mega-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.mega-menu-social {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mega-menu-social span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.mega-menu-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mega-menu-social a:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.mega-menu-social a svg {
  width: 11px;
  height: 11px;
}

@media (max-width: 1023px) {
  .mega-dropdown { display: none; }
}

/* Hamburger */
/* #8 Fitts's Law: min 44×44 hit area. Icon lines stay visually 24px;
   extra space around them is invisible-but-clickable. */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  border-radius: var(--border-radius-md);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.hamburger:hover { background: var(--color-bg-alt); }
.hamburger:active { transform: scale(0.94); }

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-base);
  border-radius: 1px;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 999;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-inner {
  padding: var(--space-lg) var(--space-lg) var(--space-3xl);
}

/* Parent-level links */
.mnav-link {
  display: block;
  padding: var(--space-md) 0 var(--space-xs);
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.mnav-label {
  cursor: default;
}

.mnav-link:hover {
  color: var(--color-primary);
}

/* Groups: parent + sub row */
.mnav-group {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
}

/* Standalone links without subs */
.mobile-nav-inner > .mnav-link {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
}

/* Horizontal sub-links row — pipe-separated */
.mnav-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding-bottom: var(--space-xs);
}

.mnav-sub a {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  background: none;
  padding: 2px 0;
  white-space: nowrap;
  transition: color var(--transition-fast);
  text-transform: none;
  letter-spacing: 0;
}

.mnav-sub a:hover {
  color: var(--color-primary);
}

/* Pipe separator between sub-links */
.mnav-sub a + a::before {
  content: "|";
  display: inline-block;
  margin: 0 8px;
  color: var(--color-border);
  font-weight: 300;
}

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-right { display: flex; }
  .hamburger { display: none; }
}

/* --- Theme Toggle --- */
/* Header tap target — compact 38×38 pill; sun/moon glyph fills to 22px */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 22px; height: 22px; }

.theme-toggle:hover {
  background: var(--color-text);
  color: var(--color-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Logo dark/light switching */
.logo-light { display: block; }
.logo-dark { display: none; }

[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block !important; }

/* (Old mega-menu removed — replaced by NCC-style inline nav-bar dropdowns above) */

/* --- Quicklinks Sidebar --- */
.quicklinks {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
}

.quicklinks-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-bg);
  border: none;
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  padding: 28px 10px;
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-left: none;
  box-shadow: var(--shadow-lg);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
.quicklinks-toggle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(0,0,0,0.08) 50%,
    transparent 70%
  );
  transform: translateX(-100%) rotate(25deg);
  transition: none;
  pointer-events: none;
}

.quicklinks-toggle:hover::before {
  transform: translateX(100%) rotate(25deg);
  transition: transform 0.7s ease;
}

.quicklinks-toggle:hover {
  padding-right: 13px;
  box-shadow: var(--shadow-xl);
  background: var(--color-bg-alt);
}

.quicklinks.open .quicklinks-toggle {
  border-radius: 0;
  box-shadow: none;
  background: var(--color-bg-alt);
}

.quicklinks-toggle svg {
  transform: rotate(-90deg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.quicklinks.open .quicklinks-toggle svg {
  transform: rotate(90deg);
}

/* --- Quicklinks Panel --- */
.quicklinks-panel {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) translateX(-110%);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  padding: var(--space-lg) 0;
  min-width: 210px;
  box-shadow: var(--shadow-2xl), 0 0 40px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              visibility 0.35s ease;
}

.quicklinks.open .quicklinks-panel {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  visibility: visible;
}

.quicklinks-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text);
  text-decoration: none;
  position: relative;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease,
              background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.quicklinks.open .quicklinks-panel a {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered delays for each link */
.quicklinks.open .quicklinks-panel a:nth-child(1)  { transition-delay: 0.06s; }
.quicklinks.open .quicklinks-panel a:nth-child(2)  { transition-delay: 0.1s; }
.quicklinks.open .quicklinks-panel a:nth-child(3)  { transition-delay: 0.14s; }
.quicklinks.open .quicklinks-panel a:nth-child(4)  { transition-delay: 0.18s; }
.quicklinks.open .quicklinks-panel a:nth-child(5)  { transition-delay: 0.22s; }
.quicklinks.open .quicklinks-panel a:nth-child(6)  { transition-delay: 0.26s; }
.quicklinks.open .quicklinks-panel a:nth-child(7)  { transition-delay: 0.3s; }
.quicklinks.open .quicklinks-panel a:nth-child(8)  { transition-delay: 0.34s; }
.quicklinks.open .quicklinks-panel a:nth-child(9)  { transition-delay: 0.38s; }
.quicklinks.open .quicklinks-panel a:nth-child(10) { transition-delay: 0.42s; }

/* Reset delays on close */
.quicklinks:not(.open) .quicklinks-panel a {
  transition-delay: 0s;
}

/* Hover indicator bar */
.quicklinks-panel a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--color-primary);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

.quicklinks-panel a:hover::before {
  width: 3px;
}

.quicklinks-panel a:hover {
  color: var(--color-primary);
  background: rgba(0,0,0,0.04);
  padding-left: 30px;
}

[data-theme="dark"] .quicklinks-panel {
  background: #1A1A19;
  border-color: rgba(226, 225, 218, 0.08);
  border-left-color: var(--color-primary);
  box-shadow: var(--shadow-2xl), 0 0 40px rgba(0,0,0,0.3);
}

[data-theme="dark"] .quicklinks-panel a:hover {
  background: rgba(0,0,0,0.12);
}

@media (max-width: 767px) {
  .quicklinks { display: none; }
}

/* --- Scroll Animations (subtle) --- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-light { color: var(--color-text-light); }
/* =========================================================
   #5 — Hierarchy utilities (weight + color, not size)
   Refactoring UI: de-emphasize via muted color, not shrinking.
   ========================================================= */
.text-muted   { color: var(--color-text-muted); }
.text-subtle  { color: var(--color-text-subtle); }
.text-strong  { color: var(--color-text-strong); font-weight: var(--font-weight-semibold); }
.text-emphasis{ font-weight: var(--font-weight-semibold); color: var(--color-text-strong); }

/* Weight-only modifiers */
.font-regular  { font-weight: var(--font-weight-regular); }
.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold     { font-weight: var(--font-weight-bold); }

/* Semantic text roles — same size as body, differentiated by color + weight */
.eyebrow {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent, var(--navy-700));
  margin-bottom: var(--space-sm);
  display: inline-block;
}
.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-strong);
  line-height: 1.55;
}
.meta {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-subtle);
  letter-spacing: 0.02em;
}
.caption {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.text-primary { color: var(--color-primary); }

.bg-white { background-color: var(--color-bg); }
.bg-alt { background-color: var(--color-bg-alt); }
.bg-dark { background-color: var(--color-bg-dark); }
.bg-cream { background-color: var(--color-cream); }
.bg-mauve { background-color: var(--color-mauve); }
.bg-steel { background-color: var(--color-steel); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Footer (NCC-inspired: premium, multi-column, dark bg) --- */

/* Social bar at top of footer */
.footer-social-bar {
  background: #111111;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: var(--space-md) 0;
}

.footer-social-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.footer-social-label {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: #888888;
  letter-spacing: 0.02em;
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  border: none;
  transition: all 0.25s ease;
}

.footer-social-icons a:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  filter: brightness(1.15);
}

.footer-social-icons a svg {
  width: 14px;
  height: 14px;
}

/* Main footer columns area */
.footer-columns-section {
  background: var(--color-bg-footer, #0A0A0A);
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.footer-columns-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: var(--space-2xl);
}

/* Footer column base */
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid rgba(255,255,255,0.08);
}

.footer-col a {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: #999999;
  padding: 4px 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-col a:hover {
  color: #ffffff;
  padding-left: 4px;
}

/* Brand column */
.footer-col-brand {
  padding-right: var(--space-xl);
}

.footer-logo img {
  height: 50px;
  width: auto;
  margin-bottom: var(--space-md);
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: #777777;
  line-height: 1.7;
}

/* Contact column */
.footer-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--space-sm);
}

.footer-contact-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: #666666;
}

.footer-contact-row a,
.footer-contact-row span {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: #999999;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.footer-contact-row a:hover {
  color: #ffffff;
  padding-left: 0;
}

/* Bottom bar */
.footer-bottom-bar {
  background: #050505;
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  color: #555555;
}

.footer-legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-legal a {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  color: #666666;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: #ffffff;
}

.footer-dot {
  color: #444444;
  font-size: 10px;
}

/* Footer responsive */
@media (max-width: 1024px) {
  .footer-columns-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  .footer-col-brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  .footer-columns-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-legal {
    justify-content: center;
  }
  .footer-social-bar-inner {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* --- Tablet section padding (768–1023px) ---
   Refactoring UI: smoother rhythm between mobile (64px) and desktop (128px). */
@media (min-width: 768px) and (max-width: 1023px) {
  .section { padding: 5rem 0; }                 /* 80px */
}

/* --- Responsive text sizes --- */
@media (max-width: 767px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-xl); }

  .section { padding: 5rem 0; }                 /* 80px — more breathing room on mobile */

  /* Hide quicklinks sidebar on mobile/tablet */
  .quicklinks { display: none; }

  /* Reduce container padding for mobile */
  .container,
  .container-wide {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  /* Reduce grid gaps on mobile */
  .grid-2, .grid-3, .grid-4 {
    gap: var(--space-lg);
  }

  /* Smaller buttons on mobile */
  .btn {
    padding: 10px 20px;
    font-size: 0.78rem;
  }

  /* Footer social bar stack */
  .footer-social-bar-inner {
    flex-wrap: wrap;
  }
}

/* ── Ultra-small mobile (375px and below) ── */
@media (max-width: 400px) {
  .container,
  .container-wide {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }

  .section { padding: var(--space-3xl) 0; }     /* 64px — was 48px, more air on ultra-small */

  .btn {
    padding: 10px 16px;
    font-size: 0.75rem;
  }

  .grid-2, .grid-3, .grid-4 {
    gap: var(--space-md);
  }

  /* Ensure mobile nav has smaller padding */
  .mobile-nav-inner {
    padding: var(--space-md);
  }

  /* Reduce search modal padding */
  .search-input-wrap {
    padding: 14px 16px;
  }

  /* Footer columns single column with less gap */
  .footer-columns-grid {
    gap: var(--space-md);
  }
  .footer-columns-section {
    padding: var(--space-2xl) 0 var(--space-lg);
  }
}

/* ============================================================
   GLOBAL SEARCH ENGINE
   ============================================================ */

/* --- Search Button (in nav) --- */
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

.nav-search-btn:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.nav-search-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

/* --- Member Account Button (header) --- */
.nav-member-btn-wrap {
  position: relative;
  flex-shrink: 0;
}

.nav-member-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  padding: 0;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.nav-member-btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.nav-member-btn svg {
  width: 22px;                    /* icon fills more of the 38px button */
  height: 22px;
  pointer-events: none;
}

.nav-member-btn--logged-in {
  border-color: var(--color-primary);
  padding: 0;
  overflow: hidden;
}

/* Avatar fills the button edge-to-edge (leaves only the 1px border ring) */
.nav-member-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-full);
  object-fit: cover;
  display: block;
}

/* Member Dropdown — hidden by default via inline style="display:none" in HTML.
   JS controls display:block/none. CSS handles opacity/transform animation. */
.member-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
  z-index: 9999;
  overflow: hidden;
}

.member-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.member-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.member-dropdown-header img {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.member-dropdown-header span {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.member-dropdown-link:hover {
  background: var(--color-bg-alt);
}

.member-dropdown-link svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.member-dropdown-link--logout {
  border-top: 1px solid var(--color-border);
  color: #c0392b;
}

.member-dropdown-link--logout:hover {
  background: #fdf0ef;
}

[data-theme="dark"] .member-dropdown-link--logout:hover {
  background: rgba(192,57,43,0.12);
}

/* Mobile Nav — Member Links */
.mnav-member-divider {
  height: 1px;
  background: var(--color-border);
  margin: 12px 0;
}

.mnav-member-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.mnav-member-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.mnav-member-link--logout {
  color: #c0392b !important;
}

/* --- Search Overlay (full screen) --- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(.4,0,.2,1), visibility 0.35s;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Search Modal --- */
.search-modal {
  width: 92%;
  max-width: 720px;
  background: var(--color-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.35), 0 0 0 1px var(--color-border);
  transform: translateY(-30px) scale(0.96);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
  overflow: hidden;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}

.search-overlay.active .search-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* --- Search Input Area --- */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.search-input-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.search-input-wrap input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-text);
  background: none;
  border: none;
  outline: none;
  padding: 0;
  line-height: 1.5;
}

.search-input-wrap input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.search-kbd {
  display: none;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .search-kbd { display: flex; }
}

.search-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-bg-alt);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-close-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .search-close-btn:hover {
  background: #000;
  color: #FFF1D3;
}

/* --- Search Results Area --- */
.search-results-wrap {
  overflow-y: auto;
  flex: 1;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.search-results-wrap::-webkit-scrollbar {
  width: 6px;
}

.search-results-wrap::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

/* Quick suggestions (before typing) */
.search-suggestions {
  padding: 16px 24px 20px;
}

.search-suggestions-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.search-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.search-suggestion-pill:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .search-suggestion-pill:hover {
  background: #000;
  color: #FFF1D3;
  border-color: rgba(255, 241, 211, 0.3);
}

.search-suggestion-pill svg {
  width: 14px;
  height: 14px;
  opacity: 0.65;
}

/* Results list */
.search-results-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.search-result-item {
  display: block;
}

.search-result-item a {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 24px;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}

.search-result-item a:hover,
.search-result-item a.search-active {
  background: var(--color-bg-alt);
  border-left-color: var(--color-primary);
}

.search-result-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 2px;
}

.search-result-icon.page { background: rgba(27,58,92,0.08); color: #1B3A5C; }
.search-result-icon.section { background: rgba(27,58,92,0.06); color: #2F5DA7; }
.search-result-icon.content { background: rgba(0,0,0,0.04); color: #4F565D; }
.search-result-icon.media { background: rgba(27,58,92,0.06); color: #1B3A5C; }
.search-result-icon.external { background: rgba(0,0,0,0.04); color: #4F565D; }
.search-result-icon.event { background: rgba(27,58,92,0.08); color: #1B6B3A; }

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0 0 2px;
}

.search-result-title mark {
  background: rgba(0,0,0,0.15);
  color: var(--color-primary);
  border-radius: 2px;
  padding: 0 2px;
}

.search-result-breadcrumb {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.search-result-breadcrumb span {
  opacity: 0.5;
}

.search-result-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 5px;
  overflow: hidden;
}

.search-result-tag {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: var(--border-radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* No results */
.search-no-results {
  text-align: center;
  padding: 48px 24px;
}

.search-no-results svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  opacity: 0.4;
  margin-bottom: 16px;
}

.search-no-results h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 0 0 6px;
}

.search-no-results p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* --- Thumbnail in search results --- */
.search-result-thumb-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}
.search-result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Live badge --- */
.search-result-live-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  margin-left: 6px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary);
  color: #fff;
  vertical-align: middle;
}

[data-theme="dark"] .search-result-live-badge {
  background: #000;
  color: #FFF1D3;
}

/* --- Date in search results --- */
.search-result-date {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: 3px;
  display: block;
}

/* --- View all results link --- */
.search-viewall-wrap {
  text-align: center;
  padding: 10px 24px 14px;
  border-top: 1px solid var(--color-border);
}
.search-viewall-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
.search-viewall-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* --- Loading states --- */
.search-loading {
  text-align: center;
  padding: 48px 24px;
}
.search-loading p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 12px 0 0;
}
.search-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: egw-spin 0.7s linear infinite;
}
.search-loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 24px 12px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.search-loading-spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: egw-spin 0.7s linear infinite;
}
@keyframes egw-spin {
  to { transform: rotate(360deg); }
}

/* --- Search Footer --- */
.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg-alt);
}

.search-footer-keys {
  display: none;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .search-footer-keys { display: flex; }
}

.search-footer-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  margin-right: 3px;
}

.search-result-count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* --- Recent searches --- */
.search-recent {
  padding: 12px 24px 4px;
  border-bottom: 1px solid var(--color-border);
}

.search-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.search-recent-header span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.search-clear-recent {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}

.search-clear-recent:hover {
  color: var(--color-primary);
}

.search-recent-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.search-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.search-recent-item:hover {
  color: var(--color-primary);
}

.search-recent-item svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ============================================================
   SHARED FORM COMPONENTS — Country Selector, Phone Input, Title
   ============================================================ */

/* --- Title Dropdown --- */
.egw-title-select {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  cursor: pointer;
  outline: none;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.egw-title-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

/* --- Custom Country Selector (shared) --- */
.egw-country-select {
  position: relative;
}
.egw-country-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  text-align: left;
}
.egw-country-trigger:focus,
.egw-country-trigger.open {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.egw-country-trigger svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.egw-country-trigger.open svg {
  transform: rotate(180deg);
}
.egw-country-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.egw-country-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 100;
  display: none;
  overflow: hidden;
}
.egw-country-dropdown.open {
  display: block;
}
.egw-country-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
}
.egw-country-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  outline: none;
}
.egw-country-search:focus {
  border-color: var(--color-primary);
}
.egw-country-list {
  max-height: 220px;
  overflow-y: auto;
}
.egw-country-list::-webkit-scrollbar { width: 6px; }
.egw-country-list::-webkit-scrollbar-track { background: transparent; }
.egw-country-list::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 3px; }
.egw-country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition: background var(--transition-fast);
}
.egw-country-option:hover,
.egw-country-option.highlighted {
  background: rgba(0,0,0,0.06);
}
.egw-country-option.selected {
  background: rgba(0,0,0,0.1);
  font-weight: 600;
}
.egw-country-flag {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.egw-country-no-results {
  padding: 14px;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* --- Phone Input with Country Code (shared) --- */
.egw-phone-wrap {
  position: relative;
}
.egw-phone-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg);
  overflow: visible;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.egw-phone-row:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.egw-phone-country-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: none;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
}
.egw-phone-country-btn:hover {
  background: rgba(0,0,0,0.06);
}
.egw-phone-flag {
  font-size: 1.2rem;
  line-height: 1;
}
.egw-phone-code {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.egw-phone-number {
  flex: 1;
  border: none;
  padding: 12px 16px;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  outline: none;
  min-width: 0;
}
.egw-phone-number::placeholder {
  color: var(--color-text-muted);
}
.egw-phone-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  max-width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 110;
  display: none;
  overflow: hidden;
}
.egw-phone-dropdown.open {
  display: block;
}
.egw-phone-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
}
.egw-phone-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  outline: none;
}
.egw-phone-search:focus {
  border-color: var(--color-primary);
}
.egw-phone-list {
  max-height: 220px;
  overflow-y: auto;
}
.egw-phone-list::-webkit-scrollbar { width: 6px; }
.egw-phone-list::-webkit-scrollbar-track { background: transparent; }
.egw-phone-list::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 3px; }
.egw-phone-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition: background var(--transition-fast);
}
.egw-phone-option:hover {
  background: rgba(0,0,0,0.06);
}
.egw-phone-option.selected {
  background: rgba(0,0,0,0.1);
  font-weight: 600;
}
.egw-phone-opt-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.egw-phone-opt-dial {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}
.egw-phone-country-btn svg {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
}

/* --- Dark mode overrides for shared form components ---
   v231: use background-color (not shorthand) + explicit no-repeat/position
   so the chevron svg doesn't tile into a wavy pattern. */
[data-theme="dark"] .egw-title-select {
  background-color: #1A1A1A;
  border-color: rgba(255,255,255,0.12);
  color: #E8E8E8;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
[data-theme="dark"] .egw-title-select:focus {
  border-color: #FFF1D3;
  box-shadow: 0 0 0 3px rgba(123,163,212,0.15);
}
[data-theme="dark"] .egw-country-trigger {
  background: #1A1A1A;
  border-color: rgba(255,255,255,0.12);
  color: #E8E8E8;
}
[data-theme="dark"] .egw-country-trigger:focus,
[data-theme="dark"] .egw-country-trigger.open {
  border-color: #FFF1D3;
  box-shadow: 0 0 0 3px rgba(123,163,212,0.15);
}
[data-theme="dark"] .egw-country-dropdown {
  background: #1A1A1A;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
[data-theme="dark"] .egw-country-search-wrap {
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .egw-country-search {
  background: #252525;
  border-color: rgba(255,255,255,0.1);
  color: #E8E8E8;
}
[data-theme="dark"] .egw-country-search:focus {
  border-color: #FFF1D3;
}
[data-theme="dark"] .egw-country-option {
  color: #E8E8E8;
}
[data-theme="dark"] .egw-country-option:hover,
[data-theme="dark"] .egw-country-option.highlighted {
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .egw-country-option.selected {
  background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .egw-phone-row {
  border-color: rgba(255,255,255,0.12);
  background: #1A1A1A;
}
[data-theme="dark"] .egw-phone-row:focus-within {
  border-color: #FFF1D3;
  box-shadow: 0 0 0 3px rgba(123,163,212,0.15);
}
[data-theme="dark"] .egw-phone-country-btn {
  background: #252525;
  border-color: rgba(255,255,255,0.1);
  color: #E8E8E8;
}
[data-theme="dark"] .egw-phone-country-btn:hover {
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .egw-phone-code {
  color: #9CA2A4;
}
[data-theme="dark"] .egw-phone-number {
  color: #E8E8E8;
}
[data-theme="dark"] .egw-phone-number::placeholder {
  color: #666;
}
[data-theme="dark"] .egw-phone-dropdown {
  background: #1A1A1A;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
[data-theme="dark"] .egw-phone-search-wrap {
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .egw-phone-search {
  background: #252525;
  border-color: rgba(255,255,255,0.1);
  color: #E8E8E8;
}
[data-theme="dark"] .egw-phone-search:focus {
  border-color: #FFF1D3;
}
[data-theme="dark"] .egw-phone-option {
  color: #E8E8E8;
}
[data-theme="dark"] .egw-phone-option:hover {
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .egw-phone-option.selected {
  background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .egw-phone-opt-dial {
  color: #666;
}

@media (prefers-color-scheme: dark) {
  .egw-title-select {
    background: #1A1A1A;
    border-color: rgba(255,255,255,0.12);
    color: #E8E8E8;
  }
  .egw-country-trigger {
    background: #1A1A1A;
    border-color: rgba(255,255,255,0.12);
    color: #E8E8E8;
  }
  .egw-country-dropdown {
    background: #1A1A1A;
    border-color: rgba(255,255,255,0.12);
  }
  .egw-country-search {
    background: #252525;
    border-color: rgba(255,255,255,0.1);
    color: #E8E8E8;
  }
  .egw-country-option { color: #E8E8E8; }
  .egw-country-option:hover,
  .egw-country-option.highlighted { background: rgba(255,255,255,0.08); }
  .egw-phone-row {
    border-color: rgba(255,255,255,0.12);
    background: #1A1A1A;
  }
  .egw-phone-country-btn {
    background: #252525;
    border-color: rgba(255,255,255,0.1);
    color: #E8E8E8;
  }
  .egw-phone-number { color: #E8E8E8; }
  .egw-phone-dropdown {
    background: #1A1A1A;
    border-color: rgba(255,255,255,0.12);
  }
  .egw-phone-search {
    background: #252525;
    border-color: rgba(255,255,255,0.1);
    color: #E8E8E8;
  }
  .egw-phone-option { color: #E8E8E8; }
}

/* ============================================================
   SESSION INACTIVITY WARNING MODAL
   ============================================================ */
.egw-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 16px;
}
.egw-session-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}
.egw-session-modal {
  background: var(--color-bg, #fff);
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  transform: scale(0.92) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.egw-session-overlay.active .egw-session-modal {
  transform: scale(1) translateY(0);
}

/* Icon */
.egw-session-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}
.egw-session-icon svg {
  color: #D97706;
}

/* Title & description */
.egw-session-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text, #111);
  margin: 0 0 8px;
}
.egw-session-desc {
  font-family: var(--font-body, sans-serif);
  font-size: 0.9rem;
  color: var(--color-text-muted, #666);
  margin: 0 0 24px;
  line-height: 1.5;
}

/* Countdown ring */
.egw-session-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}
.egw-session-countdown-ring {
  position: relative;
  width: 80px;
  height: 80px;
}
.egw-session-countdown-ring svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}
.egw-ring-bg {
  fill: none;
  stroke: var(--color-border, rgba(0,0,0,0.08));
  stroke-width: 5;
}
.egw-ring-fg {
  fill: none;
  stroke: #F59E0B;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease, stroke 0.4s ease;
}
.egw-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading, sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #111);
}
.egw-session-countdown-label {
  font-family: var(--font-body, sans-serif);
  font-size: 0.72rem;
  color: var(--color-text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Action buttons */
.egw-session-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.egw-session-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.egw-session-btn-stay {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 2px 12px rgba(5, 150, 105, 0.25);
}
.egw-session-btn-stay:hover {
  background: linear-gradient(135deg, #047857, #065F46);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}
.egw-session-btn-stay:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}
.egw-session-btn-logout {
  background: var(--color-bg-alt, #f5f5f5);
  color: var(--color-text-muted, #666);
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
}
.egw-session-btn-logout:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FECACA;
}
[data-theme="dark"] .egw-session-btn-logout {
  background: #252523;
  color: #C3C2B7;
  border-color: rgba(226, 225, 218, 0.12);
}
[data-theme="dark"] .egw-session-btn-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef9a9a;
  border-color: rgba(239, 68, 68, 0.25);
}
.egw-session-btn-logout:focus-visible {
  outline: 2px solid #DC2626;
  outline-offset: 2px;
}

/* Note */
.egw-session-note {
  font-family: var(--font-body, sans-serif);
  font-size: 0.72rem;
  color: var(--color-text-muted, #999);
  margin: 0;
  opacity: 0.7;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .egw-session-modal { padding: 28px 20px 24px; }
  .egw-session-actions { flex-direction: column; }
  .egw-session-title { font-size: 1.1rem; }
}

/* ── Dark mode ── */
[data-theme="dark"] .egw-session-icon {
  background: linear-gradient(135deg, #78350F, #92400E);
}
[data-theme="dark"] .egw-session-modal {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}
@media (prefers-color-scheme: dark) {
  .egw-session-icon {
    background: linear-gradient(135deg, #78350F, #92400E);
  }
  .egw-session-modal {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* ============================================================
   EGW GLOBAL TOAST NOTIFICATIONS
   Site-wide branded feedback — replaces all native alert()
   ============================================================ */

.egw-toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.egw-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  min-width: 300px;
  pointer-events: auto;
  animation: egwToastIn 400ms cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  font-family: var(--font-body, 'Inter', sans-serif);
}

.egw-toast.removing {
  animation: egwToastOut 300ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes egwToastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes egwToastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(60px) scale(0.95); }
}

/* Toast variants */
.egw-toast-success { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border-color: rgba(34,197,94,.3); color: #1b5e20; }
.egw-toast-error   { background: linear-gradient(135deg, #ffebee, #fce4ec); border-color: rgba(239,68,68,.3); color: #b71c1c; }
.egw-toast-warning { background: linear-gradient(135deg, #fff8e1, #fff3e0); border-color: rgba(245,158,11,.3); color: #e65100; }
.egw-toast-info    { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); border-color: rgba(59,130,246,.3); color: #0d47a1; }

/* Dark mode toast */
[data-theme="dark"] .egw-toast-success { background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(34,197,94,.08)); color: #81c784; border-color: rgba(34,197,94,.25); }
[data-theme="dark"] .egw-toast-error   { background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(239,68,68,.08)); color: #ef9a9a; border-color: rgba(239,68,68,.25); }
[data-theme="dark"] .egw-toast-warning { background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(245,158,11,.08)); color: #ffcc80; border-color: rgba(245,158,11,.25); }
[data-theme="dark"] .egw-toast-info    { background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(59,130,246,.08)); color: #90caf9; border-color: rgba(59,130,246,.25); }

.egw-toast-icon { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; }
.egw-toast-content { flex: 1; }
.egw-toast-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.15rem; }
.egw-toast-message { font-size: 0.85rem; opacity: 0.85; line-height: 1.4; }

.egw-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  color: inherit;
  padding: 0;
  line-height: 1;
}
.egw-toast-close:hover { opacity: 1; }

.egw-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 10px 10px;
  animation: egwToastProgressShrink linear forwards;
}

@keyframes egwToastProgressShrink {
  from { width: 100%; }
  to   { width: 0%; }
}

.egw-toast-success .egw-toast-progress { background: #22c55e; }
.egw-toast-error   .egw-toast-progress { background: #ef4444; }
.egw-toast-warning .egw-toast-progress { background: #f59e0b; }
.egw-toast-info    .egw-toast-progress { background: #3b82f6; }

/* ============================================================
   EGW GLOBAL CONFIRM DIALOG
   Site-wide branded replacement for confirm()
   ============================================================ */

.egw-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  animation: egwFadeIn 200ms ease;
}

@keyframes egwFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.egw-confirm-dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  padding: 2rem;
  animation: egwSlideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-family: var(--font-body, 'Inter', sans-serif);
}

@keyframes egwSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="dark"] .egw-confirm-dialog {
  background: #2C2C2A;
  border: 1px solid rgba(226, 225, 218, 0.1);
  color: #F8F8F6;
}

.egw-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.egw-confirm-icon.warning { background: rgba(245, 158, 11, 0.12); }
.egw-confirm-icon.danger  { background: rgba(239, 68, 68, 0.12); }
.egw-confirm-icon.info    { background: rgba(59, 130, 246, 0.12); }

.egw-confirm-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .egw-confirm-title { color: #F8F8F6; }

.egw-confirm-message {
  font-size: 0.9rem;
  color: var(--color-text-muted, #666);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .egw-confirm-message { color: #97958C; }

.egw-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.egw-confirm-cancel-btn {
  padding: 0.75rem 1.5rem;
  border: 1.5px solid var(--color-border, rgba(0,0,0,0.1));
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  background: transparent;
  color: var(--color-text, #1a1a2e);
}

[data-theme="dark"] .egw-confirm-cancel-btn {
  border-color: rgba(226, 225, 218, 0.15);
  color: #C3C2B7;
}

.egw-confirm-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .egw-confirm-cancel-btn:hover {
  background: rgba(226, 225, 218, 0.08);
}

.egw-confirm-primary-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  background: linear-gradient(135deg, var(--color-primary, #d4af37), var(--color-primary-hover, #e8c84a));
  color: #000;
  box-shadow: 0 2px 8px rgba(255, 241, 211, 0.3);
}

.egw-confirm-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 241, 211, 0.4);
}

[data-theme="dark"] .egw-confirm-primary-btn {
  background: #000;
  color: #FFF1D3;
  border: 1px solid rgba(255, 241, 211, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .egw-confirm-primary-btn:hover {
  border-color: rgba(255, 241, 211, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.egw-confirm-danger-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.egw-confirm-danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .egw-confirm-danger-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .egw-confirm-danger-btn:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

@media (max-width: 480px) {
  .egw-toast-container {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
  }
  .egw-toast { max-width: none; min-width: auto; }
  .egw-confirm-actions { flex-direction: column-reverse; }
}

/* ============================================================
   FORM FIELD STACKING
   Refactoring UI: consistent vertical rhythm for form fields.
   Apply .form-stack to any <form> or field container.
   ============================================================ */
.form-stack > * + * {
  margin-top: var(--space-lg);                  /* 24px between field groups */
}
.form-stack .form-row + .form-row,
.form-stack .form-field + .form-field {
  margin-top: var(--space-lg);
}
.form-stack label {
  display: block;
  margin-bottom: var(--space-xs);               /* 8px between label and input */
}
.form-stack .form-actions {
  margin-top: var(--space-xl);                  /* 32px before submit button group */
}

/* =========================================================
   #6 — Jakob's Law: familiar patterns users already know
   Skip-link, back-to-top, breadcrumb, focus rings,
   external-link indicator, required-field asterisk.
   ========================================================= */

/* Skip-to-content — invisible until keyboard focus */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -150%);
  z-index: 10000;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  box-shadow: var(--elevation-dropdown, 0 8px 24px rgba(0,0,0,0.25));
  transition: transform var(--transition-base);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline: 3px solid var(--color-focus-ring, var(--color-accent));
  outline-offset: 2px;
}

/* Universal keyboard focus ring — familiar accessibility pattern */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--color-focus-ring, var(--color-accent, var(--navy-700)));
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* Back-to-top button — recognisable bottom-right FAB */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-strong, rgba(0,0,0,0.12));
  border-radius: var(--border-radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--elevation-card);
  z-index: 90;
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-card-hover);
}
.back-to-top:active {
  transform: translateY(0);
  box-shadow: var(--elevation-card-sm);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity var(--transition-base); }
  .back-to-top:hover { transform: none; }
}

/* Breadcrumbs — familiar separator + muted color hierarchy */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
  list-style: none;
  margin: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before {
  content: "/";
  margin: 0 var(--space-xs);
  color: var(--color-text-subtle);
  opacity: 0.6;
}
.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--color-text-link, var(--color-accent)); }
.breadcrumb [aria-current="page"] {
  color: var(--color-text-strong);
  font-weight: var(--font-weight-semibold);
}

/* External-link indicator — subtle ↗ after links that open in new tab */
.prose a[target="_blank"]:not(.no-ext-icon)::after,
.content a[target="_blank"]:not(.no-ext-icon)::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.25em;
  font-size: 0.85em;
  color: var(--color-text-subtle);
  vertical-align: baseline;
}

/* Required-field asterisk — familiar form convention */
label.required::after,
.form-stack label .required-indicator,
.form-stack label[data-required="true"]::after {
  content: " *";
  color: var(--color-error, #C0392B);
  font-weight: var(--font-weight-bold);
  margin-left: 2px;
}

/* Mobile breakpoint: keep back-to-top clear of safe area */
@media (max-width: 768px) {
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* =========================================================
   #8 — Fitts's Law: generic tap-target helpers.
   Use on any small icon-only control to guarantee ≥44×44px.
   ========================================================= */
.tap-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}
.icon-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

.icon-btn--sm {
  width: 44px; height: 44px; padding: 12px;                 /* still 44 outer, smaller glyph */
}
.icon-btn--sm svg { width: 16px; height: 16px; }

/* Ensure form controls meet the 44px minimum on touch devices */
@media (pointer: coarse) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], input[type="url"],
  input[type="search"], input[type="date"], select, textarea {
    min-height: 44px;
  }
  .btn { min-height: 44px; }
}

/* Adjacent-target spacing — reduces accidental mis-taps */
.tap-row > * + * { margin-left: var(--space-xs); }

/* =========================================================
   #9 — Aesthetic-Usability Effect
   Microinteractions + skeleton loaders. Subtle polish that
   makes the product feel more trustworthy and responsive.
   ========================================================= */

/* Universal press-scale — apply .press to any clickable surface
   to get tactile feedback without adding a ripple dependency. */
.press {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
              background-color var(--transition-fast);
}
.press:active { transform: scale(0.97); }

/* Subtle icon pulse — draws eye without being loud */
@keyframes egw-pulse-soft {
  0%, 100% { transform: scale(1);    opacity: 1;    }
  50%      { transform: scale(1.08); opacity: 0.92; }
}
.pulse-soft { animation: egw-pulse-soft 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .pulse-soft { animation: none; }
}

/* Float/ease nudge for hero art, card images, etc. */
@keyframes egw-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.float-soft { animation: egw-float 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .float-soft { animation: none; }
}

/* Spinner — 20px, current color. Use for inline button loading states. */
@keyframes egw-spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: egw-spin 0.7s linear infinite;
  vertical-align: -4px;
}
.spinner--sm { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid #fff;
  border-right-color: transparent;
  animation: egw-spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .btn.is-loading::after { animation-duration: 1.4s; }
}

/* Skeleton loader — shows structural placeholder while content loads.
   Use .skeleton on a block, size it with inline style or helper classes. */
@keyframes egw-skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  display: block;
  background:
    linear-gradient(
      90deg,
      var(--neutral-100, #F3F2EB) 0%,
      var(--neutral-200, #E8E7DD) 50%,
      var(--neutral-100, #F3F2EB) 100%
    );
  background-size: 200% 100%;
  animation: egw-skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
  color: transparent !important;
  user-select: none;
  min-height: 1em;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
[data-theme="dark"] .skeleton,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .skeleton {
    background:
      linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.04) 100%
      );
    background-size: 200% 100%;
  }
}
.skeleton-line      { height: 0.9em; margin-bottom: 0.6em; }
.skeleton-line--sm  { height: 0.75em; }
.skeleton-line--lg  { height: 1.2em;  }
.skeleton-title     { height: 1.6em; width: 60%; margin-bottom: 0.9em; }
.skeleton-avatar    { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-thumb     { width: 100%; aspect-ratio: 16/10; border-radius: var(--border-radius-lg); }
.skeleton-card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  background: var(--color-bg);
}
.skeleton-card .skeleton-thumb { margin-bottom: var(--space-md); }

/* Subtle underline-slide on prose / footer links — microinteraction that
   signals interactivity without heavy hover changes. */
.link-underline,
.prose a:not(.btn):not(.no-underline),
.footer-legal a {
  position: relative;
  text-decoration: none;
}
.link-underline::after,
.prose a:not(.btn):not(.no-underline)::after,
.footer-legal a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}
.link-underline:hover::after,
.prose a:not(.btn):not(.no-underline):hover::after,
.footer-legal a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
@media (prefers-reduced-motion: reduce) {
  .link-underline::after,
  .prose a:not(.btn):not(.no-underline)::after,
  .footer-legal a::after { transition: none; }
}

/* Card entry polish — slight lift on hover if the card opts in */
.card.interactive {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}
.card.interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--elevation-card-hover);
}
.card.interactive:active {
  transform: translateY(-1px);
  box-shadow: var(--elevation-card);
}

/* Input focus ring polish — replace harsh default with brand ring */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent, var(--navy-700));
  box-shadow: 0 0 0 3px var(--color-focus-ring, rgba(27, 58, 92, 0.25));
}

/* =========================================================
   SITE-WIDE RULE — Cream-background buttons always use BLACK text.
   Dennis: any button with the cream/champagne brand color
   (#FFF1D3 / #FFF7E6 / #F8F8F6 / #FFFFFF) must show pure black
   text for readability and brand consistency.
   ========================================================= */
.btn[style*="background:#FFF1D3"],
.btn[style*="background-color:#FFF1D3"],
.btn[style*="background: #FFF1D3"],
.btn[style*="background-color: #FFF1D3"],
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .btn-primary:focus-visible,
[data-theme="dark"] .btn-dark,
[data-theme="dark"] .btn-dark:hover,
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .btn-outline-light:hover,
[data-theme="dark"] .btn-accent,
[data-theme="dark"] .btn-accent:hover,
[data-theme="dark"] .btn-highlight,
[data-theme="dark"] .btn-highlight:hover,
[data-theme="dark"] .egw-confirm-primary-btn,
[data-theme="dark"] .egw-confirm-primary-btn:hover {
  color: #000000 !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .btn-primary:hover,
  :root:not([data-theme="light"]) .btn-primary:focus,
  :root:not([data-theme="light"]) .btn-primary:focus-visible,
  :root:not([data-theme="light"]) .btn-dark,
  :root:not([data-theme="light"]) .btn-dark:hover,
  :root:not([data-theme="light"]) .btn-outline:hover,
  :root:not([data-theme="light"]) .btn-outline-light:hover,
  :root:not([data-theme="light"]) .btn-accent,
  :root:not([data-theme="light"]) .btn-accent:hover,
  :root:not([data-theme="light"]) .btn-highlight,
  :root:not([data-theme="light"]) .btn-highlight:hover,
  :root:not([data-theme="light"]) .egw-confirm-primary-btn,
  :root:not([data-theme="light"]) .egw-confirm-primary-btn:hover {
    color: #000000 !important;
  }
}

/* =========================================================
   #10 — Von Restorff Effect
   One primary CTA per section must be unmistakably distinct.
   .btn-cta = the single most-important call-to-action on a
   section/page. Use exactly ONCE per context.
   ========================================================= */
.btn-cta {
  background-color: var(--color-accent, var(--navy-700));
  color: #FFFFFF;
  border-color: var(--color-accent, var(--navy-700));
  font-size: var(--font-size-lg);                  /* larger than btn-primary */
  font-weight: var(--font-weight-bold);            /* heavier than btn-primary semibold */
  padding: 18px 44px;                              /* meatier than btn-primary 14x36 */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--border-radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 10px 26px rgba(27, 58, 92, 0.30),
    0 3px 6px rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}
.btn-cta::after {
  /* Animated sheen — subtle, non-looping on hover; reduced-motion safe */
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.22) 50%, transparent 100%);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn-cta:hover {
  background-color: var(--color-accent-hover, var(--navy-800));
  border-color: var(--color-accent-hover, var(--navy-800));
  color: #FFFFFF;
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 16px 36px rgba(27, 58, 92, 0.38),
    0 5px 10px rgba(0,0,0,0.14);
}
.btn-cta:hover::after { left: 110%; }
.btn-cta:active {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.18),
    0 4px 10px rgba(27, 58, 92, 0.25);
}
@media (prefers-reduced-motion: reduce) {
  .btn-cta::after { display: none; }
}

/* Dark mode: CTA stays visually dominant with cream accent
   — black text enforced by the site-wide cream-button rule above. */
[data-theme="dark"] .btn-cta {
  background-color: #FFF1D3;
  border-color: #FFF1D3;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 10px 26px rgba(0,0,0,0.55),
    0 3px 6px rgba(0,0,0,0.30);
}
[data-theme="dark"] .btn-cta:hover {
  background-color: #FFF7E6;
  border-color: #FFF7E6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-cta {
    background-color: #FFF1D3;
    border-color: #FFF1D3;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.4),
      0 10px 26px rgba(0,0,0,0.55),
      0 3px 6px rgba(0,0,0,0.30);
  }
  :root:not([data-theme="light"]) .btn-cta:hover {
    background-color: #FFF7E6;
    border-color: #FFF7E6;
  }
}

/* CTA group pattern — when a button row contains a primary/cta + siblings,
   de-emphasize the siblings so the eye has one obvious target. */
.cta-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}
.cta-group .btn:not(.btn-primary):not(.btn-cta):not(.btn-dark) {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  box-shadow: none;
  font-weight: var(--font-weight-medium);
}
.cta-group .btn:not(.btn-primary):not(.btn-cta):not(.btn-dark):hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

/* Auto-demotion: if a container has both .btn-cta and .btn-primary,
   the .btn-primary auto-softens to secondary-outline so there's still
   one clear winner. */
:where(.section, .hero, .cta-group, .btn-row):has(.btn-cta) .btn-primary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong, var(--color-text));
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-sm);
  padding: 12px 32px;
  font-size: var(--font-size-sm);
}
:where(.section, .hero, .cta-group, .btn-row):has(.btn-cta) .btn-primary:hover {
  background: var(--color-text);
  color: #FFFFFF;
  border-color: var(--color-text);
}

/* =========================================================
   #11 — Peak-End Rule
   Polish the high-emotion moments (first view, submission
   success, confirmation, farewell) so the memory is strong.
   ========================================================= */

/* Page-enter: first-paint bloom for hero / above-the-fold. */
@keyframes egw-hero-enter {
  0%   { opacity: 0; transform: translateY(12px); filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.page-enter,
.hero.page-enter > * {
  animation: egw-hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero.page-enter > *:nth-child(2) { animation-delay: 0.12s; }
.hero.page-enter > *:nth-child(3) { animation-delay: 0.24s; }
.hero.page-enter > *:nth-child(4) { animation-delay: 0.36s; }
.hero.page-enter > *:nth-child(5) { animation-delay: 0.48s; }
@media (prefers-reduced-motion: reduce) {
  .page-enter, .hero.page-enter > * { animation: none !important; }
}

/* Success celebration — use on confirmation cards/modals/toasts after a
   positive action (registration, prayer submission, testimony posted). */
@keyframes egw-success-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes egw-success-ring {
  0%   { box-shadow: 0 0 0 0   rgba(27, 58, 92, 0.35); }
  100% { box-shadow: 0 0 0 28px rgba(27, 58, 92, 0);   }
}
.success-celebration {
  animation: egw-success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-celebration .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-600, var(--color-accent)) 0%, var(--navy-800, var(--color-accent)) 100%);
  color: #FFFFFF;
  margin: 0 auto var(--space-lg);
  animation: egw-success-ring 1.2s ease-out 0.3s both;
  box-shadow: var(--elevation-card-hover);
}
.success-celebration .success-icon svg { width: 38px; height: 38px; }
@media (prefers-reduced-motion: reduce) {
  .success-celebration,
  .success-celebration .success-icon { animation: none; }
}

/* Checkmark draw-in — pair with .success-icon for extra polish */
@keyframes egw-check-draw {
  to { stroke-dashoffset: 0; }
}
.check-draw {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: egw-check-draw 0.55s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .check-draw { stroke-dashoffset: 0; animation: none; }
}

/* Confetti-free "bloom" — soft radial glow behind a thank-you card */
.thankyou-bloom {
  position: relative;
  isolation: isolate;
}
.thankyou-bloom::before {
  content: "";
  position: absolute;
  inset: -80px;
  z-index: -1;
  background: radial-gradient(
    closest-side,
    rgba(27, 58, 92, 0.12) 0%,
    rgba(27, 58, 92, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
}
[data-theme="dark"] .thankyou-bloom::before,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .thankyou-bloom::before {
    background: radial-gradient(
      closest-side,
      rgba(255, 241, 211, 0.10) 0%,
      rgba(255, 241, 211, 0.04) 40%,
      transparent 70%
    );
  }
}

/* "Ending" farewell — soft fade-out that triggers on .is-leaving */
@keyframes egw-fade-out-up {
  to { opacity: 0; transform: translateY(-8px); }
}
.is-leaving { animation: egw-fade-out-up 0.35s ease-out forwards; }

/* =========================================================
   #12 — Decorated backgrounds + accent borders
   Refactoring UI: "Backgrounds don't have to be plain."
   Use these on sections, blockquotes, callouts.
   ========================================================= */

/* Subtle dotted-grid — great behind section headings */
.bg-dots {
  background-image: radial-gradient(
    circle at 1px 1px,
    var(--color-border-strong, rgba(0,0,0,0.08)) 1px,
    transparent 0
  );
  background-size: 20px 20px;
}
[data-theme="dark"] .bg-dots,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bg-dots {
    background-image: radial-gradient(
      circle at 1px 1px,
      rgba(255,255,255,0.08) 1px,
      transparent 0
    );
  }
}

/* Soft diagonal stripes — for "coming soon" / studio placeholder sections */
.bg-stripes {
  background-image: repeating-linear-gradient(
    135deg,
    var(--color-bg-alt) 0,
    var(--color-bg-alt) 14px,
    var(--color-bg) 14px,
    var(--color-bg) 28px
  );
}

/* Vertical gradient — warm cream-to-white for inviting sections */
.bg-gradient-warm {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

/* Accent gradient — navy wash, for CTA banners or major breakers */
.bg-gradient-accent {
  background: linear-gradient(135deg, var(--navy-700, var(--color-accent)) 0%, var(--navy-900, var(--color-accent)) 100%);
  color: #FFFFFF;
}
.bg-gradient-accent h1,
.bg-gradient-accent h2,
.bg-gradient-accent h3,
.bg-gradient-accent p { color: #FFFFFF; }

/* Spotlight — radial glow behind hero images */
.bg-spotlight {
  position: relative;
  isolation: isolate;
}
.bg-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse at center,
    rgba(27, 58, 92, 0.10) 0%,
    transparent 60%
  );
}
[data-theme="dark"] .bg-spotlight::before,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bg-spotlight::before {
    background: radial-gradient(
      ellipse at center,
      rgba(255, 241, 211, 0.12) 0%,
      transparent 60%
    );
  }
}

/* Accent borders — left border on blockquotes, callouts, notices */
blockquote,
.callout,
.accent-left {
  border-left: 4px solid var(--color-accent, var(--navy-700));
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-alt);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}
blockquote p:last-child,
.callout p:last-child,
.accent-left p:last-child { margin-bottom: 0; }

/* Callout variants */
.callout-info    { border-left-color: var(--navy-600, var(--color-accent)); }
.callout-success { border-left-color: #2E8B57; }
.callout-warn    { border-left-color: #D68910; }
.callout-danger  { border-left-color: #C0392B; }

/* Section-heading underline accent — short colored bar under titles */
.section-title {
  position: relative;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}
.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: var(--space-sm);
  background: var(--color-accent, var(--navy-700));
  border-radius: 2px;
}
.section-title.centered::after { margin-left: auto; margin-right: auto; }

/* Accent-dot divider — minimal horizontal break with a brand-colored dot */
.divider-dot {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
  color: var(--color-text-subtle);
}
.divider-dot::before,
.divider-dot::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.divider-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent, var(--navy-700));
  flex-shrink: 0;
}

/* Corner frame — decorative L-shaped accents around feature cards */
.frame-corners {
  position: relative;
}
.frame-corners::before,
.frame-corners::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-accent, var(--navy-700));
  pointer-events: none;
}
.frame-corners::before {
  top: -6px; left: -6px;
  border-right: 0; border-bottom: 0;
  border-top-left-radius: 4px;
}
.frame-corners::after {
  bottom: -6px; right: -6px;
  border-left: 0; border-top: 0;
  border-bottom-right-radius: 4px;
}

/* =========================================================
   SITE-WIDE EXPANDED CREAM SAFETY NET (Dennis rule)
   Catches every known component that paints itself cream in
   any mode. Forces black text + enforces it on children.
   ========================================================= */
.btn-enter,
.btn-white,
.btn-cream,
.btn-light,
[data-theme="dark"] .btn-enter,
[data-theme="dark"] .btn-white,
[data-theme="dark"] .calendar-day-header,
[data-theme="dark"] .event-card-badge,
[data-theme="dark"] .event-card-badge:not(.past):not(.live),
[data-theme="dark"] .search-row button:hover,
[data-theme="dark"] .nav-prev:hover,
[data-theme="dark"] .nav-next:hover,
[data-theme="dark"] .ann-clear-btn,
[data-theme="dark"] .ann-pill,
[data-theme="dark"] .ann-filter-btn.active,
[data-theme="dark"] .page-chip.active,
[data-theme="dark"] .filter-chip-plain.active,
[data-theme="dark"] .card-badge,
[data-theme="dark"] .badge-cream,
[data-theme="dark"] .ribbon,
.ann-highlight,
.cream-surface,
.on-cream {
  color: #000000 !important;
}

/* Children of cream-surfaced wrappers inherit black too */
.cream-surface *,
.on-cream *,
.ann-highlight *,
[data-theme="dark"] .calendar-day-header *,
[data-theme="dark"] .event-card-badge:not(.past):not(.live) * {
  color: #000000 !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-enter,
  :root:not([data-theme="light"]) .btn-white,
  :root:not([data-theme="light"]) .calendar-day-header,
  :root:not([data-theme="light"]) .event-card-badge:not(.past):not(.live),
  :root:not([data-theme="light"]) .search-row button:hover,
  :root:not([data-theme="light"]) .nav-prev:hover,
  :root:not([data-theme="light"]) .nav-next:hover,
  :root:not([data-theme="light"]) .ann-clear-btn,
  :root:not([data-theme="light"]) .ann-pill,
  :root:not([data-theme="light"]) .ann-filter-btn.active,
  :root:not([data-theme="light"]) .page-chip.active,
  :root:not([data-theme="light"]) .filter-chip-plain.active {
    color: #000000 !important;
  }
}

/* Inline-styled cream backgrounds also enforced */
[style*="background:#FFF1D3"],
[style*="background: #FFF1D3"],
[style*="background-color:#FFF1D3"],
[style*="background-color: #FFF1D3"],
[style*="background:#FFF7E6"],
[style*="background: #FFF7E6"],
[style*="background:#F8F8F6"],
[style*="background: #F8F8F6"] {
  color: #000000 !important;
}

/* =========================================================
   #13 — Empty states with personality
   When a collection is empty, don't just print "No results".
   Show a friendly illustration + helpful next-step.
   ========================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--color-text-muted);
  min-height: 280px;
  gap: var(--space-md);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-sm);
  box-shadow: var(--elevation-card-sm);
  animation: egw-float 5s ease-in-out infinite;
}
.empty-state__icon svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.5;
}
.empty-state__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  margin: 0;
}
.empty-state__message {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 42ch;
  line-height: 1.6;
  margin: 0;
}
.empty-state__action {
  margin-top: var(--space-md);
}
@media (prefers-reduced-motion: reduce) {
  .empty-state__icon { animation: none; }
}
@media (max-width: 768px) {
  .empty-state { padding: var(--space-2xl) var(--space-md); min-height: 220px; }
  .empty-state__icon { width: 80px; height: 80px; }
  .empty-state__icon svg { width: 36px; height: 36px; }
}

/* Inline / compact variant — use inside cards, lists, feeds */
.empty-state--compact {
  min-height: 160px;
  padding: var(--space-xl) var(--space-md);
}
.empty-state--compact .empty-state__icon { width: 56px; height: 56px; }
.empty-state--compact .empty-state__icon svg { width: 24px; height: 24px; }
.empty-state--compact .empty-state__title { font-size: var(--font-size-lg); }
.empty-state--compact .empty-state__message { font-size: var(--font-size-sm); }

/* =========================================================
   #14 — Dense-where-it-matters spacing
   Practical UI: airy for marketing, denser for data-heavy
   areas (forms, dashboards, profile tables, admin views).
   ========================================================= */
.dense { --dense-unit: 1; }
.dense-lg { --dense-unit: 0.92; }
.dense-xl { --dense-unit: 0.84; }

.dense .stack > * + *,
.dense-lg .stack > * + *,
.dense-xl .stack > * + * {
  margin-top: calc(var(--space-sm) * var(--dense-unit));
}

/* Dense form — tighter vertical rhythm for long forms (membership, profile) */
.form-dense label {
  font-size: var(--font-size-sm);
  margin-bottom: 4px;
}
.form-dense input,
.form-dense select,
.form-dense textarea {
  padding: 8px 12px;
  font-size: var(--font-size-sm);
}
.form-dense .form-row + .form-row { margin-top: var(--space-sm); }
.form-dense .form-actions { margin-top: var(--space-md); }
.form-dense .field-help { font-size: var(--font-size-xs); }

/* Dense table — data-heavy rows (member list, transaction history) */
.table-dense {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.table-dense th,
.table-dense td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.table-dense th {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--font-size-xs);
  background: var(--color-bg-alt);
}
.table-dense tbody tr:hover { background: var(--color-bg-alt); }
.table-dense tbody tr:last-child td { border-bottom: 0; }

/* Dense list — stacked rows used in profile/settings sidebars */
.list-dense {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-dense > li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.list-dense > li:last-child { border-bottom: 0; }

/* Dense card — data tiles without hero padding */
.card-dense {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-bg);
  font-size: var(--font-size-sm);
}
.card-dense .card-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
  color: var(--color-text-strong);
}

/* Airy opt-out — for marketing sections inside dense contexts */
.airy { padding: var(--space-2xl) var(--space-xl); }
.airy-lg { padding: var(--space-3xl) var(--space-2xl); }

/* =========================================================
   #15 — Consistent icon system
   Uniform size, stroke weight, vertical alignment, color.
   Any inline SVG wrapped in .icon (or inherited via nav) inherits.
   ========================================================= */
:root {
  --icon-size-xs: 14px;
  --icon-size-sm: 16px;
  --icon-size-md: 20px;   /* default */
  --icon-size-lg: 24px;
  --icon-size-xl: 32px;
  --icon-stroke: 1.75;
}

/* Any svg that inherits from this class gets the canonical shape */
.icon {
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 0;
  color: currentColor;
}
.icon svg,
svg.icon {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  stroke-width: var(--icon-stroke);
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icon-xs, .icon-xs svg, svg.icon-xs { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.icon-sm, .icon-sm svg, svg.icon-sm { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.icon-md, .icon-md svg, svg.icon-md { width: var(--icon-size-md); height: var(--icon-size-md); }
.icon-lg, .icon-lg svg, svg.icon-lg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.icon-xl, .icon-xl svg, svg.icon-xl { width: var(--icon-size-xl); height: var(--icon-size-xl); }

/* Icon + text inline — consistent gap regardless of context */
.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  line-height: 1;
}
.icon-text > svg { flex-shrink: 0; }

/* Coloured icon chip — for category tags (Refactoring UI: "colored icons add life") */
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-md);
  flex-shrink: 0;
}
.icon-chip svg { width: 18px; height: 18px; }
.icon-chip--navy   { background: rgba(27, 58, 92, 0.12); color: var(--navy-700, var(--color-accent)); }
.icon-chip--gold   { background: rgba(212, 175, 55, 0.15); color: #9A7B11; }
.icon-chip--cream  { background: #FFF1D3; color: #000000; }
.icon-chip--success{ background: rgba(46, 139, 87, 0.14); color: #1F6140; }
.icon-chip--warn   { background: rgba(214, 137, 16, 0.14); color: #9A5F0A; }
.icon-chip--danger { background: rgba(192, 57, 43, 0.12); color: #8E1E15; }
.icon-chip--info   { background: rgba(41, 128, 185, 0.14); color: #1B5E84; }

/* Dark-mode tints */
[data-theme="dark"] .icon-chip--navy,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-chip--navy {
    background: rgba(255, 241, 211, 0.12);
    color: #FFF1D3;
  }
}

/* Normalize inline SVGs inside buttons/links that don't use .icon */
.btn > svg,
a > svg:only-child,
button > svg:only-child {
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* ═════════════════════════════════════════════════════════════════
   Site-wide Pagination — mobile/tablet visibility guarantee
   ═════════════════════════════════════════════════════════════════
   Fixes a collision where WordPress's `the_posts_pagination()` emits
   `<nav class="navigation pagination"><div class="nav-links">` — and
   the site's header `.nav-links { display: none }` rule hid it on
   mobile and tablet. These rules un-hide WP pagination and harmonize
   every pagination variant used on the site so the controls are fully
   visible at 375 / 768 / 1024 / 1440. Respects Fitts 44×44 on touch. */
.navigation.pagination,
.navigation.pagination .nav-links,
.pagination,
.pagination .nav-links,
.events-pagination,
.ann-pagination,
.search-pagination,
.search-pagination .nav-links {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding-left: 12px;
  padding-right: 12px;
}

.navigation.pagination {
  position: static;      /* defeat absolute-center from header .nav-links */
  transform: none;
  left: auto;
  padding: var(--space-xl) 12px;
}

/* Universal tap-target for pagination buttons/links */
.navigation.pagination .page-numbers,
.pagination .page-numbers,
.events-pagination button,
.ann-pagination a,
.ann-pagination span,
.search-pagination .page-numbers {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--border-radius-md, 8px);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 6px -3px rgba(0,0,0,0.08);
  transition: background var(--transition-fast, 150ms ease),
              color var(--transition-fast, 150ms ease),
              border-color var(--transition-fast, 150ms ease),
              transform var(--transition-fast, 150ms ease),
              box-shadow var(--transition-fast, 150ms ease);
}

.navigation.pagination .page-numbers:hover,
.pagination .page-numbers:hover,
.events-pagination button:hover:not(:disabled),
.ann-pagination a:hover,
.search-pagination .page-numbers:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 8px 18px -8px rgba(18,38,74,0.28);
}

.navigation.pagination .page-numbers.current,
.pagination .page-numbers.current,
.events-pagination button.active,
.ann-pagination .current,
.search-pagination .page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(18,38,74,0.28);
}

.events-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Tablet */
@media (max-width: 1023px) {
  .navigation.pagination,
  .pagination,
  .events-pagination,
  .ann-pagination,
  .search-pagination {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }
}

/* Mobile */
@media (max-width: 767px) {
  .navigation.pagination .page-numbers,
  .pagination .page-numbers,
  .events-pagination button,
  .ann-pagination a,
  .ann-pagination span,
  .search-pagination .page-numbers {
    padding: 0 10px;
    font-size: 0.8rem;
  }

  /* Tighter gap so more chips fit per row without horizontal scroll */
  .navigation.pagination .nav-links,
  .pagination .nav-links,
  .events-pagination,
  .ann-pagination,
  .search-pagination .nav-links {
    gap: 5px;
    row-gap: 8px;
  }
}

/* Very small phones — let Prev / page chips / Next wrap onto up to 3 rows
   rather than overflow horizontally (guaranteed visibility). */
@media (max-width: 374px) {
  .navigation.pagination .page-numbers,
  .pagination .page-numbers,
  .events-pagination button,
  .ann-pagination a,
  .ann-pagination span,
  .search-pagination .page-numbers {
    min-width: 36px;
    padding: 0 8px;
    font-size: 0.78rem;
  }
}

/* Touch devices — Fitts's Law 44×44 */
@media (pointer: coarse) {
  .navigation.pagination .page-numbers,
  .pagination .page-numbers,
  .events-pagination button,
  .ann-pagination a,
  .ann-pagination span,
  .search-pagination .page-numbers {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Keyboard focus ring */
.navigation.pagination .page-numbers:focus-visible,
.pagination .page-numbers:focus-visible,
.events-pagination button:focus-visible,
.ann-pagination a:focus-visible,
.search-pagination .page-numbers:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Dark-mode parity */
[data-theme="dark"] .navigation.pagination .page-numbers,
[data-theme="dark"] .pagination .page-numbers,
[data-theme="dark"] .events-pagination button,
[data-theme="dark"] .ann-pagination a,
[data-theme="dark"] .ann-pagination span,
[data-theme="dark"] .search-pagination .page-numbers {
  background: var(--color-bg-alt, #1a1a1a);
  color: var(--color-text);
  border-color: var(--color-border);
}
