/**
 * Kayan Smart — main stylesheet (v1.2)
 *
 * Fixes in this revision:
 *  - Hard horizontal overflow guards on html/body (no more side-scroll on mobile).
 *  - Language separation: Arabic uses Cairo, Latin uses Inter (no inheritance bleed).
 *  - Alternating section backgrounds (white ↔ blue) for a more dynamic feel.
 *  - Hero scroll indicator absolutely contained inside .hero only.
 *  - Floating WhatsApp bar guaranteed-visible above all content.
 *  - Counter and animations now actually trigger.
 *  - Single post / archive pages get proper readable spacing.
 */

/* ================================================================
 *  CSS Variables
 * ================================================================ */
:root {
    /* === Brand palette (unchanged) === */
    --ks-primary:   #1a3a6e;   /* deep navy — used for buttons, footer, icons */
    --ks-secondary: #2c5fa0;   /* hover / accent navy */
    --ks-accent:    #3b82d9;   /* highlight blue — links, current page */

    /* === Backgrounds — now LIGHT THEME globally ===
       The site used to be a dark theme with `.section-light` islands.
       It's now inverted: the page is white by default, and the navy
       palette appears on buttons, the footer, accent shapes, and icons.
       `--ks-bg-dark` / `--ks-bg-medium` are kept but repurposed for the
       remaining dark surfaces (footer, hero overlay, video section). */
    --ks-bg-dark:        #0e1c33;   /* footer + dark hero overlay */
    --ks-bg-medium:      #15264a;   /* deep navy variants */
    --ks-bg-light:       #ffffff;   /* page background */
    --ks-bg-light-soft:  #f6f9ff;   /* alternating soft section bg */
    --ks-bg-page:        #ffffff;   /* default page bg used by body */

    /* === Text === */
    --ks-text-on-dark:    #f1f5fb;  /* used inside dark surfaces (footer, hero) */
    --ks-text-on-light:   #15203a;  /* primary body text on white */
    --ks-text-dim:        #6a7794;  /* secondary text on white */
    --ks-text-dim-light:  #5a6680;  /* (kept for back-compat) */

    /* === Borders === */
    --ks-border:        rgba(26, 58, 110, 0.12);  /* navy-tinted border on white */
    --ks-border-light:  rgba(26, 58, 110, 0.1);
    --ks-border-dark:   rgba(255, 255, 255, 0.1); /* border on dark surfaces */

    --ks-radius:      20px;
    --ks-radius-sm:   12px;
    --ks-radius-pill: 999px;
    --ks-transition:  cubic-bezier(0.4, 0, 0.2, 1);
    --ks-shadow:        0 12px 40px rgba(26, 58, 110, 0.12);
    --ks-shadow-light:  0 8px 32px rgba(26, 58, 110, 0.08);
    --ks-shadow-soft:   0 6px 24px rgba(59, 130, 217, 0.18);

    --ks-font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
    --ks-font-en: 'Inter', system-ui, -apple-system, sans-serif;
    --ks-container: 1280px;
    --ks-container-narrow: 820px;
}

/* ================================================================
 *  Reset + Critical overflow guards
 * ================================================================ */
* { box-sizing: border-box; }

/* These two lines are the most important guard against the "site goes
   outside the screen" issue: regardless of any rogue child, the document
   itself can never scroll horizontally. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

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

body {
    margin: 0;
    font-family: var(--ks-font-ar);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ks-text-on-light);
    background: var(--ks-bg-page);
    -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; height: auto; display: block; }

/* ================================================================
 *  LANGUAGE SEPARATION — Arabic vs Latin character isolation
 *
 *  Problem (v1.1): Arabic body inherited Cairo into Latin children
 *  (or vice-versa), making English appear inside Arabic-shaped glyphs.
 *  Fix: lock fonts at the language level.
 * ================================================================ */

/* When the document is Arabic, only Arabic glyphs are rendered with Cairo;
   any inline Latin span explicitly opts back into Inter. */
html[lang^="ar"] body { font-family: var(--ks-font-ar); }
html[lang^="ar"] :lang(en),
html[lang^="ar"] [lang^="en"],
.text-en, .ks-en {
    font-family: var(--ks-font-en);
    direction: ltr;
    unicode-bidi: isolate;
}

html[lang^="en"] body { font-family: var(--ks-font-en); }
html[lang^="en"] :lang(ar),
html[lang^="en"] [lang^="ar"],
.text-ar, .ks-ar {
    font-family: var(--ks-font-ar);
    direction: rtl;
    unicode-bidi: isolate;
}

/* Numeric content (phone numbers, emails, URLs) should always render
   in LTR Inter — never in Arabic glyphs. We mark these explicitly
   instead of styling every <a href="tel:"> because that would also
   reverse the Arabic LABEL of buttons that happen to be tel: links
   (e.g. "اتصل بنا" → "انب لصتا"). */
.contact-card-value,
.ks-en-num,
a.tel-number,
a.email-link {
    font-family: var(--ks-font-en);
    direction: ltr;
    unicode-bidi: isolate-override;
    display: inline-block;
}

/* Headings */
h1, h2, h3, h4, h5 {
    font-family: inherit;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 .5em;
}
p { margin: 0 0 1rem; }

a { color: var(--ks-secondary); text-decoration: none; transition: color .2s var(--ks-transition); }
a:hover { color: var(--ks-accent); }

/* Container */
.container {
    width: 100%;
    max-width: var(--ks-container);
    margin: 0 auto;
    padding: 0 24px;
}
.container.narrow { max-width: var(--ks-container-narrow); }

@media (max-width: 640px) {
    .container { padding: 0 16px; }
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.skip-link:focus {
    position: fixed;
    top: 8px; left: 8px;
    z-index: 999;
    padding: 8px 16px;
    background: var(--ks-primary);
    color: #fff;
    border-radius: 8px;
    width: auto; height: auto;
    clip: auto;
}

/* ================================================================
 *  Buttons
 * ================================================================ */
.ks-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--ks-radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .25s var(--ks-transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.ks-btn-primary {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    color: #fff;
    box-shadow: var(--ks-shadow-soft);
}
.ks-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(59, 130, 217, 0.35);
    color: #fff;
}
.ks-btn-ghost {
    background: transparent;
    color: var(--ks-primary);
    border-color: var(--ks-primary);
}
.ks-btn-ghost:hover {
    background: var(--ks-primary);
    color: #fff;
    border-color: var(--ks-primary);
}
/* Dark-section variant: white text on transparent for hero/footer/video */
.section-dark .ks-btn-ghost,
.hero .ks-btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
.section-dark .ks-btn-ghost:hover,
.hero .ks-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: #fff;
}

/* ================================================================
 *  HEADER
 * ================================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    transition: all .3s var(--ks-transition);
    background: transparent;
}

/* When the page has scrolled past the hero, the whole header gains a
   light frosted bar so it stays visible against light page content. */
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ks-border);
    box-shadow: 0 4px 20px rgba(26, 58, 110, 0.08);
}

/* The inner pill — sits inside the (transparent) header.
   AT REST (not scrolled): semi-transparent dark pill that blends with
   the dark hero behind it — looks like a glass control floating over
   the hero, not a separate white strip.
   ON SCROLL: switches to the bright white pill we want on light pages. */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(13, 27, 51, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ks-radius-pill);
    padding: 8px 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    transition: all .3s var(--ks-transition);
}

/* After scrolling, swap the pill to its light variant. */
.site-header.is-scrolled .header-inner {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--ks-border);
    box-shadow: 0 6px 24px rgba(26, 58, 110, 0.06);
}

/* === Header in two color states ===
   At-rest header sits over the dark hero → menu links must be WHITE.
   On scroll the header is light → menu links must be NAVY. */
/* === Header in two color states ===
   At-rest header sits over the dark hero → top-level menu links must be WHITE.
   On scroll the header is light → top-level menu links must be NAVY.

   IMPORTANT: We must scope these rules to TOP-LEVEL items only via
   `.primary-menu > li > a` (direct child combinator). Without that, the
   selector would also paint links inside the Services mega panel white,
   which would make them invisible on the panel's white background. */
@media (min-width: 992px) {
    .site-header:not(.is-scrolled) .primary-menu > li > a {
        color: rgba(255, 255, 255, 0.92);
    }
    .site-header:not(.is-scrolled) .primary-menu > li > a:hover,
    .site-header:not(.is-scrolled) .primary-menu > .current-menu-item > a,
    .site-header:not(.is-scrolled) .primary-menu > .menu-item-has-children:hover > a {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }
}

/* Mobile hamburger lines: white at rest (on dark hero), navy when scrolled */
.site-header:not(.is-scrolled) .mobile-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.site-header:not(.is-scrolled) .mobile-toggle .mobile-toggle-bar {
    background: #fff;
}

/* Lang switcher at rest (on dark hero): text only, no surrounding box */
.site-header:not(.is-scrolled) .lang-switcher ul {
    background: transparent;
}
.site-header:not(.is-scrolled) .lang-switcher a {
    color: rgba(255, 255, 255, 0.75);
}
.site-header:not(.is-scrolled) .lang-switcher a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}
.site-header:not(.is-scrolled) .lang-switcher li.active a,
.site-header:not(.is-scrolled) .lang-switcher li.current-lang a {
    background: var(--ks-secondary);
    color: #fff;
}

.site-branding { flex-shrink: 0; padding: 4px 8px; }
.custom-logo, .site-branding img { max-height: 42px; width: auto; display: block; }

