/* Homepage hero: About-page navy treatment that clears over the Municipal Hall. */
.municipal-homepage .hero-slideshow {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #00345f;
}

.municipal-homepage .hero-slideshow .hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 54%;
    opacity: 0;
    transform: scale(1.006);
    transition: opacity 2.25s cubic-bezier(.4, 0, .2, 1), transform 8s ease-out;
    will-change: opacity, transform;
}

.municipal-homepage .hero-slideshow .hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.municipal-homepage .hero-shade {
    background: linear-gradient(
        90deg,
        rgba(0, 30, 65, .94) 0%,
        rgba(0, 46, 93, .86) 22%,
        rgba(0, 55, 104, .58) 34%,
        rgba(0, 62, 108, .18) 45%,
        rgba(0, 62, 108, .03) 57%,
        rgba(0, 45, 87, .06) 100%
    ) !important;
}

.municipal-homepage .hero-copy h1 {
    color: #fff !important;
    text-shadow: 0 2px 14px rgba(0, 30, 65, .22);
}

.municipal-homepage .hero-tagline,
.municipal-homepage .hero-summary {
    color: #f4f8fb !important;
    text-shadow: 0 1px 5px rgba(0, 30, 65, .24);
}

@media (max-width: 767px) {
    .municipal-homepage .hero-slideshow .hero-slide {
        object-position: 50% 72%;
    }

    .municipal-homepage .hero-shade {
        background: linear-gradient(
            90deg,
            rgba(0, 30, 65, .82) 0%,
            rgba(0, 46, 93, .68) 42%,
            rgba(0, 62, 108, .22) 72%,
            rgba(0, 45, 87, .04) 100%
        ) !important;
    }
}

/* Mobile content polish: compact actions, balanced utility content, and a
   deliberate crop that keeps the Municipal Hall facade in view. */
@media (max-width: 767px) {
    html body.municipal-homepage main#main-content .calendar-panel .panel-header > a.js-full-calendar-link {
        display: none !important;
    }

    html body.municipal-homepage main#main-content .calendar-full-link {
        width: auto !important;
        min-width: 164px;
        max-width: max-content;
        margin: 12px auto 0 !important;
        padding: 11px 18px !important;
    }

    html body.municipal-homepage main#main-content .facebook-section-mark {
        width: 32px !important;
        height: 32px !important;
    }

    html body.municipal-homepage main#main-content .facebook-section-mark svg {
        width: 18px !important;
        height: 18px !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1px !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid > a,
    html body.municipal-homepage main#main-content .quick-info-grid > div {
        min-height: 92px !important;
        padding: 14px 8px !important;
        gap: 7px !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .municipal-homepage .hero-slideshow .hero-slide {
        transition: none;
        transform: none;
    }
}

/* Municipal performance uses an open layout without a surrounding box or row rules. */
.municipal-homepage .civic-accomplishments,
.municipal-homepage .civic-accomplishments header,
.municipal-homepage .civic-accomplishments .civic-metric {
    border: 0 !important;
}

/*
 * Mobile hero service search
 *
 * Keep this component isolated from older shared search/grid rules. The input
 * and submit control always occupy one compact row, including narrow phones.
 */
@media (max-width: 900px) {
    html body.municipal-homepage main#main-content .hero .hero-copy form.service-search.homepage-service-search {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 52px !important;
        grid-template-rows: 54px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
        margin: 22px 0 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        overflow: hidden !important;
        border: 1px solid rgba(0, 48, 91, .16) !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, .96) !important;
        box-shadow: 0 10px 24px rgba(0, 35, 70, .10) !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > input#service-search {
        position: static !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 52px !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 16px !important;
        border: 0 !important;
        border-radius: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #062f59 !important;
        font: inherit !important;
        font-size: 15px !important;
        line-height: 52px !important;
        appearance: none !important;
        -webkit-appearance: none !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > input#service-search::placeholder {
        color: #667482 !important;
        opacity: 1 !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > button.service-search-submit {
        position: static !important;
        inset: auto !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: stretch !important;
        justify-self: stretch !important;
        display: grid !important;
        place-items: center !important;
        width: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;
        height: 52px !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-left: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
        outline-offset: -3px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #0877c9 !important;
        transform: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > button.service-search-submit svg {
        display: block !important;
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        transform: none !important;
        fill: none !important;
        stroke: currentColor !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > button.service-search-submit:hover,
    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > button.service-search-submit:focus-visible {
        background: #eef6fc !important;
        color: #005a9c !important;
    }
}

@media (max-width: 380px) {
    html body.municipal-homepage main#main-content .hero .hero-copy form.homepage-service-search > input#service-search {
        padding-inline: 13px !important;
        font-size: 14px !important;
    }
}

/* Mobile composition: centered hero copy and a translucent hotline panel. */
@media (max-width: 767px) {
    html body.municipal-homepage main#main-content .hero .hero-copy {
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy .hero-script,
    html body.municipal-homepage main#main-content .hero .hero-copy h1,
    html body.municipal-homepage main#main-content .hero .hero-copy .hero-tagline,
    html body.municipal-homepage main#main-content .hero .hero-copy .hero-summary {
        text-align: center !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }

    html body.municipal-homepage main#main-content .hero .hero-copy .hero-tagline::after {
        margin-right: auto !important;
        margin-left: auto !important;
    }

    html body.municipal-homepage main#main-content .hero aside.emergency-card {
        background: rgba(0, 48, 91, .78) !important;
        border-color: rgba(143, 196, 233, .24) !important;
        box-shadow: 0 14px 32px rgba(0, 30, 65, .18) !important;
        -webkit-backdrop-filter: blur(9px) saturate(115%) !important;
        backdrop-filter: blur(9px) saturate(115%) !important;
    }
}

