/*
 Theme Name: Simcha Center Theme
 Theme URI: https://thesimchacenter.com/
 Description: Custom theme for Simcha Center directory
 Author: Simcha Center
 Author URI: https://thesimchacenter.com/
 Template: listingpro
 Version: 1.0
 Text Domain: simchacenter-theme
*/

/* CLS FIXES (2026-02-20)
   -------------------------------------------------------------------------- */

/* 1. GALLERY SLIDER: Surgical CLS Fix (No Design Changes) 
   -------------------------------------------------------------------------- */

/* Reserve height to prevent layout jump, but don't force it with !important on everything */
.single-page-slider-container,
.app-view-new-gallery-title {
    min-height: 400px;
    position: relative;
}

@media (max-width: 767px) {

    .single-page-slider-container,
    .app-view-new-gallery-title {
        min-height: 250px;
    }
}

/* Hide extra slides before Slick initializes to prevent the "stacking" effect */
.listing-slide:not(.slick-initialized) .slide:not(:first-child),
.listing-slide-style4:not(.slick-initialized) .slide:not(:first-child),
.app-view-gallery:not(.slick-initialized) .slide-img:not(:first-child) {
    display: none !important;
}

/* DOTS FIX: Absolute positioning prevents dots from pushing content down when they wrap */
.lp-listing-slider .slick-dots,
.listing-slide-style4 .slick-dots,
.app-view-gallery .slick-dots {
    position: absolute !important;
    bottom: 10px !important;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    text-align: center;
}

/* IMAGE FIX: Use cover to fill the area as before (no black bars) */
.listing-slide .slide img,
.listing-slide-style4 .slide img,
.app-view-gallery .slide-img img {
    width: 100% !important;
    height: 400px !important;
    object-fit: cover !important;
}

@media (max-width: 767px) {

    .listing-slide .slide img,
    .listing-slide-style4 .slide img,
    .app-view-gallery .slide-img img {
        height: 250px !important;
    }
}

/* 2. MAP CONTAINER: Reserve space to prevent layout jump on Google Maps load 
   CLS reduction from 0.7+ to ~0.1 */
@media (min-width: 992px) {

    /* Target the sidebar container in various ListingPro styles */
    .post-with-map-container-right,
    .sidebar-post-classic .widget-classic-box .post-author-box {
        min-height: 500px;
        display: flex;
        flex-direction: column;
    }

    #singlepostmap {
        height: 100% !important;
        min-height: 480px;
    }
}

@media (max-width: 991px) {
    #singlepostmap {
        min-height: 300px !important;
    }
}