/* ==========================================================
   Green Jofiyat — Design Tokens, Reset & Utilities
   Palette: Primary Green · Dark Olive · Earth Brown · Sand Beige · Warm White
   ========================================================== */

:root {
    /* ── Brand Colors ── */
    --gj-primary: #2E7D4F;          /* Primary Green */
    --gj-primary-dark: #236340;
    --gj-primary-darker: #1A4A30;
    --gj-primary-light: #389A60;
    --gj-primary-lighter: #46B574;

    --gj-olive: #556B2F;            /* Dark Olive */
    --gj-olive-dark: #3F5022;

    --gj-brown: #7A5230;            /* Earth Brown */
    --gj-brown-light: #9A6B42;

    --gj-accent: #8BBF5A;           /* Fresh leaf accent */
    --gj-accent-light: #ABD47F;

    --gj-gold: #C9A24B;             /* Honey / premium accent */
    --gj-gold-light: #DCBE78;

    /* ── Surfaces ── */
    --gj-sand: #E4D8BE;             /* Sand Beige */
    --gj-sand-light: #F2EAD9;
    --gj-warm-white: #FAF6EE;       /* Warm White */
    --gj-bg: var(--gj-warm-white);
    --gj-bg-alt: var(--gj-sand-light);
    --gj-bg-white: #ffffff;

    /* ── Text ── */
    --gj-text: #2A2420;             /* Warm near-black */
    --gj-text-secondary: #5A4F45;
    --gj-text-muted: #8A7E70;
    --gj-text-light: #ffffff;

    /* ── Lines ── */
    --gj-border: rgba(46, 125, 79, 0.14);
    --gj-border-light: rgba(122, 82, 48, 0.10);

    /* ── Status / channels ── */
    --gj-success: #2E7D4F;
    --gj-danger: #C0392B;
    --gj-warning: #D9A441;
    --gj-info: #2D7DA8;
    --gj-whatsapp: #25d366;
    --gj-whatsapp-dark: #128c7e;
    --gj-star: #E8B84B;

    /* ── Typography (IBM Plex Sans Arabic + IBM Plex Sans) ── */
    --font-ar: 'IBM Plex Sans Arabic', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-en: 'IBM Plex Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-base: var(--font-ar);

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* ── Spacing ── */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* ── Radius ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;
    --radius-circle: 50%;

    /* ── Shadows ── */
    --shadow-sm: 0 2px 8px rgba(42, 36, 32, 0.05);
    --shadow-md: 0 8px 24px rgba(42, 36, 32, 0.08);
    --shadow-lg: 0 16px 48px rgba(42, 36, 32, 0.12);
    --shadow-xl: 0 24px 64px rgba(42, 36, 32, 0.16);
    --shadow-card: 0 4px 16px rgba(42, 36, 32, 0.06);
    --shadow-card-hover: 0 14px 40px rgba(46, 125, 79, 0.16);

    /* ── Gradients ── */
    --gradient-primary: linear-gradient(135deg, var(--gj-primary) 0%, var(--gj-primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, var(--gj-primary) 0%, var(--gj-accent) 100%);
    --gradient-earth: linear-gradient(135deg, var(--gj-olive) 0%, var(--gj-brown) 100%);
    --gradient-gold: linear-gradient(135deg, var(--gj-primary) 0%, var(--gj-gold) 100%);
    --gradient-hero: linear-gradient(135deg, rgba(26,74,48,0.90) 0%, rgba(35,99,64,0.85) 50%, rgba(85,107,47,0.88) 100%);
    --gradient-section: linear-gradient(180deg, var(--gj-bg) 0%, var(--gj-bg-white) 100%);

    /* ── Motion ── */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 300ms var(--ease-out);
    --transition-slow: 500ms var(--ease-out);
    --transition-spring: 400ms var(--ease-spring);

    /* ── Z-Index ── */
    --z-base: 1;
    --z-cards: 10;
    --z-sticky: 100;
    --z-floating: 900;
    --z-header: 1000;
    --z-overlay: 1040;
    --z-mobile-menu: 1050;

    /* ── Layout ── */
    --container-max: 1240px;
    --container-padding: 20px;
    --header-height: 76px;
}

/* English (LTR) font swap */
html[lang="en"], .gj-lang-en {
    --font-base: var(--font-en);
}

/* ── Optional dark mode tokens (ready, opt-in via .gj-dark on <html>) ── */
html.gj-dark {
    --gj-bg: #15110D;
    --gj-bg-alt: #1E1812;
    --gj-bg-white: #211B15;
    --gj-text: #F2EAD9;
    --gj-text-secondary: #C8BBA8;
    --gj-text-muted: #998C7A;
    --gj-border: rgba(139, 191, 90, 0.18);
}

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

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

body {
    font-family: var(--font-base);
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--gj-text);
    background-color: var(--gj-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg { max-width: 100%; height: auto; }
img, video { display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--gj-primary); }
ul, ol { list-style: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--gj-primary); outline-offset: 2px; }
::selection { background: var(--gj-primary); color: #fff; }

/* ==========================================================
   Typography
   ========================================================== */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 700; color: var(--gj-text); }
