/* ══════════════════════════════════════════════════════
   HOUSBE · Opportunity lists
   Buyer & Renter (more_buying_leads.php) and Financing
   (more_lending_leads.php). Everything is scoped to .opx /
   .opx-modal so the site's global sheets and these pages
   never bleed into each other. Markup: inc/opportunity_list.php
   and the two pages; behaviour: js/opportunity-list.js.
   ══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

body { background: #0a1220 !important; }
html.opx-locked { overflow: hidden; }

.opx, .opx-modal {
    --opx-bg: #0a1220;
    --opx-card: #0f1a2c;
    --opx-card-2: #0b1524;
    --opx-gold: #f2b544;
    --opx-gold-2: #f8ca62;
    --opx-line: rgba(255, 255, 255, 0.10);
    --opx-edge: rgba(255, 255, 255, 0.22);
    --opx-muted: #aeb8c9;
    --opx-faint: #8a96ab;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    color: #fff;
}
.opx *, .opx *::before, .opx *::after,
.opx-modal *, .opx-modal *::before, .opx-modal *::after { box-sizing: border-box; }

.opx {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    /* --opx-top: the fixed site header's measured height plus a gap
       (opx_style_tag() in inc/opportunity_list.php); these are fallbacks */
    padding: var(--opx-top, 118px) 44px 72px;
    background:
        radial-gradient(1100px 560px at 12% -8%, rgba(43, 93, 153, 0.16), transparent 62%),
        var(--opx-bg);
}
.opx__wrap { max-width: 1460px; margin: 0 auto; }

.opx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 4px 0;
    color: var(--opx-muted) !important;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
}
.opx-back:hover { color: var(--opx-gold) !important; }

/* ── Heading row: title left, filter + Post a Request right ── */
.opx-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 28px;
    margin-bottom: 22px;
}
.opx-head__text { min-width: 0; }
.opx-title {
    margin: 0;
    font-family: inherit !important;
    font-size: 52px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: #fff !important;
}
.opx-lede {
    margin: 8px 0 0;
    font-size: 21px;
    line-height: 1.35;
    color: var(--opx-muted) !important;
}
.opx-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }

.opx-seg {
    display: inline-flex;
    align-items: center;
    padding: 6px;
    border: 1px solid var(--opx-edge);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.opx-seg__btn {
    position: relative;
    height: 44px;
    margin: 0;
    padding: 0 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: 500 16px/1 'Outfit', system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
}
.opx-seg--4 .opx-seg__btn { padding: 0 22px; }
.opx-seg__btn + .opx-seg__btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: var(--opx-edge);
}
.opx-seg__btn[aria-pressed="true"] { background: var(--opx-gold); color: #17120a; font-weight: 600; }
.opx-seg__btn[aria-pressed="true"]::before,
.opx-seg__btn[aria-pressed="true"] + .opx-seg__btn::before { display: none; }
.opx-seg__btn:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, 0.06); }

.opx-post {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    padding: 0 22px;
    border: 2px solid var(--opx-gold);
    border-radius: 12px;
    background: transparent;
    color: var(--opx-gold) !important;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}
.opx-post:hover { background: rgba(242, 181, 68, 0.10); }

/* ── Count + search ── */
.opx-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 0 0 16px;
}
.opx-count { margin: 0; font-size: 15px; color: var(--opx-faint) !important; }
.opx-count strong { color: #fff; font-weight: 600; }
.opx-search { position: relative; width: min(340px, 100%); margin: 0; }
.opx-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--opx-faint); pointer-events: none; }
.opx-search input {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 14px 0 42px !important;
    border: 1px solid var(--opx-edge) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: #fff !important;
    font: 400 15px 'Outfit', system-ui, sans-serif;
    outline: none;
    box-shadow: none;
}
.opx-search input::placeholder { color: var(--opx-faint); opacity: 1; }
.opx-search input:focus { border-color: var(--opx-gold) !important; box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.15); }

/* ── Sections (a page with more than one list) ── */
.opx-sec + .opx-sec { margin-top: 34px; }
.opx-sec[hidden] { display: none; }
.opx-sec__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 12px;
}
.opx-sec__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: inherit !important;
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
}
.opx-sec__count {
    display: inline-flex !important;
    align-items: center;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    line-height: 1 !important;
    border-radius: 999px;
    background: rgba(242, 181, 68, 0.14);
    color: var(--opx-gold);
    font-size: 13px;
    font-weight: 600;
}
.opx-sec__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--opx-gold) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}
.opx-sec__link:hover { text-decoration: underline !important; }
.opx-info {
    display: block;
    line-height: 1.5;
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--opx-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--opx-muted) !important;
    font-size: 14.5px;
}
.opx-info svg { display: inline-block; margin-right: 8px; vertical-align: -3px; color: var(--opx-gold); }
.opx-info a { margin-left: 6px; }
.opx-info a { color: var(--opx-gold) !important; font-weight: 600; }

/* ── Cards ── */
.opx-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.opx-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 18px 18px;
    border: 1.5px solid var(--opx-gold);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--opx-card) 0%, var(--opx-card-2) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.opx-card[hidden] { display: none; }
