/* Community Grid & Listing Styles */
.jh-inventory-block-wrapper, .jh-featured-wrapper, .jh-floor-plans-wrapper {
    margin: 2rem 0;
}

.jh-grid-container, .jh-featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    list-style: none;
    padding: 0 !important;
    margin: 0;
}

@media (min-width: 768px) {
    .jh-grid-container, .jh-featured-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .jh-grid-container, .jh-featured-grid { grid-template-columns: repeat(3, 1fr); }
}

.jh-spec-card, .jh-featured-card {
    display: flex; 
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.jh-global-plans-wrapper .jh-spec-card {
    background-color: #ffffff;
}

.jh-card-img-wrap {
    display: block; 
    width: 100%; 
    height: 250px; 
    background: #e5e7eb;
    overflow: hidden;
}

.jh-card-img-wrap img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.jh-card-content {
    padding: 1.5rem; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1;
}

.jh-card-title {
    font-size: 20px; 
    font-weight: 600; 
    color: #0099ba; 
    margin: 0 0 0.5rem 0; 
    line-height: 1.2;
}

.jh-card-title a {
    text-decoration: none;
    color: inherit;
}

.jh-card-location {
    font-size: 14px; 
    color: #4b5563; 
    margin-bottom: 1.5rem;
}

.jh-card-specs {
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 0.75rem;
    font-size: 13px; 
    color: #1f2937; 
    font-weight: 500;
    margin-bottom: 30px;
}

.jh-spec-item { 
    display: flex; 
    align-items: center; 
}

.jh-card-price { 
    font-size: 22px; 
    font-weight: 400; 
    color: #111827; 
    margin-bottom: 15px;
    line-height: 1; 
    display: block;
}

.jh-card-price span {
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 10px;
    display: block;
}

.jh-card-actions {  
    display: flex; 
    gap: 5px; 
    flex-wrap: wrap;
}

.jh-card-bottom {
    margin-top: auto;
}

.jh-btn-primary, .jh-btn-secondary {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 5px;
    border: 1px solid #0099ba;
}

.jh-btn-primary { 
    background: #0099ba; 
    color: #ffffff; 
}

.jh-btn-primary:hover { 
    background: #007a95; 
    color: #FFFFFF;
}

.jh-btn-secondary { 
    background: transparent; 
    color: #0099ba; 
}

.jh-btn-secondary:hover { 
    background: #0099ba; 
    color: #ffffff; 
}

/* Tabs */
.jh-tabs-container {
    text-align: center; 
    margin-bottom: 40px;
}

.jh-tabs-label {
    font-weight: 600; 
    margin-right: 10px;
}

/* ==========================================
   Filter Bar Styles (Responsive)
   ========================================== */
.jh-filter-bar { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin-bottom: 40px; 
    justify-content: center; 
    align-items: center; 
    background: #ffffff; 
    padding: 15px; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    border: 1px solid #e5e7eb; 
}

.jh-filter-group { 
    display: flex; 
    flex-direction: column; 
    flex: 1 1 calc(50% - 12px); /* Creates a 2-column grid on mobile */
    min-width: 120px; 
}

.jh-filter-group select { 
    width: 100%;
    padding: 10px 30px 10px 15px; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    background-color: #ffffff; 
    color: #334155; 
    font-size: 14px; 
    font-weight: 500; 
    cursor: pointer; 
    outline: none; 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none; 
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2364748b" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 20px !important;
}

.jh-filter-group select:focus { 
    border-color: #0099ba; 
    box-shadow: 0 0 0 2px rgba(0, 153, 186, 0.2); 
}

.jh-reset-btn { 
    width: 100%; /* Forces button to a new row on mobile */
    padding: 10px 15px; 
    background: transparent; 
    border: none; 
    color: #64748b; 
    cursor: pointer; 
    text-decoration: underline; 
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

@media (min-width: 768px) {
    .jh-filter-bar { 
        gap: 15px; 
        padding: 20px; 
    }
    .jh-filter-group { 
        flex: 0 1 auto; 
        min-width: 140px; 
    }
    .jh-reset-btn { 
        width: auto; /* Shrinks back to natural width on larger screens */
        margin-top: 0;
    }
}

/*Schools*/
.jh-school-item {
    margin-bottom: 10px !important;
}

/*single Listing Map*/
#jh-map {
    width: 100%; 
    height: 500px; 
    border-radius: 8px;
}

.jh-no-results {
    height:150px; 
    background:#f1f5f9; 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    color:#000000;
}

.jh-broken-img-placeholder {
    height: 250px; 
    width: 100%;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar Responsive Fix */
.widget .jh-grid-container {
    grid-template-columns: 1fr !important;
}

.widget .jh-spec-card {
    margin-bottom: 1rem;
}

.jh-widget-card-content {
    text-align: center;
    background-color: #f1f5f9;
}

/* ==========================================
   Gallery & Lightbox Styles
   ========================================== */
button.jh-lightbox-nav.jh-lightbox-next:active,
button.jh-lightbox-nav.jh-lightbox-next:focus,
button.jh-lightbox-nav.jh-lightbox-prev:active,
button.jh-lightbox-nav.jh-lightbox-prev:focus, 
.jh-lightbox-close:hover, 
.jh-lightbox-close:active, 
.jh-lightbox-close:focus {
    background-color: transparent;
    box-shadow: none;
}

.jh-spec-gallery-wrapper {
    display: grid;
    width: 100%;
    gap: 8px; 
}

@media (min-width: 1024px) {
    .jh-spec-gallery-wrapper.has-2-col-thumbs { grid-template-columns: 3fr 2fr; }
    .jh-spec-gallery-wrapper.has-1-col-thumbs { grid-template-columns: 3fr 1fr; }
    .jh-spec-gallery-wrapper.has-0-thumbs { grid-template-columns: 1fr; }

    /* Hides excess elements on desktop but keeps them in DOM for Lightbox */
    .jh-desktop-hidden { display: none !important; }
    .jh-no-desktop-grid { display: none !important; }
}

.jh-main-image-container {
    width: 100%;
    height: 600px;
    background: #f8fafc;
    overflow: hidden;
}

.jh-main-image-container a {
    display: block;
    width: 100%;
    height: 100%;
}

.jh-main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease-in-out;
}
.jh-main-image-container img:hover { opacity: 0.9; }

.jh-thumbnails-container {
    height: 600px; 
    display: grid;
    gap: 8px; 
}

.jh-thumb-link {
    display: block;
    width: 100%;
    height: 100%; 
    overflow: hidden;
    position: relative; 
}

.jh-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; 
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.jh-thumb-link:hover img {
    opacity: 0.8; 
    transform: scale(1.05);
}

.jh-more-photos-badge {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    border-top-left-radius: 8px;
}

/* --- MOBILE SWIPE SLIDER CSS --- */
@media (max-width: 1023px) {
    .jh-spec-gallery-wrapper {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 15px; /* Room for scrollbar/shadows */
        scrollbar-width: none; /* Firefox */
        padding-top: 13px;
    }
    .jh-spec-gallery-wrapper::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .jh-main-image-container, 
    .jh-thumbnails-container {
        display: contents;
    }

    .jh-main-image-container > a,
    .jh-main-image-container > div,
    .jh-thumbnails-container > a.jh-thumb-link {
        flex: 0 0 85%; /* Shows 85% of image, teasing the user to swipe */
        height: 300px;
        scroll-snap-align: center;
        overflow: hidden;
        position: relative;
    }

    /* First item snaps to the start for a clean edge */
    .jh-main-image-container > a,
    .jh-main-image-container > div {
        scroll-snap-align: start;
    }

    /* Hide the badge on mobile since they can natively swipe */
    .jh-more-photos-badge {
        display: none !important;
    }
}

/* --- LIGHTBOX OVERLAY CSS --- */
.jh-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jh-lightbox-overlay.jh-show {
    display: flex;
    opacity: 1;
}

.jh-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.jh-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.jh-lightbox-close {
    position: absolute;
    top: -40px;
    right: -60px;
    color: white;
    font-size: 30px;
    background: none; border: none;
    cursor: pointer;
    line-height: 1;
}

.jh-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.jh-lightbox-nav:hover { background: rgba(0,0,0,0.8); }
.jh-lightbox-prev { left: -60px; }
.jh-lightbox-next { right: -60px; }

@media (max-width: 768px) {
    .jh-lightbox-prev { left: 10px; }
    .jh-lightbox-next { right: 10px; }
    .jh-lightbox-close { right: 0px; top: -45px; z-index: 10;}
}

/* Add pipes between the filter tabs */
.jh-inventory-block-wrapper.jh-floor-plans-wrapper .jh-tabs-container .jh-tab-btn:not(:last-child)::after {
    content: "|";
    margin: 0 10px;
    color: #64748b;
    cursor: default;
    font-weight: normal;
}

/*Dynamic Cities list - Delete first item placeholder*/
.dynamic-cities-list {
    display: none !important;
}

/*Agent Contact*/
.jh-manager-email a, .jh-manager-email a {
    color: #009ab9 !important;
    text-decoration: underline;
}

.sales-office-hours p {
    margin-bottom: 0px !important;
}

.sales-office-hours {
    margin-bottom: 30px;
}

/* ==========================================
   Fix Long Dropdown Menus on Sticky Headers
   ========================================== */
/* Force long dynamic dropdowns to stay within the screen and scroll */
.dynamic-cities-dropdown ul.sub-menu,
.dynamic-mir-cities-dropdown ul.sub-menu,
.dynamic-communities-dropdown ul.sub-menu {
    max-height: 65vh !important; /* Limits height to 65% of the user's screen */
    overflow-y: auto !important; /* Adds the vertical scrollbar */
    overflow-x: hidden !important;
}

/* Modern, slim scrollbar styling for WebKit browsers (Chrome, Safari, Edge) */
.dynamic-cities-dropdown ul.sub-menu::-webkit-scrollbar,
.dynamic-mir-cities-dropdown ul.sub-menu::-webkit-scrollbar,
.dynamic-communities-dropdown ul.sub-menu::-webkit-scrollbar {
    width: 6px;
}
.dynamic-cities-dropdown ul.sub-menu::-webkit-scrollbar-track,
.dynamic-mir-cities-dropdown ul.sub-menu::-webkit-scrollbar-track,
.dynamic-communities-dropdown ul.sub-menu::-webkit-scrollbar-track {
    background: #f8fafc; 
}
.dynamic-cities-dropdown ul.sub-menu::-webkit-scrollbar-thumb,
.dynamic-mir-cities-dropdown ul.sub-menu::-webkit-scrollbar-thumb,
.dynamic-communities-dropdown ul.sub-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 10px;
}
.dynamic-cities-dropdown ul.sub-menu::-webkit-scrollbar-thumb:hover,
.dynamic-mir-cities-dropdown ul.sub-menu::-webkit-scrollbar-thumb:hover,
.dynamic-communities-dropdown ul.sub-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}