h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); }
p { color: var(--gj-text-secondary); margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* ==========================================================
   Layout primitives
   ========================================================== */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--container-padding); }
.container--wide { max-width: 1440px; }
.container--narrow { max-width: 820px; }

.section { padding: var(--space-5xl) 0; position: relative; }
.section--alt { background: var(--gj-bg-alt); }
.section--sand { background: var(--gj-sand); }
.section--dark { background: var(--gradient-primary); color: var(--gj-text-light); }
.section--dark h2, .section--dark h3, .section--dark h4 { color: var(--gj-text-light); }
.section--dark p { color: rgba(255,255,255,0.85); }

.section__header { text-align: center; max-width: 720px; margin-inline: auto; margin-bottom: var(--space-3xl); }
.section__badge {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    background: rgba(46,125,79,0.10); color: var(--gj-primary);
    padding: var(--space-xs) var(--space-lg); border-radius: var(--radius-pill);
    font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-md); letter-spacing: .02em;
}
.section--dark .section__badge { background: rgba(255,255,255,0.14); color: var(--gj-accent-light); }
.section__title { margin-bottom: var(--space-md); }
.section__subtitle { font-size: var(--text-lg); color: var(--gj-text-muted); line-height: 1.85; }
.section--dark .section__subtitle { color: rgba(255,255,255,0.78); }

/* ── Grid ── */
.grid { display: grid; gap: var(--space-xl); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 991px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .section { padding: var(--space-3xl) 0; }
    :root { --header-height: 64px; }
}
@media (max-width: 575px) {
    :root { --container-padding: 16px; }
    .section { padding: var(--space-2xl) 0; }
}

/* ==========================================================
   Icons (Bootstrap Icons font)
   ========================================================== */
.gj-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; vertical-align: middle; flex-shrink: 0; }
.gj-icon::before { display: block; }

/* ==========================================================
   Utilities
   ========================================================== */
.text-center { text-align: center; }
.text-primary { color: var(--gj-primary); }
.text-accent { color: var(--gj-accent); }
.text-gold { color: var(--gj-gold); }
.text-muted { color: var(--gj-text-muted); }
.text-white { color: var(--gj-text-light); }
.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bg-primary { background: var(--gj-primary); }
.bg-sand { background: var(--gj-sand); }
.shadow-md { box-shadow: var(--shadow-md); }
.rounded { border-radius: var(--radius-lg); }

/* Kill transitions during language switch (prevents RTL/LTR flash). */
.lang-switching, .lang-switching *, .lang-switching *::before, .lang-switching *::after {
    transition: none !important; animation: none !important;
}

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

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: var(--z-mobile-menu);
    background: var(--gj-primary); color: #fff; padding: var(--space-sm) var(--space-lg);
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
