/*
 * Last Design — design foundation (W1; approved by the owner on 2026-10-26 as version B, for development
 * with the current fonts — not a font purchase, not the end of the font gate, not a final page design).
 *
 * Fonts and design tokens only. This file styles no element, so it can load on every page without
 * changing existing pages, including the approved questionnaires. Components that use the tokens are
 * scoped elsewhere (design-system.css for the design-system page samples).
 *
 * Tajawal is the development Arabic font (self-hosted, OFL 1.1; the font decision is still open).
 * The English roles use system fonts for now; switching fonts later means changing the role variables only.
 */

@font-face {
	font-family: "LD Tajawal";
	src: url("../fonts/tajawal-300.woff2") format("woff2");
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "LD Tajawal";
	src: url("../fonts/tajawal-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "LD Tajawal";
	src: url("../fonts/tajawal-500.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "LD Tajawal";
	src: url("../fonts/tajawal-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "LD Tajawal";
	src: url("../fonts/tajawal-800.woff2") format("woff2");
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Approved brand palette (brand guidelines, section 14) — values unchanged. */
	--ld-gold: #dba856;  /* الذهبي — accent and highlights; never body text on light surfaces (2.12:1 on paper) */
	--ld-ink: #4d4d4d;   /* الفحمي — text, depth, dark backgrounds (8.35:1 on paper) */
	--ld-stone: #a7a089; /* البيج الرمادي — natural materials; decorative lines and areas only (2.58:1 on paper) */
	--ld-warm: #e7e4de;  /* الأوف وايت — calm surfaces and backgrounds */
	--ld-paper: #fcfeff; /* الأبيض — main surface; text on dark */

	/* Functional shades approved by the owner on 2026-10-26 (derived from the palette, not new brand colours).
	   Each keeps its parent's hue and reaches 4.5:1 on both light surfaces (paper and warm). */
	--ld-gold-deep: #865d1c;  /* links and focus where suitable on light surfaces (5.77:1 paper, 4.60:1 warm) */
	--ld-stone-deep: #6a644f; /* hints, placeholders and borders (5.85:1 paper, 4.66:1 warm) */
	--ld-error: #ac3a32;      /* errors (6.09:1 paper, 4.85:1 warm) */

	/* Colour roles. Text a visitor needs (including important explanations) is charcoal; stone-deep is for
	   placeholders, non-essential hints and borders only. Primary buttons are charcoal with white text; gold is
	   a limited accent (short rules, the current-page mark, details). */
	--ld-surface: var(--ld-paper);
	--ld-surface-alt: var(--ld-warm);
	--ld-surface-dark: var(--ld-ink);
	--ld-text: var(--ld-ink);
	--ld-text-on-dark: var(--ld-paper);
	--ld-text-soft-on-dark: var(--ld-warm);
	--ld-hint: var(--ld-stone-deep);
	--ld-placeholder: var(--ld-stone-deep);
	--ld-link: var(--ld-gold-deep);
	--ld-accent: var(--ld-gold);
	--ld-divider: var(--ld-stone);
	--ld-field-border: var(--ld-stone-deep);
	--ld-focus: var(--ld-gold-deep);
	--ld-focus-on-dark: var(--ld-gold);

	/* Font roles. */
	--ld-font-ar: "LD Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
	--ld-font-en-editorial: Georgia, "Times New Roman", Times, serif; /* interim system font; Tiro Devanagari is the brand font */
	--ld-font-en-functional: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* interim system font; Avenir Next is the brand font */

	--ld-weight-light: 300;
	--ld-weight-regular: 400;
	--ld-weight-medium: 500;
	--ld-weight-bold: 700;
	--ld-weight-extrabold: 800;

	/* Weights by role (approved 2026-10-26): no 300 for body text or explanations; bold only for short emphasis. */
	--ld-weight-display: var(--ld-weight-regular); /* large headings (display, h1) */
	--ld-weight-heading: var(--ld-weight-medium);  /* section headings (h2–h6) */
	--ld-weight-body: var(--ld-weight-regular);
	--ld-weight-strong: var(--ld-weight-bold);     /* short emphasis, when needed */

	/* Type scale: fluid from 360px to 1440px wide (mobile value → desktop value). Digits: 0123. */
	--ld-text-caption: 0.875rem;                                    /* 14px — small technical labels only */
	--ld-text-small: 1rem;                                          /* 16px — important explanations, the minimum for visitors */
	--ld-text-base: 1.125rem;                                       /* 18px body */
	--ld-text-lead: clamp(1.25rem, 1.208rem + 0.185vw, 1.375rem);   /* 20 → 22px */
	--ld-h6: var(--ld-text-base);                                   /* 18px */
	--ld-h5: clamp(1.125rem, 1.083rem + 0.185vw, 1.25rem);          /* 18 → 20px */
	--ld-h4: clamp(1.25rem, 1.167rem + 0.37vw, 1.5rem);             /* 20 → 24px */
	--ld-h3: clamp(1.4375rem, 1.292rem + 0.648vw, 1.875rem);        /* 23 → 30px */
	--ld-h2: clamp(1.6875rem, 1.417rem + 1.204vw, 2.5rem);          /* 27 → 40px */
	--ld-h1: clamp(2rem, 1.583rem + 1.852vw, 3.25rem);              /* 32 → 52px */
	--ld-display: clamp(2.375rem, 1.75rem + 2.778vw, 4.25rem);      /* 38 → 68px */

	/* Arabic needs more line height than Latin (diacritics, ascenders and descenders); no letter spacing on Arabic. */
	--ld-leading-display: 1.3;
	--ld-leading-heading: 1.45;
	--ld-leading-body: 1.85;
	--ld-leading-ui: 1.5;

	/* Spacing scale (4px base). */
	--ld-space-1: 0.25rem; /*  4px */
	--ld-space-2: 0.5rem;  /*  8px */
	--ld-space-3: 0.75rem; /* 12px */
	--ld-space-4: 1rem;    /* 16px */
	--ld-space-5: 1.5rem;  /* 24px */
	--ld-space-6: 2rem;    /* 32px */
	--ld-space-7: 3rem;    /* 48px */
	--ld-space-8: 4rem;    /* 64px */
	--ld-space-9: 6rem;    /* 96px */
	--ld-section-space: clamp(3rem, 2rem + 4.444vw, 6rem); /* 48 → 96px */

	/* Layout. */
	--ld-container: 75rem;      /* 1200px */
	--ld-container-wide: 90rem; /* 1440px */
	--ld-container-text: 40rem; /*  640px reading measure */
	--ld-gutter: clamp(1rem, 0.5rem + 2.222vw, 2.5rem); /* 16 → 40px */

	/* Image ratios and focal point (object-position follows the focal point when an image is cropped). */
	--ld-ratio-wide: 16 / 9;
	--ld-ratio-landscape: 3 / 2;
	--ld-ratio-standard: 4 / 3;
	--ld-ratio-square: 1 / 1;
	--ld-ratio-portrait: 4 / 5;
	--ld-focal-x: 50%;
	--ld-focal-y: 50%;

	/* Shape, focus and motion. */
	--ld-radius: 2px;
	--ld-border-width: 1px;
	--ld-field-border-width: 1.5px;
	--ld-focus-width: 3px;
	--ld-focus-offset: 2px;
	--ld-duration: 160ms;
	--ld-ease: cubic-bezier(0.2, 0, 0, 1);

	/* Logo (approved 2026-10-26), sized by the drawn logo, not the image box. logo-primary.png fills its file;
	   logo-light.svg draws 786 of its 838px height (93.8%), so the white file is set 1.0662 times taller to look
	   the same size. Re-measure if a logo file is replaced. Clear space (the guidelines' rule): ¼ of the drawn height. */
	--ld-logo-h: 3.5rem;            /* header, phone: 56px drawn */
	--ld-logo-h-desktop: 4.6875rem; /* header, ≥ 60rem: 75px drawn */
	--ld-logo-footer-h: 3.875rem;   /* footer: 62px drawn */
	--ld-logo-white-scale: 1.0662;
	--ld-logo-clearspace: 0.25;
}
