.hpg-gallery-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
}

.hpg-category-sidebar {
    grid-column: 1;
    padding: 10px;
    background: #f9f9f9;
    border-right: 1px solid #ddd;
}

.hpg-category-sidebar .hpg-categories-heading {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: #333 !important;
    font-weight: bold;
}

.hpg-category-sidebar .hpg-category-list {
    padding: 10;
    margin: 0;
}

.hpg-category-sidebar .hpg-category-item {
    margin-bottom: 10px;
    line-height: 1.2;
}

.hpg-category-sidebar .hpg-category-item a {
    text-decoration: none;
    color: #333;
    font-weight: normal;
}

.hpg-category-sidebar .hpg-category-item a:hover {
    color: #0073aa;
}

.hpg-category-sidebar .hpg-category-item.hpg-active-category a {
    color: #0073aa;
}

.hpg-gallery {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
}

.hpg-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hpg-gallery img, .hpg-gallery .hpg-video-embed {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hpg-gallery .hpg-video-embed iframe {
    width: 100%;
    max-height: 200px;
    border: none;
}

.hpg-gallery a {
    display: block;
    text-decoration: none;
}

.hpg-gallery a:hover img, .hpg-gallery a:hover .hpg-video-embed {
    opacity: 0.8;
}

.hpg-gallery .hpg-item-title {
    margin: 5px 0 0;
    font-size: 0.9em;
    text-align: center;
    color: #333;
}

.hpg-gallery-pagination {
    text-align: center;
    margin-top: 20px;
}

.hpg-gallery-pagination .page-numbers {
    padding: 5px 10px;
    margin: 0 5px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    text-decoration: none;
}

.hpg-gallery-pagination .current {
    background: #0073aa;
    color: #fff;
}



@media (max-width: 768px) {
    .hpg-gallery-container {
        grid-template-columns: 1fr;
    }
    .hpg-category-sidebar {
        grid-column: 1;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .hpg-gallery {
        grid-column: 1;
        grid-template-columns: repeat(2, 1fr);
    }
    .fancybox-thumbs {
        height: 50px;
    }
    .fancybox-thumbs__list a {
        width: 40px;
        height: 40px;
    }
    .fancybox-content {
        max-height: 70vh;
    }
    .fancybox-button--close {
        right: 0;
        transform: translateX(50%); /* Adjust for smaller screens */
    }
}
/* PhotoSwipe customizations */
.pswp__button--close {
    position: absolute;
    top: 20px !important; /* Move down from top */
    right: 20px !important; /* Move in from right edge */
    width: 50px !important;
    height: 50px !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    z-index: 10000 !important;
}



/* Cursor on image for close */
.pswp__img {
    cursor: pointer !important;
}

/* Hide zoom button */
.pswp__button--zoom {
    display: none !important;
}

/* Ensure image fits without stretching */
.pswp__img {
    object-fit: contain !important;
}

/* Lightbox customizations */
.pswp__bg {
    opacity: 0 !important;
}

.pswp__custom-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    font-size: 14px;
    z-index: 1002 !important; /* Ensure above image/overlay */
}

.pswp-caption {
    display: none;
}