/**
 * MoonVera design tokens.
 *
 * Source of truth: Figma file Bh2AO9XItCSOB4SLut0bZb
 *   Colour      -> variables "MV Color"  (Foundations / Colour 14:2)
 *   Spacing etc -> variables "MV Layout" (Foundations / Layout 21:71)
 *   Type        -> text styles Desktop/* and Mobile/* (Foundations / Typography 18:34)
 *   Shadow      -> effect style mv/shadow-hover
 *   Grid        -> grid styles Grid/Desktop 1440, Tablet 768, Mobile 390
 *
 * Rules (DECISIONS DEC-023, DEC-030):
 *   - Use only these tokens for colour, spacing, radius and type. No raw hex values elsewhere.
 *   - Never fade a token colour with opacity; use the alpha tokens below.
 *   - Brand tokens are not editable in WP admin.
 *
 * Breakpoints (media queries cannot read custom properties, so they are fixed here
 * and used consistently in every file, mobile-first with min-width):
 *   base  390  (designed at 390, must work down to 360)
 *   md    768  (tablet)
 *   lg    1024 (desktop type + layout switch)
 *   xl    1280
 *   xxl   1440 (designed at 1440)
 *   Large screens (DEC-071, beyond Figma): 1680, 1920, 2560
 *   Container steps: 1280 (1440+) -> 1440 (1680+) -> 1600 (1920+) -> 1760 cap (2560+)
 */

:root {
	/* ---------- Colour: base (MV Color) ---------- */
	--mv-navy: #172a3a;
	--mv-offwhite: #f7f6f2;
	--mv-sage: #8faf9a;
	--mv-neutral: #e9e7e1;
	--mv-text: #252525;
	--mv-white: #ffffff;
	--mv-muted: #6b6b6b;
	--mv-border: #d6d3cb;
	--mv-success: #5e7f6a;
	--mv-error: #b3261e;

	/* ---------- Colour: helpers ---------- */
	--mv-sage-20: rgba(143, 175, 154, 0.2);   /* problem tags, icon circles */
	--mv-navy-10: rgba(23, 42, 58, 0.1);      /* subtle dividers */

	/* ---------- Colour: interaction (solid hover) ---------- */
	--mv-navy-hover: #2d3e4c;
	--mv-sage-hover: #a4bdac;
	--mv-offwhite-hover: #d5d7d6;

	/* ---------- Colour: off-white alpha tones (on navy surfaces) ---------- */
	--mv-offwhite-10: rgba(247, 246, 242, 0.1);
	--mv-offwhite-15: rgba(247, 246, 242, 0.15);
	--mv-offwhite-40: rgba(247, 246, 242, 0.4);
	--mv-offwhite-70: rgba(247, 246, 242, 0.7);
	--mv-offwhite-80: rgba(247, 246, 242, 0.8);  /* footer links (Figma text opacity 0.8) */

	/* ---------- Spacing (MV Layout, 8-pt scale) ---------- */
	--mv-space-1: 4px;
	--mv-space-2: 8px;
	--mv-space-3: 12px;
	--mv-space-4: 16px;
	--mv-space-5: 24px;
	--mv-space-6: 32px;
	--mv-space-7: 48px;
	--mv-space-8: 64px;
	--mv-space-9: 96px;

	/* ---------- Radius ---------- */
	--mv-radius-sm: 8px;     /* buttons, inputs */
	--mv-radius-md: 12px;    /* cards, images */
	--mv-radius-pill: 999px; /* chips, tags */

	/* ---------- Layout ---------- */
	--mv-container: 1280px;          /* default container max; steps up on large screens (DEC-071) */
	--mv-container-narrow: 720px;    /* articles, policies, forms */
	--mv-container-wide: 1920px;     /* hero / media sections */
	--mv-gutter: 16px;          /* mobile grid gutter (Grid/Mobile 390) */
	--mv-page-margin: 20px;     /* mobile side margin */
	--mv-grid-columns: 4;
	--mv-section-padding: 56px; /* section top/bottom, mobile */
	--mv-card-padding: var(--mv-space-4);
	--mv-header-height: 60px;   /* mobile header */
	--mv-touch-target: 44px;
	--mv-button-height: 48px;
	--mv-measure: 640px;        /* max line length for body text (~70 characters) */

	/* ---------- Effects ---------- */
	--mv-shadow-hover: 0 8px 24px rgba(23, 42, 58, 0.08);
	--mv-scrim: rgba(23, 42, 58, 0.6); /* navy backdrop behind overlays (Figma overlay scrim 0.6) */
	--mv-focus-ring-width: 2px;
	--mv-focus-ring-offset: 2px;
	--mv-focus-ring-color: var(--mv-navy);
	/* Figma focus state: 2px gap in the background colour + 2px ring (spread 2 + spread 4). */
	--mv-focus-ring: 0 0 0 2px var(--mv-offwhite), 0 0 0 4px var(--mv-navy);
	--mv-focus-ring-on-navy: 0 0 0 2px var(--mv-navy), 0 0 0 4px var(--mv-offwhite);
	--mv-icon-size: 24px;
	--mv-icon-size-button: 20px;
	--mv-icon-size-small: 16px;

	/* Logo widths (Figma Header 50:783 / 51:629, Footer 52:897, drawer 118:2119) */
	--mv-logo-width: 120px;          /* mobile header, drawer */
	--mv-logo-width-scrolled: 140px; /* desktop header after scroll */
	--mv-logo-width-footer: 180px;
	/* ---------- Motion (DEC-072) ---------- */
	--mv-duration-fast: 150ms;   /* colour, border */
	--mv-duration-base: 200ms;   /* hover lift, chips */
	--mv-duration-slow: 300ms;   /* drawers, overlays, reveal */
	--mv-ease-out: cubic-bezier(0.2, 0, 0, 1);
	--mv-ease-in: cubic-bezier(0.4, 0, 1, 1);
	--mv-lift: -3px;             /* card hover lift */
	--mv-zoom: 1.03;             /* card image hover zoom */
	--mv-reveal-distance: 16px;  /* section fade-up */

	/* ---------- Type: families ---------- */
	--mv-font-heading: "Manrope", "Manrope Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--mv-font-body: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	/* ---------- Type: weights ---------- */
	--mv-weight-regular: 400;
	--mv-weight-semibold: 600;
	--mv-weight-bold: 700;

	/* ---------- Type: letter spacing ---------- */
	--mv-tracking-tight: -0.01em; /* H1, H2 (-1%) */
	--mv-tracking-label: 0.08em;  /* Label (+8%) */
	--mv-tracking-nav: 0.04em;    /* Nav (+4%) */

	/* ---------- Type scale: mobile (base) - Mobile/* text styles ---------- */
	--mv-h1-size: 36px;          --mv-h1-line: 44px;
	--mv-h2-size: 28px;          --mv-h2-line: 36px;
	--mv-h3-size: 22px;          --mv-h3-line: 30px;
	--mv-h4-size: 18px;          --mv-h4-line: 26px;
	--mv-body-l-size: 17px;      --mv-body-l-line: 26px;
	--mv-body-size: 16px;        --mv-body-line: 24px;
	--mv-small-size: 14px;       --mv-small-line: 20px;
	--mv-label-size: 12px;       --mv-label-line: 16px;
	--mv-button-size: 15px;      --mv-button-line: 24px;
	--mv-button-s-size: 14px;    --mv-button-s-line: 20px;
	--mv-price-size: 18px;       --mv-price-line: 26px;
	--mv-nav-size: 14px;         --mv-nav-line: 20px;
}

