/* Shared by every public page (loaded after the page styles): navbar dropdown, mobile menu button, page banners. */

.nav-has-dropdown {
    position: relative;
}

.nav-caret {
    font-size: 0.65em;
    margin-inline-start: 4px;
    transition: transform 0.3s ease;
}

.nav-has-dropdown:hover .nav-caret,
.nav-has-dropdown:focus-within .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown {
    list-style: none;
    margin: 0;
    padding: 8px;
    min-width: 210px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 22px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 51, 102, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1001;
}

/* Invisible bridge so the menu stays open while the pointer moves down to it. */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    height: 22px;
}

.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 14px);
}

.nav-links-modern .nav-dropdown a {
    display: block;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--deep-blue);
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-links-modern .nav-dropdown a::after {
    display: none;
}

.nav-links-modern .nav-dropdown a:hover,
.nav-links-modern .nav-dropdown a:focus-visible {
    background: rgba(94, 162, 98, 0.1);
    color: var(--primary-green);
}

/* Menu button: hidden on desktop. These rules used to be an inline style, which
   also overrode the mobile rule and hid the menu on phones. */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
}

/* Mobile: the full-screen menu lists the sub-links directly under their parent. */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links-modern.active ~ .nav-actions .mobile-menu-btn,
    .premium-navbar.scrolled .mobile-menu-btn {
        color: var(--deep-blue);
    }

    .nav-caret,
    .nav-dropdown::before,
    .nav-dropdown li:first-child {
        display: none;
    }

    .nav-has-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: none;
        box-shadow: none;
        min-width: 0;
        padding: 0;
        margin-top: 12px;
    }

    .nav-has-dropdown:hover .nav-dropdown,
    .nav-has-dropdown:focus-within .nav-dropdown {
        transform: none;
    }

    .nav-links-modern .nav-dropdown a {
        color: var(--primary-green);
        font-size: 1.2rem;
        padding: 0;
    }

    .nav-links-modern .nav-dropdown a:hover {
        background: none;
    }
}

/* Inner page banner with an optional background photo chosen in the admin panel.
   The blue overlay keeps the white title readable on any photo. */
.page-hero.has-bg {
    background:
        linear-gradient(135deg, rgba(0, 51, 102, 0.88) 0%, rgba(0, 80, 158, 0.8) 100%),
        var(--page-bg) center / cover no-repeat;
}

/* Developer credit in the footer. The Waqqad logo follows its brand rules:
   the supplied on-dark file unchanged, at least 120px wide, clear space on
   every side equal to the amber diamond's width (about 0.092 x logo width),
   and no hover effects, shadows or glows on the logo itself. */
.developer-credit {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    border-radius: 10px;
}

.developer-credit .dev-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.3s ease;
}

.developer-credit:hover .dev-text,
.developer-credit:focus-visible .dev-text {
    color: #ffffff;
}

.developer-credit:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.developer-credit .dev-logo {
    display: block;
    width: 128px;
    height: auto;
    padding: 12px;
    box-sizing: content-box;
}

/* ==========================================================================
   Accessibility refinements from the Apple HIG review (all public pages).
   ========================================================================== */

/* Contrast >= 4.5:1 for small text (links were 3.1:1, dates 2.1:1).
   Same hues as the brand green and orange, only darker. */
.read-more { color: #3E7F43; }
.news-date { color: #A65C0A; }

/* Hit targets of at least 44px. */
.read-more,
.footer-links a,
.lang-toggle,
.nav-links-modern > li > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.footer-links li { margin-bottom: 0; }

/* Footer text readable on the navy gradient. */
.brand-col p { color: #cbd5e1; }

/* 16px stops phones zooming into the field; 48px tall is easy to tap. */
.newsletter-input { font-size: 16px; min-height: 48px; }
.btn-subscribe { min-height: 48px; }

/* News without a cover photo: show the logo whole on a quiet background
   instead of cropping it to fill the frame. */
.news-image.news-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6f9;
}

.news-image.news-image--placeholder img {
    width: 58%;
    height: 58%;
    object-fit: contain;
    mix-blend-mode: multiply; /* drop the logo file's white box */
}

/* Reduce Motion: no zooming, floating or sliding for visitors who ask for less. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-slide-item,
    .hero-slide-item.active {
        transform: none !important;
    }
}
