/**
 * Front-end styles for /communities (Maloney Properties — Communities).
 *
 * @package Maloney_Properties_Communities
 * @copyright 2026 Responsab LLC. All rights reserved. See plugin header for permitted use.
 */

.mpc-wrap {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem 1rem 3rem;
    box-sizing: border-box;
}

.mpc-app-header {
    margin-bottom: 0.75rem;
}

.mpc-app-kicker {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5a6268;
}

.mpc-app-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    line-height: 1.2;
}

.mpc-app-intro {
    margin: 0 0 15px 0;
    max-width: 52rem;
    color: #444;
    line-height: 1.55;
}

/* Filters */
.mpc-filters {
    display: block;
    flex: 1 1 auto;
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    position: relative;
}

.mpc-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.6rem;
    width: 100%;
}

.mpc-filters__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.7rem;
    background: #f5f6f8;
    border: 1px solid #d9dde4;
    border-radius: 8px;
}

.mpc-toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mpc-toolbar-row--search {
    flex: 0 1 620px;
    min-width: 280px;
    max-width: 620px;
}

.mpc-toolbar-row--filters {
    flex: 0 1 auto;
}

.mpc-toolbar-search {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
}

.mpc-toolbar-search input[type="search"] {
    width: 100%;
    height: 48px;
    padding: 0 0.85rem;
    border: 1px solid #c9ced8;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
}

.mpc-toolbar-select {
    min-width: 10.5rem;
    position: relative;
}

.mpc-toolbar-select select {
    width: 100%;
    height: 48px;
    padding: 0 2rem 0 0.85rem;
    border: 1px solid #c9ced8;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: #1e1f23;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #3a3d44 50%),
        linear-gradient(135deg, #3a3d44 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.mpc-btn--icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 4px;
    background: #276b84;
    border-color: #276b84;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
}

.mpc-btn__icon-svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mpc-btn--icon:hover,
.mpc-btn--icon:focus {
    background: #154c7c;
}

.mpc-btn--icon:disabled,
.mpc-btn--icon[aria-disabled="true"] {
    background: #9db2bf;
    border-color: #9db2bf;
    cursor: not-allowed;
    opacity: 0.8;
}

.mpc-btn--reset {
    height: 48px;
    padding: 0 1rem;
    border-radius: 4px;
    background: #fff;
    border-color: #c9ced8;
    color: #1e1f23;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.mpc-filters__toolbar .mpc-btn--reset {
    margin-left: 0;
}

.mpc-display-group {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-left: auto;
}

.mpc-display-group__label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a5564;
    white-space: nowrap;
}

.mpc-location-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 350;
    background: #fff;
    border: 1px solid #d9dde4;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.mpc-location-suggestion {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-top: 1px solid #eceff3;
    background: #fff;
    color: #1e1f23;
    text-align: left;
    padding: 0.7rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
}

.mpc-location-suggestion:first-child {
    border-top: 0;
}

.mpc-location-suggestion:hover,
.mpc-location-suggestion:focus,
.mpc-location-suggestion.is-active {
    background: #f4f7fb;
}

.mpc-location-suggestion__icon {
    opacity: 0.8;
}

.mpc-location-suggestion__label {
    font-weight: 500;
}

.mpc-location-suggestion-empty {
    padding: 0.72rem 0.8rem;
    font-size: 0.92rem;
    color: #5a636d;
    background: #fff;
}

.mpc-location-status {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    color: #496176;
}

.mpc-location-status--error {
    color: #a33a2a;
}

.mpc-btn--reset:hover,
.mpc-btn--reset:focus {
    background: #f0f3f7;
}

.mpc-filters__row,
.mpc-filters__row--location,
.mpc-filters__row--secondary,
.mpc-filters__actions,
.mpc-field,
.mpc-field--grow,
.mpc-field--units,
.mpc-field-legend-desc,
.mpc-filter-checkboxes {
    display: none;
}

.mpc-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

.mpc-check-label input {
    margin: 0;
    width: 1rem;
    height: 1rem;
    accent-color: #1a4d8c;
}

.mpc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.mpc-btn--primary {
    background: #1a4d8c;
    color: #fff;
    border-color: #153d70;
}

.mpc-btn--primary:hover,
.mpc-btn--primary:focus {
    background: #153d70;
}

.mpc-btn--secondary {
    background: #fff;
    color: #1a4d8c;
    border-color: #b8c4d6;
}

.mpc-btn--secondary:hover,
.mpc-btn--secondary:focus {
    background: #eef2f8;
}

.mpc-geocode-hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: #2d6a4f;
}

