/* ==========================================================================
   Happy Hugs - Photo & Video Gallery Display Fix
   Ensures 100% visibility, responsiveness, smooth sliding & lightbox
   ========================================================================== */

/* 1. Jetpack Slideshow Container */
.wp-block-jetpack-slideshow,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_container {
    opacity: 1 !important;
    visibility: visible !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto 2.5rem !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
    background: #0f172a !important;
    display: block !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    transition: transform 0.45s ease-in-out !important;
    will-change: transform;
    width: 100% !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    width: 100% !important;
    height: 550px !important;
    max-height: 80vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #0f172a !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    opacity: 1 !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide figure {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    cursor: zoom-in !important;
    transition: transform 0.3s ease !important;
    pointer-events: auto !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide img:hover {
    transform: scale(1.02);
}

/* Slideshow navigation arrows */
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 25 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
    color: #1e293b !important;
    border: none !important;
    text-decoration: none !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
    opacity: 0.92 !important;
    visibility: visible !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev:hover,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next:hover {
    background: #ffffff !important;
    transform: translateY(-50%) scale(1.12) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
    opacity: 1 !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev {
    left: 16px !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next {
    right: 16px !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev::after {
    content: "❮" !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    margin-right: 2px !important;
    color: #1e293b !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next::after {
    content: "❯" !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    margin-left: 2px !important;
    color: #1e293b !important;
}

/* Pause / Play button */
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-pause {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 25 !important;
    width: 36px !important;
    height: 36px !important;
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    opacity: 0.85 !important;
    transition: opacity 0.2s, background-color 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-pause:hover {
    opacity: 1 !important;
    background-color: #ffffff !important;
}

/* Pagination Dots */
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination {
    position: absolute !important;
    bottom: 16px !important;
    left: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    z-index: 20 !important;
    padding: 6px 12px !important;
}

.wp-block-jetpack-slideshow_pagination .custom-dot {
    width: 11px !important;
    height: 11px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    border: 1px solid rgba(0, 0, 0, 0.3) !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

.wp-block-jetpack-slideshow_pagination .custom-dot.active {
    background: #38bdf8 !important;
    transform: scale(1.35) !important;
    border-color: #ffffff !important;
}

/* 2. Simply Gallery Block Fix */
.sgb-preloader {
    display: none !important;
}

.simply-gallery-amp {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sgb-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
    margin: 25px 0 40px !important;
    width: 100% !important;
}

.sgb-item {
    position: relative !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    background: #000000 !important;
    aspect-ratio: 9 / 16 !important;
    max-height: 520px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.sgb-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.sgb-item video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 14px !important;
    background: #000000 !important;
    display: block !important;
}

/* Lightbox Modal for Fullscreen Photo Viewing */
.hh-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hh-lightbox.active {
    display: flex !important;
}

.hh-lightbox-content {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hh-lightbox img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    cursor: default;
    user-select: none;
}

.hh-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ffffff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 1000001;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.hh-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.15);
}

.hh-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000000;
    transition: background 0.2s, transform 0.2s;
    user-select: none;
    outline: none;
}

.hh-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-50%) scale(1.12);
}

.hh-lightbox-prev {
    left: 20px;
}

.hh-lightbox-next {
    right: 20px;
}

.hh-lightbox-counter {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 16px;
    border-radius: 20px;
    user-select: none;
}

@media (max-width: 768px) {
    .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide {
        height: 380px !important;
    }
    .wp-block-jetpack-slideshow_button-prev,
    .wp-block-jetpack-slideshow_button-next {
        width: 38px !important;
        height: 38px !important;
    }
    .hh-lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    .hh-lightbox-prev {
        left: 10px;
    }
    .hh-lightbox-next {
        right: 10px;
    }
}
