/**
 * RentCafe Floorplans Browser — Frontend Styles
 *
 * Every value that a theme might want to override is a CSS custom property.
 * To theme from your stylesheet, scope overrides under .wprc-browser-wrap:
 *
 *   .wprc-browser-wrap {
 *       --wprc-accent: #your-brand-color;
 *       --wprc-font: "Your Font", sans-serif;
 *   }
 */

/* ── Custom Properties (theme overridable) ── */
.wprc-browser-wrap {
    --wprc-font: var(--wp--preset--font-family--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif);

    --wprc-bg: var(--wp--preset--color--gray-50, #f8f9fb);
    --wprc-surface: var(--wp--preset--color--white, #fff);
    --wprc-surface-2: var(--wp--preset--color--gray-50, #f1f3f7);
    --wprc-border: var(--wp--preset--color--gray-200, #e2e5ec);
    --wprc-text: var(--wp--preset--color--gray-800, #1a1d27);
    --wprc-muted: var(--wp--preset--color--gray-500, #6b7280);
    --wprc-accent: var(--wp--preset--color--blue-600, #2563eb);
    --wprc-accent-hover: var(--wp--preset--color--blue-700, #1d4ed8);
    --wprc-accent-light: var(--wp--preset--color--blue-100, #eff6ff);
    --wprc-green: var(--wp--preset--color--green-600, #16a34a);
    --wprc-green-bg: var(--wp--preset--color--green-50, #f0fdf4);
    --wprc-red: var(--wp--preset--color--red-600, #dc2626);
    --wprc-yellow: var(--wp--preset--color--yellow-600, #ca8a04);
    --wprc-yellow-bg: var(--wp--preset--color--yellow-50, #fffbeb);

    --wprc-radius: 10px;
    --wprc-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);

    --wprc-card-min-width: 320px;
    --wprc-stat-min-width: 150px;
    --wprc-fp-image-height: 180px;

    font-family: var(--wprc-font);
    color: var(--wprc-text);
    line-height: 1.5;
}

/* ── Loading ── */
.wprc-loading { text-align: center; padding: 60px 20px; color: var(--wprc-muted); font-size: 14px; }
.wprc-spinner {
    display: inline-block; width: 28px; height: 28px;
    border: 3px solid var(--wprc-border); border-top-color: var(--wprc-accent);
    border-radius: 50%; animation: rcunits-spin 0.6s linear infinite; margin-bottom: 12px;
}
@keyframes rcunits-spin { to { transform: rotate(360deg); } }

/* ── Admin notice ── */
.wprc-notice {
    background: var(--wprc-accent-light); border: 1px solid var(--wprc-accent);
    color: var(--wprc-accent); padding: 16px 20px; border-radius: var(--wprc-radius); font-size: 14px;
}
.wprc-notice a { color: var(--wprc-accent); font-weight: 600; }

/* ── Stats ── */
.wprc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--wprc-stat-min-width), 1fr));
    gap: 12px; margin-bottom: 20px;
}
.wprc-stat {
    background: var(--wprc-surface); border: 1px solid var(--wprc-border);
    border-radius: var(--wprc-radius); padding: 16px;
}
.wprc-stat-val { font-size: 28px; font-weight: 700; line-height: 1.1; }
.wprc-stat-val--green { color: var(--wprc-green); }
.wprc-stat-label {
    font-size: 11px; color: var(--wprc-muted); margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Filter bar ── */
.wprc-filters {
    background: var(--wprc-surface); border: 1px solid var(--wprc-border);
    border-radius: var(--wprc-radius); padding: 14px 18px;
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.wprc-filters label {
    font-size: 11px; font-weight: 600; color: var(--wprc-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.wprc-filters select,
.wprc-filters input[type="search"],
.wprc-filters input[type="date"] {
    padding: 7px 12px; border: 1px solid var(--wprc-border); border-radius: var(--wprc-radius);
    font-size: 13px; font-family: var(--wprc-font);
    background: var(--wprc-surface); color: var(--wprc-text);
}
.wprc-filters select:focus,
.wprc-filters input:focus {
    border-color: var(--wprc-accent); outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.wprc-search { min-width: 180px; }
.wprc-filter-sep { width: 1px; height: 28px; background: var(--wprc-border); margin: 0 4px; }
.wprc-result-count { font-size: 13px; color: var(--wprc-muted); margin-left: auto; white-space: nowrap; }
.wprc-date-clear {
    background: none; border: none; color: var(--wprc-accent);
    font-size: 12px; cursor: pointer; padding: 4px 6px;
}
.wprc-date-clear:hover { text-decoration: underline; }

/* ── Building section header ── */
.wprc-bldg-section { margin-bottom: 28px; }
.wprc-bldg-header {
    font-size: 18px; font-weight: 700; padding: 10px 0 4px; margin-bottom: 12px;
    border-bottom: 2px solid var(--wprc-border);
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.wprc-bldg-meta { font-size: 12px; font-weight: 500; color: var(--wprc-muted); white-space: nowrap; }

/* ── Grid ── */
.wprc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--wprc-card-min-width), 1fr));
    gap: 16px;
}

/* ── Floorplan card ── */
/* UBCPT design language (Floorplans Browser aggregate card) — theme tokens. */
.wprc-fp-card {
    background: var(--wp--preset--color--white, #fff);
    border: 1px solid var(--wp--preset--color--gray-200, #dbdee3);
    border-top: 2px solid var(--wp--preset--color--black, #000);
    border-radius: 4px; overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease; display: flex; flex-direction: column;
    font-family: var(--wp--preset--font-family--sans, "Cabin", ui-sans-serif, sans-serif);
}
.wprc-fp-card:hover {
    border-top-color: var(--wp--preset--color--yellow-400, #f3e707);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--wp--preset--color--yellow-400, #f3e707) 40%, transparent);
}
.wprc-fp-img {
    width: 100%; height: var(--wprc-fp-image-height); object-fit: cover;
    display: block; background: var(--wp--preset--color--gray-200, #dbdee3);
}
.wprc-fp-placeholder {
    width: 100%; height: var(--wprc-fp-image-height);
    display: flex; align-items: center; justify-content: center;
    background: var(--wp--preset--color--gray-200, #dbdee3); color: var(--wp--preset--color--gray-500, #5a5f68); font-size: 13px;
}
.wprc-fp-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wprc-fp-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wprc-fp-title { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--gray-800, #0f1318); }
.wprc-fp-subtitle { font-size: 14px; color: var(--wp--preset--color--gray-500, #5a5f68); margin-top: 2px; }
.wprc-fp-rent { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--gray-800, #0f1318); white-space: nowrap; }
.wprc-fp-meta { font-size: 12px; color: var(--wp--preset--color--gray-500, #5a5f68); }
.wprc-fp-meta strong { font-weight: 600; color: var(--wp--preset--color--gray-800, #0f1318); }
.wprc-fp-avail { font-size: 12px; color: var(--wp--preset--color--gray-500, #5a5f68); }
.wprc-fp-avail strong { color: var(--wp--preset--color--gray-800, #0f1318); font-weight: 600; }
.wprc-fp-avail--ready strong { color: var(--wp--preset--color--green-600, #498336); }
.wprc-fp-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    margin-top: auto; padding-top: 10px; border-top: 1px solid var(--wp--preset--color--gray-200, #dbdee3);
}
/* Unit-select → tertiary button look */
.wprc-unit-select {
    font-family: var(--wp--preset--font-family--sans, "Cabin", sans-serif);
    font-size: 12px; font-weight: 700; padding: 6px 12px;
    border-radius: 99px; background: var(--wp--preset--color--white, #fff);
    color: var(--wp--preset--color--black, #000); border: 2px solid var(--wp--preset--color--yellow-400, #f3e707);
    cursor: pointer; max-width: 240px;
}
.wprc-unit-select:focus { outline: 3px solid var(--wp--preset--color--yellow-500, #dacf00); outline-offset: 1px; }
/* Link → textlink look */
.wprc-fp-link { font-size: 14px; font-weight: 700; color: var(--wp--preset--color--black, #000); text-decoration: none; white-space: nowrap; border-bottom: 2px solid var(--wp--preset--color--orange-500, #ea7501); }
.wprc-fp-link:hover { border-bottom-color: var(--wp--preset--color--yellow-400, #f3e707); }

/* ── Tags (shared by modal) ── */
.wprc-tag { display: inline-block; font-family: var(--wp--preset--font-family--condensed, "Cabin Condensed", sans-serif); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 99px; }
.wprc-tag--building { background: var(--wp--preset--color--blue-100, #e3effb); color: var(--wp--preset--color--blue-700, #115b93); }
.wprc-tag--available { background: var(--wp--preset--color--green-100, #e8f5e3); color: var(--wp--preset--color--green-700, #3c682d); }
.wprc-tag--notice { background: var(--wp--preset--color--yellow-100, #fffdcc); color: var(--wp--preset--color--yellow-800, #4e4b00); }

/* ── Empty states ── */
.wprc-empty { text-align: center; padding: 48px 20px; color: var(--wprc-muted); }
.wprc-empty-icon { font-size: 40px; margin-bottom: 12px; }
.wprc-empty h3 { margin-bottom: 6px; color: var(--wprc-text); }
.wprc-empty p { font-size: 14px; max-width: 360px; margin: 0 auto; line-height: 1.6; }

/* ══════════════════════════════════════════════════════
 * Unit details modal
 * ══════════════════════════════════════════════════════ */
.wprc-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
    z-index: 99999; display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
    font-family: var(--wprc-font, -apple-system, sans-serif);
}
.wprc-modal {
    position: relative; background: var(--wp--preset--color--white, #fff); color: var(--wp--preset--color--gray-800, #1a1d27);
    border-radius: 12px; width: 100%; max-width: 640px;
    padding: 28px; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
}
.wprc-modal-close {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; font-size: 24px; line-height: 1;
    cursor: pointer; color: var(--wp--preset--color--gray-500, #6b7280); padding: 6px 10px;
}
.wprc-modal-close:hover { color: var(--wp--preset--color--gray-800, #1a1d27); }
.wprc-modal-header h3 { font-size: 20px; font-weight: 700; margin: 0 0 4px; padding-right: 32px; }
.wprc-modal-subtitle { font-size: 13px; color: var(--wp--preset--color--gray-500, #6b7280); margin-bottom: 14px; }
.wprc-modal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wprc-modal-rent {
    font-size: 26px; font-weight: 700; color: var(--wprc-green, #16a34a);
    margin-bottom: 16px;
}
.wprc-modal-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px; margin-bottom: 16px;
}
.wprc-modal-gallery img {
    width: 100%; height: 120px; object-fit: cover;
    border-radius: 8px; display: block; background: var(--wp--preset--color--gray-50, #f1f3f7);
}
.wprc-modal-fields { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 13px; }
.wprc-modal-fields dt { color: var(--wp--preset--color--gray-500, #6b7280); }
.wprc-modal-fields dd { margin: 0; font-weight: 500; word-break: break-word; }

.wprc-btn {
    display: inline-block; padding: 11px 22px;
    border-radius: var(--wprc-radius, 10px);
    border: none; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; text-align: center;
}
.wprc-btn--primary {
    background: var(--wprc-accent, #2563eb); color: var(--wp--preset--color--white, #fff); width: 100%;
}
.wprc-btn--primary:hover { background: var(--wprc-accent-hover, #1d4ed8); color: var(--wp--preset--color--white, #fff); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .wprc-grid { grid-template-columns: 1fr; }
    .wprc-stats { grid-template-columns: repeat(2, 1fr); }
    .wprc-filters { flex-direction: column; align-items: stretch; }
    .wprc-filter-sep { display: none; }
    .wprc-result-count { margin-left: 0; }
    .wprc-search { min-width: 0; }
    .wprc-bldg-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .wprc-fp-footer { flex-direction: column; align-items: stretch; }
    .wprc-unit-select { max-width: none; width: 100%; }
    .wprc-modal { padding: 20px; }
    .wprc-modal-fields { grid-template-columns: 1fr; gap: 2px 0; }
    .wprc-modal-fields dt { margin-top: 8px; }
}

/* ══════════════════════════════════════════════════════════════
 * Find a Home block — two-column layout with Mapbox map + cards
 * ══════════════════════════════════════════════════════════════ */
.wprc-fh-wrap {
    --wprc-fh-border: var(--wp--preset--color--black, #000);
    --wprc-fh-border-light: var(--wp--preset--color--gray-300, #ccc);
    --wprc-fh-muted: var(--wp--preset--color--gray-500, #666);
    --wprc-fh-subtle: var(--wp--preset--color--gray-400, #999);
    --wprc-fh-surface-muted: var(--wp--preset--color--gray-50, #f5f5f5);
    --wprc-fh-tag-bg: var(--wp--preset--color--gray-100, #eee);
    --wprc-fh-accent: var(--wp--preset--color--black, #000);
    --wprc-fh-accent-contrast: var(--wp--preset--color--white, #fff);
}

/* ── Top bar ── */
.wprc-fh-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.wprc-fh-tabs {
    display: flex;
    flex: 1;
    border-bottom: 1px solid var(--wprc-fh-border-light);
}
.wprc-fh-tab {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 6px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    color: inherit;
}
.wprc-fh-tab.is-active { border-bottom-color: var(--wprc-fh-border); font-weight: 500; }
.wprc-fh-tab:hover { background: var(--wprc-fh-surface-muted); }

.wprc-fh-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}
.wprc-fh-result-count { font-size: 13px; color: var(--wprc-fh-muted); }

/* ── Filter button ── */
.wprc-fh-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--wprc-fh-border);
    background: var(--wp--preset--color--white, #fff);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}
.wprc-fh-filter-btn:hover { background: var(--wprc-fh-surface-muted); }
.wprc-fh-filter-btn[aria-expanded="true"] {
    background: var(--wprc-fh-accent);
    color: var(--wprc-fh-accent-contrast);
}

.wprc-fh-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--wprc-fh-accent);
    color: var(--wprc-fh-accent-contrast);
    font-size: 11px;
    font-weight: 700;
}
.wprc-fh-filter-btn[aria-expanded="true"] .wprc-fh-filter-count {
    background: var(--wp--preset--color--white, #fff);
    color: var(--wp--preset--color--black, #000);
}

/* ── Filter overlay + panel ── */
.wprc-fh-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: flex-end;
}
.wprc-fh-filter-overlay[hidden] { display: none; }

body.wprc-fh-modal-open,
body.wprc-modal-open { overflow: hidden; }

.wprc-fh-filter-panel {
    background: var(--wp--preset--color--white, #fff);
    width: 100%;
    max-width: 520px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

/* ── Panel header ── */
.wprc-fh-filter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--wprc-fh-border-light);
    position: sticky;
    top: 0;
    background: var(--wp--preset--color--white, #fff);
    z-index: 1;
}
.wprc-fh-filter-title {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}
.wprc-fh-filter-clear-all {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--wprc-fh-muted);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.wprc-fh-filter-clear-all:hover { color: var(--wprc-fh-border); }
.wprc-fh-filter-apply {
    background: var(--wprc-fh-accent);
    color: var(--wprc-fh-accent-contrast);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 20px;
    cursor: pointer;
}
.wprc-fh-filter-apply:hover { opacity: 0.85; }
.wprc-fh-filter-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
}
.wprc-fh-filter-close:hover { opacity: 0.6; }

/* ── Panel body / sections ── */
.wprc-fh-filter-body { padding: 0 20px 32px; }

.wprc-fh-filter-section { padding: 20px 0; }

.wprc-fh-filter-sep {
    border: none;
    border-top: 1px solid var(--wprc-fh-border-light);
    margin: 0;
}

.wprc-fh-filter-section-label {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}
.wprc-fh-filter-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Chip checkboxes (beds / baths) ── */
.wprc-fh-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.wprc-fh-chip-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
.wprc-fh-chip-cb {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.wprc-fh-chip-text {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--wprc-fh-border-light);
    font-size: 14px;
    background: var(--wp--preset--color--white, #fff);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.wprc-fh-chip-cb:checked + .wprc-fh-chip-text {
    background: var(--wprc-fh-accent);
    color: var(--wprc-fh-accent-contrast);
    border-color: var(--wprc-fh-accent);
}
.wprc-fh-chip-label:hover .wprc-fh-chip-text { border-color: var(--wprc-fh-accent); }
.wprc-fh-chip-cb:focus-visible + .wprc-fh-chip-text { outline: 2px solid var(--wp--preset--color--gray-500, #666); outline-offset: 2px; }

/* ── Price range slider ── */
.wprc-fh-price-range { padding-top: 4px; }

.wprc-fh-price-bubbles {
    position: relative;
    height: 30px;
    margin-bottom: 4px;
}
.wprc-fh-price-bubble-min,
.wprc-fh-price-bubble-max {
    position: absolute;
    transform: translateX(-50%);
    background: var(--wp--preset--color--gray-200, #e8e8e8);
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
}

.wprc-fh-range-track {
    position: relative;
    height: 4px;
    background: var(--wp--preset--color--gray-200, #e5e5e5);
    border-radius: 2px;
    margin: 0 8px;
}
.wprc-fh-range-fill {
    position: absolute;
    height: 100%;
    background: var(--wprc-fh-accent);
    border-radius: 2px;
    pointer-events: none;
}
.wprc-fh-range-min,
.wprc-fh-range-max {
    position: absolute;
    width: calc(100% + 16px);
    left: -8px;
    top: -8px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}
.wprc-fh-range-min::-webkit-slider-thumb,
.wprc-fh-range-max::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wp--preset--color--white, #fff);
    border: 2px solid var(--wprc-fh-accent);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.wprc-fh-range-min::-moz-range-thumb,
.wprc-fh-range-max::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wp--preset--color--white, #fff);
    border: 2px solid var(--wprc-fh-accent);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wprc-fh-price-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--wprc-fh-muted);
    margin-top: 10px;
}

/* ── Neighbourhood checkboxes ── */
.wprc-fh-neighbourhood-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}
.wprc-fh-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.wprc-fh-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--wprc-fh-accent);
}

/* ── Move in Date ── */
.wprc-fh-avail-now-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}
.wprc-fh-avail-now-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--wprc-fh-accent);
}
.wprc-fh-date {
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid var(--wprc-fh-border-light);
    background: var(--wp--preset--color--white, #fff);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Sort select ── */
.wprc-fh-sort {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--wprc-fh-border-light);
    background: var(--wp--preset--color--white, #fff);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    appearance: auto;
}

/* ── Main layout ── */
.wprc-fh-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
.wprc-fh-cards-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.wprc-fh-map-col {
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    min-height: 600px;
}
.wprc-fh-map {
    width: 100%;
    height: 100%;
    background: var(--wp--preset--color--gray-300, #d9d9d9);
    border-radius: 8px;
}

/* ── Card ── */
/* UBCPT Faculty & Staff design language (aggregate Find-a-Home card).
   Consumes the theme's --wp--preset--* tokens; hex fallbacks keep it legible
   if the theme is inactive. Structure/JS hooks are unchanged. */
.wprc-fh-card {
    display: flex;
    position: relative;
    background: var(--wp--preset--color--white, #fff);
    border: 1px solid var(--wp--preset--color--gray-200, #dbdee3);
    border-top: 2px solid var(--wp--preset--color--black, #000);
    border-radius: 4px;
    overflow: hidden;
    font-family: var(--wp--preset--font-family--sans, "Cabin", ui-sans-serif, sans-serif);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.wprc-fh-card:hover {
    border-top-color: var(--wp--preset--color--yellow-400, #f3e707);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--wp--preset--color--yellow-400, #f3e707) 40%, transparent);
}
/* Hover arrow (black circle, white arrow) */
.wprc-fh-card::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--black, #000);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.wprc-fh-card:hover::after { opacity: 1; }

.wprc-fh-card-img-wrap { position: relative; flex-shrink: 0; }
.wprc-fh-card-img {
    width: 272px;
    height: 216px;
    background: var(--wp--preset--color--gray-200, #dbdee3);
    overflow: hidden;
}
.wprc-fh-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wprc-fh-card-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--gray-500, #5a5f68);
    font-size: 13px;
}
/* Building name → glass tag */
.wprc-fh-card-building-name {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: var(--wp--preset--font-family--condensed, "Cabin Condensed", sans-serif);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--wp--preset--color--white, #fff);
    background: color-mix(in srgb, var(--wp--preset--color--gray-100, #f0f1f3) 25%, transparent);
    backdrop-filter: blur(2px);
    border-radius: 6px;
    padding: 4px 8px;
}
.wprc-fh-card-body {
    flex: 1;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.wprc-fh-card-top { display: flex; justify-content: space-between; gap: 12px; }
.wprc-fh-card-title-block { flex: 1; min-width: 0; }
.wprc-fh-card-address { font-size: 16px; font-weight: 400; color: var(--wp--preset--color--gray-500, #5a5f68); margin-bottom: 4px; }
.wprc-fh-card-beds { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--gray-800, #0f1318); margin-bottom: 4px; line-height: 1.35; }
.wprc-fh-card-sqft { font-size: 14px; color: var(--wp--preset--color--gray-500, #5a5f68); }
.wprc-fh-card-staff-tag {
    align-self: flex-start;
    font-family: var(--wp--preset--font-family--condensed, "Cabin Condensed", sans-serif);
    font-weight: 500;
    letter-spacing: 0.04em;
    background: var(--wp--preset--color--yellow-100, #fffdcc);
    color: var(--wp--preset--color--yellow-800, #4e4b00);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.wprc-fh-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-top: auto;
}
.wprc-fh-card-price { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--gray-800, #0f1318); }

.wprc-fh-unit-select-wrap { position: relative; }
.wprc-fh-unit-select-wrap::after {
    content: "\25BE";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wprc-fh-accent-contrast);
    pointer-events: none;
    font-size: 12px;
}
.wprc-fh-unit-select {
    background: var(--wprc-fh-accent);
    color: var(--wprc-fh-accent-contrast);
    padding: 8px 36px 8px 20px;
    border: 1px solid var(--wprc-fh-accent);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    min-width: 123px;
}
.wprc-fh-unit-select:focus { outline: 2px solid var(--wp--preset--color--gray-500, #666); outline-offset: 1px; }

/* ── Map pins ── */
.wprc-fh-pin {
    background: var(--wp--preset--color--black, #000);
    color: var(--wp--preset--color--white, #fff);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
    border: 2px solid var(--wp--preset--color--black, #000);
    line-height: 1;
    font-family: inherit;
}
.wprc-fh-pin.is-dim    { opacity: 0.35; }
.wprc-fh-pin.is-active { background: var(--wp--preset--color--white, #fff); color: var(--wp--preset--color--black, #000); }
.wprc-fh-pin:hover     { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }

/* ── Points of Interest markers ─────────────────────────────── */
.wprc-fh-poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: filter 0.15s;
    /* Default colour — overridden by type modifiers below. */
    background: var(--wp--preset--color--gray-500, #6b7280);
}
.wprc-fh-poi-marker:hover {
    filter: brightness(1.25);
}
.wprc-fh-poi-marker img {
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

/* One background colour per POI type.
   To change a colour, update the hex value for the relevant class.
   To swap an icon, replace the matching SVG in assets/icons/poi/.       */
/* Categorical POI palette — intentionally distinct hues, not brand skin. */
.wprc-fh-poi-marker--transit     { background: #3b82f6; }
.wprc-fh-poi-marker--library     { background: #8b5cf6; }
.wprc-fh-poi-marker--recreation  { background: #10b981; }
.wprc-fh-poi-marker--dining      { background: #f59e0b; }
.wprc-fh-poi-marker--grocery     { background: #22c55e; }
.wprc-fh-poi-marker--health      { background: #ef4444; }
.wprc-fh-poi-marker--arts        { background: #ec4899; }
.wprc-fh-poi-marker--park        { background: #16a34a; }
.wprc-fh-poi-marker--shopping    { background: #f97316; }
.wprc-fh-poi-marker--education   { background: #6366f1; }
.wprc-fh-poi-marker--community   { background: #14b8a6; }
.wprc-fh-poi-marker--other       { background: #6b7280; }

/* POI popup content */
.wprc-fh-mapbox-popup .mapboxgl-popup-content {
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    min-width: 160px;
}
.wprc-fh-poi-popup__title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}
.wprc-fh-poi-popup__type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--gray-500, #6b7280);
    margin-bottom: 6px;
}
.wprc-fh-poi-popup__address {
    color: var(--wp--preset--color--gray-700, #374151);
    margin-bottom: 4px;
}
.wprc-fh-poi-popup__desc {
    color: var(--wp--preset--color--gray-500, #6b7280);
    margin-bottom: 6px;
}
.wprc-fh-poi-popup__link {
    display: inline-block;
    font-size: 12px;
    color: var(--wp--preset--color--blue-600, #2563eb);
    text-decoration: none;
}
.wprc-fh-poi-popup__link:hover {
    text-decoration: underline;
}
.wprc-fh-poi-popup__walk {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--wp--preset--color--green-600, #16a34a);
}
.wprc-fh-poi-popup__walk-icon::before {
    content: '🚶';
    font-style: normal;
}

/* Walk-time badge on POI markers */
.wprc-fh-poi-walk-badge {
    display: none;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX( -50% );
    background: var(--wp--preset--color--gray-800, #111827);
    color: var(--wp--preset--color--white, #fff);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}
/* Dim POI markers that fall outside the selected isochrone */
.wprc-fh-poi-marker.is-outside-iso { opacity: 0.25; }

/* Isochrone walk-time legend */
.wprc-fh-iso-legend {
    position: absolute;
    bottom: 32px;
    left: 12px;
    z-index: 1;
    background: rgba(255,255,255,0.93);
    border: 1px solid var(--wp--preset--color--gray-200, #e5e7eb);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.wprc-fh-iso-legend__title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--gray-500, #6b7280);
    margin-bottom: 4px;
}
.wprc-fh-iso-legend__row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wprc-fh-iso-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.75;
}

.wprc-fh-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--wprc-fh-muted);
    border: 1px dashed var(--wprc-fh-border-light);
}

@media (max-width: 1100px) {
    .wprc-fh-layout { grid-template-columns: 1fr; }
    .wprc-fh-map-col {
        position: relative;
        top: 0;
        height: 480px;
        min-height: 0;
        order: -1;
    }
}
@media (max-width: 640px) {
    .wprc-fh-card { flex-direction: column; }
    .wprc-fh-card-img { width: 100%; height: 200px; }
    .wprc-fh-tabs { flex-wrap: wrap; }
    .wprc-fh-filter-panel { max-width: 100%; }
    .wprc-fh-neighbourhood-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
 * Building Floor Map
 * ══════════════════════════════════════════════════════════
 *
 * Theme overrides — scope under .wprc-floor-map:
 *   .wprc-floor-map {
 *       --wprc-map-available:   #your-green;
 *       --wprc-map-unavailable: #your-red;
 *   }
 */

.wprc-floor-map {
    --wprc-map-available:          var(--wp--preset--color--green-600, #16a34a);
    --wprc-map-available-stroke:   var(--wp--preset--color--green-700, #15803d);
    --wprc-map-unavailable:        var(--wp--preset--color--red-600, #dc2626);
    --wprc-map-unavailable-stroke: var(--wp--preset--color--red-700, #b91c1c);
    --wprc-map-unknown:            var(--wp--preset--color--gray-400, #9ca3af);
    --wprc-map-fill-opacity:       0.18;
    --wprc-map-fill-hover:         0.40;
    --wprc-map-stroke-width:       1.5;

    position: relative;
    font-family: var(--wprc-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    color: var(--wprc-text, #1a1d27);
}

/* ── Floor tabs ── */
.wprc-floor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.wprc-floor-tab {
    padding: 7px 20px;
    border: 1px solid var(--wprc-border, #e2e5ec);
    background: var(--wprc-surface, #fff);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    color: var(--wprc-text, #1a1d27);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wprc-floor-tab:hover {
    background: var(--wprc-surface-2, #f1f3f7);
    border-color: var(--wprc-accent, #2563eb);
}

.wprc-floor-tab:focus-visible {
    outline: 2px solid var(--wprc-accent, #2563eb);
    outline-offset: 2px;
}

.wprc-floor-tab.is-active,
.wprc-floor-tab[aria-selected="true"] {
    background: var(--wprc-accent, #2563eb);
    border-color: var(--wprc-accent, #2563eb);
    color: var(--wp--preset--color--white, #fff);
}

/* ── Map inner layout ── */
.wprc-floor-map-inner {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0; /* collapse whitespace under inline-block img */
}

.wprc-floor-bg {
    display: block;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── SVG overlay ── */
.wprc-floor-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* re-enabled per polygon */
    overflow: visible;
}

.wprc-floor-overlay polygon {
    pointer-events: all;
    fill-opacity: var(--wprc-map-fill-opacity);
    stroke-width: var(--wprc-map-stroke-width);
    stroke-opacity: 0.55;
    transition:
        fill-opacity   0.15s ease,
        stroke-opacity 0.15s ease;
    outline: none;
    cursor: default;
}

.wprc-floor-overlay polygon:focus-visible {
    outline: 2px solid var(--wprc-accent, #2563eb);
    outline-offset: 2px;
}

/* Available */
.wprc-unit--available {
    fill:   var(--wprc-map-available);
    stroke: var(--wprc-map-available-stroke);
}
.wprc-unit--available:hover,
.wprc-unit--available:focus {
    fill-opacity:   var(--wprc-map-fill-hover);
    stroke-opacity: 1;
}

/* Unavailable */
.wprc-unit--unavailable {
    fill:   var(--wprc-map-unavailable);
    stroke: var(--wprc-map-unavailable-stroke);
}
.wprc-unit--unavailable:hover,
.wprc-unit--unavailable:focus {
    fill-opacity:   var(--wprc-map-fill-hover);
    stroke-opacity: 1;
}

/* Unknown (unit name in polygon doesn't match any synced unit) */
.wprc-unit--unknown {
    fill:   var(--wprc-map-unknown);
    stroke: var(--wprc-map-unknown);
}

/* ── Tooltip ── */
.wprc-map-tooltip {
    position: absolute;
    z-index: 200;
    background: var(--wp--preset--color--gray-800, #1a1d27);
    color: var(--wp--preset--color--white, #fff);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    line-height: 1.5;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    max-width: 240px;
    white-space: normal;
}

.wprc-map-tooltip strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.wprc-map-tooltip span {
    display: block;
    opacity: 0.82;
    font-size: 0.8125rem;
}

.wprc-tip-rent {
    opacity: 1 !important;
    font-weight: 600;
    color: var(--wp--preset--color--green-300, #86efac); /* green-300 on dark bg */
    font-size: 0.9rem !important;
    margin-top: 3px;
}

.wprc-tip-status--unavailable {
    color: var(--wp--preset--color--red-300, #fca5a5); /* red-300 on dark bg */
}

/* ── Legend ── */
.wprc-floor-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--wprc-muted, #6b7280);
}

.wprc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wprc-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.wprc-legend-swatch--available   { background: var(--wprc-map-available); }
.wprc-legend-swatch--unavailable { background: var(--wprc-map-unavailable); }

/* ── Empty / notice state ── */
.wprc-floor-map .wprc-notice {
    padding: 14px 18px;
    background: var(--wprc-surface-2, #f1f3f7);
    border: 1px dashed var(--wprc-border, #e2e5ec);
    border-radius: 8px;
    color: var(--wprc-muted, #6b7280);
    font-size: 0.875rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .wprc-floor-tab { padding: 6px 12px; font-size: 0.8rem; }
    .wprc-map-tooltip { font-size: 0.75rem; padding: 8px 10px; }
}
