/* Shared, restrained navigation treatment for mobile portal contexts. */
.lgu-search-submit-label {
    display: none;
}

@media (max-width: 1023px) {
    html:root:root body .lgu-header .lgu-menu-toggle {
        width: 40px !important;
        height: 40px !important;
        padding: 9px !important;
        border: 0 !important;
        border-radius: 5px !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    html:root:root body .lgu-header .lgu-menu-toggle:is(:hover, :focus-visible) {
        background: #f2f5f7 !important;
    }

    html:root:root body .lgu-header .lgu-menu-toggle span {
        width: 21px !important;
        height: 1.5px !important;
        margin: 4px auto !important;
        background: #536675 !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-height: calc(100dvh - var(--lgu-mobile-menu-top, 88px) - 10px) !important;
        gap: 0 !important;
        padding: 6px 12px 10px !important;
        border: 0 !important;
        border-radius: 0 0 6px 6px !important;
        background: rgba(255, 255, 255, .99) !important;
        box-shadow: 0 6px 18px rgba(0, 30, 65, .055) !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav > a,
    html:root:root body .lgu-header .lgu-primary-nav > .lgu-dropdown > button {
        min-height: 40px !important;
        padding: 0 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #f0f2f4 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #334957 !important;
        font: 400 13px/1.45 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        box-shadow: none !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav > a:is(:hover, :focus-visible),
    html:root:root body .lgu-header .lgu-primary-nav > .lgu-dropdown > button:is(:hover, :focus-visible) {
        background: #f5f7f8 !important;
        color: #00365f !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav > .lgu-dropdown > button .lgu-chevron {
        width: 8px !important;
        height: 8px !important;
        color: #71808b !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav > .lgu-dropdown > .lgu-dropdown-menu,
    html:root:root body .lgu-header .lgu-primary-nav > .lgu-offices-dropdown > .lgu-offices-mega {
        margin: 2px 4px 7px !important;
        padding: 6px 8px !important;
        border: 0 !important;
        border-radius: 6px !important;
        background: #f7f8f9 !important;
        box-shadow: inset 2px 0 0 #d8e0e5 !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav .lgu-dropdown-menu a {
        min-height: 38px !important;
        padding: 7px 9px !important;
        border-radius: 4px !important;
        color: #405462 !important;
        font: 400 12px/1.45 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
    }

    html:root:root body .lgu-header .lgu-primary-nav .lgu-public-actions,
    html:root:root body .lgu-header .lgu-primary-nav .lgu-citizen-nav-tools {
        margin-top: 4px !important;
        padding-top: 6px !important;
        border-top: 1px solid #edf0f2 !important;
    }

    /* One search icon is enough: the header icon opens this restrained form. */
    html:root:root body .lgu-header .lgu-public-search-panel {
        padding: 10px !important;
        border: 1px solid #e1e7eb !important;
        border-top-color: #e1e7eb !important;
        border-radius: 8px !important;
        background: #fbfcfd !important;
        box-shadow: 0 6px 18px rgba(20, 45, 65, .08) !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel form {
        grid-template-columns: minmax(0, 1fr) auto !important;
        min-height: 46px !important;
        border: 1px solid #d8e1e6 !important;
        border-radius: 6px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel form:focus-within {
        border-color: #9aabb6 !important;
        box-shadow: 0 0 0 2px rgba(0, 52, 95, .06) !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel input[type="search"] {
        grid-column: 1 !important;
        grid-row: 1 !important;
        height: 44px !important;
        padding: 0 12px !important;
        color: #203847 !important;
        font: 400 16px/1.4 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel input[type="search"]::placeholder {
        color: #78868f !important;
        opacity: 1 !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel form > button {
        display: inline-flex !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 62px !important;
        height: 44px !important;
        padding: 0 12px !important;
        border-left: 1px solid #e5eaed !important;
        background: transparent !important;
        color: #36566c !important;
        font: 600 12px/1 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel form > button svg {
        display: none !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel .lgu-search-submit-label {
        display: inline !important;
    }

    html:root:root body .lgu-header .lgu-public-search-panel form > button:is(:hover, :focus-visible) {
        background: #f3f6f8 !important;
        color: #173c56 !important;
    }

    /* Normalize the long Offices and Legislative directories on narrow screens. */
    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) {
        width: 100% !important;
        margin: 2px 0 8px !important;
        padding: 8px 10px 10px !important;
        border: 0 !important;
        border-radius: 6px !important;
        background: #f8f9fa !important;
        box-shadow: inset 2px 0 0 #dce3e7 !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 7px !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 10px 8px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e2e7ea !important;
        background: transparent !important;
        text-align: center !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) > div,
    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) > div > * {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-inline: 0 !important;
        text-align: center !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) span {
        margin-bottom: 3px !important;
        color: #85691f !important;
        font: 600 9px/1.4 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: .12em !important;
        text-transform: uppercase !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) strong {
        color: #18364e !important;
        font: 600 18px/1.3 "Manrope", "DM Sans", sans-serif !important;
        letter-spacing: -.02em !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) small {
        margin-top: 3px !important;
        color: #6a7882 !important;
        font: 400 11px/1.45 "DM Sans", "Segoe UI", sans-serif !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(.lgu-offices-intro, .lgu-legislative-intro) > a.municipal-quiet-action {
        display: inline-flex !important;
        justify-self: center !important;
        width: fit-content !important;
        min-width: 0 !important;
        min-height: 30px !important;
        margin: 5px auto 0 !important;
        padding: 5px 10px !important;
        border: 0 !important;
        border-radius: 5px !important;
        background: #eef1f3 !important;
        color: #35546a !important;
        font: 600 10px/1.4 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        box-shadow: none !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) > .lgu-office-group,
    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) > .lgu-office-group:nth-child(n) {
        min-height: 0 !important;
        margin: 0 !important;
        padding: 12px 8px 10px !important;
        border: 0 !important;
        border-bottom: 1px solid #e2e7ea !important;
        background: transparent !important;
        text-align: left !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) > .lgu-office-group:last-child {
        border-bottom: 0 !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-group h2 {
        display: block !important;
        margin: 0 4px 6px !important;
        color: #786228 !important;
        font: 600 10px/1.45 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: .07em !important;
        text-align: left !important;
        text-transform: uppercase !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-group h2::before,
    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-links > a::before {
        content: none !important;
        display: none !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-links {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 2px !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-links > a,
    html:root:root body .lgu-header #lgu-primary-nav :is(#lgu-offices-mega, #lgu-legislative-mega) .lgu-office-links > .lgu-office-featured {
        display: block !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 8px 9px !important;
        border: 0 !important;
        border-radius: 4px !important;
        background: transparent !important;
        color: #425461 !important;
        font: 400 13px/1.45 "DM Sans", "Segoe UI", sans-serif !important;
        letter-spacing: 0 !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        box-shadow: none !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav #lgu-legislative-mega .lgu-office-links > .lgu-office-featured {
        background: #f3f4f4 !important;
        color: #29475e !important;
    }

    html:root:root body .lgu-header #lgu-primary-nav #lgu-legislative-mega .lgu-office-links > .lgu-office-featured small {
        margin-top: 3px !important;
        color: #71808a !important;
        font-size: 10px !important;
        line-height: 1.45 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:root:root body .lgu-header :is(.lgu-menu-toggle, .lgu-primary-nav, .lgu-dropdown-menu) {
        transition: none !important;
    }
}

/* Keep the municipal identity optically centered in every mobile portal header. */
@media (max-width: 767px) {
    html:root:root body .lgu-header .lgu-nav-wrap {
        position: relative !important;
    }

    html:root:root body .lgu-header .lgu-nav-inner {
        min-height: 72px !important;
        justify-content: flex-end !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: min(250px, calc(100% - 116px)) !important;
        max-width: none !important;
        margin: 0 !important;
        justify-content: center !important;
        gap: 7px !important;
        transform: translate(-50%, -50%) !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand .lgu-seal {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand .lgu-brand-wordmark-wrap {
        flex: 0 1 132px !important;
        min-width: 0 !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand .lgu-header-wordmark {
        width: 132px !important;
        height: 50px !important;
        object-position: center !important;
    }

    html:root:root body .lgu-header .lgu-menu-toggle {
        position: relative !important;
        z-index: 2 !important;
        flex: 0 0 40px !important;
        margin-left: auto !important;
    }
}

@media (max-width: 359px) {
    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand {
        width: min(218px, calc(100% - 98px)) !important;
        gap: 5px !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand .lgu-seal {
        flex-basis: 38px !important;
        width: 38px !important;
        height: 38px !important;
    }

    html:root:root body .lgu-header .lgu-brand.lgu-wordmark-brand .lgu-header-wordmark {
        width: 116px !important;
        height: 46px !important;
    }
}

/* Keep the mobile menu control pinned to the right edge of the header. */
@media (max-width: 767px) {
    html:root:root body .lgu-header .lgu-nav-inner {
        position: relative !important;
    }

    html:root:root body .lgu-header .lgu-menu-toggle {
        position: absolute !important;
        top: 50% !important;
        right: 0 !important;
        margin: 0 !important;
        transform: translateY(-50%) !important;
    }
}
