/* ============================================
   SEPJ Gabès - Custom Styles
   Design: Glassmorphism, Futuristic, Green/Emerald
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* ============================================================
       ORGANIC NATURE LUXE — Design Tokens (DARK is default)
       Warm forest night · moss + clay accents · soft diffuse depth
       ============================================================ */

    /* ---- Brand (forest / moss) ---- */
    --brand: #4E8C6A;
    --brand-bright: #5FAE82;
    --brand-rgb: 78, 140, 106;
    --brand-soft: rgba(78, 140, 106, 0.14);
    --brand-border: rgba(95, 174, 130, 0.28);
    --accent-clay: #D98A57;
    --accent-clay-soft: rgba(217, 138, 87, 0.14);

    /* ---- Surfaces (warm forest night) ---- */
    --surface-0: #0C1A14;
    --surface-1: #12241B;
    --surface-2: #18301F;

    /* ---- Text ---- */
    --text-strong: #ECF1EC;
    --text-base: #C4D2C7;
    --text-muted: #8AA290;

    /* ---- Lines & shadows ---- */
    --border: rgba(220, 231, 222, 0.10);
    --border-strong: rgba(220, 231, 222, 0.16);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.25), 0 12px 32px -12px rgba(0,0,0,0.55);
    --shadow-soft: 0 2px 6px rgba(0,0,0,0.28), 0 20px 48px -16px rgba(0,0,0,0.6);

    /* ---- Danger ---- */
    --danger: #E5674F;
    --danger-soft: rgba(229, 103, 79, 0.16);
    --danger-text: #F0A898;
    --danger-border: rgba(229, 103, 79, 0.32);

    /* ---- Fonts ---- */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-ar: 'Segoe UI', 'Tahoma', 'Noto Kufi Arabic', 'Traditional Arabic', sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

    /* ---- Radius ---- */
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    /* ---- Motion ---- */
    --duration-fast: 150ms;
    --duration-base: 300ms;
    --duration-slow: 600ms;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* ============================================================
       Legacy aliases — old variable names mapped onto the new
       system so every existing component retints automatically.
       ============================================================ */
    --primary: var(--brand);
    --primary-dark: #3B6E52;
    --primary-light: var(--brand-bright);
    --primary-glow: rgba(78, 140, 106, 0.30);
    --emerald-900: #14342A;
    --emerald-800: #244736;
    --emerald-700: #2E5942;
    --emerald-600: #3B6E52;
    --emerald-500: #4E8C6A;
    --emerald-400: var(--brand-bright);
    --emerald-300: #7FC49B;
    --dark-bg: var(--surface-0);
    --dark-card: var(--surface-2);
    --glass-bg: var(--surface-1);
    --glass-border: var(--border);
    --glass-border-hover: var(--brand-border);
    --glass-shadow: var(--shadow-card);
    --text-primary: var(--text-strong);
    --text-secondary: var(--text-base);
    --shadow-sm: var(--shadow-card);
    --shadow-glow: 0 0 24px var(--primary-glow);
    --body-bg: var(--surface-0);
    --navbar-bg: rgba(12, 26, 20, 0.72);
    --navbar-bg-scrolled: rgba(12, 26, 20, 0.90);
    --navbar-border: var(--border);
    --mobile-menu-bg: var(--surface-0);
    --footer-bg: var(--surface-1);
    --footer-border: var(--border);
    --input-bg: var(--surface-2);
    --input-border: var(--border-strong);
    --input-bg-focus: #1D3826;
    --back-to-top-bg: rgba(78, 140, 106, 0.18);
    --back-to-top-hover-bg: rgba(78, 140, 106, 0.42);
    --lightbox-bg: rgba(8, 16, 12, 0.94);
    --lightbox-btn-bg: rgba(255, 255, 255, 0.10);
    --lightbox-btn-border: rgba(255, 255, 255, 0.20);
    --lightbox-counter-bg: rgba(0, 0, 0, 0.5);
    --select-option-bg: #14342A;
    --img-overlay-bg: linear-gradient(transparent, rgba(6, 20, 14, 0.85));
    --hero-title-gradient: linear-gradient(135deg, var(--text-strong) 0%, var(--brand-bright) 100%);
    --toggle-bg: rgba(255, 255, 255, 0.08);
    --toggle-border: rgba(255, 255, 255, 0.15);
    --toggle-color: var(--text-secondary);
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--surface-0);
    background-image:
        radial-gradient(ellipse 95% 55% at 50% -12%, rgba(78,140,106,0.11) 0%, transparent 62%),
        radial-gradient(ellipse 55% 45% at 100% 2%, rgba(217,138,87,0.05) 0%, transparent 55%);
    color: var(--text-base);
    min-height: 100vh;
    overflow-x: hidden;
    animation: pageLoad 0.5s ease-out both;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Display serif on headings (Latin) — the editorial-luxe signature */
.hero-title,
.section-title,
.page-hero h1,
.dg-title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
}

/* Arabic never falls back to the Latin serif.
   Also undo the tight Latin display metrics: Arabic script needs
   ~1.4 line-height (1.06 makes wrapped lines overlap) and no
   negative tracking (joined glyphs collide). */
[dir="rtl"] .hero-title,
[dir="rtl"] .section-title,
[dir="rtl"] .page-hero h1,
[dir="rtl"] .dg-title {
    font-family: var(--font-ar);
    line-height: 1.4;
    letter-spacing: 0;
}

/* Warm text selection */
::selection {
    background: var(--brand-soft);
    color: var(--text-strong);
}

/* Admin body background: uses descendant selectors so data-theme on <html>
   controls the background correctly. Light mode inherits [data-theme="light"] body;
   dark/default mode applies the forest-night gradient below. */
html:not([data-theme="light"]) .admin-theme-bg {
    background-color: #0b1712;
    background-image: linear-gradient(135deg, #0b1712 0%, #123524 50%, #0b1712 100%);
}

/* RTL Support for Arabic */
[dir="rtl"] body {
    font-family: var(--font-sans);
}

/* ---------- Animated Background Blobs ---------- */
.blob {
    position: fixed;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.58;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    animation: blobFloat 7s ease-in-out infinite;
}

.blob-1 {
    background: radial-gradient(circle, var(--brand) 0%, transparent 65%);
    top: -220px;
    right: -160px;
    animation-duration: 6s;
    animation-delay: 0s;
    width: 680px;
    height: 680px;
    opacity: 0.62;
}

.blob-2 {
    background: radial-gradient(circle, var(--brand) 0%, transparent 65%);
    bottom: -320px;
    left: -220px;
    filter: blur(160px);
    animation-duration: 8s;
    animation-delay: -9s;
    opacity: 0.46;
}

.blob-3 {
    background: radial-gradient(circle, var(--accent-clay) 0%, transparent 65%);
    top: 62%;
    left: 8%;
    transform: none;
    animation-duration: 9s;
    animation-delay: -16s;
    width: 720px;
    height: 720px;
    opacity: 0.30;
}

/* Sharper, brighter accent — near-layer "energy" glint for depth */
.blob-4 {
    background: radial-gradient(circle, var(--brand-bright) 0%, transparent 60%);
    top: 16%;
    right: 4%;
    width: 380px;
    height: 380px;
    filter: blur(95px);
    animation-duration: 5s;
    animation-delay: -4s;
    opacity: 0.34;
}

@keyframes blobFloat {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    20%  { transform: translate(90px, -70px) scale(1.15) rotate(4deg); }
    40%  { transform: translate(-60px, 40px) scale(0.88) rotate(-3deg); }
    60%  { transform: translate(70px, 90px) scale(1.08) rotate(2deg); }
    80%  { transform: translate(-90px, -40px) scale(0.94) rotate(-2deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

/* ---------- Tech grid mesh — faint drifting depth layer ---------- */
.bg-mesh {
    position: fixed;
    inset: -60px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black 0%, transparent 72%);
}

.bg-mesh::before {
    content: '';
    position: absolute;
    inset: -64px;
    background-image:
        linear-gradient(var(--border-strong) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-strong) 1px, transparent 1px);
    background-size: 64px 64px;
    will-change: transform;
    animation: meshDrift 14s linear infinite;
}

@keyframes meshDrift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-64px, -64px, 0); }
}

