/* ─────────────────────────────────────────
   PRIMA LIVING — Find a Residence
   File: ~/Files/templates/main/css/find-residence.css
   ───────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --dark: #141414;
    --white: #FAFAFA;
    --forest: #092E1D;
    --forest-text: #043A23;
    --sage: #9EA274;
    --bg: #EEF0EE;
    --grey: #6C757D;
    --light-grey: #D9E2DB;
    --cool-grey: #C2CDC5;
    --orange: #DD6D26;
    --tag-bg: #EEEEEE;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background: var(--bg);
    color: var(--dark);
    font-weight: 500;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    background: var(--bg);
}

/* ══════════════════════════════════════════
   HERO (search-only header)
══════════════════════════════════════════ */
#find-residence .hero {
    background: var(--bg);
    padding: 40px 40px 0;
}

#find-residence .search-bar {
    background: var(--forest);
    border: 1px solid var(--cool-grey);
    border-radius: 2px;
    box-shadow: 0 8px 15px rgba(0,0,0,.04);
    display: flex;
    height: 100px;
    position: relative;
    z-index: 10;
}

/* Title */
#find-residence .search-title-col {
    background: var(--bg);
    border-right: 1px solid var(--light-grey);
    padding: 0 40px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

    #find-residence .search-title-col p {
        font-family: 'STIX Two Text', serif;
        font-size: 22px;
        font-weight: 500;
        color: var(--dark);
        line-height: 1.3;
        white-space: pre-line;
    }

/* Location */
#find-residence .search-location {
    position: relative;
    background: var(--white);
    border-right: 1px solid var(--light-grey);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 300px;
    cursor: pointer;
    user-select: none;
}

#find-residence .search-location-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
}

#find-residence .search-location-val {
    font-size: 18px;
    font-style: italic;
    color: var(--grey);
    line-height: 1.5;
}

    #find-residence .search-location-val.selected {
        font-style: normal;
        color: var(--dark);
        font-weight: 600;
    }

#find-residence .search-chevron {
    position: absolute;
    right: 16px;
    bottom: 24px;
    font-size: 18px;
    color: var(--grey);
    transition: transform .2s;
}

#find-residence .search-location.open .search-chevron {
    transform: rotate(180deg);
}

#find-residence .search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--light-grey);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    z-index: 200;
    max-height: 260px;
    overflow-y: auto;
}

    #find-residence .search-dropdown.open {
        display: block;
    }

#find-residence .search-dropdown-opt {
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s;
}

    #find-residence .search-dropdown-opt:hover {
        background: var(--bg);
    }

    #find-residence .search-dropdown-opt.active {
        background: var(--forest);
        color: var(--white);
    }

/* Living option */
#find-residence .search-living {
    background: var(--white);
    border-right: 1px solid var(--light-grey);
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
}

#find-residence .search-living-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    opacity: .8;
}

#find-residence .search-living-opts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

#find-residence .search-cb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: var(--dark);
    cursor: pointer;
    white-space: nowrap;
}

    #find-residence .search-cb input[type="checkbox"] {
        width: 24px;
        height: 24px;
        border: 1px solid var(--cool-grey);
        background: var(--white);
        border-radius: 2px;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .15s, border-color .15s;
    }

    #find-residence .search-cb input:checked {
        background: var(--forest);
        border-color: var(--forest);
    }

/* Search button */
#find-residence .search-btn-col {
    background: var(--white);
    padding: 15px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#find-residence .search-btn {
    background: var(--bg);
    border: 1px solid var(--cool-grey);
    border-radius: 2px;
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark);
    letter-spacing: 1.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

    #find-residence .search-btn:hover {
        background: var(--light-grey);
    }

    #find-residence .search-btn img {
        width: 24px;
        height: 24px;
    }

/* Mobile search */
#find-residence .search-mobile {
    display: none;
    background: var(--white);
}

#find-residence .search-mobile-title {
    background: var(--bg);
    padding: 24px;
    font-family: 'STIX Two Text', serif;
    font-size: 30px;
    font-weight: 400;
    color: var(--dark);
    line-height: 1.33;
}

#find-residence .smf {
    position: relative;
    padding: 14px 20px 14px 30px;
    border-bottom: 1px solid var(--light-grey);
    cursor: pointer;
    user-select: none;
    background: var(--white);
}

    #find-residence .smf.open {
        border-color: var(--forest);
    }