/* Final mobile homepage component repair. */
@media (max-width: 767px) {
    html body.municipal-homepage main#main-content .hero .emergency-card .emergency-action {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 50px !important;
        margin: 14px 0 0 !important;
        padding: 9px 10px !important;
        font-size: 11px !important;
        line-height: 1.25 !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .service-dock {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: auto !important;
        gap: 8px !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 10px 10px 18px !important;
        overflow: visible !important;
    }

    html body.municipal-homepage main#main-content .service-dock .service-item {
        min-height: 124px !important;
        padding: 14px 8px !important;
    }

    html body.municipal-homepage main#main-content .service-dock .services-all {
        position: static !important;
        inset: auto !important;
        grid-column: 1 / -1 !important;
        justify-self: center !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 180px !important;
        min-height: 40px !important;
        margin: 6px auto 0 !important;
        padding: 10px 18px !important;
        transform: none !important;
        white-space: normal !important;
    }

    html body.municipal-homepage main#main-content .mayor-quick-actions {
        gap: 12px !important;
        padding: 16px !important;
    }

    html body.municipal-homepage main#main-content .mayor-quick-actions a {
        display: flex !important;
        min-height: 145px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px 16px !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .mayor-quick-actions a > span {
        margin: 0 auto 14px !important;
    }

    html body.municipal-homepage main#main-content .mayor-quick-actions a strong,
    html body.municipal-homepage main#main-content .mayor-quick-actions a small {
        width: 100% !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .account-link-callout {
        display: flex !important;
        width: calc(100% - 24px) !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        margin-right: auto !important;
        margin-left: auto !important;
        padding: 22px 18px !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .account-link-callout .account-link-icon {
        margin: 0 auto !important;
    }

    html body.municipal-homepage main#main-content .account-link-callout > div,
    html body.municipal-homepage main#main-content .account-link-callout h2,
    html body.municipal-homepage main#main-content .account-link-callout p {
        width: 100% !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .account-link-callout > a {
        align-self: center !important;
        justify-self: center !important;
        width: auto !important;
        min-width: 132px !important;
        margin: 4px auto 0 !important;
    }

    html body.municipal-homepage main#main-content .civic-accomplishments .civic-metric {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 18px 0 !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .civic-accomplishments .civic-metric > span {
        margin: 0 auto !important;
    }

    html body.municipal-homepage main#main-content .civic-accomplishments .civic-metric > div,
    html body.municipal-homepage main#main-content .civic-accomplishments .civic-metric :is(strong, small, em) {
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .official-update-fallback {
        display: flex !important;
        min-height: 112px !important;
        height: auto !important;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        padding: 14px 8px !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .official-fallback-seal {
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;
    }

    html body.municipal-homepage main#main-content .official-update-fallback > span:last-child {
        align-items: center !important;
        width: 100% !important;
        gap: 5px !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .official-update-fallback :is(strong, small, em),
    html body.municipal-homepage main#main-content .facebook-native-post :is(strong, small),
    html body.municipal-homepage main#main-content .facebook-feed-footer {
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .facebook-column-heading {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    html body.municipal-homepage main#main-content .facebook-section-mark {
        margin: 0 auto !important;
    }

    html body.municipal-homepage main#main-content .facebook-native-post {
        display: flex !important;
        min-height: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 14px 12px !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .facebook-native-post > span:last-child {
        width: 100% !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .facebook-feed-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    html body.municipal-homepage main#main-content .quick-info {
        background: #fff !important;
        color: #002e5d !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid > a,
    html body.municipal-homepage main#main-content .quick-info-grid > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        background: #fff !important;
        color: #002e5d !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid > :is(a, div) > span {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid svg {
        color: #087ac7 !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid strong {
        color: #002e5d !important;
        -webkit-text-fill-color: #002e5d !important;
        text-align: center !important;
    }

    html body.municipal-homepage main#main-content .quick-info-grid small {
        color: #5f6f70 !important;
        -webkit-text-fill-color: #5f6f70 !important;
        text-align: center !important;
    }
}

@media (min-width: 390px) and (max-width: 767px) {
    html body.municipal-homepage main#main-content .hero .emergency-card .emergency-action {
        white-space: nowrap !important;
    }
}

/* Keep the compact calendar action readable on touch devices. Older global
   hover rules set a pale background while a prefixed fill rule kept the text
   white, which made the control appear blank in mobile emulation. */
@media (max-width: 767px) {
    html body.municipal-homepage main#main-content .calendar-full-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 44px;
        border: 1px solid var(--home-premium-navy, #003b6f) !important;
        background: var(--home-premium-navy, #003b6f) !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        text-decoration: none !important;
        box-shadow: none !important;
        transition: background-color 0.28s ease, border-color 0.28s ease,
            color 0.28s ease !important;
    }

    html body.municipal-homepage main#main-content .calendar-full-link:focus-visible {
        border-color: var(--home-premium-navy, #003b6f) !important;
        background: #d9e8f2 !important;
        color: var(--home-premium-navy, #003b6f) !important;
        -webkit-text-fill-color: var(--home-premium-navy, #003b6f) !important;
        outline: 2px solid var(--home-premium-navy, #003b6f);
        outline-offset: 2px;
    }
}

@media (max-width: 767px) and (hover: hover) {
    html body.municipal-homepage main#main-content .calendar-full-link:hover {
        border-color: #d9e8f2 !important;
        background: #d9e8f2 !important;
        color: var(--home-premium-navy, #003b6f) !important;
        -webkit-text-fill-color: var(--home-premium-navy, #003b6f) !important;
    }
}