/* ---------- Cursor FX (desktop, fine-pointer only — see main.js initCursorFX) ---------- */
#cursorHalo,
#cursorCore {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 40;
    transform: translate3d(-999px, -999px, 0);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#cursorHalo {
    width: 260px;
    height: 260px;
    margin: -130px 0 0 -130px;
    background: radial-gradient(circle, var(--brand-bright) 0%, transparent 70%);
    filter: blur(18px);
    will-change: transform;
}
#cursorHalo.active { opacity: 0.30; }

#cursorCore {
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: var(--brand-bright);
    box-shadow: 0 0 14px 2px var(--brand-bright);
    will-change: transform;
}
#cursorCore.active { opacity: 0.85; }

#cursorParticles {
    position: fixed;
    inset: 0;
    z-index: 39;
    pointer-events: none;
}

/* ---------- Glassmorphism Cards ---------- */
.glass-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                background-color 0.3s ease;
    position: relative;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-border);
    background: var(--surface-2);
    box-shadow: var(--shadow-soft);
}

.glass-card-static {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    position: relative;
}

/* Cursor-proximity spotlight — a soft glow that tracks the pointer
   inside cards. Position is set via --spot-x/--spot-y from main.js
   (initCardSpotlight); pure CSS fallback keeps it centered otherwise. */
.glass-card::after,
.glass-card-static::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%),
                rgba(var(--brand-rgb), 0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.glass-card:hover::after,
.glass-card-static:hover::after {
    opacity: 1;
}

/* Ghost / secondary button */
.glass-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    color: var(--text-strong);
    padding: 0.7rem 1.5rem;
    transition: background-color 0.25s ease, border-color 0.25s ease,
                color 0.25s ease, transform 0.25s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.25s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 550;
    font-size: 0.9rem;
    letter-spacing: 0.005em;
}

.glass-btn:hover {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: var(--text-strong);
    transform: translateY(-2px);
}

.glass-btn:active {
    transform: translateY(0);
}

/* Primary — solid forest, warm shadow, quiet confidence */
.glass-btn-primary {
    background: var(--brand);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 8px 20px -8px rgba(31,92,67,0.55);
}

.glass-btn-primary:hover {
    background: var(--brand-bright);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 14px 28px -10px rgba(31,92,67,0.6);
    transform: translateY(-2px);
}

/* Clay accent variant for the single most important CTA on a page */
.glass-btn-accent {
    background: var(--accent-clay);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 8px 20px -8px rgba(194,112,61,0.55);
}
.glass-btn-accent:hover {
    background: var(--accent-clay);
    filter: brightness(1.06);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 14px 28px -10px rgba(194,112,61,0.6);
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.navbar.scrolled {
    background: var(--navbar-bg-scrolled);
    box-shadow: var(--shadow-card);
    top: 0.75rem;
    left: 4rem;
    right: 4rem;
    border-radius: 32px;
    border-color: var(--border-strong);
}

.nav-link {
    position: relative;
    color: var(--text-base);
    transition: color 0.25s ease;
    padding: 0.5rem 0;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.15rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-clay);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-bright);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---------- Hero Section ---------- */
.hero-section {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 68px;
    isolation: isolate;
}

/* Soft organic halo behind the hero (no neon rings) */
.hero-section::before {
    content: '';
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(820px, 96vw);
    height: min(820px, 96vw);
    background: radial-gradient(circle, var(--brand-soft) 0%, transparent 62%);
    pointer-events: none;
    z-index: -1;
}

/* Fine concentric hairline — architectural, barely-there */
.hero-section::after {
    content: '';
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 74vw);
    height: min(560px, 74vw);
    border: 1px solid var(--border);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-bright);
    margin-bottom: 1.25rem;
}

.hero-eyebrow::before {
    content: '';
    width: 26px;
    height: 1.5px;
    background: var(--accent-clay);
    display: inline-block;
}

[dir="rtl"] .hero-eyebrow {
    letter-spacing: 0;
    font-family: var(--font-ar);
}

.hero-title {
    font-size: clamp(2.8rem, 6.5vw, 5rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.7;
    letter-spacing: 0.005em;
    margin-top: 1.25rem;
}

/* ---------- Section Titles ---------- */
.section-title {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--text-strong);
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 44px;
    height: 3px;
    background: var(--accent-clay);
    border-radius: 2px;
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
}

/* Arabic variant — underline on the right (under first word "كلمة") */
.section-title[dir="rtl"]::after {
    left: auto;
    right: 0;
}

/* Center variant */
.section-title-center::after {
    left: 50%;
    transform: translateX(-50%);
}

[dir="rtl"] .section-title-center::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

/* ---------- Image Cards ---------- */
.img-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    aspect-ratio: 16 / 10;
}

.img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-card:hover img {
    transform: scale(1.06);
}

.img-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.75rem 1.25rem 1.25rem;
    background: linear-gradient(to top, rgba(6,20,14,0.88) 0%, transparent 62%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.img-card:hover .img-card-overlay {
    opacity: 1;
}

/* ---------- Stats Cards ---------- */
.stat-card {
    text-align: center;
    padding: 2.25rem 1.75rem;
    position: relative;
    overflow: hidden;
}

.stat-clickable {
    cursor: pointer;
}

/* ---------- Stat Modal ---------- */
.stat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 14, 10, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.stat-modal.active {
    display: flex;
}

.stat-modal-content {
    max-width: 520px;
    width: 100%;
    padding: 2.5rem 2rem;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
    opacity: 0;
    border: 1px solid var(--brand-border);
    box-shadow: 0 0 60px rgba(78, 140, 106, 0.15);
}

.stat-modal.active .stat-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.stat-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.25rem;
    z-index: 1;
}

.stat-modal-close:hover {
    color: var(--text-strong);
}

.stat-modal-body {
    text-align: center;
}

.stat-modal-number {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--brand-bright);
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.stat-modal-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 1.25rem;
    display: block;
}

.stat-modal-detail {
    font-size: 0.9rem;
    color: var(--text-base);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto;
    text-align: start;
}

[data-theme="light"] .stat-modal {
    background: rgba(242, 241, 234, 0.97);
}

[data-theme="light"] .stat-modal-content {
    box-shadow: 0 0 60px rgba(31, 92, 67, 0.10);
}

[data-theme="light"] .stat-modal-close {
    color: var(--text-muted);
}

[data-theme="light"] .stat-modal-close:hover {
    color: var(--text-strong);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 84px; height: 84px;
    background: radial-gradient(circle at top right, var(--brand-soft) 0%, transparent 72%);
    border-radius: 0 var(--border-radius) 0 84px;
    pointer-events: none;
}

.stat-number {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: clamp(2.4rem, 4.8vw, 3.9rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--brand-bright);
    font-variant-numeric: tabular-nums;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--brand);
    border: 1px solid transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 6px 20px -6px rgba(0,0,0,0.5);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--brand-bright);
    box-shadow: 0 10px 26px -8px rgba(31,92,67,0.6);
    transform: translateY(-3px);
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 2rem;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--lightbox-bg);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1.2rem;
    background: var(--lightbox-btn-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--lightbox-btn-border);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.02em;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--lightbox-btn-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--lightbox-btn-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    direction: ltr;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Language Switcher ---------- */
