/**
 * [fas_search] — combined map + list split view. Structural only (the cards,
 * map, and filter form bring their own styles from cards.css / fas-map.css /
 * the filter partial).
 *
 * Desktop (≥1024px): replicates the LEGACY [mlsps_search] combined view exactly
 * (.mlsps-split-view / -map / -list). The split is a fixed, ~viewport-tall flex
 * area; the map pane is position:sticky (top: 20px) so it PINS as the page
 * scrolls and releases at the end of the block; the list pane scrolls in its
 * OWN inner scrollbar (overflow-y:auto). The page scrolls normally around the
 * whole [fas_search] block. Tune the height with --fas-search-offset (legacy: 40px).
 *
 * ≤1024px: stack reset — map-on-top fixed height, list below, page scrolls.
 */

.fas-search {
    margin: 1.5rem 0;
}

/* The filter form (.fas-filters) renders above the split, in normal flow —
   same as legacy's .mlsps-filters above .mlsps-split-view. */

.fas-search__split {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start; /* legacy: flex-start (map sticks, list flows from top) */
    margin-top: 1rem;
    height: calc(100vh - var(--fas-search-offset, 40px));
    min-height: 500px;
}

.fas-search__map {
    flex: 0 0 50%;
    max-width: 50%;
    height: 100%;
    position: sticky; /* legacy: pins as the page scrolls, releases at block end */
    top: 20px;
    z-index: 1;
}

/* Leaflet fills the sticky pane. The pane's height is resolved (a calc of vh),
   so Leaflet sizes correctly; fas-map.js also invalidateSize()s after layout. */
.fas-search__map .fas-map {
    height: 100%;
    min-height: 0;
}

.fas-search__list {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* legacy: list scrolls in its own inner scrollbar */
    padding-right: 4px;
}

/* No map (no Stadia key): the list is the sole pane → unlock the area so the
   page scrolls the full-width list normally (not trapped in a 100vh box). */
.fas-search__split:has(.fas-search__list--full) {
    height: auto;
    min-height: 0;
}

.fas-search__list--full {
    height: auto;
    overflow: visible;
}

/* Slim scrollbar for the list pane (legacy: 6px). */
.fas-search__list::-webkit-scrollbar {
    width: 6px;
}

.fas-search__list::-webkit-scrollbar-thumb {
    background: var(--fas-border);
    border-radius: 3px;
}

.fas-search__list::-webkit-scrollbar-thumb:hover {
    background: var(--fas-text-faint);
}

/* ≤1024px — reset the desktop split: stack map-on-top, list below, page scrolls. */
@media (max-width: 1024px) {
    .fas-search__split {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .fas-search__map {
        flex: none;
        max-width: 100%;
        width: 100%;
        height: 350px;
        position: relative;
        top: auto;
    }

    .fas-search__list {
        height: auto;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 600px) {
    .fas-search__map {
        height: 280px;
    }
}