@media (max-width: 1100px) {
    .mpc-toolbar-select {
        min-width: 9.5rem;
    }
}

@media (max-width: 860px) {
    .mpc-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .mpc-filters__toolbar {
        gap: 0.45rem;
    }

    .mpc-toolbar-row--search {
        order: 1;
        flex: 1 1 100%;
        min-width: 0;
    }

    .mpc-toolbar-row--search .mpc-toolbar-search {
        flex: 1 1 calc(100% - 52px);
        min-width: 0;
    }

    .mpc-toolbar-row--search .mpc-btn--icon {
        flex: 0 0 48px;
    }

    .mpc-toolbar-row--filters {
        order: 2;
        flex: 1 1 100%;
        gap: 0.45rem;
    }

    .mpc-toolbar-row--filters .mpc-toolbar-select {
        flex: 1 1 calc(50% - 0.23rem);
        min-width: 0;
    }

    .mpc-btn--reset {
        order: 3;
        flex: 1 1 100%;
    }

    .mpc-display-group {
        order: 4;
        flex: 1 1 100%;
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.4rem;
        margin-left: 0;
    }

    .mpc-view-toggle {
        margin-left: 0;
        justify-content: flex-start;
        width: 100%;
    }

    .mpc-location-suggestions {
        top: calc(100% + 2px);
    }

    /* Tighter map+list mobile cards + stronger media presence */
    #mpc-app.mpc-route .mpc-layout--split .mpc-cards-grid {
        gap: 0.7rem;
        padding: 8px;
    }

    #mpc-app.mpc-route .mpc-layout--split .mpc-card__media {
        aspect-ratio: 5 / 4;
    }

    #mpc-app.mpc-route .mpc-layout--split .mpc-card__body {
        gap: 0.35rem;
        padding: 0.68rem 0.72rem 0.78rem;
    }

    #mpc-app.mpc-route .mpc-layout--split .mpc-card__title {
        font-size: 1.02rem;
    }
}

.mpc-fallback-note {
    margin: 0 0 0.6rem;
    padding: 0.65rem 1rem !important;
    background: #fff8e6;
    border: 1px solid #e8d48b;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mpc-is-hidden {
    display: none !important;
}

.mpc-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 12px 0.6rem;
    margin-bottom: 1rem;
}

.mpc-results-total {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
    color: #1f2a36;
}

.mpc-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mpc-pagination--footer {
    justify-content: flex-end;
    padding: 0.4rem 12px 0.9rem;
    width: 100%;
}

.mpc-page-status {
    font-size: 0.95rem;
    color: #4b5563;
    min-width: 120px;
    text-align: right;
}

.mpc-page-btn {
    height: 36px;
    padding: 0 0.8rem;
    border: 1px solid #c9ced8;
    border-radius: 4px;
    background: #fff;
    color: #1f2a36;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.mpc-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mpc-selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 12px 0.9rem;
}

.mpc-filter-chip {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.7rem;
    border: 1px solid #b7d0eb;
    border-radius: 999px;
    background: #eaf3fc;
    color: #0f4f90;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.mpc-filter-chip:hover,
.mpc-filter-chip:focus {
    background: #dbeaf8;
}

.mpc-filter-chip__remove {
    font-size: 1rem;
    line-height: 1;
}

/* View toggle (above theme overlays — Divi can steal clicks without this) */
.mpc-view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
    margin-left: 0;
    justify-content: flex-start;
    flex: 0 0 auto;
    position: relative;
    z-index: 200;
}

.mpc-toggle {
    height: 44px;
    padding: 0 1rem;
    border: 1px solid #c9ced8;
    background: #fff;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

.mpc-view-toggle .mpc-toggle {
    min-width: 96px;
}

.mpc-toggle--active {
    background: #276b84;
    color: #fff;
    border-color: #276b84;
}

/* Layout */
.mpc-layout {
    display: grid;
    gap: 0.8rem;
    align-items: start;
}

.mpc-layout--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.mpc-layout--list {
    grid-template-columns: minmax(0, 1fr);
}

/* Layout visibility: scoped to #mpc-app only — no dependency on theme body classes. */
#mpc-app.mpc-route .mpc-layout--list .mpc-col--map {
    display: none !important;
}

.mpc-layout--map {
    grid-template-columns: minmax(0, 1fr);
}

#mpc-app.mpc-route .mpc-layout--map .mpc-col--cards {
    display: none !important;
}

.mpc-map-results {
    display: none;
}

#mpc-app.mpc-route .mpc-layout--map .mpc-map-results {
    display: block;
    margin-bottom: 0.55rem;
}

.mpc-results-bar--map {
    padding: 0.2rem 0 0.55rem;
}

