/**
 * BWG YGL: the single-column listing list (templates/partials/listing-list.php).
 * Used by the "That listing is no longer available" page (PropertyPage::serve_gone_page)
 * and by Similar Listings Nearby on listing pages and in the pop-up (BWG-1329).
 * Standalone on purpose: the gone page loads no map, so it skips bwgygl.css and its Leaflet dependencies.
 */

/* "That listing is no longer available" page: one sentence, then the
   latest listings in a single column (server-rendered, no map). */
.bwgygl-property-gone__body {
    margin: 0 0 24px;
}

.bwgygl-gone-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bwgygl-gone-item {
    margin: 0;
    padding: 0;
}

.bwgygl-gone-item__link {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgb(0 0 0 / 12%);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.bwgygl-gone-item__link:hover,
.bwgygl-gone-item__link:focus-visible {
    border-color: currentcolor;
}

.bwgygl-gone-item__photo {
    flex: 0 0 160px;
    width: 160px;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    background: rgb(0 0 0 / 6%);
}

.bwgygl-gone-item__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bwgygl-gone-item__details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bwgygl-gone-item__price {
    font-weight: 700;
    font-size: 1.15em;
}

.bwgygl-gone-item__facts {
    opacity: 0.75;
    font-size: 0.9em;
}

@media (width <= 480px) {
    .bwgygl-gone-item__photo {
        flex-basis: 110px;
        width: 110px;
        height: 84px;
    }
}

/* Similar Listings Nearby (BWG-1329): the same list as a grid of vertical
   cards, in the pop-up and on listing pages. The gone page keeps the single
   column. minmax(0, ...) and min-width: 0 let a long address wrap instead of
   widening its column. */
.bwgygl-similar-section .bwgygl-gone-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.bwgygl-similar-section .bwgygl-gone-item {
    min-width: 0;
}

.bwgygl-similar-section .bwgygl-gone-item__link {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 0 0 14px;
    overflow: hidden;
}

.bwgygl-similar-section .bwgygl-gone-item__photo {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
}

.bwgygl-similar-section .bwgygl-gone-item__details {
    padding: 0 14px;
}

.bwgygl-similar-section .bwgygl-gone-item__address {
    overflow-wrap: anywhere;
}

/* Two across on a phone, so six suggestions are three rows, not six */
@media (width <= 600px) {
    .bwgygl-similar-section .bwgygl-gone-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .bwgygl-similar-section .bwgygl-gone-item__link {
        gap: 8px;
        padding-bottom: 10px;
    }

    .bwgygl-similar-section .bwgygl-gone-item__details {
        padding: 0 10px;
        font-size: 0.9em;
    }
}
