/* One shared decorative canvas for the public real-estate experience.
 * Keep the actual asset under static/images/LavenderBackground.webp.
 * A viewport-sized fixed pseudo-element avoids scaling the image to long
 * infinite-scroll pages or relying on background-attachment: fixed on mobile.
 * Cards, forms, map tiles, gallery images and custom storefront covers retain
 * their existing styles. No JavaScript or additional network origin is needed.
 */
body.public-realestate-canvas {
    --realestate-wallpaper: url("../images/LavenderBackground.webp");
    --realestate-canvas-color: #f3eef8;
    --realestate-canvas-wash: rgba(255, 255, 255, .16);
    --realestate-canvas-position: center center;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Marketplace supports the public site's existing explicit theme. The share
 * page intentionally retains its existing light editorial palette. */
html.mk-public[data-theme="dark"] body.mk-marketplace-page.public-realestate-canvas {
    --realestate-canvas-color: #171322;
    --realestate-canvas-wash: rgba(17, 13, 27, .88);
}

/* Replace only the old page-level canvas; its previous declarations include
 * !important. Maintain the existing main-content/ps-page layering. */
html.mk-public body.mk-marketplace-page.public-realestate-canvas {
    background: var(--realestate-canvas-color) !important;
}
body.ps-body.ps-body--share.public-realestate-canvas {
    background: var(--realestate-canvas-color);
}
html.mk-public body.mk-marketplace-page.public-realestate-canvas::before,
body.ps-body.ps-body--share.public-realestate-canvas::before,
body.ps-body.ps-body--share.public-realestate-canvas:has(.ps-theme-premium)::before {
    content: "";
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    background-color: var(--realestate-canvas-color);
    background-image: linear-gradient(var(--realestate-canvas-wash), var(--realestate-canvas-wash)),
                      var(--realestate-wallpaper);
    background-size: cover, cover;
    background-position: center, var(--realestate-canvas-position);
    background-repeat: no-repeat;
    background-attachment: scroll;
}
body.ps-body.ps-body--share.public-realestate-canvas::after,
body.ps-body.ps-body--share.public-realestate-canvas:has(.ps-theme-premium)::after {
    display: none;
}
body.ps-body.ps-body--share.public-realestate-canvas .ps-page,
body.ps-body.ps-body--share.public-realestate-canvas .ps-page.ps-atlas.ps-editorial {
    background: transparent;
}

/* The nested marketplace canvas previously painted a second, opaque gradient
 * over the body. Make it transparent without changing its layout or z-index. */
html.mk-public body.mk-marketplace-page.public-realestate-canvas .main-content,
html.mk-public body.mk-marketplace-page.public-realestate-canvas .mkt-page-bg,
html.mk-public body.mk-marketplace-page.public-realestate-canvas .mkt-shell {
    background: transparent !important;
}
html.mk-public body.mk-marketplace-page.public-realestate-canvas .mkt-page-bg::before {
    content: none;
    display: none;
}

@media (max-width: 767px) {
    body.public-realestate-canvas {
        --realestate-canvas-wash: rgba(255, 255, 255, .22);
        --realestate-canvas-position: 53% center;
    }
}

/* Keep the canvas unobtrusive for printed property dossiers. */
@media print {
    body.public-realestate-canvas::before,
    html.mk-public body.mk-marketplace-page.public-realestate-canvas::before,
    body.ps-body.ps-body--share.public-realestate-canvas:has(.ps-theme-premium)::before {
        display: none !important;
    }
    html.mk-public body.mk-marketplace-page.public-realestate-canvas,
    body.ps-body.ps-body--share.public-realestate-canvas {
        background: white !important;
    }
}
