/* =============================================================================
   LISTINGS — search results page styles
   Loaded only by listings.php via $page_css.
============================================================================= */

/* ── Page header ──────────────────────────────────────────────────────────── */
.listings-page-header {
    background:
        linear-gradient(rgba(15,35,64,0.65), rgba(15,35,64,0.65)),
        url('/assets/img/listing_bg.jpg') center / cover no-repeat;
    padding: 3rem 0;
}
.listings-page-header__heading {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}
.listings-page-header__sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* ── Two-column layout ────────────────────────────────────────────────────── */
.listings-section { padding: 2.5rem 0 4rem; }

.listings-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .listings-layout { grid-template-columns: 280px 1fr; }
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.search-sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.search-sidebar__heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group:last-of-type { margin-bottom: 0; }

/* Remove browser default fieldset box (e.g. price range) */
.filter-group fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.filter-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── Results area ─────────────────────────────────────────────────────────── */
.results-area { min-width: 0; }

.results-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
    .results-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.results-count {
    font-size: 0.9rem;
    color: var(--muted);
}
.results-count strong { color: var(--navy); font-weight: 600; }

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.sort-control select {
    padding: 0.4rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--slate);
    background: var(--white);
    outline: none;
    cursor: pointer;
    transition: border-color var(--ease);
    appearance: auto;
}
.sort-control select:focus { border-color: var(--blue); }

/* ── Active filter pills ──────────────────────────────────────────────────── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.active-filters__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    background: rgba(30,91,168,0.08);
    border: 1px solid rgba(30,91,168,0.2);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue);
}
.filter-pill a {
    display: flex;
    align-items: center;
    color: inherit;
    opacity: 0.65;
    transition: opacity var(--ease);
}
.filter-pill a:hover { opacity: 1; }

/* ── Results grid ─────────────────────────────────────────────────────────── */
.results-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .results-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--cream);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}
.empty-state__icon {
    width: 56px;
    height: 56px;
    background: rgba(30,91,168,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--blue);
}
.empty-state__heading {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
}
.empty-state__text {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--slate);
    border: 1.5px solid var(--border);
    background: var(--white);
    transition: background-color var(--ease), border-color var(--ease), color var(--ease);
    text-decoration: none;
}
.page-btn:hover    { border-color: var(--blue); color: var(--blue); }
.page-btn.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}
.page-btn[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
}
.pagination__ellipsis {
    padding: 0 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    user-select: none;
}

/* ── Status: branded toggle slider ───────────────────────────────────────── */
/* Replaces the plain .filter-check checkbox in the Status filter group.      */

.filter-group--toggle { margin-bottom: 0; }

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;          /* 10px track → label gap */
    cursor: pointer;
    user-select: none;
    padding: 0.125rem 0;
}

/* Hide native checkbox without removing it from the a11y tree */
.filter-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Track */
.filter-toggle__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 2.75rem;         /* 44px */
    height: 1.5rem;         /* 24px */
    border-radius: var(--radius-pill);
    background: var(--border);
    border: 1.5px solid #C8D5E2;
    transition: background var(--ease), border-color var(--ease);
}

/* Thumb */
.filter-toggle__thumb {
    position: absolute;
    left: 3px;
    width: 1.125rem;        /* 18px */
    height: 1.125rem;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(15, 35, 64, 0.18);
    transition: transform var(--ease);
}

/* ON state — gold accent (matches FYSH "under offer" amber palette) */
.filter-toggle input:checked ~ .filter-toggle__track {
    background: var(--gold);
    border-color: #B8922A;
}
.filter-toggle input:checked ~ .filter-toggle__track .filter-toggle__thumb {
    transform: translateX(1.25rem);   /* 20px — track(44) - thumb(18) - gap(6) */
}

/* Hover states */
.filter-toggle:hover .filter-toggle__track {
    border-color: var(--muted);
}
.filter-toggle input:checked:hover ~ .filter-toggle__track {
    background: var(--gold-lt);
    border-color: var(--gold);
}

/* Keyboard focus — visible ring on the track */
.filter-toggle input:focus-visible ~ .filter-toggle__track {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* Label text */
.filter-toggle__label {
    font-size: 0.875rem;
    color: var(--slate);
    font-weight: 500;
    line-height: 1.4;
    transition: color var(--ease);
}
.filter-toggle input:checked ~ .filter-toggle__label {
    color: var(--navy);
    font-weight: 600;
}