.opx-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(242, 181, 68, 0.25); }
.opx-card.is-flash { animation: opxFlash 1.8s ease; }
@keyframes opxFlash {
    0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
    25%, 60% { box-shadow: 0 0 0 4px rgba(242, 181, 68, 0.45), 0 10px 30px rgba(0, 0, 0, 0.35); }
}

.opx-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--opx-line);
}
.opx-card__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: linear-gradient(180deg, var(--opx-gold-2), var(--opx-gold));
    color: #fff;
}
.opx-card__kind {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff !important;
}
.opx-card__date {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--opx-muted);
    white-space: nowrap;
}
.opx-card__date[hidden] { display: none; }
.opx-card__date--sub { margin-top: 6px; }
.opx-card__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 12px;
}
.opx-card__place {
    min-width: 0;
    margin: 0;
    padding-top: 6px;
    font-family: inherit !important;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff !important;
    overflow-wrap: anywhere;
}
.opx-card__budget { flex: 0 0 auto; margin: 0; }
.opx-card__budget[hidden] { display: none; }
.opx-card__budget span { display: block; font-size: 13.5px; line-height: 1.25; color: var(--opx-muted); }
.opx-card__budget strong { display: block; font-size: 18px; font-weight: 700; line-height: 1.3; color: #fff; white-space: nowrap; }
.opx-card__budget.is-private strong { color: var(--opx-muted); font-weight: 600; }

.opx-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 9px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    font-size: 12px;
    font-weight: 600;
    vertical-align: 2px;
}
.opx-flag.is-off { border-color: var(--opx-edge); background: rgba(255, 255, 255, 0.06); color: var(--opx-muted); }

/* equal thirds while they fit, wrapping instead of truncating when they don't */
.opx-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opx-chip {
    flex: 1 1 0;
    min-width: max-content;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--opx-edge);
    border-radius: 8px;
    font-size: 15.5px;
    color: #fff;
}
.opx-chip svg { flex: 0 0 auto; }

.opx-looking {
    flex: 1 1 auto;
    margin-top: 12px;
    padding: 12px 18px 14px;
    border: 1px solid var(--opx-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}
.opx-looking__label {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--opx-muted);
}
.opx-looking p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.5;
    color: #e9edf4 !important;
    overflow-wrap: anywhere;
}
.opx-seal {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--opx-muted) !important;
}
.opx-seal svg { flex: 0 0 auto; margin-top: 1px; }
.opx-seal.is-you { color: #34d399 !important; }

.opx-card__foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
    gap: 14px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--opx-line);
}
.opx-card__foot--one { grid-template-columns: minmax(0, 1fr); }
.opx-card__foot--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* cards that carry their facts inline (lender-finance-requests.php): the
   button row sits at the bottom whatever the card holds */
.opx-card .opx-facts { margin-top: 12px; }
.opx-card .opx-fact { padding: 8px 10px; }
.opx-card .opx-fact dd { font-size: 14.5px; }
.opx-card--plain .opx-looking { flex: 0 0 auto; }
.opx-card--plain .opx-card__foot { margin-top: auto; }
.opx-card--plain > :nth-last-child(2) { margin-bottom: 12px; }
.opx-status { margin: 12px 0 0; font-size: 14px; color: var(--opx-muted) !important; }
.opx-status b { color: var(--opx-gold); }

