/*==============================*/
/*=====----- TEMPLATE -----=====*/
/*==============================*/

.regions {
    --ease-inout-quad: cubic-bezier(0.45, 0, 0.55, 1);
    
    position: relative;
    color: var(--gray-dark);
}

/*============================*/
/*=====----- SLIDES -----=====*/
/*============================*/

.regions .slide,
.regions .slide-top,
.regions .img-cont,
.regions .slide-img {
    position: relative;
    z-index: 1;
}

.regions .slide {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 21px;
}

.regions .img-cont {
    margin-bottom: 10px;
}

.regions .img-cont::before {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    content: '';
    pointer-events: none;
}

.regions .slide-img {
    width: 100%;
}

.regions .mobile-slide-header {
    display: flex;
    align-items: flex-start;
    gap: 26px;
    padding: 0 20px;
    margin-bottom: 12px;
}

.regions .slide-title {
    max-width: 820px;
    font-family: var(--solano);
    font-weight: var(--font-weight-bold);
    font-size: 50px;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: inherit;
}

.regions .content-section {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    color: var(--white);
}

.regions .content-section .slide-title {
    margin-bottom: 16px;
}

.regions .subtitle {
    display: block;
    font-family: var(--newbery);
    font-weight: var(--font-weight-extrabold);
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--yellow);
}

.regions .location-links {
    margin-bottom: 25px;
}

.regions .location-links-title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    font-family: var(--solano);
    font-weight: var(--font-weight-bold);
    font-size: 24px;
    line-height: 1.2;
    color: inherit;
    text-transform: uppercase;
}

.regions .location-links-title::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 20px;
    content: '\f3c5';
    color: var(--yellow);
}

.regions .location-link {
    font-family: var(--pt-sans);
    font-weight: var(--font-weight-bold);
    font-size: 20px;
    line-height: 1.4;
    color: inherit;
    text-decoration: underline var(--turq) solid 2px;
    text-underline-offset: 3px;
}

.regions .slide-desc {
    font-family: var(--pt-sans);
    font-weight: normal;
    font-size: 17px;
    line-height: calc(30/17);
    color: inherit;
}

.regions .slide-desc.mobile {
    padding: 0 20px;
}

.regions .content-section .slide-desc {
    max-width: 500px;
}

/*----- related listings -----*/

.regions .sidebar {
    padding: 0 36px;
}

.regions .sidebar-header {
    margin-bottom: 26px;
}

.regions .sidebar-title {
    font-family: var(--newbery);
    font-weight: var(--font-weight-extrabold);
    font-size: 28px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--turq);
}

.regions .related-listings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
}

.regions .related-listing,
.regions .related-listing-inner,
.regions .related-image-cont,
.regions .related-image {
    position: relative;
    z-index: 1;
}

.regions .related-image-cont::before {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
    content: '';
    pointer-events: none;
}

.regions .related-image {
    width: 100%;
}

.regions .related-title {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 15px 24px;
    font-family: var(--solano);
    font-weight: var(--font-weight-bold);
    font-size: 23px;
    line-height: calc(25/23);
    color: var(--white);
    pointer-events: none;
}

/*----- region maps -----*/

.regions .mobile-slide-header .region-map {
    width: 98px;
    flex-shrink: 0;
}

.regions .region-map {
    display: none;
}

.region-northwest .regions .region-map.northwest,
.region-northcentral .regions .region-map.northcentral,
.region-northeast .regions .region-map.northeast,
.region-central .regions .region-map.central,
.region-southwest .regions .region-map.southwest,
.region-southeast .regions .region-map.southeast {
    display: block;
}

/*----- hide on mobile -----*/

.regions .content-section :where(.title-text, .slide-desc),
.regions .sidebar .region-map.desktop {
    display: none;
}

/*===================================*/
/*=====----- MEDIA QUERIES -----=====*/
/*===================================*/

