/*
 * מאר״ג — design tokens: the ONE file that holds a colour, a font, a type size, a space, a radius or a shadow
 * (MKT-1 Stage B, CF MKT-B2…B4). Every other stylesheet and page reads var(--mg-…); ops/laptop/marketing-served.sh
 * (R6) fails on a colour or font literal anywhere else.
 *
 * The palette is derived from the logo (public/favicon.svg: gradient #113C71 → #1C6DA8, white strands, #4CB84A centre)
 * by specs/marketing/palette.py, which prints every step and the WCAG contrast of every text/background pair used.
 * Names follow PrimeVue 4 / Aura so APP-THEME maps them one to one:
 *   --mg-primary-*  → semantic.primary.*          --mg-surface-*  → semantic.colorScheme.light.surface.*
 *   --mg-success-*  → primitive.green.*           --mg-warn-*     → primitive.yellow.*
 *   --mg-danger-*   → primitive.red.*             --mg-radius-*   → primitive.borderRadius.*
 *   --mg-text-color, --mg-text-muted-color, --mg-content-*, --mg-primary-color/-hover-/-contrast-, --mg-focus-ring-*
 *                   → the semantic keys of the same name
 *   --mg-accent-*, the type scale, spacing, shadows: site-only (Aura has no slot for them)
 * Light only, as the app is (resources/js/app.ts: darkModeSelector false).
 */

/* Heebo, variable weight 100–900, self-hosted (OFL 1.1; @fontsource-variable/heebo 5.3.0, integrity checked;
   the licence: specs/marketing/fonts/OFL.txt). Hebrew and Latin subsets: Hebrew carries ₪ and ״, Latin the digits. */