.lang-switcher a {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 5px;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lang-switcher a:hover {
    opacity: 0.9;
    border-color: var(--brand-border);
    transform: translateY(-1px);
    background: none;
    color: inherit;
}

.lang-switcher a.active {
    opacity: 1;
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 1px var(--brand-border);
    background: none;
    color: inherit;
}

.lang-switcher a img {
    display: block;
    width: 22px !important;
    height: 16px !important;
    max-width: 22px !important;
    max-height: 16px !important;
    border-radius: 2px;
    object-fit: cover;
    mix-blend-mode: luminosity;
    filter: contrast(1.1) saturate(1.2);
}

.lang-switcher a:hover img,
.lang-switcher a.active img {
    mix-blend-mode: normal;
    filter: none;
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Solid fallback first, then translucent glass where color-mix is supported */
    background-color: var(--surface-0);
    background-color: color-mix(in srgb, var(--surface-0) 93%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    background-image: radial-gradient(ellipse 80% 40% at 50% 0%, var(--brand-soft) 0%, transparent 62%);
    /* Below the navbar (z 1000) so the logo and the X button stay visible/usable */
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 5.25rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity var(--duration-base) ease,
                visibility var(--duration-base) ease,
                transform var(--duration-base) ease;
}

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mobile-menu .nav-link {
    display: block;
    width: min(100%, 26rem);
    margin-inline: auto;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-base) !important;
}

/* The animated underline belongs to the desktop bar, not these pills */
.mobile-menu .nav-link::after { display: none; }

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active,
.mobile-menu .nav-link[aria-current="page"] {
    color: var(--brand-bright) !important;
    background: var(--brand-soft);
}

/* Language switcher row */
.mobile-menu > div {
    justify-content: center;
    flex-wrap: wrap;
}

/* Language buttons inside mobile menu */
.mobile-menu .glass-btn {
    color: var(--text-strong) !important;
    background: var(--brand-soft) !important;
    border-color: var(--brand-border) !important;
}

/* Staggered entrance: links cascade in as the sheet opens */
.mobile-menu > * {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.mobile-menu.active > * {
    opacity: 1;
    transform: none;
}
.mobile-menu.active > :nth-child(1)  { transition-delay: 30ms; }
.mobile-menu.active > :nth-child(2)  { transition-delay: 55ms; }
.mobile-menu.active > :nth-child(3)  { transition-delay: 80ms; }
.mobile-menu.active > :nth-child(4)  { transition-delay: 105ms; }
.mobile-menu.active > :nth-child(5)  { transition-delay: 130ms; }
.mobile-menu.active > :nth-child(6)  { transition-delay: 155ms; }
.mobile-menu.active > :nth-child(7)  { transition-delay: 180ms; }
.mobile-menu.active > :nth-child(8)  { transition-delay: 205ms; }
.mobile-menu.active > :nth-child(9)  { transition-delay: 230ms; }
.mobile-menu.active > :nth-child(10) { transition-delay: 255ms; }
.mobile-menu.active > :nth-child(11) { transition-delay: 280ms; }
.mobile-menu.active > :nth-child(12) { transition-delay: 305ms; }
.mobile-menu.active > :nth-child(13) { transition-delay: 330ms; }
.mobile-menu.active > :nth-child(14) { transition-delay: 355ms; }
.mobile-menu.active > :nth-child(15) { transition-delay: 380ms; }

/* Hamburger → X icon state toggle */
.mobile-menu-btn .menu-icon-close { display: none; }
.mobile-menu-btn[aria-expanded="true"] .menu-icon-bars { display: none; }
.mobile-menu-btn[aria-expanded="true"] .menu-icon-close { display: block; }

/* ---------- Scroll Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.breadcrumbs a:hover {
    color: var(--emerald-400);
}

.breadcrumbs .separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    opacity: 0.45;
    display: block;
}

/* ---------- Form Elements ---------- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--input-bg-focus);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ---------- Select / Dropdown Theming ---------- */
select.form-input,
.form-input select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236ee7b7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.25rem;
    cursor: pointer;
}

[dir="rtl"] select.form-input,
[dir="rtl"] .form-input select {
    background-position: left 0.75rem center;
    padding-right: 1rem;
    padding-left: 2.25rem;
}

select.form-input option,
.form-input select option {
    background: var(--select-option-bg);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(5, 150, 105, 0.05) 25%, 
        rgba(5, 150, 105, 0.1) 50%, 
        rgba(5, 150, 105, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-card {
    height: 300px;
    border-radius: var(--border-radius);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ---------- Page Hero ---------- */
.page-hero {
    padding: clamp(6rem, 12vw, 10rem) 0 clamp(2.5rem, 4vw, 4rem);
    text-align: center;
    position: relative;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 300px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-border), transparent);
}

.page-hero h1 {
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-strong);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.page-hero h1 i {
    font-size: 0.8em;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    padding: 4.5rem 0 2rem;
    margin-top: 6rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-border), transparent);
}

.footer-link {
    color: var(--text-base);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    border-left: 2px solid rgba(255,255,255,0.12);
}
.footer-arrow {
    display: inline-block;
    font-size: 1.1em;
    opacity: 0.4;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.footer-link:hover {
    color: var(--emerald-400);
    transform: translateX(4px);
    background: rgba(255,255,255,0.04);
    border-left-color: var(--emerald-400);
}
.footer-link:hover .footer-arrow {
    opacity: 1;
    transform: translateX(2px);
}

[dir="rtl"] .footer-link {
    border-left: none;
    border-right: 2px solid rgba(255,255,255,0.12);
}
[dir="rtl"] .footer-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .footer-link:hover {
    transform: translateX(-4px);
    border-right-color: var(--emerald-400);
}
[dir="rtl"] .footer-link:hover .footer-arrow {
    transform: scaleX(-1) translateX(-2px);
}

/* ---------- Responsive ---------- */
/* ============================================================
   RESPONSIVE — Navbar collapse (≤ 1023px)
   The full desktop nav (6 links + More + language + search +
   theme toggle) needs ~1030px; below that, use the hamburger.
   ============================================================ */
@media (max-width: 1023px) {
    .desktop-nav       { display: none !important; }
    .mobile-menu-btn   { display: flex !important; }
    /* Always-visible theme toggle next to the hamburger (not hidden inside
       the mobile menu list) */
    .nav-mobile-theme-toggle { display: inline-flex !important; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Shrink logo on mobile so it fits in the 64px bar */
    .navbar a img      { height: 2.5rem !important; width: auto !important; }

    /* Navbar inner row: let it breathe */
    .navbar .flex.items-center.justify-between {
        height: auto !important;
        min-height: 3.5rem;
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
    }

    /* Fix scrolled pill on mobile — reduce margins so content fits */
    .navbar.scrolled {
        left: 0.75rem !important;
        right: 0.75rem !important;
        top: 0.5rem !important;
        border-radius: 20px !important;
    }

    /* --- Hero sections --- */
    .hero-section  { padding-top: 56px !important; }
    .hero-title    { font-size: clamp(1.9rem, 7vw, 3.2rem) !important; }
    .page-hero     { padding: 5rem 0 1.5rem !important; }
    .page-hero h1  { font-size: clamp(1.5rem, 5vw, 2.25rem) !important; }

    /* --- Cards --- */
    .glass-card         { border-radius: 12px; }
    .glass-card-static  { border-radius: 12px; }

    /* Reduce heavy padding on glass cards on mobile */
    .glass-card.p-8,
    .glass-card-static.p-8 { padding: 1.25rem !important; }

    /* --- Images --- */
    /* Cap featured images on mobile */
    img.max-h-\[500px\]       { max-height: 220px !important; object-fit: cover; }
    .rounded-xl img           { max-height: 220px; object-fit: cover; }

    /* --- Lightbox controls --- */
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1rem; }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }

    /* --- Back to top --- */
    .back-to-top { bottom: 1rem !important; right: 1rem !important; }

    /* --- Footer --- */
    .site-footer { padding: 2rem 0 1rem; margin-top: 2rem; }

    /* --- Section titles --- */
    .section-title { font-size: clamp(1.25rem, 4vw, 1.75rem); }

    /* --- Stat cards: 2-col on mobile is fine but reduce padding --- */
    .stat-card { padding: 1.25rem; }
    /* Match the ::before corner glow to the card's 12px radius so it doesn't
       leave a sliver of dark card background along the top-right corner */
    .stat-card::before { border-top-right-radius: 12px; }
    .stat-number { font-size: clamp(1.5rem, 7vw, 2.5rem); }
    .stat-modal-content { padding: 2rem 1.25rem; max-width: 90vw; }
    .stat-modal-detail { font-size: 0.85rem; }

    /* --- RTL: back-to-top on left for Arabic --- */
    [dir="rtl"] .back-to-top { right: auto !important; left: 1rem !important; }
}