.main-nav { display: none; }
@media (min-width: 992px) {
    .main-nav { display: block; flex: 1; }
    .primary-menu {
        display: flex;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
        justify-content: center;
        align-items: center;
    }
    .primary-menu > li { position: relative; }
    /* IMPORTANT: scope to top-level only via `> li > a`.
       Applying to all descendants would override .services-multi-flyout-list a
       and turn mega-panel links into pill-shaped no-wrap items. */
    .primary-menu > li > a {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 8px 14px;
        color: var(--ks-primary);
        font-weight: 600;
        font-size: 14.5px;
        border-radius: var(--ks-radius-pill);
        transition: all .2s var(--ks-transition);
        white-space: nowrap;
    }
    .primary-menu > li > a:hover,
    .primary-menu > .current-menu-item > a,
    .primary-menu > .current_page_item > a,
    .primary-menu > .menu-item-has-children:hover > a {
        background: rgba(26, 58, 110, 0.08);
        color: var(--ks-primary);
    }

    /* Submenu (dropdown) — used for the Services parent → service-list */
    .primary-menu .sub-menu,
    .primary-menu .children {
        position: absolute;
        top: 100%;
        inset-inline-start: 50%;
        transform: translateX(-50%) translateY(8px);
        min-width: 240px;
        background: #fff;
        border: 1px solid var(--ks-border);
        border-radius: var(--ks-radius-sm);
        box-shadow: 0 14px 40px rgba(26, 58, 110, 0.15);
        padding: 8px;
        margin: 8px 0 0;
        list-style: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s var(--ks-transition), transform .2s var(--ks-transition), visibility 0s linear .2s;
    }
    html[dir="rtl"] .primary-menu .sub-menu,
    html[dir="rtl"] .primary-menu .children { transform: translateX(50%) translateY(8px); }

    .primary-menu li:hover > .sub-menu,
    .primary-menu li:hover > .children,
    .primary-menu li:focus-within > .sub-menu,
    .primary-menu li:focus-within > .children {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
        /* visibility flips instantly on show so the panel is interactable
           the moment it appears; on hide it stays visible during the
           opacity fade so the cursor can move into it without flicker. */
        transition: opacity .2s var(--ks-transition), transform .2s var(--ks-transition);
    }
    html[dir="rtl"] .primary-menu li:hover > .sub-menu,
    html[dir="rtl"] .primary-menu li:hover > .children {
        transform: translateX(50%) translateY(0);
    }
    .primary-menu .sub-menu li,
    .primary-menu .children li { width: 100%; }
    .primary-menu .sub-menu a,
    .primary-menu .children a {
        display: block;
        padding: 10px 14px;
        font-size: 14px;
        font-weight: 600;
        color: var(--ks-text-on-light);
        border-radius: 8px;
        white-space: normal;
    }
    .primary-menu .sub-menu a:hover,
    .primary-menu .children a:hover {
        background: linear-gradient(135deg, rgba(59, 130, 217, 0.1), rgba(26, 58, 110, 0.06));
        color: var(--ks-primary);
    }

    /* === MULTI-LEVEL DROPDOWN — categories first, fly-out for services ===
     *
     * Hover "Services" → panel of categories slides down.
     * Hover any category row → its services slide out beside it.
     *
     * Key technique: invisible "bridge" pseudo-elements between
     * trigger ↔ panel and category ↔ fly-out so the cursor never falls
     * into a gap. Also delayed visibility hide (.2s) so cursor can
     * leave one zone and enter the other. */

    /* Close the cursor gap between the Services trigger and the panel. */
    .primary-menu .has-multi::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 16px;
    }

    .primary-menu .services-multi {
        position: absolute;
        top: 100%;
        inset-inline-start: 50%;
        transform: translateX(-50%) translateY(6px);
        min-width: 320px;
        max-width: 380px;
        background: #fff;
        border: 1px solid var(--ks-border);
        border-radius: var(--ks-radius-sm);
        box-shadow: 0 18px 50px rgba(26, 58, 110, 0.18);
        padding: 12px;
        margin-top: 16px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s var(--ks-transition),
                    transform .2s var(--ks-transition),
                    visibility 0s linear .2s;
        z-index: 60;
    }
    html[dir="rtl"] .primary-menu .services-multi {
        transform: translateX(50%) translateY(6px);
    }
    .primary-menu .has-multi:hover > .services-multi,
    .primary-menu .has-multi:focus-within > .services-multi {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
        transition: opacity .2s var(--ks-transition),
                    transform .2s var(--ks-transition);
    }
    html[dir="rtl"] .primary-menu .has-multi:hover > .services-multi,
    html[dir="rtl"] .primary-menu .has-multi:focus-within > .services-multi {
        transform: translateX(50%) translateY(0);
    }

    /* Category list (rows) */
    .services-multi-cats {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .services-multi-cat { position: relative; }

    .services-multi-cat-trigger {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        background: transparent;
        border: 0;
        border-radius: 8px;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--ks-text-on-light);
        text-align: start;
        line-height: 1.3;
        cursor: pointer;
        transition: all .15s var(--ks-transition);
    }
    .services-multi-cat-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 7px;
        background: linear-gradient(135deg, rgba(26, 58, 110, 0.08), rgba(59, 130, 217, 0.12));
        color: var(--ks-secondary);
        flex-shrink: 0;
        transition: all .15s;
    }
    .services-multi-cat-name { flex: 1; }
    .services-multi-cat-count {
        flex-shrink: 0;
        min-width: 24px;
        height: 20px;
        padding: 0 7px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(26, 58, 110, 0.08);
        color: var(--ks-text-dim);
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        font-family: var(--ks-font-en);
    }
    .services-multi-cat-arrow {
        flex-shrink: 0;
        width: 7px; height: 7px;
        border-top: 2px solid var(--ks-text-dim);
        border-inline-end: 2px solid var(--ks-text-dim);
        transform: rotate(45deg);
        transition: all .2s;
        opacity: 0.5;
    }
    html[dir="rtl"] .services-multi-cat-arrow { transform: rotate(-135deg); }

    /* Hovering a category row → highlight + show its fly-out */
    .services-multi-cat:hover > .services-multi-cat-trigger,
    .services-multi-cat:focus-within > .services-multi-cat-trigger {
        background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
        color: #fff;
    }
    .services-multi-cat:hover > .services-multi-cat-trigger .services-multi-cat-icon,
    .services-multi-cat:focus-within > .services-multi-cat-trigger .services-multi-cat-icon {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    .services-multi-cat:hover > .services-multi-cat-trigger .services-multi-cat-count,
    .services-multi-cat:focus-within > .services-multi-cat-trigger .services-multi-cat-count {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    .services-multi-cat:hover > .services-multi-cat-trigger .services-multi-cat-arrow,
    .services-multi-cat:focus-within > .services-multi-cat-trigger .services-multi-cat-arrow {
        opacity: 1;
        border-color: #fff;
    }

    /* Fly-out: services for the hovered category */
    .services-multi-flyout {
        position: absolute;
        top: -12px;
        inset-inline-start: 100%;
        min-width: 280px;
        max-width: 340px;
        background: #fff;
        border: 1px solid var(--ks-border);
        border-radius: var(--ks-radius-sm);
        box-shadow: 0 18px 50px rgba(26, 58, 110, 0.18);
        padding: 14px;
        margin-inline-start: 12px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-6px);
        transition: opacity .2s var(--ks-transition),
                    transform .2s var(--ks-transition),
                    visibility 0s linear .2s;
        z-index: 70;
    }
    html[dir="rtl"] .services-multi-flyout {
        transform: translateX(6px);
    }
    /* Invisible bridge between category row and its fly-out */
    .services-multi-flyout::before {
        content: '';
        position: absolute;
        top: 0; bottom: 0;
        inset-inline-start: -14px;
        width: 14px;
    }
    .services-multi-cat:hover > .services-multi-flyout,
    .services-multi-cat:focus-within > .services-multi-flyout {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
        transition: opacity .2s var(--ks-transition),
                    transform .2s var(--ks-transition);
    }

    .services-multi-flyout-head {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 4px 10px;
        margin-bottom: 8px;
        border-bottom: 1px solid rgba(26, 58, 110, 0.1);
    }
    .services-multi-flyout-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 7px;
        background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
        color: #fff;
    }
    .services-multi-flyout-title {
        font-size: 13px;
        font-weight: 800;
        color: var(--ks-primary);
    }
    .services-multi-flyout-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
        max-height: 420px;
        overflow-y: auto;
    }
    .services-multi-flyout-list a {
        display: block;
        padding: 9px 12px;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--ks-text-on-light);
        border-radius: 7px;
        white-space: normal;
        line-height: 1.45;
        text-decoration: none;
        transition: all .15s;
    }
    .services-multi-flyout-list a:hover {
        background: rgba(59, 130, 217, 0.1);
        color: var(--ks-primary);
        padding-inline-start: 16px;
    }

    .services-multi-footer {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(26, 58, 110, 0.08);
        text-align: center;
    }
    .services-multi-cta {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 22px;
        background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
        color: #fff !important;
        border-radius: var(--ks-radius-pill);
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        transition: all .2s;
    }
    .services-multi-cta:hover {
        background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(59, 130, 217, 0.3);
    }

    /* === FLAT submenu (when no categories exist yet) — bridge the gap === */
    .primary-menu .menu-item-has-children:not(.has-multi)::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 16px;
    }
    .primary-menu .menu-item-has-children > .sub-menu {
        margin-top: 16px;
    }

    /* Caret indicator on the parent item */
    .primary-menu .menu-item-has-children > a::after,
    .primary-menu .has-children > a::after {
        content: '';
        display: inline-block;
        width: 6px; height: 6px;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg);
        margin-inline-start: 4px;
        margin-top: -3px;
        opacity: 0.6;
    }
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-cta {
    font-size: 13px;
    padding: 10px 18px;
    display: none;
}
@media (min-width: 992px) { .header-cta { display: inline-flex; } }

/* Language switcher — Latin chars (AR/EN), Inter font.
   No surrounding box: only the active language gets a pill highlight. */
.lang-switcher ul {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: var(--ks-radius-pill);
    font-family: var(--ks-font-en);
}
.lang-switcher a {
    display: block;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ks-text-dim);
    border-radius: var(--ks-radius-pill);
    transition: all .2s var(--ks-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lang-switcher a:hover {
    color: var(--ks-primary);
    background: rgba(26, 58, 110, 0.08);
}
.lang-switcher li.active a,
.lang-switcher li.current-lang a {
    background: var(--ks-secondary);
    color: #fff;
}

/* Mobile hamburger */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    padding: 0 12px;
    background: rgba(26, 58, 110, 0.06);
    border: 1px solid var(--ks-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all .25s var(--ks-transition);
}
.mobile-toggle:hover { background: rgba(26, 58, 110, 0.12); }
.mobile-toggle-bar {
    display: block;
    width: 18px; height: 2px;
    background: var(--ks-primary);
    border-radius: 2px;
    transition: all .25s var(--ks-transition);
}
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 992px) { .mobile-toggle { display: none; } }

/* ================================================================
 *  MOBILE DRAWER
 * ================================================================ */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    visibility: hidden;
}
.mobile-drawer.is-open { pointer-events: auto; visibility: visible; }
.mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .35s var(--ks-transition);
}
.mobile-drawer.is-open .mobile-drawer-backdrop { opacity: 1; }

.mobile-drawer-panel {
    position: absolute;
    top: 0; bottom: 0;
    width: 86%;
    max-width: 380px;
    /* Subtle vertical gradient with a glow on top — kept on dark navy
       on purpose: a navy drawer reads as premium against the white site
       behind it (rather than a flat white drawer disappearing into the page). */
    background:
        radial-gradient(circle at 50% -10%, rgba(59, 130, 217, 0.18), transparent 50%),
        linear-gradient(180deg, var(--ks-bg-medium) 0%, var(--ks-bg-dark) 100%);
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    transition: transform .45s var(--ks-transition);
    overflow-y: auto;
    overflow-x: hidden;
}
/* RTL: drawer slides in from the right; LTR: same direction visually
   (mobile-first design) */
