/* The existing global script adds .phltd-nav-scrolled after the page moves
   down. Astra's inner 110px row and the custom logo width otherwise keep the
   sticky header at its full size. This stylesheet affects every page. */

html body #masthead .ast-primary-header-bar .site-primary-header-wrap,
html body #masthead .site-logo-img,
html body #masthead .site-logo-img .custom-logo-link,
html body #masthead .site-logo-img .custom-logo-link img {
    transition: min-height .22s ease, width .22s ease, max-width .22s ease;
}

@media (min-width: 1100px) {
    /* Astra reserves an empty right grid column for the hidden header button.
       Center the visible logo and navigation together instead. */
    html body #masthead #ast-desktop-header .site-primary-header-wrap > .ast-builder-grid-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: clamp(24px, 3vw, 56px);
    }

    html body #masthead #ast-desktop-header .site-header-primary-section-left,
    html body #masthead #ast-desktop-header .site-header-primary-section-center {
        flex: 0 0 auto !important;
    }

    html body #masthead #ast-desktop-header .site-header-primary-section-right {
        display: none !important;
    }
}

@media (min-width: 922px) {
    html body #masthead.phltd-nav-scrolled #ast-desktop-header .ast-primary-header-bar,
    html body #masthead.phltd-nav-scrolled #ast-desktop-header .site-primary-header-wrap,
    html body #masthead.phltd-nav-scrolled #ast-desktop-header .ast-builder-grid-row {
        min-height: 55px !important;
    }

    html body.ast-desktop #masthead.phltd-nav-scrolled #ast-desktop-header .main-header-menu > .menu-item {
        line-height: 52px !important;
    }

    html body #masthead.phltd-nav-scrolled #ast-desktop-header .site-logo-img {
        width: 118px !important;
        max-width: 118px !important;
    }

    html body #masthead.phltd-nav-scrolled #ast-desktop-header .site-logo-img .custom-logo-link,
    html body #masthead.phltd-nav-scrolled #ast-desktop-header .site-logo-img .custom-logo-link img {
        width: 200px !important;
        min-width: 200px !important;
        max-width: none !important;
    }

    /* Keep the language/contact row, but let it take less screen space too. */
    html:has(#masthead.phltd-nav-scrolled) #phltd-language-strip .phltd-language-inner {
        min-height: 24px;
        padding: 3px 16px;
        gap: 12px;
    }

    html:has(#masthead.phltd-nav-scrolled) #phltd-language-strip .phltd-language-links {
        gap: 12px;
    }

    html:has(#masthead.phltd-nav-scrolled) #phltd-language-strip a {
        font-size: 12px;
    }
}

@media (max-width: 921px) {
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .ast-primary-header-bar,
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-primary-header-wrap,
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .ast-builder-grid-row {
        min-height: 58px !important;
    }

    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img {
        width: 110px !important;
        max-width: 110px !important;
    }

    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img .custom-logo-link,
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img .custom-logo-link img {
        width: 187px !important;
        min-width: 187px !important;
        max-width: none !important;
    }
}

@media (max-width: 420px) {
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img {
        width: 104px !important;
        max-width: 104px !important;
    }

    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img .custom-logo-link,
    html body #masthead.phltd-nav-scrolled .ast-mobile-header-wrap .site-logo-img .custom-logo-link img {
        width: 176px !important;
        min-width: 176px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body #masthead .ast-primary-header-bar .site-primary-header-wrap,
    html body #masthead .site-logo-img,
    html body #masthead .site-logo-img .custom-logo-link,
    html body #masthead .site-logo-img .custom-logo-link img {
        transition: none;
    }
}