.mpc-selected-filters--map {
    padding: 0 0 0.65rem;
}

@media (max-width: 900px) {
    .mpc-layout--split {
        grid-template-columns: 1fr;
    }

    .mpc-col--map {
        min-height: 280px;
    }

    .mpc-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .mpc-page-status {
        text-align: left;
    }
}

#mpc-app.mpc-route {
    position: relative;
    z-index: 5;
    overflow: visible;
    box-sizing: border-box;
}

/* Break out of theme content width without editing the theme (full-bleed shell). */
#mpc-app.mpc-route {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.mpc-map {
    position: relative;
    height: 420px;
    width: 100%;
    min-height: min(55vh, 520px);
    border-radius: 8px;
    border: 1px solid #ddd;
    z-index: 2;
    isolation: isolate;
    background: #e8eaef;
}

.mpc-map-wrap {
    position: relative;
}

.mpc-map-reset {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 620;
    height: 40px;
    padding: 0 0.8rem;
    border: 1px solid #c9ced8;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    color: #1e1f23;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.mpc-map-reset .mpc-btn__icon-svg {
    width: 17px;
    height: 17px;
}

.mpc-map-reset:hover,
.mpc-map-reset:focus {
    background: #fff;
}

.mpc-map .leaflet-container {
    z-index: 2;
    font-family: inherit;
}

@media (max-width: 900px) {
    .mpc-map {
        height: 320px;
    }
}

.mpc-map-unavailable {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #444;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

/* Results: card grid */
.mpc-loading,
.mpc-no-cards {
    margin: 0;
    padding: 1rem;
    color: #555;
}

.mpc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    align-items: stretch;
    padding: 12px;
}

#mpc-app.mpc-route .mpc-layout--split .mpc-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
}

#mpc-app.mpc-route .mpc-layout--split .mpc-card {
    max-width: none;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#mpc-app.mpc-route .mpc-layout--list .mpc-cards-grouped {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 12px;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-state-group {
    display: block;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-state-group__title {
    margin: 0 0 1.8rem;
    padding: 0.72rem 1rem;
    background: #276b84 !important;
    color: #fff;
    font-size: 1.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.1;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-state-group__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1200px) {
    #mpc-app.mpc-route .mpc-layout--list .mpc-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #mpc-app.mpc-route .mpc-layout--list .mpc-state-group__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    #mpc-app.mpc-route .mpc-layout--list .mpc-cards-grid {
        grid-template-columns: 1fr;
    }

    #mpc-app.mpc-route .mpc-layout--list .mpc-state-group__grid {
        grid-template-columns: 1fr;
    }
}

.mpc-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    max-width: 300px;
    width: 100%;
}

#mpc-app.mpc-route .mpc-card[data-mpc-id] {
    cursor: pointer;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-card {
    max-width: none;
}

.mpc-card--featured {
    border-color: #e8d48b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

#mpc-app.mpc-route .mpc-card.mpc-card--active {
    border-color: #1f6eb5;
    box-shadow: 0 0 0 2px rgba(31, 110, 181, 0.28), 0 10px 20px rgba(15, 35, 70, 0.2);
}

.mpc-card__media {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #dde1e8;
    overflow: hidden;
}

.mpc-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpc-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 10rem;
    background: linear-gradient(145deg, #e8ecf2 0%, #d4dae6 100%);
}

.mpc-card__placeholder-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.mpc-card__badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #fff3cd;
    color: #856404;
}

.mpc-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.1rem 1.15rem;
    flex: 1;
}

.mpc-card__title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 700;
    color: #1a1a1a;
}

.mpc-card__body p{
    padding: 0;
}

.mpc-card__title-link {
    color: inherit;
    text-decoration: none;
}

.mpc-card__title-link:hover,
.mpc-card__title-link:focus {
    color: #1a4d8c;
    text-decoration: underline;
}

.mpc-card__location {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a4d8c;
}

.mpc-card__address {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.45;
}

.mpc-card__excerpt {
    margin: 0;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.5;
    flex: 1;
}

.mpc-card__sizes {
    margin: 0;
    font-size: 0.82rem;
    color: #333;
    line-height: 1.4;
}

.mpc-card__sizes-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
}

.mpc-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.mpc-card__actions--stack {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
}

.mpc-card__tel-line {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #333;
}

.mpc-card__tel-prefix {
    font-weight: 700;
    margin-right: 0.25rem;
}

.mpc-card__tel-link {
    font-weight: 600;
    color: #1a4d8c;
    text-decoration: none;
}

.mpc-card__tel-link:hover,
.mpc-card__tel-link:focus {
    text-decoration: underline;
}