html[dir="rtl"] .mobile-drawer-panel,
body.is-rtl .mobile-drawer-panel { right: 0; transform: translateX(100%); border-left: 1px solid var(--ks-border-dark); }
html[dir="ltr"] .mobile-drawer-panel,
body:not(.is-rtl) .mobile-drawer-panel { right: 0; transform: translateX(100%); border-left: 1px solid var(--ks-border-dark); }
.mobile-drawer.is-open .mobile-drawer-panel { transform: translateX(0); }

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--ks-border-dark);
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 2;
}
.mobile-drawer-head img { max-height: 38px; }

.mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--ks-border-dark);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all .2s var(--ks-transition);
}
.mobile-drawer-close:hover {
    background: rgba(231, 76, 94, 0.2);
    border-color: rgba(231, 76, 94, 0.4);
    transform: rotate(90deg);
}

.mobile-drawer-nav {
    flex: 1;
    padding: 28px 22px;
    /* Subtle radial glow behind the menu items for depth */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 217, 0.06), transparent 70%);
}
.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mobile-menu li { position: relative; }

/* Each menu item: glass-card with a soft gradient, an icon on the start
   edge, an animated arrow, and a glow-on-hover that gives the menu a
   premium feel. Numbers were replaced with proper category icons. */
.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ks-text-on-dark);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--ks-border);
    border-radius: 16px;
    transition: all .35s var(--ks-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
}

/* Inline SVG icon at the start — small chip with accent background */
.mobile-menu > li > a > svg {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.18), rgba(91, 168, 232, 0.08));
    border: 1px solid rgba(91, 168, 232, 0.25);
    color: var(--ks-accent);
    transition: all .3s var(--ks-transition);
}

.mobile-menu > li > a > span {
    flex: 1;
}

/* Arrow indicator at the end edge */
.mobile-menu > li > a::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--ks-text-dim);
    border-inline-end: 2px solid var(--ks-text-dim);
    transform: rotate(45deg);
    flex-shrink: 0;
    transition: all .25s var(--ks-transition);
    opacity: 0.5;
}
html[dir="rtl"] .mobile-menu > li > a::after,
body.is-rtl .mobile-menu > li > a::after { transform: rotate(-135deg); }

/* Hover / active state — gradient glow + brighter icon */
.mobile-menu > li > a:hover,
.mobile-menu .current-menu-item > a {
    background:
        linear-gradient(135deg, rgba(59, 130, 217, 0.22), rgba(91, 168, 232, 0.06));
    border-color: rgba(91, 168, 232, 0.45);
    color: #fff;
    box-shadow: 0 8px 28px rgba(59, 130, 217, 0.2);
}
.mobile-menu > li > a:hover > svg,
.mobile-menu .current-menu-item > a > svg {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    border-color: transparent;
    color: #fff;
    transform: scale(1.05);
}
.mobile-menu > li > a:hover::after,
.mobile-menu .current-menu-item > a::after {
    opacity: 1;
    border-color: #fff;
}

/* ===== Services Block + Category Accordion (mobile) =====
 *
 * The Services entry on mobile is a container `<li class="mobile-services-block">`
 * with two parts:
 *   1. A clickable title bar `.mobile-services-block-title` (links to the
 *      services archive — matches other top-level items visually).
 *   2. An accordion `.mobile-accordion` with one collapsible item per
 *      service_category. Items start closed; tapping the trigger expands
 *      just that category.
 * ===== */
.mobile-services-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mobile-services-block-title {
    /* Works as both <a> and <button> — reset button defaults so it looks identical. */
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--ks-text-on-dark);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--ks-border);
    border-radius: 16px;
    text-decoration: none;
    text-align: start;
    cursor: pointer;
    transition: all .25s var(--ks-transition);
}
.mobile-services-block-title > svg {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    color: #fff;
}
.mobile-services-block-title > span:not(.mobile-services-chevron) {
    flex: 1;
}
.mobile-services-block-title:hover {
    background:
        linear-gradient(135deg, rgba(59, 130, 217, 0.22), rgba(91, 168, 232, 0.06));
    border-color: rgba(91, 168, 232, 0.45);
    color: #fff;
}

/* Chevron at the end — rotates 180° when the panel is open. */
.mobile-services-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ks-text-dim);
    border-bottom: 2px solid var(--ks-text-dim);
    transform: rotate(45deg);
    transition: transform .25s var(--ks-transition), border-color .25s;
    margin-inline-start: auto;
    opacity: 0.7;
}
.mobile-services-block-title[aria-expanded="true"] .mobile-services-chevron {
    transform: rotate(-135deg);
    border-color: #fff;
    opacity: 1;
}
.mobile-services-block-title[aria-expanded="true"] {
    background:
        linear-gradient(135deg, rgba(59, 130, 217, 0.25), rgba(91, 168, 232, 0.08));
    border-color: rgba(91, 168, 232, 0.55);
    color: #fff;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Footer inside the Services panel: "View all services" CTA */
.mobile-services-footer {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(91, 168, 232, 0.18);
}
.mobile-services-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    color: #fff !important;
    border-radius: var(--ks-radius-pill);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s var(--ks-transition);
    box-shadow: 0 6px 16px rgba(59, 130, 217, 0.25);
}
.mobile-services-all-link:hover {
    background: linear-gradient(135deg, var(--ks-accent), var(--ks-secondary));
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(59, 130, 217, 0.35);
}

/* Flat-mode list (no categories) — render services directly without the
   accordion item shell. */
.mobile-accordion--flat .mobile-accordion-list {
    display: flex !important;
}

/* The accordion sits BELOW the Services title bar and is visually
   indented + smaller so the hierarchy is obvious — categories read
   as children of "Services", not siblings of "Home/About/Projects". */
.mobile-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 0;
    margin-inline-start: 14px;        /* indent under parent */
    padding-inline-start: 12px;
    border-inline-start: 2px solid rgba(91, 168, 232, 0.18);
}
/* CRITICAL: the HTML `hidden` attribute is `display: none` from the
   user-agent stylesheet, but our `display: flex` rules above and on
   `.mobile-accordion-list` override it. Without this rule the panels
   are visible on first page load even when aria-expanded="false". */
.mobile-accordion[hidden],
.mobile-accordion-list[hidden],
.mobile-services-block [hidden] {
    display: none !important;
}

.mobile-accordion-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 11px;
    overflow: hidden;
    transition: border-color .2s, background .2s;
}
.mobile-accordion-item:has(.mobile-accordion-trigger[aria-expanded="true"]),
.mobile-accordion-item.is-open {
    background: rgba(59, 130, 217, 0.06);
    border-color: rgba(91, 168, 232, 0.35);
}

.mobile-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;                /* slightly smaller than top-level */
    background: transparent;
    border: 0;
    color: var(--ks-text-on-dark);
    cursor: pointer;
    font: inherit;
    text-align: start;
}
.mobile-accordion-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(91, 168, 232, 0.15);
    color: var(--ks-accent);
}
.mobile-accordion-icon svg { width: 18px; height: 18px; }
.mobile-accordion-name {
    flex: 1;
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1.3;
}
.mobile-accordion-count {
    flex-shrink: 0;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ks-text-dim);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--ks-font-en);
}
.mobile-accordion-chevron {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ks-text-dim);
    border-bottom: 2px solid var(--ks-text-dim);
    transform: rotate(45deg);
    transition: transform .25s var(--ks-transition);
    margin-inline-start: 4px;
}
/* Rotate chevron when section is open */
.mobile-accordion-trigger[aria-expanded="true"] .mobile-accordion-chevron {
    transform: rotate(-135deg);
}
.mobile-accordion-trigger[aria-expanded="true"] .mobile-accordion-icon {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    color: #fff;
}
.mobile-accordion-trigger[aria-expanded="true"] .mobile-accordion-name {
    color: #fff;
}

.mobile-accordion-list {
    list-style: none;
    margin: 0;
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(91, 168, 232, 0.15);
}
.mobile-accordion-list[hidden] { display: none; }
.mobile-accordion-list a {
    display: block;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all .2s var(--ks-transition);
    text-decoration: none;
}
.mobile-accordion-list a:hover,
.mobile-accordion-list a:focus {
    background: rgba(91, 168, 232, 0.18);
    border-color: rgba(91, 168, 232, 0.35);
    color: #fff;
}

.mobile-drawer-foot {
    padding: 24px 22px;
    border-top: 1px solid var(--ks-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}
.mobile-drawer-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
}
.mobile-drawer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 14px;
    color: var(--ks-accent);
    font-weight: 700;
    background: rgba(91, 168, 232, 0.08);
    border: 1px solid rgba(91, 168, 232, 0.25);
    border-radius: 14px;
    font-family: var(--ks-font-en);
    direction: ltr;
    transition: all .25s;
}
.mobile-drawer-contact:hover {
    background: rgba(91, 168, 232, 0.18);
    color: #fff;
}

/* === Kayan Profile button — mobile drawer + desktop header === */
.mobile-drawer-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 14px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    transition: all .25s;
    text-decoration: none;
}
.mobile-drawer-profile:hover {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(59, 130, 217, 0.3);
}
.mobile-drawer-profile svg { flex-shrink: 0; }

/* Desktop header version — pill style, smaller */
.header-profile-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ks-primary);
    background: transparent;
    border: 1.5px solid var(--ks-primary);
    border-radius: var(--ks-radius-pill);
    transition: all .25s var(--ks-transition);
    text-decoration: none;
}
.header-profile-btn:hover {
    background: var(--ks-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 58, 110, 0.25);
}
@media (min-width: 992px) {
    .header-profile-btn { display: inline-flex; }
}
/* When header is over dark hero, switch profile button to white */
.site-header:not(.is-scrolled) .header-profile-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}
.site-header:not(.is-scrolled) .header-profile-btn:hover {
    background: #fff;
    color: var(--ks-primary);
    border-color: #fff;
}

/* ================================================================
 *  Section scaffolding
 * ================================================================ */
section { position: relative; padding: 100px 0; }
@media (max-width: 768px) { section { padding: 60px 0; } }

.section-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ks-accent);
    background: rgba(91, 168, 232, 0.12);
    border: 1px solid rgba(91, 168, 232, 0.3);
    border-radius: var(--ks-radius-pill);
    margin-bottom: 16px;
    font-family: var(--ks-font-en);
}
.section-title {
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.2;
    margin-bottom: 16px;
    color: #fff;
}

/* ============================================================
 *  Section color scheme — LIGHT BY DEFAULT
 *
 *  All sections render on white background with navy text. Dark
 *  sections (hero, video, footer) opt in via class="section-dark".
 *  Legacy `.section-light` is kept as a no-op alias so existing
 *  template-part markup keeps working.
 * ============================================================ */
section {
    background: var(--ks-bg-light);
    color: var(--ks-text-on-light);
}
/* Alternating bg DISABLED: hiding a section in the Customizer used to
   shift the nth-of-type index, which made a previously light section
   become "soft" or vice versa — and dark sections inherit the light
   background entirely. The base `section { background: white }` rule
   above already gives a consistent light theme. Use the `.section-dark`
   class explicitly when a navy background is wanted. */
