/* ============================================================================
   Nexio — custom overrides (qm-dev)

   THE ONLY place to hand-write CSS for the Nexio frontend template.
   Helix auto-loads this file LAST (onBeforeCompileHead -> addCustomAssets),
   i.e. after bootstrap.min.css, template.css, rtl.css and presets/*.css, so
   plain selectors win without !important. It is NEVER SCSS-compiled and
   survives both Helix-plugin and Nexio-template updates.

   DO NOT edit templates/nexio/css/template.css or rtl.css (SCSS-generated,
   overwritten on every template-style save). Put everything here.

   ----------------------------------------------------------------------------
   INDEX
     §0  Design tokens ................... CSS variables (--qm-*) — tune once
     §1  RTL dropdown chevron fix ........ all headers, RTL only (LTR untouched)
     §2  "Centered Menu" header .......... preset 10-CenteredMenu  (DORMANT — fallback)
     §3  "Topbar Centered" header ........ preset 11-TopbarCentered (ACTIVE)
     §4  SPPB page-content top spacing ... every SP Page Builder page (all presets)
     §5  Floating help button ........... site-wide FAB (all presets)
     §6  Footer .......................... #sp-footer darker + right-aligned + full-width container
     §7  SPPB buttons ..................... brand palette for .sppb-btn-* (solid + outline + link)
     §8  Sticky footer .................... site-wide; footer rests at viewport bottom on short pages
     §9  Smart Search page .............. com_finder /search — branded form, filters & result cards
     §10 Error / 404 page ............... templates/nexio/error.php — Arabic 404 + 5s redirect to home
     §11 GTranslate switcher ............ floating language popup — compact, rounded, brand colours
     §12 Floating buttons placement ..... accessibility widget + help bottom-RIGHT (stacked), GTranslate bottom-LEFT
     §13 OSMap HTML sitemap ............. com_osmap view=html — branded list (RTL, green headings)
   ----------------------------------------------------------------------------
   ============================================================================ */


/* ============================================================================
   §0. Design tokens — tune once; everything below references them.
   Pure refactor: values are identical to the previously-hardcoded literals
   (no visual change). :root cascades everywhere; the --qm- prefix avoids
   clashing with Helix / SPPB variables. (§2 dormant fallback intentionally
   still uses literals — it's a separate, inactive colour scheme.)
   ============================================================================ */
:root {
    --qm-green:       #315b4d;                /* primary brand green — links, menu hover/active, accents */
    --qm-ink:         #11212d;                /* primary text on light */
    --qm-gold:        #b18f5d;                /* gold accent — floating help button */
    --qm-accent:      var(--qm-green);        /* accent = brand green (e.g. dropdown top-cap) */
    --qm-border:      #e2e6ea;                /* hairline — menu band */
    --qm-border-soft: #dfe5e8;                /* hairline — dropdown panel */
    --qm-hover-tint:  rgba(49, 91, 77, .09);  /* hover wash (= --qm-green @ ~9%) */
    --qm-radius:      12px;                   /* panel radius (matches template.css dropdown) */
    --qm-radius-item: 7px;                    /* row / item radius */

    /* SPPB button palette (used by §7). Hover shades ≈ 15% darker. Primary &
       secondary reuse the brand green/gold; the four semantics are brand-
       harmonised and all carry white text. */
    --qm-green-h:     #274a3f;                /* primary button hover (= --qm-green darker) */
    --qm-gold-h:      #9a7b4c;                /* secondary button hover (= --qm-gold darker) */
    --qm-success:     #4f8c69;                /* forest green   */
    --qm-success-h:   #41785a;
    --qm-info:        #4a8589;                /* dusty teal      */
    --qm-info-h:      #3c6e72;
    --qm-warning:     #b3791f;                /* deep amber-ochre*/
    --qm-warning-h:   #976419;
    --qm-danger:      #b46550;                /* muted terracotta*/
    --qm-danger-h:    #9a5340;
    --qm-neutral:     #eff1f4;                /* Default button — neutral light grey */
    --qm-neutral-h:   #d7dadd;
    --qm-neutral-bd:  #cfd6db;                /* Default outline border */
}


/* ============================================================================
   §1. Dropdown chevron — RTL: ONE caret, AFTER the word; Solid face (no tofu)
   ----------------------------------------------------------------------------
   Two stock bugs combine on this RTL site:
   (a) template.css defines the top-level caret on `> a:after` (content + weight 900)
       but does NOT scope it to body.ltr, so it ALSO renders in RTL.
   (b) rtl.css ADDS a second caret on `> a:before` (floated left, weight unset → tofu).
   Because the centred-menu header makes the top-level <a> display:inline-flex, both
   pseudo-elements become flex items: :before lands at the start (RIGHT = before the
   word) and :after at the end (LEFT = after the word) — a duplicate, wrong-side caret.
   Fix: drop the :before caret in RTL and keep :after (already after the word in the
   inline-flex), forced to the Solid (900) face so the angle glyph shows. Angle glyphs
   (\f107 / \f104 / \f105) exist only in the Solid face. (LTR / qmnex unaffected.)
   ========================================================================== */

/* remove the wrong-side (right / before-the-word) top-level caret */
body.rtl .sp-megamenu-parent > li.sp-has-child > a:before,
body.rtl .sp-megamenu-parent > li.sp-has-child > span:before {
    content: none !important;
}

/* re-define the :after caret as a normal flowing flex item on the LEFT (after the
   word). The stock :after is position:absolute + float:right, which misplaces it
   inside our inline-flex <a> (it vanished). Pin content + static flow + Solid face. */
body.rtl .sp-megamenu-parent > li.sp-has-child > a:after,
body.rtl .sp-megamenu-parent > li.sp-has-child > span:after {
    content: "\f107" !important;        /* fa-angle-down */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
    position: static !important;        /* flow as a flex item (stock makes it absolute) */
    float: none !important;
    top: auto !important;
    margin: 0 7px 0 0 !important;       /* gap between caret (left) and label (right) */
}

/* 2nd / 3rd-level dropdown carets: rtl.css already floats these left (correct side) —
   just force the Solid face so the angle glyph renders instead of a tofu box. */
body.rtl .sp-megamenu-parent .sp-dropdown .sp-dropdown-items .sp-has-child > a:after,
body.rtl .sp-megamenu-parent .sp-dropdown .sp-dropdown-items .sp-has-child > span:after {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
}

/* Menu-Heading dropdown parents render as <span> (HelixultimateMenu::item, heading/
   separator branch), so rtl.css's `.sp-has-child > a:after` caret never matches them and
   they show NO submenu arrow. Supply the same left-angle glyph + float that rtl.css gives
   the <a> variant. (RTL-scoped → LTR untouched.) */
