/* ==========================================================================
   RaiDana - site header (shared by every page)
   This is the slim header of the home page, extracted from the home document
   content so the rest of the site renders exactly the same navigation bar.
   The home page keeps its transparent start over the video hero; other pages
   start in the white "scrolled" state (body.rd-inner) so the bar stays
   readable over the page background.

   The class name raidana-home-header is kept on purpose: the home document in
   the database still ships a script that looks for it and must keep skipping
   its own header construction.
   ========================================================================== */

:root {
    --rd-header-height: 82px;
}

body.rd-inner #main {
    padding-top: var(--rd-header-height) !important;
}

/* the home hero sits underneath the transparent header */
body.rd-home #main {
    padding-top: 0 !important;
}

/* One surface definition for the header and every panel that hangs under it,
   so the menu card always shares the header background (glass on the home
   hero, white elsewhere). */
#header.raidana-home-header {
    --rd-surface: rgba(18, 30, 46, .40);
    --rd-surface-text: #f7f9fb;
    --rd-surface-line: rgba(255, 255, 255, .19);
    --rd-surface-hover: rgba(255, 255, 255, .13);
    --rd-surface-shadow: none;
    position: fixed;
    inset: 0 0 auto;
    height: var(--rd-header-height) !important;
    padding: 0 !important;
    background: var(--rd-surface) !important;
    color: var(--rd-surface-text) !important;
    border-bottom: 1px solid var(--rd-surface-line) !important;
    box-shadow: var(--rd-surface-shadow);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
    transition: background-color .22s, color .22s, border-color .22s, box-shadow .22s;
}

#header.raidana-home-header.raidana-scrolled {
    --rd-surface: #fff;
    --rd-surface-text: #24354a;
    --rd-surface-line: #e7ebef;
    --rd-surface-hover: #eef3f8;
    --rd-surface-shadow: 0 4px 16px rgba(38, 55, 80, .09);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#header .raidana-bar {
    width: min(calc(100% - 64px), 1250px);
    height: 100%;
    margin-inline: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(12px, 1.9vw, 30px);
    direction: rtl;
}

/* ---- brand ------------------------------------------------------------ */
.raidana-brand,
.raidana-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.raidana-brand,
.raidana-brand:hover,
.raidana-actions a,
.raidana-actions a:hover {
    text-decoration: none;
    color: inherit;
}

.raidana-brand strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
}

.raidana-brand small {
    display: block;
    margin-top: 4px;
    text-align: right;
    font: 600 9px/1 system-ui;
    letter-spacing: .12em;
    color: #e0e6ed;
}

.raidana-scrolled .raidana-brand small {
    color: #596a7c;
}

.raidana-brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 8px;
    flex: none;
}

.raidana-brand-mark img {
    display: block;
    width: 33px;
    height: 33px;
    object-fit: contain;
}

.raidana-scrolled .raidana-brand-mark {
    background: transparent;
}

/* ---- main navigation inside the bar ----------------------------------- */
#header.raidana-home-header .raidana-bar > .main-nav {
    float: none !important;
    margin: 0 !important;
    justify-self: center;
}

/* the open panel is positioned against the header, not against the item */
#header.raidana-home-header .raidana-bar > .main-nav,
#header.raidana-home-header .raidana-bar > .main-nav > ul,
#header.raidana-home-header .raidana-bar > .main-nav > ul > li {
    position: static;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.1vw, 19px);
    white-space: nowrap;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li {
    float: none;
    margin: 0;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > a {
    color: inherit;
    font-size: clamp(12px, 1.13vw, 14px);
    font-weight: 600;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > a:hover {
    color: #f2c59d;
}

.raidana-scrolled .raidana-bar > .main-nav > ul > li > a:hover {
    color: #17447c !important;
}

/* ---- drop-down card ---------------------------------------------------
   A click opens one card that runs the full content width, centered right
   under the header, instead of a list cascading out of the clicked item. */
#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: min(calc(100% - 64px), 1250px);
    margin: 0 auto !important;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 8px;
    padding: 10px 12px 12px;
    float: none;
    max-height: none;
    overflow: visible;
    /* the card must always render the same surface as the bar above it, even if a
       page ships its own .dropdown-menu colours, so the tokens are authoritative */
    background: var(--rd-surface) !important;
    color: var(--rd-surface-text) !important;
    border: 1px solid var(--rd-surface-line) !important;
    border-top-width: 0 !important;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 20px 40px rgba(12, 22, 36, .18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 3;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li.rd-open > .dropdown-menu {
    display: grid;
    animation: rd-menu-in .16s ease-out;
}

/* white pages: the bar has no glass, so the card is a flat white panel too */
#header.raidana-home-header.raidana-scrolled .raidana-bar > .main-nav > ul > li > .dropdown-menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@keyframes rd-menu-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li {
    min-width: 0;
    padding: 0;
}

/* style.css paints the old cascading items white on hover; the card tints its
   link instead, so the row itself must stay transparent or the light text
   disappears on the white patch. */
#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li:hover,
#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li:focus-within {
    background-color: transparent;
}

/* the "all <section>" entry heads the card instead of hanging above the links */
#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li:first-child {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rd-surface-line);
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.65;
    white-space: normal;
    text-transform: none;
    transition: background-color .15s, color .15s;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu a:hover,
#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu a:focus-visible {
    background: var(--rd-surface-hover);
    color: inherit;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li:first-child > a {
    font-weight: 700;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu > li:first-child > a::after {
    content: "←";
    opacity: .7;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li.rd-open > a {
    color: #f2c59d;
}

.raidana-scrolled .raidana-bar > .main-nav > ul > li.rd-open > a {
    color: #17447c !important;
}

#header.raidana-home-header .raidana-bar > .main-nav > ul > li.rd-open > a.dropdown-toggle::after {
    transform: rotate(180deg);
}

/* ---- actions ---------------------------------------------------------- */
.raidana-actions .raidana-portal {
    font-size: 12px;
}

.raidana-actions .raidana-contact {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 22px;
    background: #fff;
    color: #24354a;
    font-size: 13px;
    font-weight: bold;
}

.raidana-actions .raidana-contact:hover {
    background: #eaf0f5;
    color: #24354a;
}

.raidana-scrolled .raidana-actions .raidana-contact {
    background: #1b3e76;
    color: #fff;
}

.raidana-scrolled .raidana-actions .raidana-contact:hover {
    background: #31598a;
    color: #fff;
}

.raidana-search-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .37);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.raidana-scrolled .raidana-search-toggle {
    border-color: #dce4ed;
}

.raidana-search-toggle span {
    display: block;
    width: 11px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    position: relative;
    margin: 0 3px 3px 0;
}

.raidana-search-toggle span::after {
    content: "";
    width: 6px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    position: absolute;
    right: -5px;
    bottom: -3px;
    transform: rotate(45deg);
}

/* ---- tools panel (search, portal, account, contact) ------------------- */
#header.raidana-home-header #topbar {
    display: none !important;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: #fff;
    color: #24354a;
    padding: 10px 0;
    border-bottom: 1px solid #e6eaee;
    box-shadow: 0 6px 18px rgba(38, 55, 80, .14);
}

