/* Compact About-style contact hero. */
.contact-hero::before {
    background: linear-gradient(90deg, rgba(0, 30, 65, .94) 0%, rgba(0, 46, 93, .78) 42%, rgba(0, 72, 126, .34) 72%, rgba(0, 30, 65, .62) 100%);
}

@media (max-width: 520px) {
    .contact-form select {
        padding-right: 42px !important;
        padding-left: 14px !important;
        text-align: left !important;
        text-align-last: left !important;
    }
    .contact-form select option {
        text-align: left;
        font-weight: 400;
    }
}

.contact-hero__grid {
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 54px;
    min-height: 380px;
    padding-block: 34px;
}

.contact-hero h1 {
    max-width: 760px;
    font-size: clamp(2.55rem, 4.5vw, 4rem);
    line-height: 1.02;
}

.contact-hero p { line-height: 1.62; }
.contact-hero nav { margin-top: 19px; }
.contact-hero figure { height: 255px; background: rgba(8, 122, 199, .18); }
.contact-hero figure img { opacity: .86; }
.contact-hero figure::after { background: linear-gradient(125deg, rgba(0, 46, 93, .38), rgba(8, 122, 199, .1) 48%, rgba(0, 30, 65, .5)); }

/* Center each section introduction without centering detailed content. */
.contact-heading {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.contact-heading p {
    max-width: 780px;
    margin-right: auto;
    margin-left: auto;
}

/* Form control alignment and content-sized routing panel. */
.contact-form select {
    height: 48px;
    min-height: 48px;
    padding: 0 44px 0 14px;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 4px;
    background-color: #fbfdff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23002e5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    color: var(--contact-ink);
    font-weight: 400;
    line-height: 1.3;
}

.contact-form select:required:invalid { color: #526873; font-weight: 400; }
.contact-form select option { color: var(--contact-ink); font-weight: 400; }
.contact-form select:focus { color: var(--contact-ink) !important; }
.contact-form select option { background: #fff; }
.contact-health-fields[hidden] { display: none !important; }
.contact-health-fields {
    display: grid;
    gap: 15px;
    padding: 18px;
    border: 1px solid var(--contact-line);
    border-radius: 4px;
    background: #f4f9fc;
}
.contact-health-fields legend {
    padding: 0 6px;
    color: var(--contact-navy);
    font-size: .82rem;
    font-weight: 800;
}
.contact-radio-group { display: flex; flex-wrap: wrap; gap: 18px; }
.contact-radio-group label { display: flex; grid-template-columns: none; align-items: center; gap: 7px; font-weight: 600; }
.contact-radio-group input { width: 17px; height: 17px; margin: 0; accent-color: var(--contact-navy); }
.privacy-check a { color: var(--contact-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.privacy-check a:hover, .privacy-check a:focus-visible { color: var(--contact-navy); }
.contact-field { display: grid; gap: 7px; }
.contact-field__label { color: var(--contact-navy); font-size: .74rem; font-weight: 800; }
.contact-select { position: relative; }
.contact-select__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #b9ceda;
    border-radius: 4px; background: #fbfdff; color: var(--contact-ink);
    font: 500 .84rem "DM Sans",Arial,sans-serif; text-align: left; cursor: pointer;
}
.contact-select__trigger svg { width: 16px; height: 16px; fill: none; stroke: var(--contact-navy); stroke-width: 2; }
.contact-select__trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.contact-select__options {
    position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; left: 0;
    max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid #9fb8c7;
    border-radius: 4px; background: #fff; box-shadow: 0 14px 34px rgba(0,46,93,.16);
}
.contact-select__options[hidden] { display: none; }
.contact-select__options button {
    display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 3px;
    background: transparent; color: var(--contact-ink); font: 500 .84rem "DM Sans",Arial,sans-serif;
    text-align: left; cursor: pointer;
}
.contact-select__options button:hover, .contact-select__options button:focus-visible { background: #eaf4fb; outline: 0; }
.contact-select__options button[aria-selected="true"] { background: var(--contact-navy); color: #fff; }
.contact-field__error { color: #9b2424; font-size: .7rem; font-weight: 600; }

.contact-form-layout { align-items: start; }
.contact-routing { align-self: start; }
.contact-routing > p { margin-bottom: 0; }

/* Readable message-routing hierarchy. */
.contact-routing > .contact-kicker { font-size: .7rem; line-height: 1.4; }
.contact-routing h3 { font-size: 1.35rem; line-height: 1.25; }
.contact-routing li b { font-size: .95rem; line-height: 1; }
.contact-routing li span { font-size: .82rem; line-height: 1.5; }
.contact-routing > p { font-size: .72rem; line-height: 1.65; }

/* Physical address left, email center, compact phone channel right. */
.direct-channel-grid {
    grid-template-columns: 1fr 1.08fr .82fr;
    align-items: stretch;
}

.direct-channel-grid > article { display:flex;flex-direction:column;min-height:0;height:100%; }
.direct-channel-grid > article:nth-child(3) { grid-column: 1; grid-row: 1; }
.direct-channel-grid > article:nth-child(2) { grid-column: 2; grid-row: 1; }
.direct-channel-grid > article:nth-child(1) { grid-column: 3; grid-row: 1; }
.channel-number { display: none; }
.direct-channel-grid h3 { margin-top: 0; }
.direct-channel-grid > article > .contact-button { margin-top:auto;align-self:flex-start; }

/* Keep Direct Channels and Municipal Location visually connected. */
.contact-section--tint:has(.direct-channel-grid){padding-bottom:40px}
#municipal-map.contact-section{padding-top:40px}

/* Consistent self-service card rhythm and action alignment. */
.self-service-grid{align-items:stretch}
.self-service-grid article{
    display:grid;
    grid-template-rows:auto auto minmax(28px,1fr) auto 34px;
    height:100%;
}
.self-service-grid article>h3{grid-row:1}
.self-service-grid article>p{grid-row:2}
.self-service-grid article>.contact-button{
    grid-row:4;
    justify-self:center;
    margin-top:0;
}
.self-service-grid article>.social-actions{
    grid-row:4;
    justify-content:center;
    margin-top:0;
}
.self-service-grid article>.chat-note{
    grid-row:5;
    align-self:start;
    margin-top:10px;
    text-align:center;
}

/* Municipal photograph and directions presented side by side. */
.contact-map-layout {
    display: grid;
    grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.contact-map-photo {
    min-height: 410px;
    margin: 0;
    overflow: hidden;
    background: #dcecf7;
}

.contact-map-photo img {
    width: 100%;
    height: 100%;
    min-height: 410px;
    object-fit: cover;
}

.map-placeholder .map-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
}

.map-placeholder--embedded {
    display: grid;
    grid-template-rows: minmax(300px, 1fr) auto;
    min-height: 410px;
    padding: 0;
    text-align: center;
}

.map-placeholder--embedded > iframe {
    width: 100% !important;
    height: 100%;
    min-height: 300px;
    border: 0;
}

.map-location-summary {
    padding: 20px 24px 22px;
    border-top: 1px solid var(--contact-line);
    background: #fff;
}

.map-location-summary p { margin: 7px 0 14px; }

/* Official social links; X is intentionally unfilled. */
.social-actions .contact-social-x {
    min-width: 42px;
    padding-inline: 12px;
    border-color: transparent;
    background: transparent;
    color: var(--contact-navy);
    font-size: 1rem;
}

.social-actions .contact-social-x:hover,
.social-actions .contact-social-x:focus-visible {
    border-color: transparent;
    background: transparent;
    color: var(--contact-blue);
}

@media (max-width: 1000px) {
    .contact-hero__grid { grid-template-columns: 1fr 340px; gap: 34px; min-height: 350px; }
    .contact-hero figure { height: 230px; }
    .direct-channel-grid { grid-template-columns: 1fr 1fr; }
    .direct-channel-grid > article:nth-child(3), .direct-channel-grid > article:nth-child(2), .direct-channel-grid > article:nth-child(1) { grid-column: auto; grid-row: auto; }
}

@media (max-width: 720px) {
    .contact-hero__grid { grid-template-columns: 1fr; min-height: 0; padding-block: 31px; }
    .contact-hero figure { height: 220px; }
    .direct-channel-grid, .contact-map-layout { grid-template-columns: 1fr; }
    .contact-map-photo, .contact-map-photo img { min-height: 280px; }
}

@media (max-width: 520px) {
    .contact-container { width: calc(100% - 28px); }

    .contact-hero__grid {
        gap: 20px;
        padding-block: 27px 29px;
        text-align: center;
    }

    .contact-hero h1 {
        max-width: 370px;
        margin: 8px auto 13px;
        font-size: 2.25rem;
        line-height: 1.06;
    }

    .contact-hero p {
        max-width: 360px;
        margin-inline: auto;
        font-size: .82rem;
        line-height: 1.62;
    }

    .contact-hero nav {
        justify-content: flex-start;
        margin-top: 19px;
        text-align: left;
    }

    .contact-hero figure {
        width: 100%;
        height: 184px;
        padding: 8px;
    }

    .contact-hero figure::after { inset: 8px; }

    .contact-hero figcaption {
        right: 0;
        bottom: 12px;
        width: min(282px, calc(100% - 74px));
        padding: 10px 13px;
        text-align: left;
    }

    .contact-section { padding-block: 38px; }
    .contact-heading { margin-bottom: 23px; }
    .contact-heading h2 { font-size: 1.9rem; line-height: 1.13; }
    .contact-heading p { font-size: .8rem; line-height: 1.62; }

    .contact-form-panel,
    .contact-routing,
    .direct-channel-grid > article,
    .self-service-grid article { padding: 21px 18px; }

    .contact-form { gap: 15px; }
    .contact-form label { text-align: left; }
    .contact-form input,
    .contact-form select { min-height: 48px; }
    .contact-form textarea { min-height: 142px; }
    .privacy-check span { text-align: center; }
    .captcha-status { padding: 11px; }

    .contact-button {
        align-self: center;
        width: auto;
        min-width: 126px;
        padding-inline: 16px;
    }

    .contact-form > .contact-button { justify-self: center; }
    .contact-routing { text-align: center; }
    .contact-routing h3 { margin-bottom: 15px; }
    .contact-routing li { grid-template-columns: 32px 1fr; padding: 13px 0; }
    .contact-routing > p { margin-top: 16px; }

    .direct-channel-grid { gap: 14px; }
    .direct-channel-grid > article { text-align: center; }
    .direct-channel-grid h3 { margin-bottom: 12px; }
    .direct-channel-grid .contact-button { align-self: center; margin: 16px auto 0; }

    .contact-map-layout { gap: 14px; }
    .contact-map-photo,
    .contact-map-photo img { min-height: 0; height: 205px; }
    .contact-map { min-height: 260px; }
    .map-placeholder { min-height: 260px; padding: 24px 18px; }
    .map-placeholder--embedded {
        grid-template-rows: minmax(240px, 1fr) auto;
        padding: 0;
    }
    .map-placeholder--embedded > iframe { min-height: 240px; }
    .map-location-summary { padding: 18px 16px 20px; }
    .map-placeholder p { margin-bottom: 12px; }
    .map-placeholder .map-actions { gap: 10px; }

    .self-service-grid { gap: 14px; }
    .self-service-grid article {
        min-height: 210px;
        align-items: center;
        text-align: center;
    }
    .self-service-grid h3 { margin-bottom: 10px; }
    .self-service-grid p { max-width: 320px; margin-bottom: 16px; }
    .self-service-grid .contact-button { margin-top: auto; }
    .social-actions { align-items: center; margin-top: auto; }
    .chat-note { max-width: 310px; }

    html body .lgu-scroll-top {
        right: 10px !important;
        bottom: 10px !important;
        width: 42px !important;
        height: 42px !important;
    }
}

/* Unified municipal hero: use the hall as the header, not as an inset collage. */
.contact-hero{
    background:#00345f url('../../uploads/Municipal-hall-1.jpg') center 44%/cover no-repeat!important;
}
.contact-hero::before{
    background:linear-gradient(90deg,rgba(0,30,65,.92) 0%,rgba(0,46,93,.74) 42%,rgba(0,46,93,.38) 68%,rgba(0,46,93,.12) 100%)!important;
}
.contact-hero__gloss{display:none!important}
.contact-hero__grid{grid-template-columns:minmax(0,920px)!important;justify-content:start!important}
.contact-hero figure{display:none!important}

@media(max-width:700px){
    .contact-hero{background-position:center 42%!important}
}

/* Keep Contact Us controls visually neutral on hover, focus and validation. */
.contact-form input:hover,
.contact-form select:hover,
.contact-form textarea:hover,
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus,
.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible,
.contact-form input:invalid:focus,
.contact-form select:invalid:focus,
.contact-form textarea:invalid:focus {
    border-color: #b9ceda !important;
    background-color: #fbfdff !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Restrained municipal treatment for the self-service resolution cards. */
.self-service-grid article {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 46, 93, 0.07);
    transition: background-color 320ms ease, box-shadow 320ms ease;
}

.self-service-grid article::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 44px;
    height: 2px;
    content: "";
    background: #ffc936;
    transform: translateX(-50%);
}

.self-service-grid article:hover {
    background: #f8fbfd;
    box-shadow: 0 14px 34px rgba(0, 46, 93, 0.1);
    transform: none !important;
}

.self-service-grid h3 {
    color: #00345f;
}

.self-service-grid p,
.self-service-grid .chat-note {
    color: #60717e;
}

.self-service-grid .contact-button {
    align-self: center;
}

@media (max-width: 520px) {
    .self-service-grid article {
        min-height: 195px;
        padding: 26px 20px;
    }

    .self-service-grid .contact-button {
        width: min(100%, 240px);
        margin-inline: auto;
    }

    .self-service-grid .social-actions {
        width: 100%;
    }
}
