/**
 * =============================================================
 * PRCF GLOBAL DIGITAL INSTITUTION
 * PRIMARY NAVIGATION — PRODUCTION COMPACT DESKTOP
 * =============================================================
 *
 * Goals:
 * - Keep desktop header on one clean row
 * - Prevent Burmese labels from breaking header height
 * - Keep dropdowns floating below navigation
 * - Support Who We Are / Our Work / International
 * - Preserve mobile navigation behaviour
 */


/* =============================================================
   DESKTOP HEADER
   ============================================================= */

.main-header {
    position: relative;
    z-index: 900;
}


.main-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;

    min-height: 92px;
}


/* =============================================================
   BRAND
   ============================================================= */

.main-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;

    flex: 0 1 315px;
    min-width: 245px;
    max-width: 315px;

    text-decoration: none;
}


.main-header .brand-mark {
    flex: 0 0 auto;
}


.main-header .brand-text {
    min-width: 0;
}


.main-header .brand-text strong {
    display: block;

    font-size: .92rem;
    line-height: 1.3;

    white-space: normal;
}


.main-header .brand-text span {
    display: block;

    margin-top: 2px;

    font-size: .67rem;
    line-height: 1.3;

    white-space: normal;
}


/* =============================================================
   PRIMARY NAVIGATION
   ============================================================= */

.primary-navigation {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex: 1 1 auto;

    gap: clamp(
        10px,
        1vw,
        18px
    );

    min-width: 0;

    white-space: nowrap;
}


.primary-navigation > a,
.primary-navigation .nav-parent-link {
    display: inline-flex;
    align-items: center;

    min-height: 40px;

    padding: 6px 0;

    color: inherit;

    font-size: clamp(
        .72rem,
        .76vw,
        .84rem
    );

    font-weight: 700;

    line-height: 1.25;

    text-decoration: none;

    white-space: nowrap;
}


.primary-navigation > a:hover,
.primary-navigation > a:focus-visible,
.primary-navigation .nav-parent-link:hover,
.primary-navigation .nav-parent-link:focus-visible {
    opacity: .82;
}


/* =============================================================
   DROPDOWN ROOT
   ============================================================= */

.primary-navigation .nav-dropdown {
    position: relative;

    display: flex;
    align-items: center;

    flex: 0 0 auto;

    min-width: 0;
}


.primary-navigation .nav-parent-row {
    display: flex;
    align-items: center;

    gap: 2px;

    min-height: 40px;

    white-space: nowrap;
}


.primary-navigation .nav-dropdown-toggle {
    display: inline-flex;

    width: 24px;
    height: 36px;

    align-items: center;
    justify-content: center;

    flex: 0 0 24px;

    padding: 0;

    border: 0;

    background: transparent;

    color: inherit;

    font: inherit;

    line-height: 1;

    cursor: pointer;
}


.primary-navigation .nav-dropdown-toggle span {
    display: block;

    font-size: .68rem;

    transition:
        transform .16s ease;
}


.primary-navigation
.nav-dropdown.is-open
.nav-dropdown-toggle span,
.primary-navigation
.nav-dropdown.open
.nav-dropdown-toggle span {
    transform: rotate(180deg);
}


/* =============================================================
   FLOATING SUBMENU
   ============================================================= */

.primary-navigation .nav-submenu {
    position: absolute;

    top: calc(100% + 8px);
    left: 50%;

    z-index: 2000;

    display: none;

    width: max-content;

    min-width: 220px;
    max-width: 310px;

    transform: translateX(-50%);

    padding: 10px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            .12
        );

    border-radius: 12px;

    background: #121c2b;

    box-shadow:
        0 18px 45px
        rgba(
            0,
            0,
            0,
            .34
        );

    white-space: normal;
}


.primary-navigation
.nav-dropdown:hover
> .nav-submenu,
.primary-navigation
.nav-dropdown:focus-within
> .nav-submenu,
.primary-navigation
.nav-dropdown.is-open
> .nav-submenu,
.primary-navigation
.nav-dropdown.open
> .nav-submenu {
    display: block;
}


.primary-navigation .nav-submenu a {
    display: block;

    width: 100%;

    padding:
        10px
        12px;

    border-radius: 7px;

    color: #f4f7fb;

    font-size: .78rem;

    font-weight: 650;

    line-height: 1.55;

    text-decoration: none;

    white-space: normal;
}


.primary-navigation .nav-submenu a:hover,
.primary-navigation .nav-submenu a:focus-visible {
    background:
        rgba(
            255,
            255,
            255,
            .07
        );
}


/* =============================================================
   EDGE-SAFE DROPDOWNS
   ============================================================= */