.opx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border-radius: 8px;
    font: 600 15.5px/1 'Outfit', system-ui, sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.opx-btn--ghost { border: 1px solid rgba(255, 255, 255, 0.55); background: transparent; color: #fff !important; }
.opx-btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.opx-btn--gold { border: 1.5px solid var(--opx-gold); background: transparent; color: var(--opx-gold) !important; }
.opx-btn--gold:hover { background: rgba(242, 181, 68, 0.12); }
.opx-btn--solid { width: 100%; height: 50px; border: 0; background: var(--opx-gold); color: #17120a !important; font-size: 16.5px; }
.opx-btn--solid:hover { background: var(--opx-gold-2); }
.opx-btn[disabled] { border: 1px solid var(--opx-edge); background: transparent; color: var(--opx-muted) !important; cursor: not-allowed; }
.opx-btn.is-off { border: 1px solid var(--opx-edge); color: var(--opx-muted) !important; cursor: default; pointer-events: none; }
.opx-btn.busy { opacity: 0.7; pointer-events: none; }
.opx-unread {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--opx-gold);
    color: #17120a;
    font-size: 12px;
    font-style: normal;
}
.opx-owned {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    font-size: 15px;
    font-weight: 600;
}
.opx-back:focus-visible, .opx-seg__btn:focus-visible, .opx-post:focus-visible, .opx-sec__link:focus-visible,
.opx-btn:focus-visible, .opx-modal__x:focus-visible { outline: 2px solid var(--opx-gold); outline-offset: 2px; }

/* empty list, and "nothing matches" under a filter */
.opx-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 56px 24px;
    border: 1.5px dashed rgba(242, 181, 68, 0.5);
    border-radius: 14px;
    text-align: center;
}
.opx-empty[hidden] { display: none; }
.opx-empty h2, .opx-empty h3 { margin: 6px 0 0; font-family: inherit !important; font-size: 22px; font-weight: 700; color: #fff !important; }
.opx-empty p { margin: 0 0 8px; color: var(--opx-muted) !important; font-size: 16px; }
.opx-none { margin: 28px 0 0; text-align: center; color: var(--opx-muted) !important; font-size: 16px; }
.opx-none[hidden] { display: none; }

/* ── Dialogs: details and checkout ── */
.opx-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.opx-modal[hidden] { display: none; }
.opx-modal__backdrop { position: absolute; inset: 0; background: rgba(3, 7, 14, 0.78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.opx-modal__box {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 18px 20px 20px;
    border: 1.5px solid var(--opx-gold);
    border-radius: 16px;
    background: linear-gradient(180deg, #0f1a2c 0%, #0b1423 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.opx-modal__box .opx-card__head { padding-right: 46px; }
.opx-modal__x {
    position: absolute;
    top: 20px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
}
.opx-modal__x:hover { border-color: var(--opx-gold); background: rgba(242, 181, 68, 0.14); }
.opx-modal .opx-looking p { display: block; overflow: visible; -webkit-line-clamp: unset; }
.opx-modal .opx-card__foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }

.opx-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 0; }
.opx-facts:empty { display: none; }
.opx-fact { min-width: 0; padding: 10px 12px; border: 1px solid var(--opx-line); border-radius: 8px; background: rgba(255, 255, 255, 0.02); }
.opx-fact dt { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--opx-muted); }
.opx-fact dd { margin: 0; font-size: 15.5px; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.opx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.opx-tags:empty { display: none; }
.opx-tag { padding: 5px 12px; border: 1px solid rgba(242, 181, 68, 0.45); border-radius: 999px; background: rgba(242, 181, 68, 0.08); color: #f6d58f; font-size: 13px; font-weight: 600; }
.opx-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 13.5px; color: var(--opx-faint) !important; text-align: center; }
.opx-note svg { flex: 0 0 auto; }

.opx-buy { text-align: center; }
.opx-buy__icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 8px auto 12px; border-radius: 12px; background: linear-gradient(180deg, var(--opx-gold-2), var(--opx-gold)); color: #fff; }
.opx-buy__title { margin: 0; font-family: inherit !important; font-size: 24px; font-weight: 700; color: #fff !important; }
.opx-buy__sub { max-width: 420px; margin: 6px auto 16px; font-size: 15px; line-height: 1.5; color: var(--opx-muted) !important; }
.opx-buy__rows { margin: 0 0 16px; border: 1px solid var(--opx-line); border-radius: 10px; text-align: left; }
.opx-buy__rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.opx-buy__rows > div + div { border-top: 1px solid var(--opx-line); }
.opx-buy__rows dt { font-size: 14.5px; font-weight: 400; color: var(--opx-muted); }
.opx-buy__rows dd { margin: 0; font-size: 15px; font-weight: 600; color: #fff; text-align: right; overflow-wrap: anywhere; }
.opx-buy__rows .is-total dd { font-size: 18px; color: var(--opx-gold); }
.opx-buy form { margin: 0; }

/* ── Smaller screens ── */
@media (max-width: 1180px) {
    .opx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .opx { padding: var(--opx-top, 140px) 20px 56px; }
    .opx-title { font-size: 38px; }
    .opx-lede { font-size: 17px; }
}
@media (max-width: 720px) {
    .opx-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .opx { padding: var(--opx-top, 156px) 16px 48px; }
    .opx-title { font-size: 30px; }
    .opx-lede { font-size: 16px; }
    .opx-head { gap: 16px; margin-bottom: 18px; }
    .opx-tools { width: 100%; gap: 10px; }
    .opx-seg { flex: 1 1 100%; }
    .opx-seg__btn, .opx-seg--4 .opx-seg__btn { flex: 1 1 auto; padding: 0 8px; }
    .opx-seg--4 .opx-seg__btn { font-size: 14.5px; padding: 0 4px; }
    .opx-post { flex: 1 1 100%; height: 50px; font-size: 16px; }
    .opx-search { width: 100%; }
    .opx-sec__title { font-size: 18px; }
    .opx-card { padding: 14px 14px 16px; }
    .opx-card__icon { width: 36px; height: 36px; }
    .opx-card__kind { font-size: 16.5px; }
    .opx-card__place { font-size: 22px; padding-top: 4px; }
    .opx-card__budget strong { font-size: 16.5px; }
    .opx-chip { height: 46px; padding: 0 12px; gap: 8px; font-size: 15px; }
    .opx-looking { padding: 11px 14px 12px; }
    .opx-modal { padding: 10px; }
    .opx-modal__box { padding: 15px 14px 16px; max-height: calc(100dvh - 20px); }
    .opx-modal__x { top: 16px; right: 13px; }
}
@media (max-width: 400px) {
    .opx-card__foot, .opx-modal .opx-card__foot { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .opx-card__head { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .opx-card, .opx-btn { transition: none; }
    .opx-card:hover { transform: none; }
    .opx-card.is-flash { animation: none; }
}