#find-residence .smf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

#find-residence .smf-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

#find-residence .smf-chevron {
    font-size: 16px;
    color: var(--grey);
    transition: transform .2s;
}

#find-residence .smf.open .smf-chevron {
    transform: rotate(180deg);
}

#find-residence .smf-val {
    font-size: 18px;
    font-style: italic;
    color: var(--grey);
}

    #find-residence .smf-val.selected {
        font-style: normal;
        color: var(--dark);
        font-weight: 600;
    }

#find-residence .smf-living-panel {
    display: none;
    flex-direction: column;
    padding-top: 12px;
    border-top: 1px solid var(--light-grey);
    margin-top: 10px;
}

#find-residence .smf.open .smf-living-panel {
    display: flex;
}

#find-residence .smf-cb-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--light-grey);
}

    #find-residence .smf-cb-item:last-child {
        border-bottom: none;
    }

#find-residence .search-mobile-btn-wrap {
    padding: 16px 20px;
}

#find-residence .search-mobile-btn {
    width: 100%;
    height: 64px;
    background: var(--bg);
    border: 1px solid var(--cool-grey);
    border-radius: 2px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark);
    letter-spacing: 1.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

/* ══════════════════════════════════════════
   COMMUNITIES LISTING
══════════════════════════════════════════ */
#find-residence .communities {
    padding: 40px;
    position: relative;
}

#find-residence .community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

#find-residence .community-card {
    background: var(--white);
    border: 1px solid var(--cool-grey);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
}

    #find-residence .community-card:hover {
        box-shadow: 0 12px 32px rgba(9,46,29,.12);
        transform: translateY(-3px);
    }

#find-residence .comm-img-wrap {
    position: relative;
    aspect-ratio: 427/269;
    overflow: hidden;
}

#find-residence .comm-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#find-residence .comm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(226,229,226,.3);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

#find-residence .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--orange);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

    #find-residence .badge.waitlist {
        background: var(--grey);
    }

#find-residence .comm-body {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

#find-residence .comm-location {
    font-size: 16px;
    color: var(--grey);
    line-height: 1.5;
    margin-bottom: 4px;
}

#find-residence .comm-name {
    font-family: 'STIX Two Text', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 8px;
}

#find-residence .comm-desc {
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark);
}

#find-residence .comm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

#find-residence .tag {
    background: var(--tag-bg);
    border-radius: 2px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
}

#find-residence .comm-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    align-items: center;
}

#find-residence .btn-secondary {
    flex: 1;
    height: 48px;
    border: 1px solid var(--forest);
    border-radius: 2px;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s;
}

#find-residence .btn-primary-dark .mobile-calendar {
    display: none;
}

    #find-residence .btn-secondary:hover {
        background: var(--light-grey);
    }

    #find-residence .btn-secondary .mobile-arrow {
        display: none;
        width: 16px;
        height: 16px;
    }

#find-residence .btn-primary-dark {
    flex: 1;
    height: 48px;
    background: var(--forest);
    border: 1px solid var(--forest);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--cool-grey);
    cursor: pointer;
    transition: opacity .2s;
}

    #find-residence .btn-primary-dark:hover {
        opacity: .85;
    }

/* ══════════════════════════════════════════
   BOTTOM CTA BAR
══════════════════════════════════════════ */
#find-residence .bottom-cta {
    background: #EEF0EE;
    border: 1px solid var(--PL-Cool-Grey, #C2CDC5);
    box-shadow: 0 8px 20px 0 rgba(153, 163, 157, 0.10);
    border-radius: 2px;
    margin-top: 60px;
    margin-bottom: 40px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

#find-residence .bottom-cta-text h3 {
    font-family: 'STIX Two Text', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 8px;
}

#find-residence .bottom-cta-text p {
    font-size: 16px;
    font-weight: 500;
    color: var(--grey);
    line-height: 1.5;
    max-width: 567px;
}

#find-residence .btn-cta-outline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    padding: 4px 24px;
    border: 1px solid var(--forest);
    border-radius: 2px;
    background: rgba(255,255,255,.01);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 1.3px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

    #find-residence .btn-cta-outline:hover {
        background: var(--forest);
        color: var(--white);
    }