/* Tablet: grid + spacing (Grid/Tablet 768). Type stays mobile until desktop. */
@media (min-width: 768px) {
	:root {
		--mv-gutter: 24px;
		--mv-page-margin: 32px;
		--mv-grid-columns: 8;
	}
}

/* Desktop: type, grid and spacing (Desktop/* text styles, Grid/Desktop 1440) */
@media (min-width: 1024px) {
	:root {
		--mv-page-margin: 80px;
		--mv-grid-columns: 12;
		--mv-section-padding: var(--mv-space-9);
		--mv-card-padding: var(--mv-space-5);

		--mv-h1-size: 56px;          --mv-h1-line: 64px;
		--mv-h2-size: 40px;          --mv-h2-line: 48px;
		--mv-h3-size: 28px;          --mv-h3-line: 36px;
		--mv-h4-size: 20px;          --mv-h4-line: 28px;
		--mv-body-l-size: 18px;      --mv-body-l-line: 28px;
		--mv-body-size: 16px;        --mv-body-line: 26px;
		--mv-small-size: 14px;       --mv-small-line: 22px;
		--mv-label-size: 12px;       --mv-label-line: 16px;
		--mv-button-size: 16px;      --mv-button-line: 24px;
		--mv-button-s-size: 14px;    --mv-button-s-line: 20px;
		--mv-price-size: 20px;       --mv-price-line: 28px;
		--mv-nav-size: 14px;         --mv-nav-line: 20px;
	}
}

/* Desktop header from 1280 (DEC-090): it needs ~1118 px of content width. */
@media (min-width: 1280px) {
	:root {
		--mv-header-height: 80px;
		--mv-logo-width: 160px;
	}
}

/* 1024-1439: fluid side margin 40 -> 80 (DEC-071) */
@media (min-width: 1024px) and (max-width: 1439.98px) {
	:root {
		--mv-page-margin: clamp(40px, calc(40px + (100vw - 1024px) * 0.0962), 80px);
	}
}

/* Large screens: the container grows in steps (DEC-071) */
@media (min-width: 1680px) {
	:root { --mv-container: 1440px; }
}
@media (min-width: 1920px) {
	:root { --mv-container: 1600px; }
}
@media (min-width: 2560px) {
	:root { --mv-container: 1760px; }
}

/* Reduced motion: no transforms or reveals (DEC-072) */
@media (prefers-reduced-motion: reduce) {
	:root {
		--mv-duration-fast: 0ms;
		--mv-duration-base: 0ms;
		--mv-duration-slow: 0ms;
		--mv-lift: 0px;
		--mv-zoom: 1;
		--mv-reveal-distance: 0px;
	}
}
