/* ============================================================
   ebhdr4 — Header Component
   Namespace  : ebhdr4
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=El+Messiri:wght@400..700&display=swap');

/* =============================== */
/* 1. Variables & Colors           */
/* =============================== */
.ebhdr4 {
    font-family: "El Messiri", sans-serif;

    /* --- Nav --- */
    --ebhdr4-nav-bg:            #0a0f1e;
    --ebhdr4-nav-border:        rgba(59, 130, 246, 0.18);
    --ebhdr4-nav-shadow:        0 0.2em 0.8em rgba(0, 0, 0, 0.45);

    /* --- Sidebar --- */
    --ebhdr4-sidebar-bg:        #0d1424;
    --ebhdr4-sidebar-border:    rgba(59, 130, 246, 0.12);
    --ebhdr4-sidebar-shadow:    -0.4rem 0 1.5rem rgba(0, 0, 0, 0.6);

    /* --- Links --- */
    --ebhdr4-link-text:         #e2e8f0;
    --ebhdr4-link-hover-text:   #ffffff;
    --ebhdr4-link-hover-bg:     rgba(59, 130, 246, 0.1);
    --ebhdr4-link-border:       rgba(59, 130, 246, 0.15);
    --ebhdr4-link-active-bg:    #1d4ed8;
    --ebhdr4-link-active-text:  #ffffff;
    --ebhdr4-link-active-accent:#3b82f6;

    /* --- Dropdown --- */
    --ebhdr4-drop-bg:           #0f1a2e;
    --ebhdr4-drop-hover-bg:     rgba(59, 130, 246, 0.12);
    --ebhdr4-drop-item-text:    #cbd5e1;
    --ebhdr4-drop-border:       rgba(59, 130, 246, 0.15);

    /* --- Close / Ham --- */
    --ebhdr4-ham-color:         #e2e8f0;
    --ebhdr4-close-color:       #e2e8f0;
    --ebhdr4-close-hover-bg:    rgba(239, 68, 68, 0.15);
    --ebhdr4-close-hover-color: #ef4444;

    /* --- Overlay --- */
    --ebhdr4-overlay-bg:        rgba(0, 0, 0, 0.55);

    /* --- Sizing  --- */
    --ebhdr4-nav-h:         3.6rem;
    --ebhdr4-sidebar-w:     17rem;
    --ebhdr4-radius:        0.75rem;
    --ebhdr4-radius-sm:     0.45rem;
    --ebhdr4-radius-pill:   1.5rem;

    /* --- Padding --- */
    --ebhdr4-padding-top:    0;
    --ebhdr4-padding-bottom: 0;
}


/* =============================== */
/* 2. Reset                        */
/* =============================== */
*,
.ebhdr4 *,
.ebhdr4 *::before,
.ebhdr4 *::after { box-sizing: border-box; margin: 0; padding: 0; }

.ebhdr4 a      { text-decoration: none; }
.ebhdr4 ul     { list-style: none; }
.ebhdr4 button { cursor: pointer; font-family: "El Messiri", sans-serif; }
.ebhdr4 img    { display: block; max-width: 100%; }


/* =============================== */
/* 3. Base — Mobile                */
/* =============================== */
.ebhdr4 {
    direction: rtl;
    padding-top: var(--ebhdr4-padding-top);
    padding-bottom: var(--ebhdr4-padding-bottom);
}

.ebhdr4__container {
    width: 100%;
    max-width: 78rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Nav */
.ebhdr4__nav {
    background-color: var(--ebhdr4-nav-bg);
    box-shadow: var(--ebhdr4-nav-shadow);
    border-bottom: 0.06em solid var(--ebhdr4-nav-border);
    position: sticky;
    top: 0;
    z-index: 9999;
    height: var(--ebhdr4-nav-h);
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.ebhdr4__nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.ebhdr4__logo {
    display: block;
    flex-shrink: 0;
}

.ebhdr4__logo img {
    display: block;
    height: 2.4rem;
    width: auto;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    object-position: center;
}


/* =============================== */
/* Sidebar                         */
/* =============================== */
.ebhdr4__links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100dvh;
    width: var(--ebhdr4-sidebar-w);
    background-color: var(--ebhdr4-sidebar-bg);
    border-left: 0.06em solid var(--ebhdr4-sidebar-border);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ebhdr4__links.ebhdr4--open {
    right: 0;
    box-shadow: var(--ebhdr4-sidebar-shadow);
}

/* Close Row */
.ebhdr4__close-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    border-bottom: 0.06em solid var(--ebhdr4-sidebar-border);
}

.ebhdr4__close-btn {
    position: relative;
    width: 1.8rem;
    height: 1.8rem;
    border: 0.1em solid var(--ebhdr4-close-color);
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s;
}

.ebhdr4__close-btn:hover {
    background-color: var(--ebhdr4-close-hover-bg);
    border-color: var(--ebhdr4-close-hover-color);
}

.ebhdr4__close-btn span {
    position: absolute;
    width: 55%;
    height: 0.12em;
    background-color: var(--ebhdr4-close-color);
    border-radius: 0.1em;
    transition: background 0.25s;
}

.ebhdr4__close-btn:hover span   { background-color: var(--ebhdr4-close-hover-color); }
.ebhdr4__close-btn span:nth-child(1) { transform: rotate(45deg); }
.ebhdr4__close-btn span:nth-child(2) { transform: rotate(-45deg); }

/* Nav Items */
.ebhdr4__links > li { width: 100%; }

.ebhdr4__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9em 1.2em;
    color: var(--ebhdr4-link-text);
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    font-weight: 500;
    font-family: "El Messiri", sans-serif;
    border: none;
    background: transparent;
    text-align: right;
    direction: rtl;
    border-bottom: 0.05em solid var(--ebhdr4-link-border);
    transition: background 0.25s, color 0.25s, padding-right 0.25s;
}