.mpc-card__tel-relay {
    color: #444;
}

.mpc-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.mpc-card__btn--primary {
    background: #276b84;
    color: #fff;
    border-color: #276b84;
}

.mpc-card__btn--primary:hover,
.mpc-card__btn--primary:focus {
    background: #153d70;
    color: #fff;
}

.mpc-card__btn--secondary {
    background: #fff;
    color: #1a4d8c;
    border-color: #b8c4d6;
}

.mpc-card__btn--secondary:hover,
.mpc-card__btn--secondary:focus {
    background: #eef2f8;
    color: #1a4d8c;
}

/* Leaflet popup readability */
.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
    min-width: 280px;
}

.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.leaflet-popup-tip {
    box-shadow: none;
}

.leaflet-popup-content a {
    color: #1a4d8c;
    font-weight: 600;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #2a3f57;
    font-size: 22px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(35, 57, 84, 0.2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
    color: #173a63;
    background: #fff;
    border-color: rgba(23, 58, 99, 0.35);
}

.leaflet-popup-content a.mpc-card__btn {
    color: inherit;
}

.leaflet-popup-content a.mpc-card__btn--primary {
    color: #fff;
}

.leaflet-popup-content a.mpc-card__btn--secondary {
    color: #1a4d8c;
}

.leaflet-popup-content .mpc-popup-thumb {
    max-width: 100% !important;
    height: auto !important;
}

.mpc-popup-card {
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    overflow: hidden;
}

.mpc-popup-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #edf0f4;
}

.mpc-popup-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mpc-popup-card__body {
    padding: 0.75rem 0.85rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.leaflet-popup-content .mpc-popup-card__body > * {
    margin: 0 !important;
    padding: 0 !important;
}

.mpc-popup-card__title {
    font-size: 1.25rem;
    line-height: 1.2;
    color: #262a31;
}

.mpc-popup-card__location {
    color: #1a4d8c;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}

.mpc-popup-card__address {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.35;
}

.mpc-popup-card__excerpt {
    color: #2b2f35;
    font-size: 0.95rem;
    line-height: 1.45;
}

.mpc-popup-card__sizes {
    color: #2b2f35;
    font-size: 0.85rem;
    line-height: 1.4;
}

.mpc-popup-card__sizes-label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #1f2732;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mpc-popup-card__actions {
    margin-top: 0.2rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.mpc-popup-card__actions--stack {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
}

.mpc-popup-card__tel {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #333;
}

.mpc-popup-card__tel-prefix {
    font-weight: 700;
    margin-right: 0.2rem;
}

.mpc-popup-card__tel-link {
    font-weight: 600;
    color: #1a4d8c;
    text-decoration: none;
}

.mpc-popup-card__tel-relay {
    color: #444;
}

/* Full-width split + scroll column (plugin-scoped; mirrors listings feel). */
#mpc-app.mpc-route.mpc-communities-app.mpc-wrap {
    max-width: none;
}

body.mpc-communities-active #main-content,
body.mpc-communities-active #et-main-area,
body.mpc-communities-active #main-content .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.mpc-communities-active #page-container {
    padding-top: var(--mpc-page-top-offset, 147px) !important;
}

body.admin-bar.mpc-communities-active #page-container {
    padding-top: var(--mpc-page-top-offset, 179px) !important;
}

#mpc-app.mpc-route .mpc-app-header,
#mpc-app.mpc-route .mpc-fallback-note {
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

#mpc-app.mpc-route .mpc-controls {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

#mpc-app.mpc-route .mpc-layout--list .mpc-col--cards {
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
}

@media (min-width: 901px) {
    #mpc-app.mpc-route .mpc-layout--split {
        grid-template-columns: minmax(300px, 36%) 1fr;
        align-items: stretch;
        min-height: calc(100vh - 200px);
    }

    #mpc-app.mpc-route .mpc-col--cards {
        background: #fff;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.12);
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mpc-app.mpc-route .mpc-map {
        height: calc(100vh - 180px);
        min-height: 560px;
        border-radius: 0;
        border: none;
        border-left: 1px solid #ddd;
        background: #f0f2f5;
    }
}

.leaflet-control-attribution {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.85) !important;
}

.mpc-map-pin-wrap {
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
    z-index: 650 !important;
}

.mpc-map-pin {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    border: 3px solid #fff;
    transform: rotate(-45deg);
    transform-origin: center center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    position: relative;
}

.mpc-map-pin::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.mpc-map-pin--default {
    background: #E86962;
}

.mpc-map-pin--featured {
    background: #E4C780;
}

.mpc-cluster-wrap {
    background: transparent !important;
    border: 0 !important;
    z-index: 660 !important;
}