section h1, section h2, section h3, section h4, section .section-title {
    color: var(--ks-primary);
}
section p { color: var(--ks-text-dim); }
.section-eyebrow {
    color: var(--ks-secondary);
    background: rgba(59, 130, 217, 0.1);
    border-color: rgba(59, 130, 217, 0.2);
}

/* `.section-light` — legacy alias, same as the new default. */
.section-light { background: var(--ks-bg-light-soft); }

/* `.section-dark` — opt-in for sections that need a dark navy bg
   (hero with photo, footer, video block).

   IMPORTANT: We list `section.section-dark` AND
   `section.section-dark:nth-of-type(even)` so this rule beats the
   alternating `section:nth-of-type(even)` rule above on specificity.
   Without this, hiding any section in the Customizer would shift the
   even/odd index and a dark section would suddenly inherit the light
   background — making its white text invisible. */
.section-dark,
section.section-dark,
section.section-dark:nth-of-type(even),
section.section-dark:nth-of-type(odd) {
    background: linear-gradient(180deg, var(--ks-bg-medium) 0%, var(--ks-bg-dark) 100%) !important;
    color: var(--ks-text-on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark p { color: var(--ks-text-on-dark); }
.section-dark .section-eyebrow {
    color: var(--ks-accent);
    background: rgba(91, 168, 232, 0.12);
    border-color: rgba(91, 168, 232, 0.25);
}

/* ================================================================
 *  HERO
 *  - Scroll indicator ABSOLUTELY contained inside .hero (no leak).
 *  - Brand tagline "Kayan Smart / Engineering Consulting" included.
 * ================================================================ */
/* HERO — true full-screen takeover. The header sits transparently
   on top via position:sticky, so we don't need a negative margin.
   The hero is always a dark section (overrides the global light-theme
   default for <section> and the even-row alternation). */
.hero,
section.hero,
section.hero:nth-of-type(even) {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    /* Compensate for the sticky header's height so the hero starts
       at the very top of the viewport visually. */
    margin-top: calc(-1 * var(--ks-header-h, 78px));
    padding: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--ks-bg-dark) !important;     /* anchor — keeps hero dark even when sections default to white */
    color: var(--ks-text-on-dark);
}
.hero h1, .hero h2, .hero h3, .hero h4 { color: #fff; }
.hero p { color: var(--ks-text-on-dark); }
/* When the page starts with a hero, kill any default body top spacing. */
body.has-transparent-header { padding-top: 0; }
.hero-video, .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-bg { background-size: cover; background-position: center; }
.hero-bg-default {
    background:
        radial-gradient(ellipse at top right, rgba(59, 130, 217, 0.4), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(26, 58, 110, 0.55), transparent 50%),
        linear-gradient(180deg, var(--ks-bg-dark), var(--ks-bg-medium));
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 20, 33, 0.4) 0%, rgba(13, 20, 33, 0.75) 100%);
    z-index: 1;
}
.hero-shapes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.shape { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.shape-1 {
    width: 400px; height: 400px;
    background: var(--ks-secondary);
    top: -80px; right: -80px;
    animation: ks-float 8s ease-in-out infinite;
}
.shape-2 {
    width: 320px; height: 320px;
    background: var(--ks-accent);
    bottom: -80px; left: -80px;
    animation: ks-float 10s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 140px 24px 100px;
    width: 100%;
}

/* On mobile, tighten the vertical breathing room so the image dominates
   the viewport instead of being squeezed into the middle. */
@media (max-width: 640px) {
    .hero-content { padding: 110px 20px 90px; }
}

.hero-eyebrow {
    display: inline-block;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(59, 130, 217, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ks-radius-pill);
    margin-bottom: 24px;
    font-family: var(--ks-font-en);
}

.hero-title {
    /* Mobile-first: use the mobile prop; desktop overrides via media query.
       Font weight + line-height come from Customizer (with fallbacks). */
    font-size: var(--hero-title-size-mobile, 36px);
    font-weight: var(--hero-title-weight, 700);
    line-height: var(--hero-title-lh, 1.2);
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    /* Better Arabic rendering — Cairo's variable axis benefits from this. */
    font-feature-settings: "kern" 1;
    -webkit-font-smoothing: antialiased;
}
.hero-title br {
    /* Make sure forced breaks always render (some user-agents collapse <br>
       inside flex/grid headings). */
    display: block;
    content: "";
    margin-top: 0.1em;
}
.hero-sub {
    font-size: var(--hero-sub-size-mobile, 15px);
    color: rgba(255, 255, 255, 0.88);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
}
@media (min-width: 768px) {
    .hero-title { font-size: var(--hero-title-size, 64px); }
    .hero-sub   { font-size: var(--hero-sub-size, 18px); }
}

/* NEW — Brand tagline block under the hero CTA */
.hero-brand {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    text-align: center;
}
.hero-brand-name {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.hero-brand-tagline {
    font-size: clamp(13px, 1.4vw, 15px);
    color: var(--ks-accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

.hero-cta { margin-bottom: 0; }

/* Scroll indicator — pinned to bottom of HERO ONLY */
.hero-scroll {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 7px;
    z-index: 4;
}
.hero-scroll-dot {
    width: 4px; height: 8px;
    background: var(--ks-accent);
    border-radius: 2px;
    animation: ks-scroll-bounce 1.8s ease-in-out infinite;
}
@keyframes ks-scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(16px); opacity: 0.3; }
}
@keyframes ks-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* ================================================================
 *  ABOUT
 * ================================================================ */
.about-grid {
    display: grid;
    gap: 48px;
    align-items: center;
    grid-template-columns: 1fr;
}
@media (min-width: 992px) {
    .about-grid { grid-template-columns: 1fr 1.1fr; gap: 80px; }
}

.about-image-wrap { position: relative; padding: 16px; }
.about-image-decor {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    border-radius: var(--ks-radius);
    transform: rotate(-3deg);
    opacity: 0.12;
}
.about-image {
    position: relative;
    width: 100%;
    height: 460px;
    object-fit: cover;
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
}
.about-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff, var(--ks-bg-light-soft));
    color: var(--ks-secondary);
}
.about-text { font-size: 17px; line-height: 1.85; margin-bottom: 24px; }

@media (max-width: 767px) {
    .about-image { height: 280px; }
    .about-text { font-size: 15px; }
}

/* ================================================================
 *  STATS
 * ================================================================ */
.stats {
    background:
        radial-gradient(ellipse at center top, rgba(59, 130, 217, 0.15), transparent 60%),
        linear-gradient(180deg, var(--ks-bg-dark), var(--ks-bg-medium));
}

.stats-head { text-align: center; margin-bottom: 56px; }
.stats-text { max-width: 600px; margin: 0 auto; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

.stat-card {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    transition: all .35s var(--ks-transition);
}
.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 217, 0.4);
    box-shadow: var(--ks-shadow-soft);
}

/* The actual counter number — uses Inter for clean numerals */
.stat-value {
    font-family: var(--ks-font-en);
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--ks-accent), var(--ks-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Show even before animation kicks in */
    min-height: 1em;
}
.stat-label {
    font-size: 14px;
    color: var(--ks-text-dim);
    font-weight: 500;
}

/* ================================================================
 *  SERVICES
 * ================================================================ */
.services-head { text-align: center; margin-bottom: 56px; max-width: 720px; margin-inline: auto; }
.services-sub { font-size: 16px; }

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }

/* 4-column variant — used on homepage when admin picks 4 featured services. */
@media (min-width: 1100px) {
    .services-grid.services-grid--cols-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* No-images variant — hides every service image inside this grid.
   The card adapts: more vertical padding, larger icon, no top image strip.
   This applies ONLY here on the homepage; internal /service/* pages
   still show their featured image via single-service.php. */
.services-grid--no-images .service-card-image { display: none !important; }
.services-grid--no-images .service-card {
    padding: 32px 24px;
    text-align: center;
}
.services-grid--no-images .service-icon {
    margin: 0 auto 18px;
    width: 64px;
    height: 64px;
    border-radius: 18px;
}
.services-grid--no-images .service-icon svg {
    width: 30px; height: 30px;
}
.services-grid--no-images .service-title {
    font-size: 17px;
    margin-bottom: 10px;
}
.services-grid--no-images .service-excerpt {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 14px;
}
.services-grid--no-images .service-more {
    justify-content: center;
}

/* "View all services" centered CTA below the grid */
.services-cta {
    text-align: center;
    margin-top: 48px;
}

.service-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    text-decoration: none;
    color: inherit;
    transition: all .35s var(--ks-transition);
    box-shadow: 0 1px 2px rgba(26, 58, 110, 0.04);
    overflow: hidden;        /* clip the image to rounded corners */
}

/* Card with an image header — image stretches edge-to-edge above the
   icon + content. Reduces the top padding so the image sits flush. */
.service-card--has-image { padding-top: 0; padding-inline: 0; }
.service-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ks-bg-medium);
}
.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ks-transition);
}
.service-card--has-image:hover .service-card-image img { transform: scale(1.05); }
/* Icon sits on top of the image, half above / half below — modern card look */
.service-card--has-image .service-icon {
    position: relative;
    z-index: 2;
    margin: -28px 24px 16px;
}
.service-card--has-image .service-title,
.service-card--has-image .service-excerpt,
.service-card--has-image .service-more {
    margin-inline: 24px;
}
.service-card--has-image .service-excerpt { margin-bottom: 16px; }
.service-card--has-image .service-more { margin-bottom: 24px; }

/* In dark sections, services get a dark surface */
.section-dark .service-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border-color: var(--ks-border);
    color: var(--ks-text-on-dark);
}
.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--ks-secondary);
    box-shadow: var(--ks-shadow-light);
    color: inherit;
}
.service-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    color: #fff;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: var(--ks-shadow-soft);
}
.service-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--ks-primary);
    font-weight: 700;
}
.section-dark .service-title { color: #fff; }

.service-excerpt {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
    color: var(--ks-text-dim);
}
.section-dark .service-excerpt { color: var(--ks-text-on-dark); }

.service-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-secondary);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ================================================================
 *  PROJECTS
 * ================================================================ */
.projects-head { text-align: center; margin-bottom: 56px; }
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }

/* "View all projects" centered CTA */
.projects-cta {
    text-align: center;
    margin-top: 48px;
}

/* Admin-only empty state when no projects exist yet */
.projects-empty {
    text-align: center;
    padding: 60px 20px;
    border: 2px dashed var(--ks-border-light);
    border-radius: var(--ks-radius);
    background: rgba(255, 255, 255, 0.4);
}
.projects-empty svg { opacity: 0.3; margin-bottom: 16px; color: var(--ks-secondary); }
.projects-empty h3 { color: var(--ks-primary); margin-bottom: 8px; }
.projects-empty p { color: var(--ks-text-dim-light); margin: 0; }
.projects-empty a { color: var(--ks-secondary); font-weight: 700; text-decoration: underline; }

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    overflow: hidden;
    transition: all .35s var(--ks-transition);
}
.section-light .project-card {
    background: #fff;
    border-color: var(--ks-border-light);
    box-shadow: var(--ks-shadow-light);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--ks-secondary); }