body.rtl .sp-megamenu-parent .sp-dropdown .sp-dropdown-items .sp-has-child > span:after {
    content: "\f104" !important;        /* fa-angle-left — RTL flyout opens to the left */
    float: left !important;
    margin-right: 7px !important;
}

/* ----------------------------------------------------------------------------
   Nested sub-dropdown (3rd level) not opening — ROOT CAUSE: the main dropdown's
   inner (#sp-header #sp-menu … .sp-dropdown-inner) is overflow:hidden, which CLIPS
   the sub-dropdown when it opens out to the side (the stock overflow:visible rule
   is scoped to #modal-menu only, not this header). Let inners that actually contain
   a submenu overflow. Direction-NEUTRAL — fixes nested menus in BOTH LTR and RTL
   (LTR opens the sub to the right via stock left:100%, also outside the inner). The
   stock right:100% (RTL) / left:100% (LTR) positioning is already correct. */
#sp-header #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent li .sp-dropdown .sp-dropdown-inner:has(.sp-dropdown-sub) {
    overflow: visible;
}


/* ============================================================================
   §2. "Centered Menu" predefined header  (#sp-header.header-centered-menu)
   ----------------------------------------------------------------------------
   STATUS: DORMANT — fallback preset (10-CenteredMenu). These rules ONLY apply
   when that header is active; the live header is §3 (11-TopbarCentered). Kept
   so we can switch back without re-deriving the dark-pill layout. The pill /
   white colours below are this preset's, NOT the active site's.

   Logo centered on its own row, horizontal menu centered on the row below.
   Scoped to the preset's hook class so switching to another header is clean.
   Desktop only (lg+); below lg the burger/offcanvas handles navigation.
   ========================================================================== */
@media (min-width: 992px) {

    #sp-header.header-centered-menu .container-inner > .row {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* --- Logo: full-width, centered, on top --- */
    #sp-header.header-centered-menu #sp-logo {
        order: 1;
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0 auto !important;
        padding: 0 !important;
        text-align: center;
    }
    #sp-header.header-centered-menu #sp-logo .sp-column,
    #sp-header.header-centered-menu #sp-logo .logo {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #sp-header.header-centered-menu #sp-logo .logo-image,
    #sp-header.header-centered-menu #sp-logo img {
        margin: 0 auto;
        display: inline-block;
    }

    /* --- Menu: full-width, centered, below the logo --- */
    #sp-header.header-centered-menu #sp-menu {
        order: 2;
        flex: 0 0 100%;
        max-width: 100%;
    }
    /* Re-centre the flex chain. Bootstrap's .justify-content-between is
       !important and the base .menu-with-offcanvas/.flex-auto grow, which
       (combined with the block-float UL below) made the menu spread full-width.
       Force centre + don't grow so the menu is a tight, centred group. */
    #sp-header.header-centered-menu #sp-menu .sp-column {
        position: relative;
        justify-content: center !important;
    }
    #sp-header.header-centered-menu #sp-menu .menu-with-offcanvas {
        justify-content: center !important;
        flex: 0 1 auto !important;
    }
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper {
        justify-content: center !important;
        flex: 0 1 auto !important;
        width: auto !important;
        /* rounded "pill" that hugs the menu (content-width, centred) */
        background: rgba(17, 33, 45, 0.60);   /* dark green-navy, translucent */
        border-radius: 999px;                  /* full pill */
        padding: 5px 28px;
        box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    }

    /* THE KEY FIX: the base rule is `.sp-megamenu-parent{display:block;float:right}`
       with `>li{display:inline-block}` — that is what made the items spread and
       the overflow item drop to a RIGHT-aligned 2nd row. Force the UL to be a
       centred flex row. !important guarantees the win over the generated
       base/rtl.css rules regardless of their specificity. */
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        float: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* Item spacing + kill the base 120px line-height (that tall green band) so
       the menu row is a sane height. */
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item {
        margin: 0 9px !important;
    }
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item > a,
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item > span {
        line-height: 1.2 !important;
        padding: 10px 6px !important;
        display: inline-flex;
        align-items: center;
        color: #ffffff !important;        /* readable on the dark pill (carets inherit) */
    }
    /* hover / active accent (gold), readable on the dark pill */
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item:hover > a,
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item.active > a,
    #sp-header.header-centered-menu #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent > li.sp-menu-item.current > a {
        color: #d8b888 !important;
    }

    /* Pin the header modules (search/login) and the "menu" module position
       (.modules-wrap — currently holds an "Admin Menu" module) out of the flex
       flow so the megamenu centres in the FULL width, not pushed off-centre.
       inset-inline-end is RTL-aware (left edge in RTL). */
    #sp-header.header-centered-menu #sp-menu .header-modules,
    #sp-header.header-centered-menu #sp-menu .modules-wrap {
        position: absolute;
        inset-inline-end: 0;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }
}


/* ============================================================================
   §3. "Topbar Centered" predefined header  (#sp-header.header-topbar-centered)
   ----------------------------------------------------------------------------
   STATUS: ACTIVE — this is the live header (preset 11-TopbarCentered, set via
   the header_style param on template_styles id=21). Edit HERE for the current
   site's header look.

   artolio-style stacked header: Helix topbar -> centred logo -> FULL-WIDTH white
   menu band with the menu centred inside it. No pill.
   TOPBAR is fully Helix-controlled: its colours come from the params
   topbar_bg_color / topbar_text_color (System > Templates > Nexio style > Top Bar)
   and its content from the social/contact features + the top1/top2 module
   positions (Module Manager) — so add/remove elements there, never in CSS.
   ========================================================================== */

/* --- Topbar: tidy inline contact + social (applies at all widths, RTL-safe) --- */
#sp-top-bar .sp-contact-info {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 22px;
    align-items: center;
    vertical-align: middle;
}
#sp-top-bar .sp-contact-info > li { line-height: 1.6; }
#sp-top-bar .sp-contact-info a { text-decoration: none; }
#sp-top-bar .sp-contact-info [class*="fa-"] { margin-inline-end: 6px; opacity: .85; }
#sp-top-bar ul.social-icons { margin: 0; vertical-align: middle; }

/* --- Topbar date/time (3 separate Custom HTML modules in top2:
       "Topbar — Hijri Date" / "— Gregorian Date" / "— Madinah Time").
       Lay the modules out in one inline row with thin dividers between them.
       Logical properties (inline-start/-end) keep it RTL-safe AND LTR-safe. --- */