@media (min-width: 40em) {
    .regions .mobile-slide-header {
        display: none;
    }

    .regions .slide-desc {
        margin-bottom: 20px;
    }

    .regions .location-links {
        order: 1;
        margin: 20px -22px -20px auto;
        padding: 20px 22px;
        border-left: 2px solid rgba(255 255 255 / .5);
    }

    .regions .sidebar {
        padding: 0 20px;
    }

    .regions .sidebar-header {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .regions .region-map {
        width: 126px;
        flex-shrink: 0;
    }

    .regions .related-listings-grid {
        grid-template: auto / repeat(3, minmax(0, 1fr));
    }

    .regions .related-title {
        font-size: 18px;
    }

    /*----- show on tablet -----*/
    
    .region-northwest .regions .sidebar .region-map.desktop.northwest,
    .region-northcentral .regions .sidebar .region-map.desktop.northcentral,
    .region-northeast .regions .sidebar .region-map.desktop.northeast,
    .region-central .regions .sidebar .region-map.desktop.central,
    .region-southwest .regions .sidebar .region-map.desktop.southwest,
    .region-southeast .regions .sidebar .region-map.desktop.southeast,
    .regions .content-section :where(.title-text, .slide-desc)  {
        display: block;
    }

    /*----- hide on tablet -----*/

    .regions .mobile-slide-header,
    .regions .slide-desc.mobile {
        display: none;
    }
}

@media (min-width: 64em) {
    .regions .slide {
        grid-template: auto / minmax(0, 2fr) minmax(0, 1fr);
        gap: 20px;
        align-items: start;
    }

    .regions .img-cont {
        margin: 0;
    }

    .regions .content-section {
        inset: 0;
        padding: 87px 30px 46px;
    }

    .regions .location-links {
        margin: auto -30px -87px auto;
        padding: 20px 30px 87px;
    }

    .regions .slide-footer {
        margin-bottom: auto;
    }

    .regions .sidebar {
        padding: 0;
    }

    .regions .related-listings-grid {
        grid-template: auto / minmax(0, 1fr);
    }

    .regions .related-title {
        font-size: 23px;
    }

    /*----- slide transitions (on intersect) -----*/

    .regions .main-col,
    .regions .related-listing {
        position: relative;
        background: #e1ddd8;
        overflow: hidden;
    }

    .regions .main-col::before,
    .regions .related-listing::before {
        position: absolute;
        inset: 0;
        z-index: 2;
        transform: translateX(-101%);
        transform-origin: left center;
        display: block;
        background: var(--gray);
        content: '';
        pointer-events: none;
    }

    .regions .slide-top,
    .regions .related-listing-inner {
        opacity: 0;
        transition: opacity var(--transition);
    }

    .regions .slide-top {
        transition-delay: 550ms;
    }

    .regions .related-listing-inner {
        transition-delay: 750ms;
    }
    
    .regions .related-listing:nth-child(2) .related-listing-inner {
        transition-delay: 950ms;
    }
    
    .regions .related-listing:last-child .related-listing-inner {
        transition-delay: 1050ms;
    }

    /* intersected */

    .regions-marquee-container.intersected .regions .slide-top,
    .regions-marquee-container.intersected .regions .related-listing-inner {
        opacity: 1;
    }

    .regions-marquee-container.intersected .regions .main-col::before {
        animation: color-swipe 1000ms var(--ease-inout-quad) 0s 1 normal forwards;
    }

    .regions-marquee-container.intersected .regions .related-listing:first-child::before {
        animation: color-swipe 600ms var(--ease-inout-quad) 300ms 1 normal forwards
    }

    .regions-marquee-container.intersected .regions .related-listing:nth-child(2)::before {
        animation: color-swipe 600ms var(--ease-inout-quad) 500ms 1 normal forwards;
    }
    
    .regions-marquee-container.intersected .regions .related-listing:last-child::before {
        animation: color-swipe 600ms var(--ease-inout-quad) 700ms 1 normal forwards
    }
}

@media (min-width: 90em) {
    .regions .slide {
        grid-template: auto / 72.8% minmax(0, 1fr);
        gap: 74px;
    }

    .regions .content-section {
        padding: 86px 76px 46px 80px;
    }

    .regions .location-links {
        margin: auto -76px -46px auto;
        padding: 16px 76px 46px 31px;
    }

    .regions .slide-title {
        margin-bottom: 24px;
        font-size: 70px;
    }

    .regions .subtitle {
        margin-top: 7px;
        font-size: 30px;
    }

    .regions .slide-desc {
        margin-bottom: 37px;
        font-size: 19px;
        line-height: 2;
    }

    .regions .sidebar.has-map {
        margin-top: -10px;
    }

    .regions .sidebar-header {
        margin-bottom: 18px;
    }
}

@keyframes color-swipe {
    0% {
        transform: translateX(-101%);
    }
    40% {
        transform: translateX(0%);
    }
    60% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(101%);
    }
}