.project-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ks-bg-medium);
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ks-transition); }
.project-card:hover .project-thumb img { transform: scale(1.06); }

.project-status-chip {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 6px 14px;
    background: rgba(13, 20, 33, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: var(--ks-radius-pill);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;          /* never wrap to a new line */
    line-height: 1;
}

/* On the single-project hero, the chip floats inside the title block —
   render it as a compact pill (no absolute positioning) so it sits cleanly
   above the title at any viewport width. */
.project-hero .project-status-chip {
    position: static;
    display: inline-block;
    padding: 5px 12px;
    font-size: 11px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.3px;
}

.project-body { padding: 22px; }
.project-body-title {
    font-size: 19px;
    margin-bottom: 12px;
    color: var(--ks-primary);
}
.section-dark .project-body-title { color: #fff; }
.project-body-title a { color: inherit; }

.project-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-text-dim);
    font-size: 13px;
    margin-bottom: 14px;
}
.section-light .project-location { color: var(--ks-text-dim-light); }

/* ================================================================
 *  VIDEO SECTION
 * ================================================================ */
.video-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }

.video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--ks-radius);
    overflow: hidden;
    box-shadow: var(--ks-shadow);
    cursor: pointer;
    background: var(--ks-bg-medium);
    max-width: 1100px;
    margin: 0 auto;
}
.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ks-transition), filter .35s;
}
.video-poster-default {
    background:
        radial-gradient(ellipse at center, rgba(91, 168, 232, 0.4), transparent 70%),
        linear-gradient(135deg, var(--ks-primary), var(--ks-bg-dark));
}
.video-wrap:hover .video-poster { transform: scale(1.03); filter: brightness(0.7); }

.video-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 88px; height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline-start: 6px;
    box-shadow: 0 12px 40px rgba(59, 130, 217, 0.5);
    transition: transform .25s;
}
.video-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); }
.video-play-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--ks-accent);
    animation: ks-video-pulse 2s infinite;
}
@keyframes ks-video-pulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ================================================================
 *  TESTIMONIALS
 * ================================================================ */
.testimonials { overflow: hidden; }
.testimonials-head { text-align: center; margin-bottom: 48px; }

/* The slider WRAPPER is the visible viewport — it clips the scrolling
   track. Use a negative margin on the inner track to compensate for the
   container's horizontal padding so the cards align with the page edge
   when scrolled, but never spill out of the section. */
.testimonials-slider {
    position: relative;
    overflow: hidden;
    /* Add safety padding so card shadows aren't visually clipped */
    padding: 4px 0 12px;
}
.testimonials-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 88%;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
    /* Prevent any overscroll bounce on iOS that visually leaks cards */
    overscroll-behavior-x: contain;
}
.testimonials-track::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .testimonials-track { grid-auto-columns: calc(50% - 8px); } }
@media (min-width: 992px) { .testimonials-track { grid-auto-columns: calc(33.333% - 11px); } }

.testimonial-card {
    scroll-snap-align: start;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
    position: relative;
    transition: all .35s var(--ks-transition);
}
.section-dark .testimonial-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-color: var(--ks-border);
    box-shadow: none;
}
.testimonial-card:hover { transform: translateY(-4px); border-color: var(--ks-secondary); }

.testimonial-quote-mark {
    position: absolute;
    top: 12px;
    inset-inline-end: 22px;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    color: rgba(91, 168, 232, 0.18);
    font-family: Georgia, serif;
}
.rating-stars {
    display: flex;
    gap: 2px;
    color: #f5b841;
    margin-bottom: 14px;
}
.testimonial-text {
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 22px;
    color: var(--ks-text-on-light);
}
.section-dark .testimonial-text { color: var(--ks-text-on-dark); }
.testimonial-text p { margin: 0; color: inherit; }

.testimonial-author { display: flex; align-items: center; gap: 14px; }
.testimonial-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}
.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }
.testimonial-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--ks-primary);
}
.section-dark .testimonial-name { color: #fff; }
.testimonial-role { font-size: 13px; color: var(--ks-text-dim); }
.section-light .testimonial-role { color: var(--ks-text-dim-light); }

.testimonials-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}
.testimonials-prev, .testimonials-next {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--ks-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ks-text-on-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
}
.section-light .testimonials-prev,
.section-light .testimonials-next {
    background: #fff;
    border-color: var(--ks-border-light);
    color: var(--ks-primary);
    box-shadow: var(--ks-shadow-light);
}
.testimonials-prev:hover, .testimonials-next:hover {
    background: var(--ks-secondary);
    border-color: var(--ks-secondary);
    color: #fff;
}

/* ================================================================
 *  BLOG SECTION — REDESIGNED, more polished
 * ================================================================ */
.blog-section { }
.blog-head { text-align: center; margin-bottom: 56px; }
.blog-head-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 48px;
}
.blog-head-row > div:first-child { text-align: start; max-width: 600px; }
.blog-head-row .section-title { margin-bottom: 4px; }
.blog-head-row .section-eyebrow { margin-bottom: 12px; }

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    overflow: hidden;
    transition: all .35s var(--ks-transition);
    box-shadow: var(--ks-shadow-light);
    height: 100%;
}
.section-dark .blog-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-color: var(--ks-border);
    box-shadow: none;
}

.blog-card:hover {
    transform: translateY(-6px);
    border-color: var(--ks-secondary);
    box-shadow: 0 16px 48px rgba(26, 58, 110, 0.15);
}

.blog-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ks-bg-light-soft), #fff);
}
.section-dark .blog-card-thumb { background: var(--ks-bg-medium); }
.blog-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ks-transition);
}
.blog-card:hover .blog-card-thumb img { transform: scale(1.06); }

.blog-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ks-secondary);
    opacity: 0.4;
}

.blog-card-cat {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 12px;
    background: var(--ks-secondary);
    color: #fff;
    border-radius: var(--ks-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--ks-font-en);
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--ks-text-dim);
    margin-bottom: 12px;
    font-family: var(--ks-font-en);
}
.section-light .blog-card-meta { color: var(--ks-text-dim-light); }
.blog-card-meta span { display: flex; align-items: center; gap: 4px; }

.blog-card-title {
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 12px;
    transition: color .2s;
    color: var(--ks-primary);
}
.section-dark .blog-card-title { color: #fff; }
.blog-card-title a { color: inherit; }
.blog-card:hover .blog-card-title { color: var(--ks-secondary); }

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
}
.blog-card-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-secondary);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ================================================================
 *  PARTNERS MARQUEE
 * ================================================================ */
.partners {
    padding-bottom: 100px;
    overflow: hidden;
}
.partners-head { text-align: center; margin-bottom: 48px; }

/* MARQUEE — single row of partner logos, infinite seamless scroll.
 *
 * Two-step lifecycle controlled by JS:
 *   1. Initial render: items are visible but NOT animating (no flash of
 *      motion before the user can register what they're looking at).
 *   2. After ~600ms + image load: JS clones the seed list to fill 2×
 *      viewport, then adds .is-running which kicks off the animation
 *      using --ks-marquee-step (set by JS to -100/copies %).
 *
 * Critical fixes for RTL:
 *   - direction: ltr on the inner forces left-to-right flex flow even
 *     on RTL pages (Arabic). Without this, RTL flips flex-start which
 *     breaks the layout and causes the items to wrap.
 *   - flex-wrap: nowrap !important guarantees a single row.
 *   - width: max-content lets the inner grow to fit ALL clones.
 */
.marquee-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.marquee-track {
    display: flex;
    overflow: hidden;
    width: 100%;
}
.marquee-inner {
    display: flex;
    flex-wrap: nowrap !important;
    width: max-content;
    direction: ltr;
    gap: 20px;
    padding-inline: 10px;
    will-change: transform;
    /* Default: NOT animating. JS adds .is-running on the wrap to start. */
}
/* Animation kicks in only after JS has cloned & measured. The step is
   set per-marquee via --ks-marquee-step; the duration is set inline by
   JS (animationDuration = seedWidth / target-px-per-second) so the
   apparent scroll speed stays constant regardless of how many copies
   we stitched together to fill the viewport. */
.marquee-wrap.is-running .marquee-inner {
    animation-name: ks-marquee;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    /* animation-duration is set inline per-marquee by JS */
}
.marquee-wrap:hover .marquee-inner { animation-play-state: paused; }

@keyframes ks-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--ks-marquee-step, -50%)); }
}

.marquee-item {
    flex: 0 0 auto;
    width: 170px; height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: 14px;
    color: var(--ks-text-dim-light);
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--ks-shadow-light);
    transition: all .25s;
    white-space: nowrap;
}
.section-dark .marquee-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ks-border);
    color: var(--ks-text-dim);
    box-shadow: none;
}
.marquee-item:hover {
    border-color: var(--ks-secondary);
    color: var(--ks-secondary);
}
.marquee-item img { max-width: 100%; max-height: 56px; object-fit: contain; }

/* ================================================================
 *  CONTACT SECTION (NO FORM — removed per user request)
 * ================================================================ */