#sp-top-bar #sp-top2 .sp-column { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
@media (min-width: 992px) { #sp-top-bar #sp-top2 .sp-column { justify-content: flex-end; } }
#sp-top-bar #sp-top2 .sp-module { margin: 0; padding-inline: 14px; }
#sp-top-bar #sp-top2 .sp-module + .sp-module { border-inline-start: 1px solid rgba(255, 255, 255, 0.18); }
#sp-top-bar .topbar-dt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; line-height: 1.7; }
#sp-top-bar .topbar-dt > [class*="fa-"] { opacity: .8; font-size: .95em; }
#sp-top-bar .topbar-dt .tb-tz { opacity: .7; font-size: .85em; margin-inline-start: 2px; }

/* header is now multi-row: let it size to its content.
   Also kill the stock `.full-header` 45px side padding (scss/theme.scss; 10px on
   mobile via responsive.scss) so the full-width white #sp-menu-bar runs edge-to-
   edge. Direction-neutral (LTR-safe); the inner .container still caps + centres
   the logo / topbar / menu content. Scoped to our preset so the other headers
   keep their stock 45px. */
#sp-header.header-topbar-centered {
    height: auto;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

/* --- Mobile (<992px): stacked topbar-centred header. Stock Helix forces
       #sp-header .logo{height:65px} (responsive.scss), which clips our taller
       stacked logo (emblem + titles + calligraphy) so its top spills up into the
       dark topbar. Let the logo size to its content and give the logo row top
       breathing room below the topbar. Scoped to our preset; LTR-safe. --- */
@media (max-width: 991.98px) {
    #sp-header.header-topbar-centered #sp-logo,
    #sp-header.header-topbar-centered #sp-logo .sp-column,
    #sp-header.header-topbar-centered #sp-logo .logo,
    #sp-header.header-topbar-centered #sp-logo .logo-image {
        height: auto;
    }
    #sp-header.header-topbar-centered .sp-logo-row {
        padding-top: 20px;
        padding-bottom: 12px;
    }
}

@media (min-width: 992px) {

    /* Row 2 — centred logo */
    #sp-header.header-topbar-centered .sp-logo-row { padding: 16px 0; }
    #sp-header.header-topbar-centered #sp-logo {
        float: none;
        text-align: center;
        /* Kill template.css `#sp-header #sp-logo{margin-right:48px}` which offset
           the centered logo to the left in this stacked header. */
        margin-right: 0;
    }
    #sp-header.header-topbar-centered #sp-logo .sp-column,
    #sp-header.header-topbar-centered #sp-logo .logo {
        display: flex;
        justify-content: center;
        align-items: center;
        height: auto;
    }
    #sp-header.header-topbar-centered #sp-logo img,
    #sp-header.header-topbar-centered #sp-logo .logo-image { margin: 0 auto; }

    /* Row 3 — FULL-WIDTH white menu band */
    #sp-header.header-topbar-centered #sp-menu-bar {
        width: 100%;
        background: #ffffff;
        border-top: 1px solid var(--qm-border);
        border-bottom: 1px solid var(--qm-border);
        /* box-shadow disabled (kept borders only): box-shadow: 0 2px 6px rgba(17, 33, 45, 0.06); */
    }

    /* === Dropdown UI — Variant B "Green top-cap" (flat / shadowless) ==========
       1px hairline edge defines the floating surface (replaces the shadow); a 3px
       brand-green TOP border adds depth-via-colour + brand identity. 12px radius
       kept from template.css. Items: comfortable padding, 7px radius, FULL-ROW
       green-tint hover + green text — same for the active/current page AND the
       3rd-level sub-dropdown (both reuse .sp-dropdown-inner / .sp-dropdown-items).
       The hover/active backgrounds use !important to beat a higher-specificity
       generated rule (template.css `…​>a:hover{background:var(--sppb-bg-card-primary)}`
       which otherwise paints the row grey) and the preset's gold hover (#b99a6b).
       RTL + LTR safe (no direction-specific CSS). */

    /* panel: kill shadow (vendor: main 0 3px 5px, sub 0 0 5px), hairline + green cap */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown .sp-dropdown-inner {
        box-shadow: none;
        border: 1px solid var(--qm-border-soft);
        border-top: 3px solid var(--qm-accent);   /* Variant B: brand-green top-cap */
        background-color: #ffffff;
        padding: 8px;
    }
    /* items */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item > span {
        display: block;
        padding: 10px 16px;
        border-radius: var(--qm-radius-item);
        color: var(--qm-ink);
        font-size: 16px !important;   /* match the top-level menu titles (vendor sets dropdown to 18px) */
        line-height: 1.45;
        transition: background-color .15s ease, color .15s ease;
    }
    /* full-row hover + keyboard focus (green tint — !important beats vendor grey) */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item:hover > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item:hover > span,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item > a:focus {
        background-color: var(--qm-hover-tint) !important;
        color: var(--qm-green) !important;
    }
    /* active / current page */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item.active > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-dropdown-items > li.sp-menu-item.current > a {
        background-color: var(--qm-hover-tint) !important;
        color: var(--qm-green) !important;
    }

    /* menu wrapper spans the band, auto height (kills the base 120px band) */
    #sp-header.header-topbar-centered #sp-menu-bar #sp-menu {
        position: relative;
        float: none;
        width: 100%;
        height: auto;
    }
    #sp-header.header-topbar-centered #sp-menu-bar #sp-menu > .sp-column {
        height: auto;
        width: 100%;
        justify-content: flex-start !important;   /* override Bootstrap's .justify-content-center */
    }

    /* FULL WIDTH: the megamenu takes ALL available space and distributes items
       edge-to-edge. space-between is direction-neutral (works LTR + RTL). */
    #sp-header.header-topbar-centered #sp-menu-bar .menu-with-offcanvas {
        flex: 1 1 auto !important;
        width: 100%;
        justify-content: space-between !important;
    }
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-wrapper {
        flex: 1 1 auto !important;
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* base rule is .sp-megamenu-parent{display:block;float:right}; force a full-width
       flex row that spreads items across all available space. */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
    }

    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item {
        margin: 0 !important;
    }
    /* `> span` (plain direct child) styles a "Menu Heading" / "Text Separator"
       item the SAME as a link. Helix renders those non-link types as a bare
       <span class="sp-menu-heading|sp-menu-separator"> child of the <li>
       (HelixultimateMenu::item()), while URL items render <a>. Without this, a
       heading falls back to the vendor base `…>li>span{line-height:55px}`, which
       — being taller than the inline-flex links — stretches the align-items:center
       flex row and bloats the whole band. URL items keep their icon spans INSIDE
       the <a>, so `> span` never double-targets them. */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item > span {
        line-height: 1.2 !important;
        padding: 16px 14px !important;
        display: inline-flex;
        align-items: center;
        color: var(--qm-ink) !important;        /* dark text on the white band */
        font-weight: 500;
    }
    /* a heading is non-clickable — don't show the link hand cursor */
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item > span.sp-menu-heading,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item > span.sp-menu-separator {
        cursor: default;
    }
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item:hover > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item.active > a,
    #sp-header.header-topbar-centered #sp-menu-bar .sp-megamenu-parent > li.sp-menu-item.current > a {
        color: var(--qm-green) !important;        /* brand primary green hover/active (opened page) */
    }

    /* search/login + the "menu" module position + burger sit IN-FLOW at the end
       (not absolutely pinned) so the full-width menu never overlaps them. */
    #sp-header.header-topbar-centered #sp-menu-bar .header-modules,
    #sp-header.header-topbar-centered #sp-menu-bar .modules-wrap {
        position: static;
        transform: none;
        margin: 0;
        flex: 0 0 auto;
    }

    /* Header SEARCH icon — sits at the menu bar's INLINE-END: visually far-left
       on the RTL (Arabic) site, far-right once an LTR (English) site is added
       (flex DOM order handles both, no direction-specific CSS). margin-inline-
       start is the requested GAP after the menu items — it falls on the side
       facing the menu in BOTH directions. The menu (flex:1 1 auto) shrinks to
       make room. Desktop only (the element is d-none d-lg-flex). LTR-safe. */
    #sp-header.header-topbar-centered #sp-menu-bar .qm-header-search {
        flex: 0 0 auto;
        margin-inline-start: 26px;
    }
    #sp-header.header-topbar-centered #sp-menu-bar .qm-search-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        color: var(--qm-ink);           /* matches the menu text colour */
        font-size: 16px;
        line-height: 1;
        text-decoration: none;
        transition: color .2s ease, background-color .2s ease;
    }
    #sp-header.header-topbar-centered #sp-menu-bar .qm-search-btn:hover,
    #sp-header.header-topbar-centered #sp-menu-bar .qm-search-btn:focus {
        color: var(--qm-green);         /* brand primary green */
        background-color: var(--qm-hover-tint);
        outline: none;
    }
}