.ebhdr4__link:hover {
    background-color: var(--ebhdr4-link-hover-bg);
    color: var(--ebhdr4-link-hover-text);
    padding-right: 1.6em;
}

.ebhdr4__link--active {
    background-color: var(--ebhdr4-link-hover-bg);
    color: var(--ebhdr4-link-active-text);
  
}


/* =============================== */
/* Hamburger                       */
/* =============================== */
.ebhdr4__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28em;
    width: 1.8rem;
    height: auto;
    background: transparent;
    border: none;
    z-index: 100000;
    position: relative;
}

.ebhdr4__hamburger span {
    display: block;
    width: 100%;
    height: 0.15rem;
    background-color: var(--ebhdr4-ham-color);
    border-radius: 0.1rem;
    transition: transform 0.4s ease, opacity 0.3s ease;
    transform-origin: center;
}

.ebhdr4__hamburger span:nth-child(2) {
    width: 70%;
    align-self: flex-start;
}


/* =============================== */
/* Dropdown                        */
/* =============================== */
.ebhdr4__dropdown { width: 100%; }

.ebhdr4__dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.ebhdr4__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0.09em solid currentColor;
    border-radius: 50%;
    font-size: 0.88rem;
    color: inherit;
    background: transparent;
    transition: transform 0.35s ease, color 0.25s, border-color 0.25s;
    flex-shrink: 0;
}

.ebhdr4__dropdown.ebhdr4--open .ebhdr4__arrow {
    transform: rotate(45deg);
    color: var(--ebhdr4-link-active-accent);
    border-color: var(--ebhdr4-link-active-accent);
    background: transparent;
}

/* Dropdown Menu — Mobile */
.ebhdr4__dropdown-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: rgba(59, 130, 246, 0.05);
    border-top: 0.05em solid var(--ebhdr4-drop-border);
}

.ebhdr4__dropdown.ebhdr4--open .ebhdr4__dropdown-menu {
    display: flex;
    animation: ebhdr4SlideDown 0.3s ease;
}

@keyframes ebhdr4SlideDown {
    from { opacity: 0; transform: translateY(-0.4rem); }
    to   { opacity: 1; transform: translateY(0); }
}

.ebhdr4__dropdown-menu li { width: 100%; }

.ebhdr4__dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.7em 1.8em;
    color: var(--ebhdr4-drop-item-text);
    font-size: clamp(0.84rem, 3vw, 0.98rem);
    font-family: "El Messiri", sans-serif;
    font-weight: 400;
    border-bottom: 0.05em solid var(--ebhdr4-drop-border);
    transition: background 0.2s, color 0.2s, padding-right 0.2s;
    direction: rtl;
}

.ebhdr4__dropdown-menu li a::before {
    content: '';
    display: inline-block;
    width: 0.3em;
    height: 0.3em;
    background-color: var(--ebhdr4-link-active-accent);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.5;
}

.ebhdr4__dropdown-menu li a:hover {
    background-color: var(--ebhdr4-drop-hover-bg);
    color: #ffffff;
    padding-right: 2.4em;
}

.ebhdr4__dropdown-menu li a:hover::before { opacity: 1; }


/* =============================== */
/* Overlay                         */
/* =============================== */
.ebhdr4__overlay {
    position: fixed;
    inset: 0;
    background: var(--ebhdr4-overlay-bg);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    backdrop-filter: blur(0.1rem);
}

.ebhdr4__overlay.ebhdr4--show {
    opacity: 1;
    visibility: visible;
}