.contact-section { }
.contact-head { text-align: center; margin-bottom: 48px; max-width: 720px; margin-inline: auto; }
.contact-subtitle { font-size: 16px; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
@media (min-width: 992px) {
    .contact-grid { grid-template-columns: 1.3fr 1fr; }
}

.contact-map {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--ks-radius);
    overflow: hidden;
    border: 1px solid var(--ks-border-light);
    background: var(--ks-bg-light-soft);
    box-shadow: var(--ks-shadow-light);
}
.section-dark .contact-map {
    background: var(--ks-bg-medium);
    border-color: var(--ks-border);
}
.contact-map iframe {
    width: 100%; height: 100%;
    border: 0;
}
.section-dark .contact-map iframe {
    filter: invert(0.92) hue-rotate(180deg) saturate(0.8);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-card {
    /* Always horizontal: icon on the start, text on the rest.
       The !important + min-width ensures this layout never collapses
       to a vertical stack even on narrow mobile screens. */
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius-sm);
    color: inherit;
    transition: all .25s;
    box-shadow: var(--ks-shadow-light);
    text-decoration: none;
    width: 100%;
}
.contact-card > div:not(.contact-card-icon) {
    flex: 1;
    min-width: 0;          /* lets long text truncate cleanly */
}
.section-dark .contact-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--ks-border);
    box-shadow: none;
}
.contact-card:hover {
    border-color: var(--ks-secondary);
    color: inherit;
    transform: translateY(-2px);
}
.contact-card-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 217, 0.12);
    color: var(--ks-secondary);
    border-radius: 12px;
}
.contact-card-whatsapp .contact-card-icon { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.contact-card-label { font-size: 12px; color: var(--ks-text-dim); font-weight: 500; margin-bottom: 4px; }
.section-light .contact-card-label { color: var(--ks-text-dim-light); }
.contact-card-value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
    font-family: var(--ks-font-en);
    direction: ltr;
}
.section-light .contact-card-value { color: var(--ks-primary); }
.section-dark .contact-card-value { color: #fff; }

/* For text values that should remain Arabic (like address), opt back in */
.contact-card-value.is-text {
    font-family: var(--ks-font-ar);
    direction: rtl;
}
html[dir="ltr"] .contact-card-value.is-text { direction: ltr; }

/* ================================================================
 *  FOOTER
 * ================================================================ */
.site-footer {
    position: relative;
    background:
        linear-gradient(180deg, var(--ks-primary) 0%, var(--ks-bg-medium) 100%);
    color: var(--ks-text-on-dark);
    padding: 80px 0 0;
    overflow: hidden;
}
/* Decorative background image (set by inline style from PHP) */
.footer-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.04;
    z-index: 0;
}
/* Logo watermark variant — placed bottom-end, very subtle */
.footer-bg-image--logo {
    background-size: auto 60%;
    background-repeat: no-repeat;
    background-position: 90% center;
    opacity: 0.05;
}
html[dir="rtl"] .footer-bg-image--logo { background-position: 10% center; }
.footer-glow {
    position: absolute;
    top: -200px; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 400px;
    background: radial-gradient(ellipse, rgba(59, 130, 217, 0.2), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.footer-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 60px;
}
@media (min-width: 640px) { .footer-inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 60px; } }

.footer-logo img { max-height: 56px; margin-bottom: 20px; filter: brightness(1.1); }
.footer-about {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.85);   /* near-white for high contrast on navy */
}

.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social a {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #ffffff;
    transition: all .25s;
}
.footer-social a:hover {
    background: var(--ks-accent);
    border-color: var(--ks-accent);
    color: #fff;
    transform: translateY(-3px);
}

.footer-title {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-menu, .footer-contact {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-menu a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    transition: all .2s;
}
.footer-menu a:hover {
    color: #ffffff;
    padding-inline-start: 4px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}
.footer-contact svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--ks-accent);
}
.footer-contact a {
    color: inherit;
    font-family: var(--ks-font-en);
    direction: ltr;
}
.footer-contact a:hover { color: #ffffff; }

.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.75);
}
.footer-bottom a {
    color: rgba(255, 255, 255, 0.9);
}
.footer-bottom a:hover { color: #ffffff; }
.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--ks-text-dim);
}

/* The credit line — centered, with heart icon and clickable name */
.footer-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ks-text-dim);
}
.footer-credit-heart {
    color: #e74c5e;
    animation: ks-heart-pulse 1.6s ease-in-out infinite;
    display: inline-block;
    font-style: normal;
    font-size: 15px;
    line-height: 1;
}
@keyframes ks-heart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}
.footer-credit a {
    color: var(--ks-accent);
    font-weight: 700;
    transition: color .2s;
}
.footer-credit a:hover { color: var(--ks-secondary); }

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: center;
}
.footer-reg { font-family: var(--ks-font-en); }
.footer-reg strong { color: var(--ks-text-on-dark); font-weight: 600; }

/* ================================================================
 *  FLOATING WHATSAPP + CALL BAR — guaranteed visible
 * ================================================================ */
.floating-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    animation: ks-float-in .6s .4s backwards var(--ks-transition);
    /* Smooth hide/show when drawer opens */
    transition: opacity .25s, transform .25s;
}
/* Hide when mobile drawer is open */
.floating-bar[data-drawer-open] {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}
@keyframes ks-float-in {
    from { opacity: 0; transform: translateX(-50%) translateY(40px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.floating-bar-inner {
    position: relative;
    display: flex;
    align-items: stretch;
    background: rgba(21, 28, 46, 0.78);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--ks-radius-pill);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(59, 130, 217, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Soft glow behind the bar */
.floating-bar-inner::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.4), rgba(59, 130, 217, 0.4));
    filter: blur(14px);
    opacity: 0.45;
    z-index: -1;
    animation: ks-soft-pulse 4s ease-in-out infinite;
}
@keyframes ks-soft-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    transition: all .25s;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.floating-btn:hover { color: #fff; }
.floating-btn-whatsapp svg { color: #25d366; }
.floating-btn-call svg { color: var(--ks-accent); }
.floating-btn-whatsapp:hover { background: rgba(37, 211, 102, 0.12); }
.floating-btn-call:hover { background: rgba(59, 130, 217, 0.12); }

.floating-bar-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.3), transparent);
}

@media (max-width: 480px) {
    .floating-bar { bottom: 12px; width: calc(100% - 24px); max-width: 360px; }
    .floating-bar-inner { width: 100%; }
    .floating-btn { flex: 1; justify-content: center; padding: 13px 12px; font-size: 13px; }
}

/* ================================================================
 *  SINGLE POST / CONTENT PAGES — improved typography
 * ================================================================ */
.single-post-main, .single-service-main { padding: 80px 0; }

.single-post-header {
    text-align: center;
    margin-bottom: 40px;
}
.single-post-meta {
    font-size: 13px;
    color: var(--ks-text-dim);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.single-post-meta .sep { opacity: 0.5; }
.single-post-meta a { color: var(--ks-accent); }

.single-post-title {
    font-size: clamp(28px, 4vw, 44px);
    color: #fff;
    line-height: 1.25;
    margin-bottom: 20px;
}
.single-post-excerpt {
    font-size: 18px;
    color: var(--ks-text-dim);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
}

.single-post-thumb {
    margin: 40px 0;
    border-radius: var(--ks-radius);
    overflow: hidden;
    box-shadow: var(--ks-shadow);
    aspect-ratio: 16 / 9;
}
.single-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Content typography */
.entry-content {
    font-size: 17px;
    line-height: 1.95;
    color: var(--ks-text-on-dark);
}
.entry-content > * + * { margin-top: 1.2em; }
.entry-content p { color: var(--ks-text-on-dark); margin: 0 0 1.2em; }
.entry-content h2 {
    font-size: 28px;
    margin: 1.8em 0 0.6em;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(91, 168, 232, 0.2);
}
.entry-content h3 { font-size: 22px; margin: 1.5em 0 0.5em; color: #fff; }
.entry-content h4 { font-size: 18px; margin: 1.2em 0 0.4em; color: var(--ks-accent); }
.entry-content a { color: var(--ks-accent); text-decoration: underline; text-decoration-color: rgba(91, 168, 232, 0.3); text-underline-offset: 3px; }
.entry-content a:hover { color: var(--ks-secondary); text-decoration-color: var(--ks-secondary); }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-inline-start: 24px; }
.entry-content ul li, .entry-content ol li { margin-bottom: 10px; line-height: 1.75; }
.entry-content ul li::marker { color: var(--ks-accent); }
.entry-content ol li::marker { color: var(--ks-accent); font-weight: 700; }
.entry-content strong { color: #fff; font-weight: 700; }
.entry-content em { color: var(--ks-accent); font-style: normal; }
.entry-content blockquote {
    margin: 28px 0;
    padding: 24px 28px;
    border-inline-start: 4px solid var(--ks-accent);
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.08), rgba(91, 168, 232, 0.04));
    border-radius: 0 14px 14px 0;
    font-style: italic;
    font-size: 18px;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img {
    border-radius: var(--ks-radius-sm);
    margin: 24px auto;
    box-shadow: var(--ks-shadow-light);
}
.entry-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--ks-accent);
}

/* ===== Article body — high-contrast white text on dark card =====
 *
 * The article wrapper (.page-article) is a clean white card on the
 * light page background. All text is dark navy/grey for max readability.
 * Headings use the brand primary navy for hierarchy.
 * ===== */
.page-article.entry-content,
.page-article .entry-content {
    color: var(--ks-text-on-light) !important;
    font-size: 17px;
    line-height: 1.95;
}
.page-article.entry-content p,
.page-article .entry-content p {
    color: #2b3a55 !important;
}
.page-article.entry-content h1,
.page-article.entry-content h2,
.page-article.entry-content h3,
.page-article.entry-content h4,
.page-article.entry-content h5,
.page-article.entry-content h6 {
    color: var(--ks-primary) !important;
}
.page-article.entry-content h2 {
    border-bottom-color: rgba(26, 58, 110, 0.15);
    padding-bottom: 12px;
}
.page-article.entry-content h3 {
    color: var(--ks-secondary) !important;
}
.page-article.entry-content strong,
.page-article .entry-content strong {
    color: var(--ks-primary) !important;
    font-weight: 700;
}
.page-article.entry-content em,
.page-article .entry-content em {
    color: var(--ks-secondary) !important;
}
.page-article.entry-content a,
.page-article .entry-content a {
    color: var(--ks-secondary) !important;
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 217, 0.35);
    text-underline-offset: 3px;
}
.page-article.entry-content a:hover,
.page-article .entry-content a:hover {
    color: var(--ks-primary) !important;
    text-decoration-color: var(--ks-primary);
}
.page-article.entry-content ul li,
.page-article.entry-content ol li {
    color: #2b3a55 !important;
    line-height: 1.75;
    margin-bottom: 10px;
}
.page-article.entry-content ul li::marker,
.page-article.entry-content ol li::marker {
    color: var(--ks-secondary) !important;
}
.page-article.entry-content blockquote {
    border-inline-start: 4px solid var(--ks-secondary);
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.06), rgba(91, 168, 232, 0.02));
    color: #2b3a55 !important;
    padding: 24px 28px;
    border-radius: 0 14px 14px 0;
    font-style: italic;
}
.page-article.entry-content blockquote p { color: #2b3a55 !important; }
.page-article.entry-content code {
    background: rgba(26, 58, 110, 0.08);
    color: var(--ks-secondary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
}
.page-article.entry-content figcaption {
    color: var(--ks-text-dim) !important;
    text-align: center;
    font-size: 14px;
    margin-top: 8px;
}
.entry-content pre {
    background: #f4f7fc;
    color: var(--ks-text-on-light);
    padding: 20px;
    border-radius: var(--ks-radius-sm);
    overflow-x: auto;
    border: 1px solid var(--ks-border);
}

.single-post-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--ks-border);
    font-size: 13px;
}
.tag-label { font-weight: 700; color: #fff; margin-inline-end: 8px; }
.single-post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    color: var(--ks-text-dim);
    margin: 0 4px 6px;
    transition: all .2s;
}
.single-post-tags a:hover { background: var(--ks-secondary); color: #fff; border-color: var(--ks-secondary); }

/* Post navigation */
.post-navigation {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--ks-border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) { .post-navigation { grid-template-columns: 1fr 1fr; } }
.post-navigation a {
    display: block;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    transition: all .25s;
}
.post-navigation a:hover {
    border-color: var(--ks-secondary);
    transform: translateY(-2px);
    background: rgba(59, 130, 217, 0.08);
}
.post-navigation .nav-sub {
    display: block;
    font-size: 12px;
    color: var(--ks-accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--ks-font-en);
}
.post-navigation .nav-title { font-size: 15px; font-weight: 600; color: #fff; }

/* ============================================================
 *  SINGLE SERVICE PAGE — 2-column layout (content + sidebar)
 *
 *  Desktop: 2 columns (content right in RTL / left in LTR, sidebar
 *  opposite). Mobile: single column, sidebar drops below content.
 * ============================================================ */
.service-single-main {
    padding: 56px 0 80px;
}
@media (min-width: 768px) {
    .service-single-main { padding: 80px 0 100px; }
}

.service-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 992px) {
    .service-detail-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 40px;
        align-items: start;
    }
}
@media (min-width: 1200px) {
    .service-detail-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 48px;
    }
}