/* ============================================================
   RESPONSIVE — Tablet (481px – 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .page-hero { padding: 5.5rem 0 2rem !important; }
}

/* ============================================================
   RESPONSIVE — Small mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    /* Tighten page padding */
    .max-w-7xl, .max-w-5xl, .max-w-4xl { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Even tighter scrolled nav on very small screens */
    .navbar.scrolled {
        left: 0.5rem !important;
        right: 0.5rem !important;
    }
    /* Keep the company name visible beside the logo on the scrolled pill;
       just size it down so it fits on tiny screens */
    .navbar.scrolled .inline.sm\:hidden {
        font-size: 0.875rem;
        white-space: nowrap;
    }
    .navbar.scrolled a img {
        height: 2rem !important;
    }

    /* Stack contact grid explicitly */
    .grid.lg\:grid-cols-2  { grid-template-columns: 1fr !important; }

    /* Card padding */
    .glass-card-static, .glass-card { padding: 1rem !important; }

    /* Reduce hero title further */
    .hero-title { font-size: clamp(1.6rem, 8vw, 2.5rem) !important; }

    /* Breadcrumbs: wrap nicely */
    .breadcrumbs { font-size: 0.75rem; gap: 0.25rem; }

    /* Search form */
    .search-form { flex-direction: column !important; }

    /* Footer copyright text */
    .site-footer .text-sm { font-size: 0.75rem; }

    /* Pagination: smaller buttons */
    .pagination-btn { padding: 0.375rem 0.625rem !important; font-size: 0.8rem !important; }
}

/* ============================================================
   RESPONSIVE — Desktop show/hide
   ============================================================ */
@media (min-width: 1024px) {
    .mobile-menu-btn { display: none !important; }
}

/* ============================================================
   RESPONSIVE — Tailwind grid overrides for tablet (sm breakpoint)
   Apply 2-col layout on tablets where Tailwind jumps 1→3/4
   ============================================================ */
@media (min-width: 640px) and (max-width: 900px) {
    /* News, projects, services, videos, prizes — all jump from 1→3 at md (768px).
       Give them a 2-col intermediate step at sm. */
    .grid.md\:grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }

    /* Stats: already 2-col on mobile, keep 4 on tablet */
    .grid.md\:grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================================
   RESPONSIVE — Fluid layout utilities
   ============================================================ */

/* Make all images responsive by default */
img { max-width: 100%; height: auto; }

/* Prevent content overflow on any screen */
* { box-sizing: border-box; }
main, section, article { overflow-x: hidden; }

/* ---------- Print ---------- */
@media print {
    .navbar,
    .back-to-top,
    .lightbox {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ============================================================
   ACCESSIBILITY — Skip Navigation
   ============================================================ */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top var(--duration-fast) ease;
}
.skip-nav:focus { top: 1rem; }

/* ============================================================
   ACCESSIBILITY — Visually Hidden (screen-reader only)
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   ACCESSIBILITY — Global focus-visible ring
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--emerald-400);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

/* form-input manages its own focus ring via box-shadow */
.form-input:focus-visible { outline: none; }

/* ============================================================
   REDUCED MOTION — Stop all animations for motion-sensitive users
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
    .blob { animation: none; opacity: 0.08; }
    .bg-mesh::before { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .skeleton { animation: none; background: rgba(5,150,105,0.08); }
    #cursorHalo, #cursorCore, #cursorParticles { display: none !important; }
}

/* ============================================================
   PERFORMANCE — Reduce blob size & blur cost on mobile
   ============================================================ */
@media (max-width: 768px) {
    .blob {
        filter: blur(80px);
        opacity: 0.22;
        width: 300px;
        height: 300px;
    }
    .blob-3 { width: 400px; height: 400px; }
    .blob-4 { width: 220px; height: 220px; filter: blur(60px); }
    .bg-mesh::before { background-size: 48px 48px; }
}

/* Cursor FX is desktop-only by design; keep it off touch/coarse pointers
   even if the JS check is ever bypassed (defense in depth). */
@media (hover: none), (pointer: coarse) {
    #cursorHalo, #cursorCore, #cursorParticles { display: none !important; }
}

/* ============================================================
   LIGHTBOX — Image counter
   ============================================================ */
.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lightbox-counter-bg);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   DROPDOWN — "More" + Lang menus: solid opaque background
   ============================================================ */
.more-dropdown-menu {
    background: var(--surface-2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: var(--shadow-soft) !important;
    transition: opacity var(--duration-fast) ease,
                visibility var(--duration-fast) ease,
                transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top center;
    transform: scale(0.97) translateY(-6px);
}

.more-dropdown-menu.open,
.group:focus-within .more-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

[data-theme="light"] .more-dropdown-menu {
    background: var(--surface-2) !important;
    border-color: var(--border-strong) !important;
    box-shadow: var(--shadow-soft) !important;
}

/* ============================================================
   CTA CARD — Contact / call-to-action section
   ============================================================ */
.cta-card {
    border-color: var(--brand-border);
    background:
        radial-gradient(ellipse 70% 120% at 50% 0%, var(--brand-soft) 0%, transparent 60%),
        var(--surface-1);
    box-shadow: var(--shadow-soft);
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-clay), transparent);
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================
   PAGINATION — Active page visual indicator
   ============================================================ */
.pagination-btn[aria-current="page"] {
    background: rgba(5,150,105,0.4) !important;
    border-color: var(--emerald-500) !important;
    font-weight: 600;
}

/* ============================================================
   MEDIA SELECTION — Multi-select via Ctrl+click
   ============================================================ */
.media-item.media-selected {
    outline: 3px solid var(--danger);
    outline-offset: -3px;
    border-color: var(--danger) !important;
    box-shadow: 0 0 20px rgba(229, 103, 79, 0.35);
}

.media-item.media-selected .media-selected-overlay {
    display: flex !important;
}

/* ============================================================
   QUICK CONTACT PAGE
   ============================================================ */
.qc-page {
    padding: 7rem 1.25rem 4rem;
}

.qc-container {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.qc-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
    text-decoration: none;
}
.qc-back:hover { color: var(--emerald-400); }

.qc-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
}

[data-theme="light"] .qc-card {
    background: var(--surface-1);
    border-color: var(--border);
    box-shadow: var(--shadow-soft);
}

/* Card header */
.qc-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.qc-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--emerald-400);
}

.qc-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0 0 0.2rem;
}

.qc-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Form fields */
.qc-form { display: flex; flex-direction: column; gap: 1.1rem; }

.qc-field { display: flex; flex-direction: column; gap: 0.4rem; }

.qc-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.qc-required { color: var(--emerald-400); margin-inline-start: 2px; }