/* ══════════════════════════════════════════
   RESPONSIVE — ≤1300px search bar tighten
══════════════════════════════════════════ */
@media (max-width: 1300px) {
    #find-residence .search-title-col {
        padding: 0 24px;
    }

    #find-residence .search-title-col p {
        font-size: 18px;
    }

    #find-residence .search-location {
        flex: 0 0 260px;
        padding: 16px;
    }

    #find-residence .search-location-label,
    #find-residence .search-location-val {
        font-size: 16px;
    }

    #find-residence .search-living {
        padding: 0 16px;
        gap: 8px;
    }

    #find-residence .search-living-label {
        font-size: 15px;
    }

    #find-residence .search-living-opts {
        flex-wrap: nowrap;
        gap: 12px;
    }

    #find-residence .search-cb {
        font-size: 15px;
        gap: 6px;
    }

    #find-residence .search-cb input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    #find-residence .search-btn {
        padding: 0 20px;
        font-size: 14px;
        gap: 8px;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (≤1100px)
══════════════════════════════════════════ */
@media (max-width: 1100px) {
    #find-residence .community-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #find-residence .search-bar {
        flex-wrap: wrap;
        height: auto;
    }

    #find-residence .search-living {
        overflow: visible;
    }

    #find-residence .search-living-opts {
        flex-wrap: wrap;
    }

    #find-residence .search-title-col {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid var(--light-grey);
        height: 80px;
    }

    #find-residence .search-location {
        flex: 0 0 40%;
    }

    #find-residence .search-living {
        flex: 1;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — SMALL TABLET (≤900px)
══════════════════════════════════════════ */
@media (max-width: 900px) {
    #find-residence .hero {
        padding: 0;
    }

    #find-residence .search-bar {
        display: none;
    }

    #find-residence .search-mobile {
        display: block;
    }

    #find-residence .communities {
        padding: 20px;
    }

    #find-residence .community-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #find-residence .comm-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #find-residence .btn-secondary {
        flex: unset;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
    }

        #find-residence .btn-secondary .mobile-arrow {
            display: block;
        }

    #find-residence .btn-primary-dark {
        flex: unset;
        width: 100%;
        padding: 0 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

        #find-residence .btn-primary-dark .mobile-calendar {
            display: block;
            width: 24px;
            height: 24px;
        }

    #find-residence .bottom-cta {
        flex-direction: column;
        gap: 20px;
        margin-top: 40px;
    }

    #find-residence .btn-cta-outline {
        width: 100%;
        justify-content: center;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤540px)