/*
 * International is close to the right side.
 * Let it open toward the left instead of spilling off screen.
 */

.primary-navigation
.prcf-international-nav
.nav-submenu {
    left: auto;
    right: 0;

    transform: none;
}


/*
 * Who We Are can safely open slightly toward the left.
 */

.primary-navigation
#who-we-are-navigation
.nav-submenu {
    left: 0;

    transform: none;
}


/*
 * Our Work remains centred under its trigger.
 */

.primary-navigation
#our-work-navigation
.nav-submenu {
    left: 50%;

    transform: translateX(-50%);
}


/* =============================================================
   BURMESE DESKTOP COMPACTION
   ============================================================= */

html[lang="my"]
.primary-navigation {
    gap: clamp(
        7px,
        .72vw,
        13px
    );
}


html[lang="my"]
.primary-navigation > a,
html[lang="my"]
.primary-navigation .nav-parent-link {
    font-size: clamp(
        .70rem,
        .72vw,
        .79rem
    );

    line-height: 1.45;
}


html[lang="my"]
.main-header .brand {
    flex-basis: 285px;

    min-width: 225px;
    max-width: 285px;
}


html[lang="my"]
.main-header .brand-text strong {
    font-size: .84rem;

    line-height: 1.42;
}


html[lang="my"]
.main-header .brand-text span {
    font-size: .61rem;
}


/* =============================================================
   MEDIUM DESKTOP
   ============================================================= */

@media (
    min-width: 1101px
)
and (
    max-width: 1450px
) {

    .main-header-inner {
        gap: 14px;
    }


    .main-header .brand {
        flex-basis: 255px;

        min-width: 210px;
        max-width: 255px;
    }


    .primary-navigation {
        gap: 8px;
    }


    .primary-navigation > a,
    .primary-navigation .nav-parent-link {
        font-size: .70rem;
    }


    html[lang="my"]
    .primary-navigation {
        gap: 5px;
    }


    html[lang="my"]
    .primary-navigation > a,
    html[lang="my"]
    .primary-navigation .nav-parent-link {
        font-size: .66rem;
    }

}


/* =============================================================
   MOBILE / TABLET
   ============================================================= */

@media (
    max-width: 1100px
) {

    .main-header-inner {
        min-height: 76px;

        flex-wrap: wrap;
    }


    .main-header .brand {
        flex:
            1
            1
            auto;

        min-width: 0;
        max-width: calc(100% - 60px);
    }


    .primary-navigation {
        display: none;

        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 0;

        padding:
            12px
            0
            18px;

        white-space: normal;
    }


    .primary-navigation.is-open,
    .primary-navigation.open {
        display: flex;
    }


    .primary-navigation > a {
        width: 100%;

        min-height: 44px;

        padding:
            10px
            4px;

        font-size: .86rem;

        white-space: normal;
    }


    .primary-navigation .nav-dropdown {
        display: block;

        width: 100%;
    }


    .primary-navigation .nav-parent-row {
        width: 100%;

        justify-content: space-between;
    }


    .primary-navigation .nav-parent-link {
        flex:
            1
            1
            auto;

        min-height: 44px;

        padding:
            10px
            4px;

        font-size: .86rem;

        white-space: normal;
    }


    .primary-navigation .nav-dropdown-toggle {
        width: 44px;
        height: 44px;

        flex-basis: 44px;
    }


    .primary-navigation .nav-submenu,
    .primary-navigation
    #who-we-are-navigation
    .nav-submenu,
    .primary-navigation
    #our-work-navigation
    .nav-submenu,
    .primary-navigation
    .prcf-international-nav
    .nav-submenu {
        position: static;

        display: none;

        width: 100%;

        min-width: 0;
        max-width: none;

        transform: none;

        margin:
            2px
            0
            8px;

        padding:
            6px
            0
            6px
            14px;

        border: 0;

        border-left:
            1px solid
            rgba(
                255,
                255,
                255,
                .14
            );

        border-radius: 0;

        background: transparent;

        box-shadow: none;
    }


    .primary-navigation
    .nav-dropdown.is-open
    > .nav-submenu,
    .primary-navigation
    .nav-dropdown.open
    > .nav-submenu {
        display: block;
    }


    .primary-navigation
    .nav-submenu a {
        padding:
            9px
            8px;

        font-size: .82rem;
    }

}


/* =============================================================
   VERY SMALL DEVICES
   ============================================================= */

@media (
    max-width: 520px
) {

    .main-header .brand-text strong {
        font-size: .78rem;
    }


    .main-header .brand-text span {
        font-size: .6rem;
    }

}