/* ============================================================================
   §4. Page-content top spacing (SP Page Builder pages)
   ----------------------------------------------------------------------------
   Stock theme.scss zeroes #sp-main-body padding on SPPB pages
   (`.com-sppagebuilder #sp-main-body{padding:0}`), so page content butts
   right up under the white menu band. Add a small 10px breathing gap.
   Direction-neutral (LTR-safe); applies uniformly to every SPPB page,
   independent of the active header preset.
   ========================================================================== */
.com-sppagebuilder #sp-main-body {
    padding: 0;
    margin-top: 0px;
}


/* ============================================================================
   §5. Floating help button (site-wide FAB)
   ----------------------------------------------------------------------------
   Round gold help button linking to the help portal. The HTML lives in a Custom
   HTML module (mod_custom "Help FAB") published to ALL pages in position bottom1;
   `position:fixed` pulls it to the corner, so the module's position is irrelevant.
   Flat (no shadow, matching the site) — hover = slight lift + subtle darken.
   Pinned to the bottom INLINE-END: left on the RTL (Arabic) site, right on the
   LTR (English) site — opposite the bottom-right GTranslate float. RTL + LTR safe.
   ============================================================================ */
.qm-help-fab {
    position: fixed;
    inset-inline-end: 24px;             /* left in RTL, right in LTR (auto-flips) */
    bottom: 24px;
    z-index: 1040;                      /* above content, below Bootstrap modals (1050) */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--qm-gold);   /* #b18f5d */
    color: #ffffff !important;          /* white "?" — !important beats the template's link colour */
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: filter .2s ease, transform .2s ease;
}
.qm-help-fab:hover,
.qm-help-fab:focus {
    color: #ffffff !important;
    filter: brightness(0.92);           /* subtle darken (flat — no shadow) */
    transform: translateY(-2px);        /* slight float on hover (no extra animation) */
}


/* ============================================================================
   §6. Footer
   ----------------------------------------------------------------------------
   The bottom of every page is TWO stacked Helix sections that share one
   generated rule (`#sp-footer,#sp-bottom{background:#151917}` in preset1.css):
     • #sp-bottom  — the "bottom" row (bottom1-4). Now holds only the floating
                     Help FAB, so it reads as a thin band. Stays #151917.
     • #sp-footer  — the real <footer> (footer1 = Helix copyright, footer2 empty).
   We give #sp-footer a slightly DARKER shade so the two sections read as
   distinct. custom.css loads after preset1.css at equal specificity, so this
   plain #id selector wins the source-order tiebreak — no !important needed.
   Content is right-aligned, RTL-scoped (body.rtl) so the LTR site keeps its
   natural left alignment — LTR-safe.
   ============================================================================ */
#sp-footer {
    background: #0f1210;                 /* slightly darker than #sp-bottom (#151917) */
}
body.rtl #sp-footer {
    text-align: right;                   /* copyright hugs the right edge (RTL only) */
}

/* Let footer + bottom content span the FULL width.
   Stock Helix wraps them in a Bootstrap .container capped at a centered
   1140/960/720/540px (the "boxed content on full-bleed background" pattern),
   which is why the right-aligned copyright stops short of the screen edge.
   custom.css loads after template.css at equal specificity, so this wins by
   source order over every responsive breakpoint — no !important needed.
   max-width:100% keeps the .container's built-in 15px side padding as a small
   gutter (use max-width:none for truly edge-to-edge). Direction-neutral. */
#sp-footer > .container,
#sp-bottom  > .container {
    max-width: 1290px;
}


/* ============================================================================
   §7. SP Page Builder buttons — brand palette
   ----------------------------------------------------------------------------
   Re-skins the SPPB Button addon's "Button Style" options to the brand palette
   (tokens in §0). Stock SPPB ships blue/cyan/yellow/red; we map them to the
   green + gold family. ALL coloured styles use white text.

   WHY !important: these colours are set (without !important) in three places —
   SPPB core `components/com_sppagebuilder/assets/css/sppagebuilder.css`, the
   Nexio `template.css` (Default/Primary via --sppb-* vars) and the active
   `presets/preset1.css` (Primary → #315b4d). An !important declaration beats
   ANY non-important rule regardless of specificity/order, so a single class
   wins cleanly. Per-instance custom colours set in the page builder are
   ID-scoped (also !important) and therefore still override these — intended.

   Untouched: Dark, Custom (Custom = manual pickers in the addon).
   Direction-neutral → LTR-safe.
   ============================================================================ */

/* --- Default → neutral light grey. MUST be pinned: the template maps Default to
       background-color:var(--sppb-button-primary), a variable SPPB's JS injects
       from the active Color-Variables theme — which resolves to BLUE #3653F4.
       Without this rule, "Default" renders blue, not grey. --- */
.sppb-btn-default {
    color: var(--qm-ink) !important;
    background-color: var(--qm-neutral) !important;
    border-color: var(--qm-neutral) !important;
}
.sppb-btn-default:hover,
.sppb-btn-default:focus,
.sppb-btn-default:active {
    color: var(--qm-ink) !important;
    background-color: var(--qm-neutral-h) !important;
    border-color: var(--qm-neutral-h) !important;
}