══════════════════════════════════════════ */
@media (max-width: 540px) {
    #find-residence .community-grid {
        grid-template-columns: 1fr;
    }

    #find-residence .community-card {
        flex-direction: column;
    }

    #find-residence .comm-img-wrap {
        aspect-ratio: 411.5 / 269;
        height: auto;
        flex: none;
    }

    #find-residence .comm-body {
        padding: 24px;
        gap: 20px;
    }

    #find-residence .comm-name {
        font-size: 22px;
        margin-bottom: 4px;
    }

    #find-residence .comm-desc {
        display: block;
        font-size: 15px;
    }

    #find-residence .comm-tags {
        display: flex;
    }

    #find-residence .comm-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #find-residence .btn-secondary {
        /*flex: 1;*/
        height: 48px;
        display: flex;
        align-items: center;
        padding: 0 16px;
    }

        #find-residence .btn-secondary span:not(.mobile-arrow) {
            display: inline;
        }

        #find-residence .btn-secondary .mobile-arrow {
            display: block;
        }

    #find-residence .btn-primary-dark {
        /*flex: 1;*/
        height: 48px;
        font-size: 14px;
    }

    #find-residence .bottom-cta {
        padding: 24px 20px;
    }

    #find-residence .bottom-cta-text h3 {
        font-size: 22px;
    }
}
/* ══════════════════════════════════════════
   LARGE DESKTOP (≥1440px) — PROPORTIONAL SCALING
   Same mechanism as header-nav.css / home.css / footer.css:
   under 1440 everything uses the Figma 1440 values above; here
   --s runs 1 → 1.3333 between 1440 and 1920 (then caps) and
   every fixed size is multiplied by it. .wrapper's max-width
   scales too so content grows past 1440 (to 1920, centered).
══════════════════════════════════════════ */
@media (min-width: 1440px) {

    :root {
        --s: clamp(1, calc(100vw / 1440px), 1.3333);
    }

    /* Container cap grows 1440 → 1920 so scaled content fits */
    .wrapper {
        max-width: calc(1440px * var(--s));
    }

    /* ── Hero / search bar ── */
    #find-residence .hero {
        padding: calc(40px * var(--s)) calc(40px * var(--s)) 0;
    }

    #find-residence .search-bar {
        height: calc(100px * var(--s));
    }

    #find-residence .search-title-col {
        padding: 0 calc(40px * var(--s));
    }

        #find-residence .search-title-col p {
            font-size: calc(22px * var(--s));
        }

    #find-residence .search-location {
        padding: calc(20px * var(--s));
        gap: calc(8px * var(--s));
        flex: 0 0 calc(300px * var(--s));
    }

    #find-residence .search-location-label,
    #find-residence .search-location-val {
        font-size: calc(18px * var(--s));
    }

    #find-residence .search-chevron {
        right: calc(16px * var(--s));
        bottom: calc(24px * var(--s));
        font-size: calc(18px * var(--s));
    }

    #find-residence .search-dropdown-opt {
        padding: calc(12px * var(--s)) calc(20px * var(--s));
        font-size: calc(16px * var(--s));
    }

    #find-residence .search-living {
        padding: 0 calc(20px * var(--s));
        gap: calc(12px * var(--s));
    }

    #find-residence .search-living-label {
        font-size: calc(18px * var(--s));
    }

    #find-residence .search-living-opts {
        gap: calc(16px * var(--s));
    }

    #find-residence .search-cb {
        gap: calc(8px * var(--s));
        font-size: calc(18px * var(--s));
    }

        #find-residence .search-cb input[type="checkbox"] {
            width: calc(24px * var(--s));
            height: calc(24px * var(--s));
        }

    #find-residence .search-btn-col {
        padding: calc(15px * var(--s));
    }

    #find-residence .search-btn {
        height: calc(64px * var(--s));
        padding: 0 calc(24px * var(--s));
        gap: calc(12px * var(--s));
        font-size: calc(16px * var(--s));
        letter-spacing: calc(1.6px * var(--s));
    }

        #find-residence .search-btn img {
            width: calc(24px * var(--s));
            height: calc(24px * var(--s));
        }

    /* ── Communities grid ── */
    #find-residence .communities {
        padding: calc(40px * var(--s));
    }

    #find-residence .community-grid {
        gap: calc(40px * var(--s));
    }

    #find-residence .badge {
        top: calc(12px * var(--s));
        right: calc(12px * var(--s));
        font-size: calc(12px * var(--s));
        padding: calc(4px * var(--s)) calc(8px * var(--s));
    }

    #find-residence .comm-body {
        padding: calc(40px * var(--s));
        gap: calc(32px * var(--s));
    }

    #find-residence .comm-location {
        font-size: calc(16px * var(--s));
    }

    #find-residence .comm-name {
        font-size: calc(28px * var(--s));
    }

    #find-residence .comm-desc {
        font-size: calc(16px * var(--s));
    }

    #find-residence .comm-tags {
        gap: calc(4px * var(--s));
    }

    #find-residence .tag {
        padding: calc(6px * var(--s)) calc(10px * var(--s));
        font-size: calc(13px * var(--s));
    }

    #find-residence .comm-actions {
        gap: calc(8px * var(--s));
    }

    #find-residence .btn-secondary {
        height: calc(48px * var(--s));
        font-size: calc(15px * var(--s));
        gap: calc(8px * var(--s));
    }

    #find-residence .btn-primary-dark {
        height: calc(48px * var(--s));
        font-size: calc(15px * var(--s));
    }

    /* ── Bottom CTA ── */
    #find-residence .bottom-cta {
        margin-top: calc(60px * var(--s));
        margin-bottom: calc(40px * var(--s));
        padding: calc(40px * var(--s));
        gap: calc(40px * var(--s));
    }

    #find-residence .bottom-cta-text h3 {
        font-size: calc(28px * var(--s));
    }

    #find-residence .bottom-cta-text p {
        font-size: calc(16px * var(--s));
        max-width: calc(567px * var(--s));
    }

    #find-residence .btn-cta-outline {
        gap: calc(12px * var(--s));
        height: calc(48px * var(--s));
        padding: calc(4px * var(--s)) calc(24px * var(--s));
        font-size: calc(13px * var(--s));
        letter-spacing: calc(1.3px * var(--s));
    }
}