.qc-input-error {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Submit */
.qc-submit {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

/* Errors */
.qc-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.qc-errors ul { margin: 0; padding: 0; list-style: none; }
.qc-errors li { font-size: 0.85rem; color: #fca5a5; padding: 0.2rem 0; }
[data-theme="light"] .qc-errors li { color: #dc2626; }

/* Success */
.qc-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem 0;
}
.qc-success-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-bright);
}
.qc-success p { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }
.qc-home-btn { margin-top: 0.5rem; }

@media (max-width: 480px) {
    .qc-card { padding: 1.5rem; }
    .qc-title { font-size: 1.2rem; }
}

/* ============================================================
   FLOATING CONTACT + SOCIALS — single centred stack, left side
   ============================================================ */
.float-stack {
    position: fixed;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    z-index: 997;
    /* Always lay out + expand left->right, even when the page is RTL (Arabic) */
    direction: ltr;
}

/* RTL: move floating stack to the right side for Arabic,
   flip individual buttons so icon is right / label expands left */
[dir="rtl"] .float-stack {
    left: auto;
    right: 1.25rem;
    align-items: flex-end;
}
[dir="rtl"] .float-stack .float-contact,
[dir="rtl"] .float-stack .social-float-btn {
    direction: rtl;
}
[dir="rtl"] .float-stack .social-float-group {
    align-items: flex-end;
}

/* Contact button — collapsed icon pill that expands to reveal its label */
.float-contact {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--brand);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    max-width: 48px;
    box-shadow: 0 6px 20px -6px rgba(31, 92, 67, 0.55);
    transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding    0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease,
                transform  0.2s ease,
                box-shadow 0.3s ease;
}

.float-contact:hover {
    max-width: 180px;
    padding: 0.75rem 1.1rem 0.75rem 0.75rem;
    background: var(--brand-bright);
    box-shadow: 0 10px 28px -8px rgba(31, 92, 67, 0.6);
    transform: translateX(4px);
    gap: 0.5rem;
}

[dir="rtl"] .float-contact:hover {
    padding: 0.75rem 0.75rem 0.75rem 1.1rem;
    transform: translateX(-4px);
}

.float-contact-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.float-contact-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.25s ease 0.05s, width 0.35s ease;
    pointer-events: none;
}

.float-contact:hover .float-contact-label {
    opacity: 1;
    width: auto;
}

[data-theme="light"] .float-contact { color: #fff; }

/* ============================================================
   SOCIAL FLOAT GROUP — stacked beneath the contact button
   ============================================================ */
.social-float-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
}

/* Collapsed = 40px icon pill; expands on hover to reveal the label,
   mirroring the contact button. */
.social-float-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    max-width: 40px;
    border-radius: 999px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-card);
    transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease, border-color 0.25s ease,
                box-shadow 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

/* Fixed-width icon slot keeps the glyph centred while collapsed */
.social-float-btn i {
    width: 38px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.social-float-label {
    opacity: 0;
    padding-right: 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: opacity 0.25s ease 0.05s;
    pointer-events: none;
}

[dir="rtl"] .social-float-label {
    text-align: left;
    padding-right: 0;
    padding-left: 1.1rem;
}

.social-float-btn:hover {
    max-width: 220px;
    transform: translateX(4px);
}

[dir="rtl"] .social-float-btn:hover {
    transform: translateX(-4px);
}

.social-float-btn:hover .social-float-label {
    opacity: 1;
}

.social-float-linkedin:hover {
    border-color: #0077B5;
    box-shadow: 0 6px 20px rgba(0, 119, 181, 0.45);
    color: #0077B5;
}
.social-float-facebook:hover {
    border-color: #1877F2;
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.45);
    color: #1877F2;
}
.social-float-instagram:hover {
    border-color: #E4405F;
    box-shadow: 0 6px 20px rgba(228, 64, 95, 0.4);
    color: #E4405F;
}
.social-float-youtube:hover {
    border-color: #FF0000;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
    color: #FF0000;
}

[data-theme="light"] .social-float-btn { color: #064e3b; }

/* Mobile */
@media (max-width: 768px) {
    /* Dock to the bottom corner as a horizontal row — the mid-screen
       vertical stack sits on top of text/cards on narrow viewports */
    .float-stack {
        top: auto;
        bottom: calc(0.9rem + env(safe-area-inset-bottom, 0));
        left: 0.75rem;
        transform: none;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    /* RTL mobile: back-to-top moves to the bottom-left, so mirror the row right */
    [dir="rtl"] .float-stack { left: auto; right: 0.75rem; }

    .float-contact {
        padding: 0.6rem;
        max-width: 38px !important;
        gap: 0 !important;
    }
    .float-contact:hover {
        max-width: 38px !important;
        padding: 0.6rem !important;
        transform: translateX(2px) !important;
    }
    [dir="rtl"] .float-contact:hover { transform: translateX(-2px) !important; }
    .float-contact-icon { width: 1rem; height: 1rem; }
    .float-contact-label { display: none; }

    .social-float-group { flex-direction: row; align-items: center; gap: 0.5rem; }
    .social-float-btn { max-width: 34px; height: 34px; font-size: 0.8rem; }
    .social-float-btn i { width: 32px; }
    .social-float-btn:hover { max-width: 34px; transform: translateX(2px); }
    [dir="rtl"] .social-float-btn:hover { transform: translateX(-2px); }
    .social-float-label { display: none; }
}

/* ============================================================
   SAFE AREA INSETS — Notched / rounded-corner devices
   ============================================================ */
.navbar { padding-top: env(safe-area-inset-top, 0); }
.site-footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0)); }
.back-to-top {
    bottom: calc(2rem + env(safe-area-inset-bottom, 0));
    right: calc(2rem + env(safe-area-inset-right, 0));
}
[dir="rtl"] .back-to-top {
    right: auto;
    left: calc(2rem + env(safe-area-inset-left, 0));
}

/* ============================================================
   CONTACT FORM — Loading spinner
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ============================================================
   GALLERY — 3-column intermediate breakpoint
   ============================================================ */
@media (min-width: 640px) and (max-width: 899px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   PERFORMANCE — GPU compositing hint on interactive cards
   ============================================================ */
.glass-btn { will-change: transform; }

/* ============================================================
   SUSTAINABILITY REPORT PAGE
   ============================================================ */
.sr-report-eyebrow {
    margin-bottom: 0.5rem;
}

.sr-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.sr-back-link:hover { color: var(--emerald-400); }

/* Section wrapper */
.sr-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
}

/* Section header */
.sr-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--brand-soft);
}

.sr-section-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.sr-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.sr-section-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sr-count {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: 99px;
    font-size: 0.75rem;
    color: var(--brand-bright);
    font-weight: 600;
}

/* Empty state */
.sr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sr-empty-icon {
    font-size: 2.5rem;
    opacity: 0.35;
}

/* Items grid */
.sr-grid {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Item card — horizontal list style */
.sr-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sr-card:hover {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    transform: translateX(4px);
}

[dir="rtl"] .sr-card:hover { transform: translateX(-4px); }

/* Thumbnail */
.sr-card-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
}

.sr-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sr-card-thumb-placeholder {
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Card body */
.sr-card-body {
    flex: 1;
    min-width: 0;
}

.sr-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sr-card-date {
    font-size: 0.72rem;
    color: var(--emerald-500);
    display: block;
}

/* Arrow */
.sr-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.sr-card:hover .sr-card-arrow {
    opacity: 1;
    color: var(--emerald-400);
    transform: translateX(3px);
}

[dir="rtl"] .sr-card-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .sr-card:hover .sr-card-arrow { transform: translateX(-3px); }

/* Light mode handled by the token system (surfaces + brand-soft). */

/* Mobile */
@media (max-width: 640px) {
    .sr-section-header { padding: 1.25rem; }
    .sr-grid { padding: 1rem 1.25rem; }
    .sr-card-thumb { width: 48px; height: 48px; }
    .sr-card-title { white-space: normal; }
}

/* ============================================================
   DIRECTOR SECTION — Premium redesign
   ============================================================ */

/* Section wrapper */
.dg-section {
    padding-top: 3.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

/* Header: eyebrow + title */
.dg-header {
    margin-bottom: 2rem;
}

.dg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--emerald-500);
    margin-bottom: 0.6rem;
}