.mpc-map .leaflet-marker-pane {
    z-index: 650;
}

.mpc-cluster-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #67bb3c;
    border: 3px solid #ffffff;
    color: #153d24;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.mpc-cluster-badge--medium {
    width: 46px;
    height: 46px;
    font-size: 15px;
}

.mpc-cluster-badge--large {
    width: 50px;
    height: 50px;
    font-size: 16px;
}

/* -------------------------------------------------------------------------
 * Single community (singular `community` CPT): hero + card.
 * ------------------------------------------------------------------------- */
.mpc-community-page {
    padding-top: 0;
}

#mpc-community-page .mpc-community-single__hero {
    background: #58595B;
    background-image: url(data:image/svg+xml;base64,PHN2ZyAgZmlsbD0icmdiYSg5NCw5NSw5NiwwLjQpIiBoZWlnaHQ9IjE5NHB4IiB3aWR0aD0iMTEycHgiIHZpZXdCb3g9IjAgMCAxMTIgMTk0IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik01NiwxMjkuMzMsMCw5Nyw1Niw2NC42NywxMTIsOTdaTTU2LDBIMFYzMi4zM1ptNTYsMzIuMzNWMEg1NlpNNTYsMTk0aDU2VjE2MS42N1pNMCwxNjEuNjdWMTk0SDU2WiIvPgoJCQkJCQkJCQkJPHBhdGggZmlsbC1vcGFjaXR5PSIuNSIgZD0iTTU2LDBWNjQuNjdMMCw5N1YzMi4zM1ptMCwxMjkuMzNWMTk0bDU2LTMyLjMzVjk3WiIvPjwvc3ZnPg==);
    color: #fff;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 1.25rem;
}

#mpc-community-page .mpc-community-single__hero-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 2.6rem 1.25rem 2.8rem;
    text-align: center;
}

#mpc-community-page .mpc-community-single__hero-title {
    margin: 0;
    font-size: clamp(1.85rem, 4.2vw, 2.75rem);
    line-height: 1.2;
    font-weight: 700;
    font-style: normal;
    color: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.02em;
}

#mpc-community-page .mpc-community-single__hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    padding: 0.62rem 1.25rem;
    border-radius: 4px;
    border: 1px solid #5cba3c;
    background: #5cba3c;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

#mpc-community-page .mpc-community-single__hero-cta:hover,
#mpc-community-page .mpc-community-single__hero-cta:focus {
    background: #579d31;
    border-color: #4f902d;
    color: #ffffff;
}

@media (max-width: 800px) {
    #mpc-community-page .mpc-community-single__hero-inner {
        padding: 2rem 1rem 2.2rem;
    }

    #mpc-community-page .mpc-community-single__hero-title {
        font-size: clamp(1.65rem, 8vw, 2.4rem);
    }
}

/* -------------------------------------------------------------------------
 * Single community (singular `community` CPT): card + meta below hero.
 * ------------------------------------------------------------------------- */
#mpc-community-page .mpc-community-single__card.mpc-card {
    max-width: 42rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    cursor: default;
}

#mpc-community-page .mpc-community-single__info-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.35;
    font-weight: 700;
    color: #1a1a1a;
}

#mpc-community-page .mpc-community-single__info {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.55;
}

#mpc-community-page .mpc-community-single__info > *:first-child {
    margin-top: 0;
}

#mpc-community-page .mpc-community-single__info > *:last-child {
    margin-bottom: 0;
}

#mpc-community-page .mpc-community-single__contact {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #333;
}

#mpc-community-page .mpc-community-single__contact-link {
    font-weight: 600;
    color: #1a4d8c;
    text-decoration: none;
}

#mpc-community-page .mpc-community-single__contact-link:hover,
#mpc-community-page .mpc-community-single__contact-link:focus {
    color: #153d70;
    text-decoration: underline;
}

#mpc-community-page .mpc-community-single__website-wrap {
    margin: 0.85rem 0 0;
}

#mpc-community-page .mpc-community-single__website-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#mpc-community-page .mpc-community-single__tel {
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
}

#mpc-community-page .mpc-community-single__tel-prefix {
    font-weight: 700;
    margin-right: 0.3rem;
}

#mpc-community-page .mpc-community-single__tel-link {
    font-weight: 600;
    color: #1a4d8c;
    text-decoration: none;
}

#mpc-community-page .mpc-community-single__tel-link:hover,
#mpc-community-page .mpc-community-single__tel-link:focus {
    text-decoration: underline;
}

#mpc-community-page .mpc-community-single__tel-relay {
    color: #444;
}