/* ===== MAIN CONTENT COLUMN ===== */
.service-detail-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.service-detail-content .page-breadcrumbs {
    align-self: flex-start;
    margin: 0;
}

.service-detail-image {
    margin: 0;
    border-radius: var(--ks-radius);
    overflow: hidden;
    box-shadow: var(--ks-shadow-light);
    border: 1px solid var(--ks-border);
}
.service-detail-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.service-detail-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.service-detail-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.service-detail-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ks-shadow-soft);
}
.service-detail-title {
    font-size: clamp(26px, 3.6vw, 38px);
    color: var(--ks-primary);
    line-height: 1.2;
    margin: 0;
    font-weight: 800;
}
.service-detail-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ks-text-dim);
    margin: 0;
    padding: 16px 20px;
    background: var(--ks-bg-light-soft);
    border-inline-start: 4px solid var(--ks-secondary);
    border-radius: 0 var(--ks-radius-sm) var(--ks-radius-sm) 0;
}

/* The article body — applies on top of the global .entry-content styles.
   Forces dark, high-contrast text so the service description is highly
   readable on the white page background. */
.service-detail-body {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 36px 32px;
    box-shadow: var(--ks-shadow-light);
    color: var(--ks-text-on-light) !important;
    font-size: 16.5px;
    line-height: 1.95;
}
@media (max-width: 640px) {
    .service-detail-body { padding: 28px 22px; font-size: 16px; }
}
.service-detail-body p,
.service-detail-body li {
    color: #2b3a55 !important;
    margin: 0 0 1.2em;
}
.service-detail-body p:last-child { margin-bottom: 0; }
.service-detail-body h1,
.service-detail-body h2,
.service-detail-body h3,
.service-detail-body h4,
.service-detail-body h5,
.service-detail-body h6 {
    color: var(--ks-primary) !important;
    margin: 1.5em 0 0.6em;
    line-height: 1.3;
}
.service-detail-body h2 {
    font-size: 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(26, 58, 110, 0.12);
}
.service-detail-body h3 { font-size: 20px; color: var(--ks-secondary) !important; }
.service-detail-body strong { color: var(--ks-primary) !important; font-weight: 700; }
.service-detail-body a {
    color: var(--ks-secondary) !important;
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 217, 0.35);
    text-underline-offset: 3px;
}
.service-detail-body a:hover { color: var(--ks-primary) !important; }
.service-detail-body ul,
.service-detail-body ol {
    padding-inline-start: 22px;
    margin: 0 0 1.2em;
}
.service-detail-body ul li::marker { color: var(--ks-secondary); }
.service-detail-body blockquote {
    border-inline-start: 4px solid var(--ks-secondary);
    background: var(--ks-bg-light-soft);
    padding: 20px 24px;
    border-radius: 0 14px 14px 0;
    margin: 1.5em 0;
    color: var(--ks-text-on-light) !important;
}

/* Final CTA card at the bottom of the content column */
.service-detail-final-cta {
    position: relative;
    overflow: hidden;
    padding: 44px 36px;
    background:
        radial-gradient(ellipse at top right, rgba(59, 130, 217, 0.08), transparent 60%),
        linear-gradient(180deg, #fff, var(--ks-bg-light-soft));
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
    text-align: center;
}
@media (max-width: 640px) {
    .service-detail-final-cta { padding: 32px 22px; }
}
.service-detail-final-cta-decoration {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
    color: #fff;
    box-shadow: 0 8px 22px rgba(26, 58, 110, 0.25);
}
.service-detail-final-cta-title {
    font-size: clamp(22px, 2.6vw, 28px);
    color: var(--ks-primary);
    margin: 0 0 12px;
    font-weight: 800;
}
.service-detail-final-cta-text {
    font-size: 16px;
    color: var(--ks-text-dim);
    max-width: 540px;
    margin: 0 auto 28px;
    line-height: 1.7;
}
.service-detail-final-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ===== SIDEBAR COLUMN ===== */
.service-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
@media (min-width: 992px) {
    .service-detail-sidebar {
        position: sticky;
        top: 100px;
        /* keep within viewport while user scrolls — content column is taller */
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-inline-end: 4px;     /* allow scrollbar */
    }
    /* Custom scrollbar for sidebar */
    .service-detail-sidebar::-webkit-scrollbar { width: 6px; }
    .service-detail-sidebar::-webkit-scrollbar-track { background: transparent; }
    .service-detail-sidebar::-webkit-scrollbar-thumb {
        background: rgba(26, 58, 110, 0.18);
        border-radius: 3px;
    }
}

/* === Sidebar block 1: CTA mini-box === */
.service-sidebar-cta {
    position: relative;
    overflow: hidden;
    padding: 24px 22px;
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
    color: #fff;
    border-radius: var(--ks-radius);
    box-shadow: 0 12px 32px rgba(26, 58, 110, 0.22);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}
.service-sidebar-cta::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.service-sidebar-cta-title {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.92;
    position: relative;
}
.service-sidebar-cta-service-name {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
    color: #fff;
    position: relative;
}
.service-sidebar-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    color: var(--ks-primary) !important;
    border-radius: var(--ks-radius-pill);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all .25s var(--ks-transition);
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.service-sidebar-cta-btn:hover {
    background: #25d366;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.4);
}
.service-sidebar-cta-btn svg { flex-shrink: 0; }

/* === Sidebar block 2: Vertical video === */
.service-sidebar-video {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 14px;
    box-shadow: var(--ks-shadow-light);
}
.service-sidebar-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;          /* portrait/vertical */
    background: var(--ks-bg-medium);
    border-radius: var(--ks-radius-sm);
    overflow: hidden;
    cursor: pointer;
}
.service-sidebar-video-wrap .video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}
.service-sidebar-video-wrap .video-poster-default {
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-bg-medium));
}
.service-sidebar-video-wrap .video-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 0;
    color: var(--ks-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s;
    z-index: 2;
}
.service-sidebar-video-wrap .video-play-btn svg {
    margin-inline-start: 3px;      /* visually center the triangle */
}
.service-sidebar-video-wrap .video-play-btn:hover {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}
.service-sidebar-video-wrap .video-play-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    animation: kspulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes kspulse {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.7); opacity: 0; }
}
.service-sidebar-video-title {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ks-primary);
}

/* === Sidebar block 3: Latest articles === */
.service-sidebar-recent {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 22px 20px;
    box-shadow: var(--ks-shadow-light);
}
.service-sidebar-recent-heading {
    font-size: 16px;
    font-weight: 800;
    color: var(--ks-primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(26, 58, 110, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.service-sidebar-recent-heading::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, var(--ks-secondary), var(--ks-accent));
    border-radius: 2px;
}
.service-sidebar-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.service-sidebar-recent-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all .2s var(--ks-transition);
}
.service-sidebar-recent-item:hover {
    background: var(--ks-bg-light-soft);
    transform: translateX(-2px);
}
html[dir="rtl"] .service-sidebar-recent-item:hover { transform: translateX(2px); }

.service-sidebar-recent-thumb {
    flex-shrink: 0;
    width: 58px; height: 58px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ks-bg-light-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.service-sidebar-recent-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.service-sidebar-recent-thumb--ph {
    color: var(--ks-secondary);
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.12), rgba(91, 168, 232, 0.06));
}
.service-sidebar-recent-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.service-sidebar-recent-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ks-primary);
    line-height: 1.4;
    transition: color .2s;
}
.service-sidebar-recent-item:hover .service-sidebar-recent-title {
    color: var(--ks-secondary);
}
.service-sidebar-recent-date {
    font-size: 12px;
    color: var(--ks-text-dim);
    font-family: var(--ks-font-en);
    direction: ltr;
    text-align: start;
}

/* Single project hero */
.project-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 180px 0 80px;
    margin-top: -78px;
}
.project-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(4px);
    transform: scale(1.05);
}
.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 20, 33, 0.7), rgba(13, 20, 33, 0.95));
}
.project-hero-content { position: relative; z-index: 2; }
.project-title { font-size: clamp(28px, 5vw, 48px); color: #fff; margin-bottom: 16px; }

.project-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 28px;
    background: var(--ks-bg-medium);
    border-radius: var(--ks-radius);
    border: 1px solid var(--ks-border);
    margin: -40px auto 40px;
    position: relative;
    z-index: 2;
}
.project-stat-value { font-size: 26px; font-weight: 900; color: var(--ks-accent); font-family: var(--ks-font-en); }
.project-stat-label { font-size: 13px; color: var(--ks-text-dim); }
.project-progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.project-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ks-secondary), var(--ks-accent)); border-radius: 3px; transition: width 1.2s var(--ks-transition); }

/* ================================================================
 *  PAGE TEMPLATE — used for Contact Us, About, Privacy, etc.
 * ================================================================ */

/* Branded header strip — light theme version. Navy title on a soft
   white bg with two faint navy glows for depth. */
.page-header {
    position: relative;
    overflow: hidden;
    padding: 140px 0 70px;
    margin-top: calc(-1 * var(--ks-header-h, 78px));
    background:
        radial-gradient(ellipse at top right, rgba(59, 130, 217, 0.10), transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(26, 58, 110, 0.08), transparent 55%),
        linear-gradient(180deg, var(--ks-bg-light) 0%, var(--ks-bg-light-soft) 100%);
    border-bottom: 1px solid var(--ks-border);
    text-align: center;
}
.page-header-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.page-header-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
}
.page-header-shape-1 {
    width: 320px; height: 320px;
    background: var(--ks-secondary);
    top: -100px; right: -80px;
}
.page-header-shape-2 {
    width: 260px; height: 260px;
    background: var(--ks-accent);
    bottom: -100px; left: -60px;
}
.page-header > .container { position: relative; z-index: 1; }