#header.raidana-home-header[data-tools-open] #topbar {
    display: block !important;
}

#header.raidana-home-header #topbar > .container > .row {
    align-items: center;
}

.raidana-home-header #topbar .social-links {
    display: flex !important;
    gap: 7px;
    align-items: center;
    white-space: nowrap;
}

.raidana-home-header #topbar .social-links .btn {
    width: auto;
    min-width: 0;
    padding: 5px 8px;
    margin: 0;
    font-size: 12px !important;
}

.raidana-home-header #topbar .social-links .logged-in {
    position: static;
    display: inline-flex;
    align-items: center;
}

.raidana-home-header #topbar .social-links .logged-in a {
    font-size: 11px;
    padding: 2px 3px;
}

.raidana-home-header #topbar .social-media {
    margin-top: 0 !important;
}

#header.raidana-home-header :focus-visible {
    outline: 2px solid #d0996c;
    outline-offset: 3px;
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 1199.98px) {
    #header .raidana-bar {
        width: calc(100% - 42px);
    }

    #header.raidana-home-header .raidana-bar > .main-nav > ul > li > .dropdown-menu {
        width: calc(100% - 42px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .raidana-actions .raidana-portal {
        display: none;
    }

    .raidana-brand strong {
        font-size: 15px;
    }
}

@media (max-width: 991.98px) {
    :root {
        --rd-header-height: 65px;
    }

    #header .raidana-bar {
        width: calc(100% - 32px);
        display: flex;
        justify-content: space-between;
        gap: 7px;
    }

    .raidana-brand {
        gap: 7px;
    }

    .raidana-brand-mark {
        width: 35px;
        height: 35px;
    }

    .raidana-brand-mark img {
        width: 28px;
        height: 28px;
    }

    .raidana-brand strong {
        font-size: 14px;
    }

    .raidana-brand small {
        font-size: 8px;
    }

    .raidana-actions {
        gap: 7px;
    }

    .raidana-actions .raidana-contact {
        padding: 6px 10px;
        font-size: 12px;
    }

    .raidana-contact span {
        display: none;
    }

    .raidana-search-toggle {
        width: 30px;
        height: 30px;
    }

    #header.raidana-home-header .mobile-nav-toggle {
        position: static;
        line-height: 1;
        border: 1px solid rgba(255, 255, 255, .36);
        border-radius: 6px;
        color: inherit;
        padding: 6px 7px;
        font-size: 17px;
        transition: none;
    }

    #header.raidana-home-header .mobile-nav-toggle i {
        margin: 0;
        color: inherit;
    }

    #header.raidana-home-header.raidana-scrolled .mobile-nav-toggle {
        border-color: #dce4ed;
    }

    body.mobile-nav-active #header.raidana-home-header {
        z-index: 100000;
    }

    #header.raidana-home-header #topbar .social-links,
    #header.raidana-home-header #topbar .social-media {
        display: none !important;
    }

    #header.raidana-home-header #topbar #search {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        padding-inline: 15px !important;
    }

    body:has(#header.raidana-home-header) > .mobile-nav {
        top: 65px !important;
        height: calc(100vh - 65px);
        height: calc(100dvh - 65px);
    }

    /* the drawer keeps style.css's dark sheet on the home page, where the bar is
       dark as well; the white pages carry the same surface as the bar */
    body.rd-inner > .mobile-nav {
        background: #fff;
        border-inline-end: 1px solid #e7ebef;
        box-shadow: 0 18px 40px rgba(38, 55, 80, .16);
    }

    body.rd-inner > .mobile-nav a,
    body.rd-inner > .mobile-nav .dropdown-menu > li > a {
        color: #24354a;
    }

    body.rd-inner > .mobile-nav a:hover,
    body.rd-inner > .mobile-nav .active > a,
    body.rd-inner > .mobile-nav li:hover > a {
        color: #17447c;
    }
}

@media (max-width: 350px) {
    .raidana-actions .raidana-contact {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #header.raidana-home-header {
        transition: none;
    }

    #header.raidana-home-header .raidana-bar > .main-nav > ul > li.rd-open > .dropdown-menu {
        animation: none;
    }
}
