/* Listing v2 — new shared listing design.
   Scoped under .l2 to avoid bleeding into the rest of the site. */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600&display=swap');

/* Break out of Bootstrap's narrow `.container` so the page fills the
   viewport. Bootstrap caps .container at 540 / 720 / 960 / 1140 px which
   leaves the content visibly pushed to the centre with empty gutters at
   small widths. Override only on this page. */
body.page-listing .container {
    max-width: 100%;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

body.page-listing .row { margin-left: 0; margin-right: 0; }
body.page-listing .col-lg-12 { padding-left: 0; padding-right: 0; }

/* Re-pad the legacy footer (MLS disclaimer / © / HS logo) — it's outside .l2 */
body.page-listing .footer { padding-left: 24px; padding-right: 24px; }

/* Footer logo is now the Figma combo (icon + wordmark, 122x22) instead of the
   legacy 30x30 square icon — override the legacy `.hs-logo img` size. */
body.page-listing .hs-logo img {
    width: 122px;
    height: 22px;
    object-fit: contain;
}

.l2 {
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: #1f1f1f;
    padding: 24px 24px 64px;
    max-width: 1140px;
    margin: 0 auto;
}

.l2 *,
.l2 *::before,
.l2 *::after { box-sizing: border-box; }

.l2 p,
.l2 h1, .l2 h2, .l2 h3, .l2 h4, .l2 h5, .l2 h6 {
    font-weight: 500;
    margin: 0;
}

.l2-grid {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    width: 100%;
}

.l2-center { text-align: center; }

/* LEFT COLUMN -------------------------------------------------------- */

.l2-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
}

.l2-photo-wrap {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 36px;
    background: #f5f5f5;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 48px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 12px;
}

.l2-photo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 32px;
}

.l2-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -0.28px;
    color: rgba(67, 66, 66, 0.6);
    text-transform: capitalize;
}

.l2-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2bb673;
    display: inline-block;
}

.l2-price-block {
    text-align: center;
    margin-top: 4px;
}

.l2-price {
    font-size: 24px;
    line-height: 28px;
    letter-spacing: -0.48px;
    color: #1f1f1f;
}

.l2-addr,
.l2-meta {
    margin-top: 4px;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: #7a7a7a;
}

/* RIGHT COLUMN ------------------------------------------------------- */

.l2-right {
    flex: 1 1 0;
    min-width: 0;
    max-width: 480px;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-self: stretch;
}

.l2-sep {
    height: 1px;
    background: #eeeeee;
    width: 100%;
}

/* Agent ------------------------------------------------------------- */

.l2-agent {
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 24px;
}

.l2-agent-photo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.l2-agent-photo--empty { background-color: #f5f5f5; }

.l2-agent-info { min-width: 0; flex: 1 1 0; }

.l2-agent-name {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: #1f1f1f;
}

.l2-agent-role {
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -0.28px;
    color: rgba(67, 66, 66, 0.6);
}

/* Section headings ------------------------------------------------- */

.l2-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.l2-h3 {
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.4px;
    font-weight: 500;
    color: #1f1f1f;
}

/* About-this-place tiles ------------------------------------------- */

.l2-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 21px 24px;
}

.l2-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.l2-tile-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.l2-tile-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.l2-tile-text { min-width: 0; flex: 1 1 0; }