@font-face {
    font-family: 'Heebo';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/heebo-hebrew-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
    font-family: 'Heebo';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/heebo-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;

    /* ── the logo, exact ── */
    --mg-logo-gradient-start: #113c71;
    --mg-logo-gradient-end: #1c6da8;
    --mg-logo-centre: #4cb84a;
    --mg-logo-strands: #ffffff;

    /* ── primary: the logo blue's hue (oklch h≈246); 700 and 900 are the gradient's two ends ── */
    --mg-primary-50: #f0f8ff;
    --mg-primary-100: #e0edf9;
    --mg-primary-200: #c7dcef;
    --mg-primary-300: #a4c5e4;
    --mg-primary-400: #71a7d6;
    --mg-primary-500: #458cc6;
    --mg-primary-600: #2775b1;
    --mg-primary-700: #1c6da8;
    --mg-primary-800: #105484;
    --mg-primary-900: #113c71;
    --mg-primary-950: #0f283d;

    /* ── surface: neutral, tinted toward the primary (same hue, chroma ≤ 0.022) ── */
    --mg-surface-0: #ffffff;
    --mg-surface-50: #f4f7fb;
    --mg-surface-100: #e8ecef;
    --mg-surface-200: #d6dadd;
    --mg-surface-300: #bcc2c7;
    --mg-surface-400: #99a3ab;
    --mg-surface-500: #7c8892;
    --mg-surface-600: #66727c;
    --mg-surface-700: #5a656f;
    --mg-surface-800: #48515a;
    --mg-surface-900: #363d43;
    --mg-surface-950: #23272b;

    /* ── accent: the logo green (oklch h≈143); 500 is the logo's square. Fills and marks only — 2.54:1 on white,
          never text on white; text in the accent family uses 700 or darker ── */
    --mg-accent-50: #eefbed;
    --mg-accent-100: #dff1dd;
    --mg-accent-200: #c6e2c4;
    --mg-accent-500: #4cb84a;
    --mg-accent-700: #01790b;
    --mg-accent-800: #016207;

    /* ── semantic ── */
    --mg-success-50: #eefbed;
    --mg-success-100: #dff1dd;
    --mg-success-200: #c6e2c4;
    --mg-success-300: #a1d09e;
    --mg-success-400: #6bb768;
    --mg-success-500: #389f38;
    --mg-success-600: #078811;
    --mg-success-700: #01790b;
    --mg-success-800: #016207;
    --mg-success-900: #014a04;
    --mg-success-950: #0a2f0a;

    --mg-warn-50: #fff5ea;
    --mg-warn-100: #f8e8d6;
    --mg-warn-200: #edd5b9;
    --mg-warn-300: #e1b98c;
    --mg-warn-400: #d19345;
    --mg-warn-500: #b87503;
    --mg-warn-600: #9b6200;
    --mg-warn-700: #8a5602;
    --mg-warn-800: #6f4502;
    --mg-warn-900: #553300;
    --mg-warn-950: #382101;

    --mg-danger-50: #fef4f3;
    --mg-danger-100: #fee4e1;
    --mg-danger-200: #fdcbc5;
    --mg-danger-300: #f8aaa0;
    --mg-danger-400: #f1786d;
    --mg-danger-500: #e14a42;
    --mg-danger-600: #cb2526;
    --mg-danger-700: #b9131a;
    --mg-danger-800: #980911;
    --mg-danger-900: #710f10;
    --mg-danger-950: #47100e;

    /* ── roles (PrimeVue's semantic names); every text/background pair here is in palette.py's PAIRS ── */
    --mg-text-color: var(--mg-surface-900);
    --mg-text-muted-color: var(--mg-surface-600);
    --mg-text-subtle-color: var(--mg-surface-500); /* large text and captions ≥ 3:1 only */
    --mg-text-strong-color: var(--mg-surface-950);
    --mg-heading-color: var(--mg-primary-900);
    --mg-link-color: var(--mg-primary-700);
    --mg-link-hover-color: var(--mg-primary-900);
    --mg-content-background: var(--mg-surface-0);
    --mg-band-background: var(--mg-surface-50);
    --mg-content-border-color: var(--mg-surface-200);
    --mg-content-border-strong-color: var(--mg-surface-300);
    --mg-primary-color: var(--mg-primary-700);
    --mg-primary-hover-color: var(--mg-primary-800);
    --mg-primary-contrast-color: var(--mg-surface-0);
    --mg-primary-tint: var(--mg-primary-50);
    --mg-inverse-background: var(--mg-primary-900);
    --mg-inverse-text-color: var(--mg-surface-0);
    --mg-inverse-muted-color: var(--mg-primary-100);
    --mg-inverse-border-color: rgb(255 255 255 / 0.18);
    --mg-topbar-background: rgb(255 255 255 / 0.94);
    --mg-focus-ring-color: var(--mg-primary-600);
    --mg-focus-ring-width: 2px;
    --mg-focus-ring-offset: 2px;

    /* ── type: one family; the scale is mobile-first, the two largest grow with the viewport ── */
    --mg-font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --mg-font-family-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --mg-font-numeric: tabular-nums; /* Heebo's digits share one advance (1151 units); this holds for the fallbacks */
    --mg-font-weight-regular: 400;
    --mg-font-weight-medium: 500;
    --mg-font-weight-semibold: 600;
    --mg-font-weight-bold: 700;
    --mg-font-weight-black: 800;
    --mg-text-xs: 0.8125rem; /* 13 */
    --mg-text-sm: 0.9375rem; /* 15 */
    --mg-root-size: 100%; /* 16px on a phone; 17px from 48rem (below) */
    --mg-text-base: 1rem;
    --mg-text-lg: 1.125rem; /* 18 */
    --mg-text-xl: 1.3125rem; /* 21 */
    --mg-text-2xl: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem); /* 24 → 30 */
    --mg-text-3xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem); /* 28 → 38 */
    --mg-text-4xl: clamp(2.125rem, 1.5rem + 3vw, 3.25rem); /* 34 → 52 */
    --mg-leading-tight: 1.2;
    --mg-leading-snug: 1.35;
    --mg-leading-body: 1.7;
    --mg-tracking-tight: -0.02em;

    /* ── space: a 4px step ── */
    --mg-space-1: 0.25rem;
    --mg-space-2: 0.5rem;
    --mg-space-3: 0.75rem;
    --mg-space-4: 1rem;
    --mg-space-5: 1.25rem;
    --mg-space-6: 1.5rem;
    --mg-space-8: 2rem;
    --mg-space-10: 2.5rem;
    --mg-space-12: 3rem;
    --mg-space-16: 4rem;
    --mg-space-20: 5rem;
    --mg-gutter: 1rem; /* the page's side gutter on a phone; 1.5rem from 48rem */
    --mg-max-width: 73.75rem; /* 1180px */
    --mg-measure: 64ch;

    /* ── radius: Aura's names and values, plus a pill ── */
    --mg-radius-none: 0;
    --mg-radius-xs: 2px;
    --mg-radius-sm: 4px;
    --mg-radius-md: 6px;
    --mg-radius-lg: 8px;
    --mg-radius-xl: 12px;
    --mg-radius-full: 999px;

    /* ── shadow: tinted with the primary's darkest step ── */
    --mg-shadow-sm: 0 1px 2px rgb(15 40 61 / 0.06);
    --mg-shadow-md: 0 1px 2px rgb(15 40 61 / 0.05), 0 6px 18px rgb(15 40 61 / 0.07);
    --mg-shadow-lg: 0 2px 4px rgb(15 40 61 / 0.06), 0 16px 40px rgb(15 40 61 / 0.1);

    --mg-duration: 0.15s;
}

@media (min-width: 48rem) {
    :root {
        --mg-gutter: 1.5rem;
        --mg-root-size: 106.25%;
    }
}
