/* About nav dropdown — shared across pages */
.nav-dropdown {
    position: relative;
    /* Extend hit area below the label so the cursor can travel to the menu */
    padding-bottom: 18px;
    margin-bottom: -18px;
}
.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    padding: 0;
    position: relative;
}
header nav ul .nav-dropdown-trigger::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background: #f8c400;
    border-radius: 1px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
header nav ul .nav-dropdown:hover .nav-dropdown-trigger::after,
header nav ul .nav-dropdown.is-active .nav-dropdown-trigger::after,
header nav ul .nav-dropdown.is-open .nav-dropdown-trigger::after {
    width: 100%;
}
.nav-dropdown-chevron { transition: transform 0.3s ease; }
.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown.is-open .nav-dropdown-chevron { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 188px;
    padding: 0.45rem;
    border-radius: 14px;
    background: rgba(10, 15, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transition-delay: 0s;
    z-index: 60;
}
/* Invisible bridge covering the space between trigger and panel */
.nav-dropdown-menu::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -22px;
    height: 22px;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(10, 15, 28, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}
/* Short close delay so the menu doesn't vanish mid-move */
.nav-dropdown:not(:hover):not(.is-open) .nav-dropdown-menu {
    transition-delay: 0.12s;
}
.nav-dropdown-link {
    display: block;
    padding: 0.62rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    transition: background 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}
.nav-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.nav-dropdown-link.is-active {
    background: rgba(248, 196, 0, 0.12);
    color: #f8c400;
}
.nav-dropdown.is-active > .nav-dropdown-trigger {
    color: #fff;
}

/* ========== Mobile navigation ========== */
body.mobile-nav-open { overflow: hidden; }
body.mobile-nav-open > header { z-index: 80; }

.mobile-nav-toggle {
    position: relative;
    z-index: 80;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(10, 15, 28, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-panel {
    position: fixed;
    inset: 0;
    z-index: 75;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(248, 196, 0, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        #0a0f1c;
    display: flex;
    flex-direction: column;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-nav-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    flex-shrink: 0;
}
.mobile-nav-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}
.mobile-nav-close {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.mobile-nav-close:hover {
    background: rgba(248, 196, 0, 0.15);
    border-color: rgba(248, 196, 0, 0.4);
    color: #f8c400;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 1rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
    min-height: min(70vh, 520px);
    text-align: center;
}
.mobile-nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    font-size: clamp(1.15rem, 4.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.88) !important;
    -webkit-text-fill-color: currentColor !important;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    text-align: center;
}
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.mobile-nav-link.is-active {
    color: #f8c400;
    background: rgba(248, 196, 0, 0.12);
}

.mobile-nav-group {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mobile-nav-group-label {
    padding: 0.35rem 1rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55) !important;
    -webkit-text-fill-color: currentColor !important;
    text-align: center;
}
.mobile-nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}
.mobile-nav-sublist .mobile-nav-link {
    font-size: clamp(1.05rem, 4vw, 1.25rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82) !important;
}

/* Arabic / RTL mobile menu */
html[dir="rtl"] .mobile-nav-panel {
    direction: rtl;
    font-family: "Cairo", "Noto Sans Arabic", "Inter", sans-serif;
}

html[dir="rtl"] .mobile-nav-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-nav-title {
    letter-spacing: 0.04em;
    text-transform: none;
}

html[dir="rtl"] .mobile-nav-link,
html[dir="rtl"] .mobile-nav-group-label {
    letter-spacing: 0;
}

@media (min-width: 768px) {
    .mobile-nav-overlay,
    .mobile-nav-panel { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav-overlay,
    .mobile-nav-panel { transition: none; }
}