.page-breadcrumbs {
    font-size: 13px;
    color: var(--ks-text-dim);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(26, 58, 110, 0.05);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    backdrop-filter: blur(10px);
}
.page-breadcrumbs a {
    color: var(--ks-secondary);
    transition: color .2s;
    font-weight: 600;
}
.page-breadcrumbs a:hover { color: var(--ks-primary); }
.page-breadcrumbs-sep { opacity: 0.4; }

.page-header-title {
    font-size: clamp(28px, 5vw, 44px);
    color: var(--ks-primary);
    line-height: 1.2;
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}
.page-header-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ks-text-dim);
    max-width: 680px;
    margin: 0 auto;
}

/* ===== CONTACT PAGE =====
 *
 * Dedicated `/contact` page layout (page-contact.php). Uses the same
 * branded page-header as other internal pages, then below it shows a
 * 4-cell contact cards grid + a 2-column form/map split.
 * ===== */
.contact-page { padding-bottom: 90px; }
.contact-page-intro { margin-bottom: 48px; }

/* ===== Contact Page intro paragraph + highlight badges =====
 * Sits above the contact cards. Reads from Customizer. */
.contact-page-intro-block {
    max-width: 880px;
    margin: 0 auto 32px;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
    text-align: center;
}
.contact-page-intro-text {
    font-size: 16px;
    line-height: 1.85;
    color: var(--ks-text-on-light);
    margin: 0;
}
@media (max-width: 640px) {
    .contact-page-intro-block { padding: 22px 18px; margin-bottom: 24px; }
    .contact-page-intro-text { font-size: 14.5px; line-height: 1.75; }
}

.contact-page-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    margin: 0 auto 56px;
    max-width: 880px;
}
.contact-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(26, 58, 110, 0.04), rgba(59, 130, 217, 0.06));
    border: 1px solid rgba(26, 58, 110, 0.12);
    color: var(--ks-primary);
    border-radius: var(--ks-radius-pill);
    font-size: 14px;
    font-weight: 700;
    transition: all .25s var(--ks-transition);
}
.contact-page-badge:hover {
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 58, 110, 0.18);
}
.contact-page-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(59, 130, 217, 0.15);
    color: var(--ks-secondary);
    transition: all .25s;
}
.contact-page-badge:hover .contact-page-badge-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
@media (max-width: 640px) {
    .contact-page-badges { margin-bottom: 36px; gap: 8px; }
    .contact-page-badge { padding: 8px 14px; font-size: 13px; }
    .contact-page-badge-icon { width: 24px; height: 24px; }
}

/* 4-cell contact cards row */
.contact-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0 0 60px;
}
@media (min-width: 640px) { .contact-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .contact-cards-grid { grid-template-columns: repeat(4, 1fr); } }

.contact-card-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px 22px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    color: inherit;
    transition: all .3s var(--ks-transition);
    box-shadow: var(--ks-shadow-light);
    text-decoration: none;
}
.contact-card-block:hover {
    transform: translateY(-6px);
    border-color: var(--ks-secondary);
    box-shadow: 0 14px 40px rgba(59, 130, 217, 0.18);
}
.contact-card-block-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ks-primary), var(--ks-secondary));
    color: #fff;
}
.contact-card-block-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ks-text-dim);
}
.contact-card-block-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--ks-primary);
    word-break: break-word;
}
.contact-card-block--whatsapp .contact-card-block-icon {
    background: linear-gradient(135deg, #1faa55, #25d366);
}

/* 2-column form + map */
.contact-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 992px) {
    .contact-split { grid-template-columns: 1.1fr 0.9fr; gap: 32px; }
}

.contact-form-wrap {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 36px 32px;
    box-shadow: var(--ks-shadow-light);
}
@media (max-width: 640px) { .contact-form-wrap { padding: 28px 22px; } }

.contact-form-title {
    font-size: 24px;
    color: var(--ks-primary);
    margin: 0 0 10px;
}
.contact-form-sub {
    color: var(--ks-text-dim);
    margin: 0 0 24px;
    font-size: 14.5px;
}

.contact-form-simple { display: flex; flex-direction: column; gap: 16px; }
.contact-form-row { display: flex; flex-direction: column; gap: 6px; }
.contact-form-row label {
    font-weight: 600;
    font-size: 14px;
    color: var(--ks-primary);
}
.contact-form-row input,
.contact-form-row textarea {
    padding: 12px 14px;
    background: #f6f9ff;
    border: 1px solid var(--ks-border);
    border-radius: 12px;
    font: inherit;
    color: var(--ks-text-on-light);
    transition: all .2s;
}
.contact-form-row input:focus,
.contact-form-row textarea:focus {
    outline: 0;
    border-color: var(--ks-secondary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 217, 0.15);
}
.contact-form-simple .ks-btn { align-self: flex-start; }
html[dir="rtl"] .contact-form-simple .ks-btn { align-self: flex-end; }

.contact-map-wrap {
    position: relative;
    min-height: 460px;
    border-radius: var(--ks-radius);
    overflow: hidden;
    border: 1px solid var(--ks-border);
    box-shadow: var(--ks-shadow-light);
    background: var(--ks-bg-light-soft);
}
/* Full-width map variant — used on the Contact Us page (no form column). */
.contact-map-wrap--full {
    min-height: 520px;
    margin-top: 8px;
}
@media (min-width: 992px) {
    .contact-map-wrap--full { min-height: 580px; }
}
.contact-map-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: 0;
}
.contact-map-wrap .contact-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 460px;
    padding: 24px;
    text-align: center;
    gap: 16px;
    color: var(--ks-text-dim);
}

/* Page body main area */
.page-main { padding: 70px 0 90px; }

.page-thumb {
    margin: 0 0 48px;
    border-radius: var(--ks-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--ks-shadow);
}
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Article content block — clean white card on the light page bg. */
.page-article.entry-content {
    background: #ffffff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 48px 40px;
    box-shadow: var(--ks-shadow-light);
}
@media (max-width: 640px) {
    .page-article.entry-content { padding: 32px 24px; }
}

/* If the page is empty (no content), don't show an empty card. */
.page-article.entry-content:empty { display: none; }

/* When a contact section is appended automatically, give it some breathing
   room and make it look continuous with the page article above. */
.page-main .contact-section { margin-top: 0; }


.archive-title { font-size: clamp(28px, 5vw, 44px); color: #fff; }
.archive-description { font-size: 16px; max-width: 640px; margin: 12px auto 0; color: var(--ks-text-dim); }

/* ----- Single post meta inside the branded header ----- */
.single-post-header .single-post-meta {
    margin-top: 18px;
    font-size: 14px;
    color: var(--ks-text-dim);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.single-post-header .single-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.single-post-header .single-post-meta .sep { opacity: 0.4; }
.single-post-header .single-post-meta a { color: var(--ks-accent); }
.single-post-header .single-post-meta a:hover { color: #fff; }

/* ----- Tag chips at the bottom of an article ----- */
.single-post-tags {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--ks-border);
    font-size: 13px;
}
.tag-label { font-weight: 700; color: #fff; margin-inline-end: 8px; }
.single-post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    color: var(--ks-text-dim);
    margin: 0 4px 6px;
    transition: all .2s;
}
.single-post-tags a:hover { background: var(--ks-secondary); color: #fff; border-color: var(--ks-secondary); }

/* ----- "No posts found" empty state for archives ----- */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--ks-text-dim);
}
.no-posts h2 { color: #fff; margin: 16px 0 8px; }
.no-posts svg { opacity: 0.3; margin: 0 auto; }
.no-posts form { max-width: 360px; margin: 24px auto 0; }

/* ===== PAGINATION — premium look for archive pages =====
 *
 * Used by the_posts_pagination(), paginate_links(), and any element
 * that outputs <nav class="navigation pagination|posts-navigation"> or
 * <nav class="ks-pagination">. Styled to match the rest of the theme:
 * gradient on the active page, sky-blue accent on hover, soft glow.
 */
.pagination,
.navigation.pagination,
.posts-navigation,
.ks-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 60px auto 20px;
    flex-wrap: wrap;
}
/* Hide the "Posts navigation" screen-reader heading WP outputs */
.pagination .screen-reader-text,
.navigation.pagination .screen-reader-text,
.posts-navigation .screen-reader-text { display: none; }

/* The links container WordPress wraps numbers in */
.pagination .nav-links,
.navigation.pagination .nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Each clickable page item — supports light & dark page backgrounds */
.pagination .page-numbers,
.ks-pagination .page-numbers,
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 46px;
    height: 46px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ks-border);
    border-radius: 12px;
    color: var(--ks-text-on-dark);
    font-weight: 700;
    font-family: var(--ks-font-en);
    font-size: 14px;
    text-decoration: none;
    transition: all .25s var(--ks-transition);
    line-height: 1;
}

/* Prev / Next pills get a slightly different look — wider, with the
   accent color tinting their background so they read as actions. */
.pagination .page-numbers.prev,
.pagination .page-numbers.next,
.navigation.pagination .page-numbers.prev,
.navigation.pagination .page-numbers.next {
    padding: 0 20px;
    background: rgba(91, 168, 232, 0.08);
    border-color: rgba(91, 168, 232, 0.3);
    color: var(--ks-accent);
}
.pagination .page-numbers.prev svg,
.pagination .page-numbers.next svg { flex-shrink: 0; }

/* Hover state on any page link */
.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover,
.ks-pagination .page-numbers:hover {
    background: rgba(91, 168, 232, 0.18);
    border-color: var(--ks-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 217, 0.25);
}

/* Active (current) page — the gradient pill that anchors the row */
.pagination .current,
.navigation.pagination .current,
.ks-pagination .current {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px rgba(59, 130, 217, 0.35);
    cursor: default;
    transform: none;
}
.pagination .current:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(59, 130, 217, 0.35);
}

/* The "..." dots between page ranges */
.pagination .dots,
.navigation.pagination .dots {
    background: transparent;
    border: 0;
    color: var(--ks-text-dim);
    pointer-events: none;
}

/* Light-page variants — pagination on white sections (page-article children, etc) */
.section-light .pagination .page-numbers,
.page-main .pagination .page-numbers {
    background: #fff;
    border-color: var(--ks-border-light);
    color: var(--ks-text-on-light);
}
.section-light .pagination .page-numbers.prev,
.section-light .pagination .page-numbers.next,
.page-main .pagination .page-numbers.prev,
.page-main .pagination .page-numbers.next {
    background: rgba(59, 130, 217, 0.06);
    border-color: rgba(59, 130, 217, 0.2);
    color: var(--ks-secondary);
}

/* Mobile — keep the row scannable */
@media (max-width: 640px) {
    .pagination,
    .navigation.pagination,
    .ks-pagination { gap: 6px; margin-top: 40px; }
    .pagination .page-numbers,
    .navigation.pagination .page-numbers,
    .ks-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
    .pagination .page-numbers.prev,
    .pagination .page-numbers.next { padding: 0 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
