/* style.css — NPC-ANC Roma Centro ODV
   Custom palette: Navy Blue (#1a3a6b) + Deep Red (#8B1A1A)
   Fonts: Libre Baskerville (display) + Source Sans 3 (body)
   Tone: Serious, institutional, trustworthy, Italian
*/

/* ============================================================
   DESIGN TOKENS — TYPE SCALE
   ============================================================ */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);
}

/* ============================================================
   DESIGN TOKENS — SPACING (4px grid)
   ============================================================ */
:root {
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
}

/* ============================================================
   DESIGN TOKENS — CUSTOM PALETTE (Light Mode)
   NPC-ANC Roma: Navy Blue + Deep Red
   ============================================================ */
:root, [data-theme="light"] {
  /* --- Surfaces (warm off-white institutional) --- */
  --color-bg:               #f8f7f4;
  --color-surface:          #ffffff;
  --color-surface-2:        #f0eff0;
  --color-surface-offset:   #e8e7e8;
  --color-surface-offset-2: #e0dee0;
  --color-surface-dynamic:  #d8d6d8;
  --color-divider:          #dbd9da;
  --color-border:           #d0cece;

  /* --- Text --- */
  --color-text:         #1a1a2e;
  --color-text-muted:   #5a5a6e;
  --color-text-faint:   #9a9aaa;
  --color-text-inverse: #f8f7f4;

  /* --- Primary Accent (Navy Blue) --- */
  --color-primary:          #1a3a6b;
  --color-primary-hover:    #0f2a50;
  --color-primary-active:   #0a1e3a;
  --color-primary-highlight: #c8d4e8;

  /* --- Accent Red (CTAs, alerts, emphasis) --- */
  --color-notification:         #8B1A1A;
  --color-notification-hover:   #6d1414;
  --color-notification-active:  #520f0f;
  --color-notification-highlight: #e8c8c8;

  /* --- Semantic: Success --- */
  --color-success:        #2d6a2d;
  --color-success-hover:  #1e4e1e;
  --color-success-active: #143614;
  --color-success-highlight: #c8ddc8;

  /* --- Semantic: Warning --- */
  --color-warning:        #8a5a00;
  --color-warning-hover:  #6a4400;
  --color-warning-active: #4a3000;
  --color-warning-highlight: #e0d0a8;

  /* --- Semantic: Error --- */
  --color-error:          #8B1A1A;
  --color-error-hover:    #6d1414;
  --color-error-active:   #520f0f;
  --color-error-highlight: #e8c8c8;

  /* --- Radius --- */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Shadows (warm-tinted to match surfaces) --- */
  --shadow-sm: 0 1px 3px oklch(0.2 0.03 250 / 0.08);
  --shadow-md: 0 4px 16px oklch(0.2 0.03 250 / 0.10);
  --shadow-lg: 0 12px 40px oklch(0.2 0.03 250 / 0.14);

  /* --- Content widths --- */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1200px;
  --content-full:    100%;

  /* --- Fonts --- */
  --font-display: 'Libre Baskerville', 'Georgia', serif;
  --font-body:    'Source Sans 3', 'Helvetica Neue', sans-serif;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  /* --- Surfaces (deep navy-toned dark) --- */
  --color-bg:               #0e1420;
  --color-surface:          #131a2a;
  --color-surface-2:        #182035;
  --color-surface-offset:   #1c2840;
  --color-surface-offset-2: #212e4a;
  --color-surface-dynamic:  #28375a;
  --color-divider:          #1f2e48;
  --color-border:           #2a3d60;

  /* --- Text --- */
  --color-text:         #e8e8f0;
  --color-text-muted:   #9090a8;
  --color-text-faint:   #606078;
  --color-text-inverse: #0e1420;

  /* --- Primary (lighter navy for dark bg) --- */
  --color-primary:          #5b82c4;
  --color-primary-hover:    #7a9ed8;
  --color-primary-active:   #95b4e8;
  --color-primary-highlight: #1e3060;

  /* --- Accent Red (brighter for dark) --- */
  --color-notification:         #c44040;
  --color-notification-hover:   #e05050;
  --color-notification-active:  #f06060;
  --color-notification-highlight: #4a1818;

  /* --- Semantic --- */
  --color-success:        #4a9a4a;
  --color-success-hover:  #5ab55a;
  --color-success-active: #6acc6a;
  --color-success-highlight: #1a3a1a;

  --color-warning:        #c08020;
  --color-warning-hover:  #d49030;
  --color-warning-active: #e8a040;
  --color-warning-highlight: #3a2800;

  --color-error:          #c44040;
  --color-error-hover:    #e05050;
  --color-error-active:   #f06060;
  --color-error-highlight: #4a1818;

  /* --- Shadows (dark-adjusted) --- */
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.50);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #0e1420;
    --color-surface:          #131a2a;
    --color-surface-2:        #182035;
    --color-surface-offset:   #1c2840;
    --color-surface-offset-2: #212e4a;
    --color-surface-dynamic:  #28375a;
    --color-divider:          #1f2e48;
    --color-border:           #2a3d60;
    --color-text:         #e8e8f0;
    --color-text-muted:   #9090a8;
    --color-text-faint:   #606078;
    --color-text-inverse: #0e1420;
    --color-primary:          #5b82c4;
    --color-primary-hover:    #7a9ed8;
    --color-primary-active:   #95b4e8;
    --color-primary-highlight: #1e3060;
    --color-notification:         #c44040;
    --color-notification-hover:   #e05050;
    --color-notification-active:  #f06060;
    --color-notification-highlight: #4a1818;
    --color-success:        #4a9a4a;
    --color-success-hover:  #5ab55a;
    --color-success-active: #6acc6a;
    --color-success-highlight: #1a3a1a;
    --color-warning:        #c08020;
    --color-warning-hover:  #d49030;
    --color-warning-active: #e8a040;
    --color-warning-highlight: #3a2800;
    --color-error:          #c44040;
    --color-error-hover:    #e05050;
    --color-error-active:   #f06060;
    --color-error-highlight: #4a1818;
    --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.50);
  }
}