/* ======================================================= */
/* 481px — Small Tablet                                    */
/* ======================================================= */
@media (min-width: 481px) {
    .ebhdr4 { --ebhdr4-nav-h: 4rem; --ebhdr4-sidebar-w: 18rem; }
    .ebhdr4__container { padding: 0 1.25rem; }
    .ebhdr4__logo img  { height: 2.6rem; }
}

/* ======================================================= */
/* 601px — Medium Tablet                                   */
/* ======================================================= */
@media (min-width: 601px) {
    .ebhdr4 { --ebhdr4-nav-h: 4.2rem; }
}

/* ======================================================= */
/* 769px — Large Tablet                                    */
/* ======================================================= */
@media (min-width: 769px) {
    .ebhdr4 { --ebhdr4-nav-h: 4.5rem; --ebhdr4-sidebar-w: 20rem; }
    .ebhdr4__container { padding: 0 1.5rem; }
    .ebhdr4__logo img  { height: 2.8rem; }
}

/* ======================================================= */
/* 1025px — Desktop Inline Nav                             */
/* ======================================================= */
@media (min-width: 1025px) {
    .ebhdr4 { --ebhdr4-nav-h: 4.8rem; }

    .ebhdr4__hamburger { display: none; }
    .ebhdr4__overlay   { display: none !important; }

    .ebhdr4__links {
        position: static;
        flex-direction: row;
        align-items: center;
        height: auto;
        width: auto;
        background: transparent;
        border: none;
        overflow: visible;
        box-shadow: none;
        transition: none;
        right: auto;
    }

    .ebhdr4__close-wrap { display: none; }

    .ebhdr4__link {
        width: auto;
        padding: 0.45em 0.9em;
        border-bottom: none;
        border-radius: var(--ebhdr4-radius-pill);
        font-size: clamp(0.8rem, 1vw, 0.95rem);
        white-space: nowrap;
        justify-content: center;
        margin: 0 0.12rem;
        border: 0.08em solid transparent;
        transition: background 0.25s, color 0.25s, border-color 0.25s;
    }

    .ebhdr4__link:hover {
        background-color: var(--ebhdr4-link-hover-bg);
        border-color: var(--ebhdr4-nav-border);
        color: #ffffff;
        padding-right: 0.9em;
    }

    .ebhdr4__link--active {
        background-color: var(--ebhdr4-link-active-bg);
        border-color: var(--ebhdr4-link-active-bg);
        color: var(--ebhdr4-link-active-text);
        border-inline-end: none;
        padding-right: 0.9em;
    }

    .ebhdr4__dropdown { position: relative; width: auto; }

    .ebhdr4__dropdown-btn {
        justify-content: center;
        gap: 0.4em;
    }


    .ebhdr4__arrow { display: none; }

    /* Desktop dropdown menu */
    .ebhdr4__dropdown-menu {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        width: 14rem;
        background-color: var(--ebhdr4-drop-bg);
        border: 0.06em solid var(--ebhdr4-drop-border);
        border-radius: var(--ebhdr4-radius-sm);
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
        overflow: hidden;
        flex-direction: column;
        z-index: 1000;
    }

    .ebhdr4__dropdown.ebhdr4--open .ebhdr4__dropdown-menu { display: flex; }

    .ebhdr4__dropdown-menu li a {
        padding: 0.65em 1rem;
        font-size: clamp(0.8rem, 0.95vw, 0.92rem);
    }

    .ebhdr4__dropdown-menu li a:hover { padding-right: 1.4em; }
}

/* ======================================================= */
/* 1281px — Medium Desktop                                 */
/* ======================================================= */
@media (min-width: 1281px) {
    .ebhdr4 { --ebhdr4-nav-h: 5rem; }
    .ebhdr4__link { font-size: clamp(0.84rem, 0.95vw, 1rem); padding: 0.5em 1.1em; }
    .ebhdr4__container { max-width: 88rem; padding: 0 2rem; }
}

/* ======================================================= */
/* 1441px — Large Desktop                                  */
/* ======================================================= */
@media (min-width: 1441px) {
    .ebhdr4 { --ebhdr4-nav-h: 5.4rem; }
    .ebhdr4__link { font-size: clamp(0.87rem, 0.85vw, 1.02rem); }
    .ebhdr4__container { max-width: 92rem; }
}

/* ======================================================= */
/* 1921px — Extra Large                                    */
/* ======================================================= */
@media (min-width: 1921px) {
    .ebhdr4 { --ebhdr4-nav-h: 5.8rem; }
    .ebhdr4__link { font-size: clamp(0.9rem, 0.8vw, 1.1rem); }
    .ebhdr4__container { max-width: 100rem; }
}