.l2-tile-value {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.l2-tile-label {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.24px;
    color: #7a7a7a;
}

/* Description ------------------------------------------------------ */

.l2-desc {
    font-size: 16px;
    line-height: 22px;
    letter-spacing: -0.32px;
    color: #7a7a7a;
    white-space: pre-line;
}

/* App-download CTA -----------------------------------------------
   Two sibling blocks live inside .l2-cta: the email-capture block
   ([data-l2-cta-email]) and the success "Perfect!" block
   ([data-l2-cta-success]). JS toggles `hidden` between them. */

.l2-cta {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.l2-cta-email,
.l2-cta-success {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.l2-cta-email[hidden],
.l2-cta-success[hidden] { display: none; }

.l2-cta-success-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.l2-cta-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.l2-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.l2-app-icon--empty { background-color: #f5f5f5; }

.l2-cta-text { min-width: 0; flex: 1 1 0; }

.l2-cta-title {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: #1f1f1f;
}

.l2-cta-sub,
.l2-sub {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: rgba(67, 66, 66, 0.6);
}

/* Email form ------------------------------------------------------ */

.l2-form {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.l2-input {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    padding: 0 20px;
    border: 0;
    outline: none;
    border-radius: 30px;
    background: rgba(128, 126, 125, 0.12);
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: #1f1f1f;
    -webkit-appearance: none;
    appearance: none;
}

.l2-input::placeholder {
    color: rgba(67, 66, 66, 0.6);
}

.l2-input:focus {
    background: rgba(128, 126, 125, 0.18);
}

/* Note: style.css has `button, button:focus, button:active { width: 100% }`.
   That `button:active` selector (tag + pseudo) outranks plain `.l2-btn` on
   focus/active states, so we have to win specificity with the same compound
   selector pattern below. Don't simplify unless you remove the global rule. */
.l2 .l2-btn,
.l2 .l2-btn:focus,
.l2 .l2-btn:active,
.l2 .l2-btn:hover {
    width: 77px;
    min-width: 77px;
    max-width: 77px;
    height: 56px;
    flex: 0 0 auto;
    padding: 0 20px;
    border: 0;
    border-radius: 28px;
    background: #6155f5;
    color: #ffffff;
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.l2 .l2-btn { transition: opacity 0.15s ease; }
.l2 .l2-btn:hover { opacity: 0.92; }
.l2 .l2-btn:active { opacity: 0.85; }
.l2 .l2-btn:disabled,
.l2 .l2-btn--loading { opacity: 0.6; cursor: default; }

.l2-form-msg {
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -0.28px;
    color: #d23535;
    min-height: 18px;
    margin-top: -8px;
}

.l2-form-msg:empty { display: none; }

.l2-cta-error .l2-input { box-shadow: 0 0 0 1px #d23535 inset; }

/* Badges (shown after email submitted, or as legacy) -------------- */

.l2-badges {
    display: flex;
    gap: 12px;
}

.l2-badges[hidden] { display: none; }
.l2-badges.l2-center { justify-content: center; }

.l2-badge img {
    height: 40px;
    width: auto;
    display: block;
}

/* QR --------------------------------------------------------------- */

.l2-qr {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 16px;
}

.l2-qr-code {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.l2-qr-code img,
.l2-qr-code canvas {
    width: 128px !important;
    height: 128px !important;
}

.l2-qr-text {
    flex: 1 1 0;
    min-width: 0;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.32px;
    color: rgba(67, 66, 66, 0.6);
}

/* Mobile sticky bottom card --------------------------------------- */

.l2-sticky { display: none; }

/* Responsive ------------------------------------------------------- */

@media (max-width: 991.98px) {
    /* push the entire page content above the sticky bottom card so the
       legacy MLS disclaimer / copyright footer is reachable */
    body.page-listing { padding-bottom: 260px; }

    .l2 {
        padding: 16px 24px 0;
    }

    .l2-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .l2-left {
        padding: 24px 0 8px;
    }

    .l2-photo-wrap {
        width: 256px;
    }

    .l2-right {
        padding: 16px 0 32px;
        max-width: 100%;
        width: 100%;
        align-items: stretch;
        gap: 24px;
    }

    /* Centre the agent row (photo + name) horizontally on mobile */
    .l2-agent { justify-content: center; }

    /* Hide desktop-only CTA / QR — replaced by sticky card */
    .l2-cta-desktop,
    .l2-qr-desktop,
    .l2-sep-desktop {
        display: none;
    }

    /* Description fades to white on mobile (matches Figma) */
    .l2-desc {
        background: linear-gradient(to bottom, #7a7a7a 0%, #ffffff 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }

    /* Sticky bottom card — same email-capture CTA, fixed to viewport */
    .l2-sticky {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff;
        border-top-left-radius: 32px;
        border-top-right-radius: 32px;
        padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.16);
        z-index: 100;
        gap: 16px;
    }

    .l2-sticky .l2-badges { justify-content: center; }
    .l2-sticky .l2-cta-success-head { text-align: center; align-items: center; }
}

@media (max-width: 480px) {
    .l2-tiles {
        gap: 18px 16px;
    }
}