/* --- Primary → brand green (kills stock #3071ff + the preset override) --- */
.sppb-btn-primary {
    color: #fff !important;
    background-color: var(--qm-green) !important;
    border-color: var(--qm-green) !important;
}
.sppb-btn-primary:hover,
.sppb-btn-primary:focus,
.sppb-btn-primary:active {
    color: #fff !important;
    background-color: var(--qm-green-h) !important;
    border-color: var(--qm-green-h) !important;
}

/* --- Secondary → brand gold --- */
.sppb-btn-secondary {
    color: #fff !important;
    background-color: var(--qm-gold) !important;
    border-color: var(--qm-gold) !important;
}
.sppb-btn-secondary:hover,
.sppb-btn-secondary:focus,
.sppb-btn-secondary:active {
    color: #fff !important;
    background-color: var(--qm-gold-h) !important;
    border-color: var(--qm-gold-h) !important;
}

/* --- Success → forest green --- */
.sppb-btn-success {
    color: #fff !important;
    background-color: var(--qm-success) !important;
    border-color: var(--qm-success) !important;
}
.sppb-btn-success:hover,
.sppb-btn-success:focus,
.sppb-btn-success:active {
    color: #fff !important;
    background-color: var(--qm-success-h) !important;
    border-color: var(--qm-success-h) !important;
}

/* --- Info → dusty teal --- */
.sppb-btn-info {
    color: #fff !important;
    background-color: var(--qm-info) !important;
    border-color: var(--qm-info) !important;
}
.sppb-btn-info:hover,
.sppb-btn-info:focus,
.sppb-btn-info:active {
    color: #fff !important;
    background-color: var(--qm-info-h) !important;
    border-color: var(--qm-info-h) !important;
}

/* --- Warning → deep amber-ochre (white text, unlike stock yellow) --- */
.sppb-btn-warning {
    color: #fff !important;
    background-color: var(--qm-warning) !important;
    border-color: var(--qm-warning) !important;
}
.sppb-btn-warning:hover,
.sppb-btn-warning:focus,
.sppb-btn-warning:active {
    color: #fff !important;
    background-color: var(--qm-warning-h) !important;
    border-color: var(--qm-warning-h) !important;
}

/* --- Danger → muted terracotta --- */
.sppb-btn-danger {
    color: #fff !important;
    background-color: var(--qm-danger) !important;
    border-color: var(--qm-danger) !important;
}
.sppb-btn-danger:hover,
.sppb-btn-danger:focus,
.sppb-btn-danger:active {
    color: #fff !important;
    background-color: var(--qm-danger-h) !important;
    border-color: var(--qm-danger-h) !important;
}

/* --- Link → brand green text (was off-palette blue) --- */
.sppb-btn-link {
    color: var(--qm-green) !important;
    background-color: transparent !important;
    border-color: transparent !important;
}
.sppb-btn-link:hover,
.sppb-btn-link:focus {
    color: var(--qm-green-h) !important;
    text-decoration: underline !important;
}

/* --- Outline variant (the addon's "Outline" toggle): transparent fill,
       brand border + text; fills solid (white text) on hover. Higher
       specificity than the solid rules above, so it wins for outline buttons.
       Both class forms (.sppb-btn-outline and Bootstrap .btn-outline-*). --- */
.sppb-btn-default.sppb-btn-outline,   .sppb-btn-default.btn-outline-default     { color: var(--qm-ink)     !important; background-color: transparent !important; border-color: var(--qm-neutral-bd) !important; }
.sppb-btn-primary.sppb-btn-outline,   .sppb-btn-primary.btn-outline-primary     { color: var(--qm-green)   !important; background-color: transparent !important; border-color: var(--qm-green)   !important; }
.sppb-btn-secondary.sppb-btn-outline, .sppb-btn-secondary.btn-outline-secondary { color: var(--qm-gold)    !important; background-color: transparent !important; border-color: var(--qm-gold)    !important; }
.sppb-btn-success.sppb-btn-outline,   .sppb-btn-success.btn-outline-success     { color: var(--qm-success) !important; background-color: transparent !important; border-color: var(--qm-success) !important; }
.sppb-btn-info.sppb-btn-outline,      .sppb-btn-info.btn-outline-info           { color: var(--qm-info)    !important; background-color: transparent !important; border-color: var(--qm-info)    !important; }
.sppb-btn-warning.sppb-btn-outline,   .sppb-btn-warning.btn-outline-warning     { color: var(--qm-warning) !important; background-color: transparent !important; border-color: var(--qm-warning) !important; }
.sppb-btn-danger.sppb-btn-outline,    .sppb-btn-danger.btn-outline-danger       { color: var(--qm-danger)  !important; background-color: transparent !important; border-color: var(--qm-danger)  !important; }