.dg-eyebrow::before,
.dg-eyebrow::after {
    content: '';
    display: block;
    width: 28px;
    height: 1.5px;
    background: var(--emerald-500);
    opacity: 0.6;
}

.dg-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

/* Main card */
.dg-card {
    display: flex;
    gap: 0;
    align-items: stretch;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    background: var(--surface-1);
    position: relative;
}

.dg-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--emerald-400), var(--emerald-700));
    border-radius: 4px 0 0 4px;
    z-index: 1;
}

[data-theme="light"] .dg-card {
    background: var(--surface-1);
    box-shadow: var(--shadow-soft);
}

/* Message column */
.dg-message-col {
    flex: 1;
    padding: 2.5rem 2.5rem 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dg-quote-mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 5rem;
    line-height: 0.8;
    color: var(--emerald-400);
    opacity: 0.35;
    display: block;
    margin-bottom: 0.5rem;
    user-select: none;
}

.dg-summary {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.75;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.dg-body {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.85;
    flex: 1;
    margin-bottom: 1.75rem;
}

/* Signature */
.dg-signature {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.dg-sig-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.dg-sig-role {
    font-size: 0.8rem;
    color: var(--emerald-500);
    font-style: italic;
}

/* Photo column */
.dg-photo-col {
    flex: 0 0 220px;
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    background: var(--brand-soft);
    border-left: 1px solid var(--border);
}

[data-theme="light"] .dg-photo-col {
    background: var(--brand-soft);
}

.dg-photo-ring {
    padding: 3px;
    background: linear-gradient(145deg, var(--brand-bright), var(--brand));
    border-radius: 16px;
    box-shadow: 0 10px 28px -8px rgba(31, 92, 67, 0.45);
}

.dg-photo-ring img {
    width: 168px;
    height: 210px;
    object-fit: cover;
    object-position: top center;
    border-radius: 13px;
    display: block;
}

.dg-identity {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dg-identity-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.dg-identity-role {
    font-size: 0.75rem;
    color: var(--emerald-500);
    font-style: italic;
    display: block;
}

/* Light mode text overrides inside dg */
[data-theme="light"] .dg-body { color: #1a2e1f; }
[data-theme="light"] .dg-summary { color: #0a0f0d; }

/* Mobile: stack vertically */
@media (max-width: 640px) {
    .dg-card { flex-direction: column; }
    .dg-card::before { width: 100%; height: 4px; top: 0; left: 0; right: 0; bottom: auto; border-radius: 4px 4px 0 0; }
    .dg-message-col { padding: 1.5rem; }
    .dg-photo-col {
        flex: none; width: 100%;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        padding: 1.5rem;
        flex-direction: row;
        gap: 1.25rem;
        align-items: center;
        justify-content: center;
    }
    .dg-photo-ring img { width: 100px; height: 125px; }
    .dg-identity { text-align: start; }
}

/* ============================================================
   THEME — Smooth transition on theme switch
   ============================================================ */
body,
.glass-card,
.glass-card-static,
.glass-btn,
.site-footer,
.form-input,
.back-to-top,
.nav-link,
.hero-title,
.section-title,
.footer-link,
.breadcrumbs,
.lang-switcher a,
.skip-nav,
.more-dropdown-menu {
    transition: background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease,
                box-shadow 0.3s ease,
                background 0.3s ease;
}

/* Navbar needs extra geometric properties for floating pill transition */
.navbar {
    transition: background-color 0.35s ease,
                border-color 0.35s ease,
                box-shadow 0.35s ease,
                background 0.35s ease,
                top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                left 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                right 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
/* Opacity-only: a transform here would make <body> the containing block
   for position:fixed children (floating buttons), breaking them on scroll. */
@keyframes pageLoad {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   LIGHT MODE — token overrides (warm sage-stone paper)
   Only the base tokens change; every component re-tints
   automatically through the alias layer defined in :root.
   ============================================================ */
[data-theme="light"] {
    /* Brand */
    --brand: #1F5C43;
    --brand-bright: #2E7D5B;
    --brand-rgb: 31, 92, 67;
    --brand-soft: #E4EBE1;
    --brand-border: rgba(31, 92, 67, 0.22);
    --accent-clay: #C2703D;
    --accent-clay-soft: rgba(194, 112, 61, 0.12);
    /* Surfaces */
    --surface-0: #F2F1EA;
    --surface-1: #FBFAF5;
    --surface-2: #FFFFFF;
    /* Text */
    --text-strong: #14261E;
    --text-base: #33473B;
    --text-muted: #5C6F63;
    /* Lines & shadows */
    --border: rgba(20, 52, 42, 0.10);
    --border-strong: rgba(20, 52, 42, 0.16);
    --shadow-card: 0 1px 2px rgba(20,40,30,0.04), 0 8px 24px -8px rgba(20,40,30,0.10);
    --shadow-soft: 0 2px 6px rgba(20,40,30,0.05), 0 16px 40px -12px rgba(20,40,30,0.14);
    /* Danger */
    --danger: #C0492F;
    --danger-soft: #F7E7E2;
    --danger-text: #A83A24;
    --danger-border: rgba(192, 73, 47, 0.30);
    /* Aliases carrying an explicit rgba/hex — restated for light */
    --primary-dark: #143C2C;
    --primary-glow: rgba(31, 92, 67, 0.18);
    --emerald-900: #0F2E22;
    --emerald-800: #143C2C;
    --emerald-700: #194B37;
    --emerald-600: #1F5C43;
    --emerald-500: #1F5C43;
    --emerald-300: #4E9E76;
    --navbar-bg: rgba(216, 226, 214, 0.85);
    --navbar-bg-scrolled: rgba(208, 220, 206, 0.94);
    --input-bg-focus: #FFFFFF;
    --back-to-top-bg: rgba(31, 92, 67, 0.12);
    --back-to-top-hover-bg: rgba(31, 92, 67, 0.30);
    --lightbox-bg: rgba(242, 241, 234, 0.96);
    --lightbox-btn-bg: rgba(31, 92, 67, 0.12);
    --lightbox-btn-border: rgba(31, 92, 67, 0.25);
    --lightbox-counter-bg: rgba(31, 92, 67, 0.12);
    --select-option-bg: #E4EBE1;
    --img-overlay-bg: linear-gradient(transparent, rgba(20, 38, 30, 0.75));
    --toggle-bg: rgba(31, 92, 67, 0.10);
    --toggle-border: rgba(31, 92, 67, 0.30);
    --toggle-color: var(--brand);
}

/* Light mode: body — warm paper + a whisper of clay warmth */
[data-theme="light"] body {
    background-color: var(--surface-0);
    background-image:
        radial-gradient(ellipse 95% 55% at 50% -8%, rgba(31,92,67,0.06) 0%, transparent 62%),
        radial-gradient(ellipse 55% 45% at 100% 2%, rgba(194,112,61,0.05) 0%, transparent 55%);
}

/* Light mode: bold green washes — a denser gradient core and less blur
   than dark mode so the shapes read as defined color, not a hazy tint
   that dissolves into the paper surface. blob-3 swaps its dark-mode
   clay tone for a bright emerald so the light palette reads as
   "green tech", not orange. */
[data-theme="light"] .blob   { opacity: 0.46; }
[data-theme="light"] .blob-1 {
    opacity: 0.52;
    filter: blur(110px);
    background: radial-gradient(circle, var(--brand) 0%, var(--brand) 32%, transparent 72%);
}
[data-theme="light"] .blob-2 {
    opacity: 0.42;
    filter: blur(120px);
    background: radial-gradient(circle, var(--brand) 0%, var(--brand) 32%, transparent 72%);
}
[data-theme="light"] .blob-3 {
    opacity: 0.36;
    filter: blur(110px);
    background: radial-gradient(circle, var(--emerald-300) 0%, var(--emerald-300) 30%, transparent 70%);
}
[data-theme="light"] .blob-4 {
    opacity: 0.50;
    filter: blur(65px);
    background: radial-gradient(circle, var(--brand-bright) 0%, var(--brand-bright) 30%, transparent 68%);
}
[data-theme="light"] .bg-mesh::before {
    background-image:
        linear-gradient(rgba(31, 92, 67, 0.30) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 92, 67, 0.30) 1px, transparent 1px);
}

/* Light mode: dg director message text a touch deeper for contrast */
[data-theme="light"] .dg-body    { color: #223528; }
[data-theme="light"] .dg-summary { color: var(--text-strong); }

/* ============================================================
   SEMANTIC REMAP — hardcoded Tailwind utilities → design tokens
   Applies to BOTH themes (values flow from the token layer), so
   the SAME markup renders a cohesive, purpose-built result in
   dark and light. !important is required to beat the Tailwind
   Play CDN's runtime-injected utility classes.
   ============================================================ */

/* — Text — */
.text-white            { color: var(--text-strong) !important; }
.text-white\/80        { color: var(--text-base)   !important; }
.text-white\/70        { color: var(--text-base)   !important; }
.text-white\/60        { color: var(--text-muted)  !important; }
.text-white\/40        { color: var(--text-muted)  !important; }
.text-emerald-200      { color: var(--text-base)   !important; }
.text-emerald-200\/50  { color: var(--text-muted)  !important; }
.text-emerald-200\/70  { color: var(--text-base)   !important; }
.text-emerald-200\/80  { color: var(--text-base)   !important; }
.text-emerald-200\/90  { color: var(--text-strong) !important; }
.text-emerald-300      { color: var(--brand-bright)!important; }
.text-emerald-300\/40  { color: var(--text-muted)  !important; }
.text-emerald-300\/50  { color: var(--text-muted)  !important; }
.text-emerald-300\/60  { color: var(--text-muted)  !important; }
.text-emerald-400      { color: var(--brand-bright)!important; }
.text-red-300          { color: var(--danger-text) !important; }
.hover\:text-white:hover       { color: var(--text-strong)  !important; }
.hover\:text-emerald-400:hover { color: var(--brand-bright) !important; }

/* — Surfaces — */
.bg-emerald-800\/20    { background-color: var(--brand-soft)  !important; }
.bg-emerald-900\/30    { background-color: var(--brand-soft)  !important; }
.bg-emerald-600\/30    { background-color: var(--brand-soft)  !important; }
.bg-emerald-600\/40    { background-color: var(--brand-soft)  !important; }
.bg-white\/5           { background-color: var(--brand-soft)  !important; }
.bg-white\/10          { background-color: var(--brand-soft)  !important; }
.bg-red-500\/20        { background-color: var(--danger-soft) !important; }
.hover\:bg-white\/5:hover        { background-color: var(--brand-soft) !important; }
.hover\:bg-emerald-600\/40:hover { background-color: var(--brand-soft) !important; }

/* — Borders — */
.border-white\/10      { border-color: var(--border)        !important; }
.border-white\/20      { border-color: var(--border-strong) !important; }
.border-emerald-500    { border-color: var(--brand)         !important; }
.border-emerald-500\/30{ border-color: var(--brand-border)  !important; }
.border-emerald-500\/50{ border-color: var(--brand-border)  !important; }
.border-red-500\/30    { border-color: var(--danger-border) !important; }
.border-red-500\/50    { border-color: var(--danger-border) !important; }

/* — Contact page file-input button — */
.file\:bg-emerald-700\/40::file-selector-button            { background-color: var(--brand) !important; }
.file\:text-emerald-200::file-selector-button              { color: #fff !important; }
.hover\:file\:bg-emerald-600\/50:hover::file-selector-button { background-color: var(--brand-bright) !important; }

/* — Image-overlay label must stay light on its dark gradient (both themes) — */
.img-card-overlay .text-white,
.img-card-overlay .text-white\/70,
.img-card-overlay .text-white\/80 { color: #fff !important; }

/* ============================================================
   THEME TOGGLE SWITCH
   ============================================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    outline: none;
}

/* Persistent mobile toggle: hidden by default (desktop uses the one inside
   .desktop-nav); shown only below the navbar-collapse breakpoint above. */
.nav-mobile-theme-toggle { display: none; }

/* Track */
.theme-toggle-track {
    position: relative;
    display: block;
    width: 56px;
    height: 30px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover .theme-toggle-track {
    background: var(--brand-soft);
    border-color: var(--brand-border);
}

[data-theme="light"] .theme-toggle-track {
    background: rgba(31, 92, 67, 0.14);
    border-color: rgba(31, 92, 67, 0.35);
}

/* Thumb */
.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--emerald-400);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(26px);
    background: var(--primary);
}

/* Icons inside thumb */
.theme-toggle-thumb svg {
    color: #fff;
    flex-shrink: 0;
}

/* Moon shown in dark mode, sun shown in light mode */
.theme-icon-sun  { display: none; }
.theme-icon-moon { display: block; }

[data-theme="light"] .theme-icon-sun  { display: block; }
[data-theme="light"] .theme-icon-moon { display: none; }

/* RTL: flip directional arrows to point outward (left) for Arabic */
[dir="rtl"] .rtl-flip-arrow { transform: scaleX(-1); }

/* ============================================================
   VIDEO THUMBNAILS — YouTube-style red play button overlay
   ============================================================ */
.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    cursor: pointer;
    background: #0b1712;
    display: block;
}
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-thumb .yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    pointer-events: none;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    transition: transform 0.15s ease, filter 0.15s ease;
}
.video-thumb .yt-play svg {
    width: 100%;
    height: 100%;
    display: block;
}
.video-thumb:hover .yt-play,
.video-thumb:focus-visible .yt-play {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}
.video-thumb:focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 2px;
}

/* ============================================================
   ADMIN LIGHT MODE — readable overrides
   The public light-mode remap handles text-white / bg-white / bg-emerald-*,
   but the admin uses status badges & stat gradients in green/yellow/red/
   blue/gray that are NOT covered. In light mode those stay light tints and
   become unreadable, so remap them here to dark, high-contrast variants.
   ============================================================ */
[data-theme="light"] .text-green-300,
[data-theme="light"] .text-green-400   { color: #1F7A45 !important; }
[data-theme="light"] .text-yellow-300,
[data-theme="light"] .text-yellow-400  { color: #B7791F !important; }
[data-theme="light"] .text-red-300,
[data-theme="light"] .text-red-400     { color: #C0392B !important; }
[data-theme="light"] .text-blue-300,
[data-theme="light"] .text-blue-400    { color: #2563EB !important; }
[data-theme="light"] .text-gray-300    { color: #4B5563 !important; }
[data-theme="light"] .text-emerald-300\/70 { color: #1F5C43 !important; }
[data-theme="light"] .text-emerald-300\/75 { color: #1F5C43 !important; }
[data-theme="light"] .text-emerald-300\/80 { color: #143C2C !important; }
[data-theme="light"] .text-emerald-300\/85 { color: #143C2C !important; }
[data-theme="light"] .text-emerald-300\/90 { color: #0F2E22 !important; }

[data-theme="light"] .bg-green-500\/20   { background-color: rgba(31, 122, 69, 0.14)  !important; }
[data-theme="light"] .bg-yellow-500\/20  { background-color: rgba(183, 121, 31, 0.16) !important; }
[data-theme="light"] .bg-red-500\/20     { background-color: rgba(192, 57, 43, 0.14)  !important; }
[data-theme="light"] .bg-blue-500\/20    { background-color: rgba(37, 99, 235, 0.12)  !important; }
[data-theme="light"] .bg-gray-500\/20    { background-color: rgba(75, 85, 99, 0.14)   !important; }

[data-theme="light"] .border-green-500\/30 { border-color: rgba(31, 122, 69, 0.35)  !important; }
[data-theme="light"] .border-red-500\/30   { border-color: rgba(192, 57, 43, 0.35)  !important; }
[data-theme="light"] .border-red-500\/50   { border-color: rgba(192, 57, 43, 0.45)  !important; }

/* Stat card brand gradients — keep them vivid but readable on light paper */
[data-theme="light"] .from-emerald-500.to-green-600 { background-image: linear-gradient(135deg, #1F7A45, #2E9E5B) !important; }
[data-theme="light"] .from-blue-500.to-cyan-600     { background-image: linear-gradient(135deg, #2563EB, #0891B2) !important; }
[data-theme="light"] .from-purple-500.to-violet-600 { background-image: linear-gradient(135deg, #7C3AED, #6D28D9) !important; }
[data-theme="light"] .from-amber-500.to-orange-600  { background-image: linear-gradient(135deg, #D97706, #EA580C) !important; }
[data-theme="light"] .from-pink-500.to-rose-600     { background-image: linear-gradient(135deg, #DB2777, #E11D48) !important; }
[data-theme="light"] .from-red-500.to-pink-600      { background-image: linear-gradient(135deg, #DC2626, #DB2777) !important; }

/* Form inputs: ensure legible text + visible borders in light mode */
[data-theme="light"] .form-input {
    background-color: #FFFFFF !important;
    color: #14261E !important;
    border: 1px solid rgba(20, 52, 42, 0.18) !important;
}
[data-theme="light"] .form-input::placeholder { color: #7C8C81 !important; }
[data-theme="light"] .form-input:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(31, 92, 67, 0.15) !important;
}

/* Sidebar / header borders read as hairlines on light paper */
[data-theme="light"] .border-white\/10 { border-color: rgba(20, 52, 42, 0.10) !important; }
[data-theme="light"] .border-white\/20 { border-color: rgba(20, 52, 42, 0.16) !important; }

/* Tables: row hover + divider stay subtle on light */
[data-theme="light"] .hover\:bg-white\/5:hover { background-color: rgba(31, 92, 67, 0.10) !important; }

/* Sidebar bottom nav (View site / Logout) & header logout icon: visible in light mode */
[data-theme="light"] .text-white\/50 { color: var(--text-muted) !important; }

/* Language dropdown: light surface instead of dark gray */
[data-theme="light"] .bg-gray-900\/95 { background-color: var(--surface-2) !important; }

/* Header logout icon: muted red default, neon red glow on hover in both modes */
.logout-icon-btn {
    color: rgba(200, 80, 80, 0.65) !important;
    transition: color 0.2s ease, filter 0.2s ease !important;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.logout-icon-btn:hover {
    color: #ff4444 !important;
    filter: drop-shadow(0 0 6px rgba(255, 60, 60, 0.55)) drop-shadow(0 0 14px rgba(255, 60, 60, 0.25));
}
.logout-icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ============================================================
   GALLERY ITEM — cover frame + action buttons
   ============================================================ */
.gallery-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2.5px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(255, 255, 255, 0.04);
}
.gallery-item.is-cover {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981, 0 4px 16px rgba(16, 185, 129, 0.25);
}
.gallery-item-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}
.gallery-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-item-badge {
    display: none;
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}
.gallery-item.is-cover .gallery-item-badge {
    display: block;
}
.gallery-item-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.2);
}
.gallery-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
    font-family: inherit;
    text-decoration: none;
}
.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.gallery-btn-cover.is-active,
.gallery-btn-cover:hover {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.1);
}
.gallery-btn-delete:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
}
.gallery-btn-retry {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    background: rgba(251, 191, 36, 0.12) !important;
    font-size: 0.75rem !important;
    padding: 4px 14px !important;
}
.gallery-btn-retry:hover {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    background: rgba(251, 191, 36, 0.2) !important;
}
[data-theme="light"] .gallery-btn-retry {
    color: #d97706 !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
    background: rgba(217, 119, 6, 0.08) !important;
}
[data-theme="light"] .gallery-btn-retry:hover {
    color: #b45309 !important;
    border-color: rgba(180, 83, 9, 0.4) !important;
    background: rgba(217, 119, 6, 0.15) !important;
}
.gallery-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}
.gallery-item.marked-for-delete {
    opacity: 0.5;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444, 0 4px 16px rgba(239, 68, 68, 0.2) !important;
}
.gallery-item.marked-for-delete .gallery-item-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 0.5rem;
    pointer-events: none;
}
.gallery-item-delete-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}
.gallery-item.marked-for-delete .gallery-item-delete-badge {
    display: block;
}
.gallery-btn-restore {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    background: rgba(251, 191, 36, 0.1) !important;
}
.gallery-btn-restore:hover {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    background: rgba(251, 191, 36, 0.2) !important;
}
/* Light-mode overrides for gallery items */
[data-theme="light"] .gallery-item {
    background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .gallery-item.is-cover {
    border-color: #059669;
    box-shadow: 0 0 0 1px #059669, 0 4px 16px rgba(5, 150, 105, 0.2);
}
[data-theme="light"] .gallery-item-badge {
    background: rgba(5, 150, 105, 0.92);
}
[data-theme="light"] .gallery-item-actions {
    background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .gallery-btn {
    color: rgba(0, 0, 0, 0.55);
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .gallery-btn:hover {
    background: #fff;
    color: rgba(0, 0, 0, 0.8);
}
[data-theme="light"] .gallery-btn-cover.is-active,
[data-theme="light"] .gallery-btn-cover:hover {
    color: #059669;
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(5, 150, 105, 0.08);
}
[data-theme="light"] .gallery-btn-delete:hover {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
}

/* ============================================================
   CUSTOM FILE INPUT — hides browser-native "No file chosen" text
   ============================================================ */
.file-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.file-input-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
}
.file-input-btn:hover {
    background: rgba(5, 150, 105, 0.3);
}
.file-input-btn input[type="file"] {
    display: none;
}
.file-input-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
[data-theme="light"] .file-input-btn {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.2);
}
[data-theme="light"] .file-input-btn:hover {
    background: rgba(5, 150, 105, 0.15);
}
[data-theme="light"] .file-input-name {
    color: rgba(0, 0, 0, 0.4);
}

/* ============================================================
   ADMIN RESPONSIVE FIXES
   ============================================================ */

/* Mobile: sidebar becomes an off-canvas overlay */
@media (max-width: 1023px) {
    #adminSidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 45;
        width: 280px;
    }
    #adminSidebar.-translate-x-full {
        transform: translateX(-100%);
    }
    /* RTL: sidebar on the right, hidden to the right */
    [dir="rtl"] #adminSidebar {
        left: auto;
        right: 0;
    }
    [dir="rtl"] #adminSidebar.-translate-x-full {
        transform: translateX(100%);
    }
    /* Main content fills full width when sidebar is off-screen */
    .relative.z-10.flex.h-screen > .flex-1 {
        width: 100%;
    }
}

/* Desktop: sidebar is inline flex child */
@media (min-width: 1024px) {
    #adminSidebar {
        position: static !important;
        transform: translateX(0) !important;
    }
}

/* Pill bar: stronger background so content doesn't show through on scroll */
header.fixed.top-4.left-2.right-2.z-50 > div > div {
    background: rgba(11, 23, 18, 0.82) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}
[data-theme="light"] header.fixed.top-4.left-2.right-2.z-50 > div > div {
    background: rgba(245, 245, 240, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}