.sppb-btn-default.sppb-btn-outline:hover,   .sppb-btn-default.btn-outline-default:hover     { color: var(--qm-ink) !important; background-color: var(--qm-neutral) !important; border-color: var(--qm-neutral-bd) !important; }
.sppb-btn-primary.sppb-btn-outline:hover,   .sppb-btn-primary.btn-outline-primary:hover     { color:#fff !important; background-color: var(--qm-green)   !important; border-color: var(--qm-green)   !important; }
.sppb-btn-secondary.sppb-btn-outline:hover, .sppb-btn-secondary.btn-outline-secondary:hover { color:#fff !important; background-color: var(--qm-gold)    !important; border-color: var(--qm-gold)    !important; }
.sppb-btn-success.sppb-btn-outline:hover,   .sppb-btn-success.btn-outline-success:hover     { color:#fff !important; background-color: var(--qm-success) !important; border-color: var(--qm-success) !important; }
.sppb-btn-info.sppb-btn-outline:hover,      .sppb-btn-info.btn-outline-info:hover           { color:#fff !important; background-color: var(--qm-info)    !important; border-color: var(--qm-info)    !important; }
.sppb-btn-warning.sppb-btn-outline:hover,   .sppb-btn-warning.btn-outline-warning:hover     { color:#fff !important; background-color: var(--qm-warning) !important; border-color: var(--qm-warning) !important; }
.sppb-btn-danger.sppb-btn-outline:hover,    .sppb-btn-danger.btn-outline-danger:hover       { color:#fff !important; background-color: var(--qm-danger)  !important; border-color: var(--qm-danger)  !important; }


/* ============================================================================
   §8. Sticky footer (site-wide)

   Keeps #sp-bottom + #sp-footer at the bottom of the viewport on SHORT pages,
   while LONG pages flow naturally (the footer sits right after the content).

   Standard CSS flexbox "sticky footer" — NO position:fixed, NO JavaScript.
   The wrapper chain becomes a full-height flex column and #sp-main-body grows
   to absorb any leftover space, pushing the footer down. On a tall page the
   content already fills the height, so there is no spare space to grow into —
   long pages render exactly as before.

   Layout (verified): body > .body-wrapper > .body-innerwrapper >
       [ #sp-top-bar, #sp-header, #sp-main >
           ( #sp-page-title, #sp-main-body, #sp-bottom, #sp-footer ) ]
   The off-canvas menu/overlay are FIXED siblings of .body-wrapper, so this
   flex layout never touches them. Mobile menu is unaffected.
   ============================================================================ */
.body-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;   /* dynamic viewport unit avoids mobile address-bar jump */
}

.body-wrapper .body-innerwrapper,
.body-innerwrapper #sp-main {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

#sp-main > #sp-main-body {
    flex: 1 0 auto;
}


/* GTranslate floating widget.
   float.js creates #gt_float_wrapper as a child of .gtranslate_wrapper with inline
   style="position:fixed;bottom:20px;right:20px;z-index:999999;" (no !important).
   Stylesheet !important beats normal inline → our rule wins.
   NOTE: never apply transform/filter/perspective to .gtranslate_wrapper — those create
   a new containing block and break the fixed positioning of its child #gt_float_wrapper.
   On desktop: no override needed (float.js default bottom:20px is fine, no nav bar).
   On mobile: lift above the 60px bottom nav bar.
   Scroll-hide (.qm-gt-hidden) toggled by JS in plg_system_qm_bottomnav. */
@media (max-width: 1024px) {
    #gt_float_wrapper {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px) !important;
        transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    }
    #gt_float_wrapper.qm-gt-hidden {
        opacity: 0 !important;
        transform: scale(.7) !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}


/* ============================================================================
   §9. Smart Search page (com_finder — the /search menu item)
   ----------------------------------------------------------------------------
   The header magnifier links to a hidden "Smart Search → Search" menu item
   (alias `search`, itemid 825). The core finder view renders raw Bootstrap +
   BEM `com-finder__*` markup with no brand styling. This section re-skins it to
   the homepage design language (tokens in §0): centred narrow column, white
   stroke cards with the green top-cap (same as the menu dropdown / SPPB look),
   brand-green primary button, gold dates, green taxonomy chips. No shadows.

   Scope: component styling under `.com-finder`; page-chrome fixes under
   `body.com_finder`. Direction-neutral except where noted (LTR-safe). All CSS —
   never edit the core/Helix finder layout PHP (a template update overwrites the
   html/com_finder overrides). After editing: cache:clean all + hard-refresh.
   ============================================================================ */

/* Collapse the empty page-title band on search views (no heading is set, so it
   was just a large blank gap under the header). Guarded with :has(:empty) so it
   only hides when genuinely empty — a heading, if ever added, still shows. */
body.com_finder #sp-page-title:has(#sp-title .sp-column:empty) {
    display: none;
}

/* Centre + narrow the finder column (parent is a full-width col-lg-12) and give
   it breathing room top/bottom.
   ⚠ MUST be `.com-finder.finder` (the wrapper <div class="com-finder finder">),
   NOT bare `.com-finder` — Helix puts `com-finder` on the <body> too, so a bare
   `.com-finder{max-width}` shrinks the ENTIRE site. Targeting both classes pins
   it to the wrapper div only (the body has no `finder` class). */
.com-finder.finder {
    max-width: 1040px;
    margin-inline: auto;
    padding-block: 8px 56px;
}

/* --- Search form: one branded card with the brand-green top-cap --- */
.com-finder__form {
    background: #fff;
    border: 1px solid var(--qm-border-soft);
    border-top: 3px solid var(--qm-green);
    border-radius: var(--qm-radius);
    padding: 26px 24px;
    box-shadow: none;
}

/* label on its own line, input + buttons in a wrapping row below it */
.com-finder__search { margin-bottom: 0; }
.com-finder__search .form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.com-finder__search label[for="q"] {
    flex: 0 0 100%;
    margin: 0 0 2px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--qm-ink);
}

/* turn Bootstrap's joined input-group into a clean spaced flex row
   (!important is needed to beat BS5's high-specificity radius/margin rules) */
.com-finder .input-group {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}
.com-finder .input-group > * { margin: 0 !important; }
.com-finder .input-group > .form-control,
.com-finder .input-group > .btn {
    border-radius: var(--qm-radius-item) !important;
}

.com-finder #q.form-control {
    flex: 1 1 240px;
    min-height: 48px;
    border: 1px solid var(--qm-border);
    padding: .65rem 1rem;
    font-size: 1rem;
    color: var(--qm-ink);
}
.com-finder #q.form-control:focus {
    border-color: var(--qm-green);
    box-shadow: 0 0 0 3px var(--qm-hover-tint);
    outline: none;
}

/* primary "Search" button → brand green; secondary "Advanced" → ghost/outline */
.com-finder .input-group > .btn {
    flex: 0 0 auto;
    min-height: 48px;
    padding-inline: 1.25rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.com-finder .btn-primary {
    background-color: var(--qm-green);
    border-color: var(--qm-green);
    color: #fff;
}
.com-finder .btn-primary:hover,
.com-finder .btn-primary:focus {
    background-color: var(--qm-green-h);
    border-color: var(--qm-green-h);
    color: #fff;
}
.com-finder .btn-secondary {
    background-color: transparent;
    border: 1px solid var(--qm-border);
    color: var(--qm-ink);
}
.com-finder .btn-secondary:hover,
.com-finder .btn-secondary:focus {
    background-color: var(--qm-hover-tint);
    border-color: var(--qm-green);
    color: var(--qm-green);
}

/* --- Advanced search: tips card + filter selects --- */
.com-finder__advanced { margin-top: 16px; padding: 0; border: 0; }
.com-finder__tips.card {
    border: 1px solid var(--qm-border-soft);
    border-radius: var(--qm-radius);
    background: #fbfaf7;                 /* faint warm tint, like the homepage panels */
    box-shadow: none;
}
.com-finder__tips .card-body { padding: 16px 20px; color: var(--qm-ink); }
.com-finder__tips p { margin: 0 0 .5rem; line-height: 1.8; }
.com-finder__tips p:last-child { margin-bottom: 0; }
.com-finder__tips strong { color: var(--qm-green); }

.com-finder__filter {
    margin-top: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--qm-border-soft);
    border-radius: var(--qm-radius);
}
.com-finder__filter .filter-branch {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.com-finder__filter .control-group { margin: 0; }
.com-finder__filter .control-label label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--qm-ink);
}
.com-finder .form-select {
    min-height: 44px;
    border: 1px solid var(--qm-border);
    border-radius: var(--qm-radius-item);
    padding: .5rem .8rem;
    color: var(--qm-ink);
}
.com-finder .form-select:focus {
    border-color: var(--qm-green);
    box-shadow: 0 0 0 3px var(--qm-hover-tint);
    outline: none;
}

/* --- Results --- */
.com-finder__results { margin-top: 28px; }
.com-finder__explained {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--qm-hover-tint);
    border: 1px solid var(--qm-border-soft);
    border-radius: var(--qm-radius-item);
    color: var(--qm-ink);
}
.com-finder__explained p { margin: 0; }
.com-finder__explained .term { color: var(--qm-green); font-weight: 700; }
.com-finder__explained a { color: var(--qm-green); text-decoration: underline; }

.com-finder__results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.com-finder .result__item {
    position: relative;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--qm-border-soft);
    border-radius: var(--qm-radius);
    transition: border-color .18s ease, transform .18s ease;
}
.com-finder .result__item:hover {
    border-color: var(--qm-green);
    transform: translateY(-2px);
}
.com-finder .result__title { margin: 0; font-size: 1.15rem; line-height: 1.5; }
.com-finder .result__title-link { text-decoration: none; }
.com-finder .result__title-text { color: var(--qm-green); font-weight: 700; }
.com-finder .result__title-link:hover .result__title-text {
    color: var(--qm-green-h);
    text-decoration: underline;
}
/* the URL under the title — small, muted, always LTR (URLs read left-to-right) */
.com-finder .result__title-url {
    display: block;
    margin-top: 3px;
    font-style: normal;
    font-size: .8rem;
    color: #8a949c;
    direction: ltr;
    text-align: start;
    word-break: break-all;
}
.com-finder .result__description {
    margin: .55rem 0 0;
    color: #4a565e;
    line-height: 1.85;
    font-size: .95rem;
}
.com-finder .result__date {
    display: block;
    margin-bottom: 4px;
    color: var(--qm-gold);
    font-weight: 600;
    font-size: .85rem;
}
/* taxonomy = pill chips */
.com-finder .result__taxonomy {
    list-style: none;
    margin: .85rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.com-finder .result__taxonomy-item {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--qm-hover-tint);
    color: var(--qm-green);
    font-size: .78rem;
    line-height: 1.6;
}
.com-finder .result__taxonomy-item span { color: #6a7c74; font-weight: 600; }

/* pagination */
.com-finder .pagination {
    margin-top: 28px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}
.com-finder .pagination .page-link {
    color: var(--qm-green);
    border-color: var(--qm-border);
    border-radius: var(--qm-radius-item);
}
.com-finder .pagination .page-item.active .page-link {
    background-color: var(--qm-green);
    border-color: var(--qm-green);
    color: #fff;
}

/* small screens: form padding eases in */
@media (max-width: 575.98px) {
    .com-finder__form { padding: 20px 16px; }
    .com-finder .result__item { padding: 16px; }
}


/* ============================================================================
   §10. Error / 404 page  (templates/nexio/error.php)
   ----------------------------------------------------------------------------
   Helix's error.php is a stand-alone minimal document that does NOT run Helix's
   addCustomAssets, so it would not normally load this file — error.php now has an
   explicit <link> to css/custom/custom.css. Everything visual for the error page
   lives HERE; only the markup + the countdown <script> are in error.php (CSS
   can't hold HTML/JS). Scoped to .error-page (the <html class="error-page"> Helix
   sets) so it can never affect a normal page. The 404 view (.qm-404) shows an
   Arabic "not found" message + a 5→1 countdown that redirects to the homepage.
   Direction-neutral; the page is RTL on the Arabic site via <html dir>.
   ============================================================================ */
html.error-page,
html.error-page body {
    height: 100%;
    margin: 0;
    background: #f4f6f7;
    color: var(--qm-ink, #11212d);
    /* site Arabic font (same family the front-end loads) for typographic parity */
    font-family: "IBM Plex Sans Arabic", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}
html.error-page body > .container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}

/* logo lockup (shown only if an error logo is set in the template params) */
html.error-page .error-logo {
    max-height: 130px;
    width: auto;
    margin-bottom: 4px;
}

/* ---- 404 card: same white stroke + green top-cap as the site cards (§9, halaqat) ---- */
.error-page .qm-404 {
    width: 100%;
    max-width: 560px;
    margin-top: 26px;
    background: #fff;
    border: 1px solid var(--qm-border-soft, #dfe5e8);
    border-top: 3px solid var(--qm-green, #315b4d);
    border-radius: var(--qm-radius, 12px);
    padding: 44px 36px 38px;
}

/* big brand green->gold gradient "404" (falls back to solid green if unsupported) */
.error-page .qm-404__code {
    margin: 0 0 6px;
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 4px;
    color: var(--qm-green, #315b4d);
    background: linear-gradient(90deg, var(--qm-green, #315b4d), var(--qm-gold, #b18f5d));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-page .qm-404__title {
    margin: 0 0 16px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--qm-green, #315b4d);
}
.error-page .qm-404__count {
    margin: 0 0 28px;
    font-size: 1.05rem;
    color: #5a6a72;
    line-height: 1.9;
}
.error-page .qm-404__num {
    display: inline-block;
    min-width: 1.7em;
    padding: 2px 9px;
    margin: 0 3px;
    border-radius: 999px;
    background: var(--qm-hover-tint, rgba(49, 91, 77, .09));
    color: var(--qm-green, #315b4d);
    font-weight: 800;
}
.error-page .qm-404__btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .8rem 1.8rem;
    border-radius: var(--qm-radius-item, 7px);
    background: var(--qm-green, #315b4d);
    color: #fff !important;
    font-size: 1.02rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, transform .08s ease;
}
.error-page .qm-404__btn:hover,
.error-page .qm-404__btn:focus {
    background: var(--qm-green-h, #274a3f);
    color: #fff !important;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .error-page .error-logo { max-height: 100px; }
    .error-page .qm-404 { padding: 34px 20px 30px; }
    .error-page .qm-404__code { font-size: 4.2rem; }
    .error-page .qm-404__title { font-size: 1.6rem; }
}


/* ============================================================================
   §11. GTranslate floating language switcher — compact, rounded, on-brand
   ----------------------------------------------------------------------------
   The "AR" floating switcher (#gt_float_wrapper → .gt_float_switcher → .gt-selected
   pill + .gt_options popup) is built by media/mod_gtranslate/js/float.js, which
   ALSO injects a <style class="gtranslate_css"> into <head> at RUNTIME — i.e. AFTER
   this file. So every rule below is prefixed with #gt_float_wrapper (ID specificity)
   to beat GTranslate's plain-class defaults WITHOUT !important. Stock defaults are
   bulky/off-brand (20px font, 2px radius, 33px flags, blue #6070a0 hover); this makes
   it compact, rounded and brand-coloured. (Positioning + mobile scroll-hide live in
   the GTranslate block above; this is purely the look.) Vendor JS = update-safe to
   override here since we don't touch the module files.
   ============================================================================ */

/* whole switcher box: site font, compact text, big radius, soft elevation + hairline */
#gt_float_wrapper .gt_float_switcher {
    font-family: "IBM Plex Sans Arabic", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--qm-ink, #11212d);
    background: #fff;
    border: 1px solid var(--qm-border-soft, #dfe5e8);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(17, 33, 45, 0.12);
}

/* flags: smaller + rounded; logical margin so it's correct in RTL and LTR */
#gt_float_wrapper .gt_float_switcher img {
    width: 20px;
    height: auto;
    margin: 0;
    margin-inline-end: 8px;
    border-radius: 3px;
}

/* selected (always-visible) row: compact pill */
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang {
    padding: 8px 12px;
    color: var(--qm-ink, #11212d);
    font-weight: 700;
}

/* the popup list: compact, padded so the rounded hover rows don't touch the edges */
#gt_float_wrapper .gt_float_switcher .gt_options {
    max-height: 220px;
    padding: 5px;
}
#gt_float_wrapper .gt_float_switcher .gt_options a {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    margin: 1px 0;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--qm-ink, #11212d);
}
/* brand-green hover (replaces GTranslate's blue #6070a0) */
#gt_float_wrapper .gt_float_switcher .gt_options a:hover {
    background: var(--qm-hover-tint, rgba(49, 91, 77, 0.09));
    color: var(--qm-green, #315b4d);
}

/* slim brand scrollbar for the popup */
#gt_float_wrapper .gt_float_switcher .gt_options::-webkit-scrollbar { width: 6px; }
#gt_float_wrapper .gt_float_switcher .gt_options::-webkit-scrollbar-track { background: transparent; }
#gt_float_wrapper .gt_float_switcher .gt_options::-webkit-scrollbar-thumb {
    background: var(--qm-border-soft, #dfe5e8);
    border-radius: 999px;
}


/* ============================================================================
   §12. Floating button placement — accessibility widget + help RIGHT, GTranslate LEFT
   ----------------------------------------------------------------------------
   Final corner layout (physical, both directions):
     RIGHT edge, bottom→up:  [accessibility FAB]  then  [help FAB]
     LEFT  edge:             [GTranslate language switcher]
   - Accessibility widget (sienna) stock-pins FAB + panel bottom-right; we just
     pin the FAB to right:24px to align with help.
   - Help FAB (§5) uses inset-inline-end (=left in RTL) — force it to the physical
     RIGHT and lift it ABOVE the 56px widget FAB (20 base + 56 + 16 gap = 92px).
   - GTranslate float (#gt_float_wrapper, stock inline right:20px) → bottom-LEFT.
   Widget z-index (FAB 500000 / overlay 499999) stays; open panel covers the help
   FAB (1040) — fine, panel has focus. !important beats the widgets' inline rules.
   ============================================================================ */

/* accessibility widget FAB: bottom-RIGHT, aligned with help */
.asw-widget .asw-menu-btn {
    right: 24px !important;
    left:  auto !important;
}

/* widget panel stays on the RIGHT (stock) */
.asw-menu {
    right: 20px !important;
    left:  auto !important;
}

/* Help FAB: physical RIGHT (override inset-inline-end), ABOVE the widget FAB */
.qm-help-fab {
    right: 24px;
    inset-inline-end: auto;
    left: auto;
    bottom: 92px;
}

/* GTranslate language switcher → bottom-LEFT (stock inline is right:20px) */
#gt_float_wrapper {
    left:  20px !important;
    right: auto !important;
}

/* mobile: lift the widget FAB above the 60px bottom nav (GTranslate already lifts
   in its own § ; help FAB is hidden on mobile) */
@media (max-width: 1024px) {
    .asw-widget .asw-menu-btn {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px) !important;
    }
}


/* ============================================================================
   §13. OSMap HTML sitemap (com_osmap view=html) — brand to match the site
   ----------------------------------------------------------------------------
   Markup: #osmap > .osmap-items(div) > h2 (menu title) + ul.level_0 >
   li(.osmap-has-children) > a.osmap-link | span.osmap-item-heading + ul.level_1…
   Body carries .com-osmap.view-html. RTL site. Scope to .com-osmap so it can't
   leak. Brand tokens from §0 (green/gold/radius).
   ============================================================================ */
/* empty page-title section reserves a big blank band above the sitemap — hide it
   (osmap menu item shows no heading) and give #sp-main-body balanced top/bottom space */
.com-osmap #sp-page-title {
    display: none;
}
.com-osmap #sp-main-body {
    padding-top: 28px;
    padding-bottom: 40px;
}
/* The sheikh-logo band (component-bottom module) sits INSIDE #sp-component right
   after #osmap, so #sp-main-body padding lands below it. Put the "after sitemap"
   gap on that band's top instead. Scoped to .com-osmap → no other page affected. */
.com-osmap #sp-component .sp-module-content-bottom {
    margin-top: 56px;
}
.com-osmap #osmap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 18px;
}
.com-osmap .osmap-sitemap-description {
    color: var(--qm-ink);
    opacity: .75;
    margin-bottom: 18px;
}
/* ACTUAL markup: .osmap-items (div) > h2#osmap-menu-uid-<type> + ul.level_0
   > li(.osmap-has-children) > a.osmap-link | span.osmap-item-heading + ul.level_1 … */

/* menu-title heading ("Main Menu" etc.) — stock template h2 is huge; shrink + brand */
.com-osmap .osmap-items > h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--qm-green);
    margin: 4px 0 10px;
    padding: 0;
    border: 0;
}
/* lists (ul.level_0/1/2…) */
.com-osmap .osmap-items ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.com-osmap .osmap-items li {
    margin: 2px 0;
}
/* nested levels: indent on the inline-start (RTL-aware) + hairline guide */
.com-osmap ul.level_0 ul {
    margin-inline-start: 18px;
    padding-inline-start: 16px;
    border-inline-start: 2px solid var(--qm-border-soft);
}
/* every row: link or heading */
.com-osmap .osmap-link,
.com-osmap .osmap-item-heading {
    display: inline-block;
    padding: 7px 12px;
    border-radius: var(--qm-radius-item);
    color: var(--qm-ink);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.com-osmap a.osmap-link:hover,
.com-osmap a.osmap-link:focus {
    background-color: var(--qm-hover-tint);
    color: var(--qm-green);
}
/* top-level rows (level_0) = section headings: bolder, brand green */
.com-osmap ul.level_0 > li > .osmap-link,
.com-osmap ul.level_0 > li > .osmap-item-heading {
    font-weight: 700;
    font-size: 16px;
    color: var(--qm-green);
}
/* parent rows get a subtle marker */
.com-osmap .osmap-has-children > .osmap-link,
.com-osmap .osmap-has-children > .osmap-item-heading {
    font-weight: 600;
}
