/* --- Filter Bar Styles --- */
.sp-gallery-filter { margin-bottom: 2rem; text-align: center; }
.sp-filter-btn { background: transparent; border: 1px solid #ddd; color: #555; padding: 8px 16px; margin: 0 5px; border-radius: 20px; cursor: pointer; transition: all 0.3s ease; }
.sp-filter-btn:hover { background-color: #f0f0f0; border-color: #ccc; }
.sp-filter-btn.is-active { background-color: #F37921; color: #fff; border-color: #F37921; }

/* --- Grid Layout Styles --- */
.is-layout-grid .sp-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.is-layout-grid .sp-gallery-item { height: 250px; }
.is-layout-grid .sp-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* --- Masonry Layout Styles --- */
.sp-gallery-item { position: relative; cursor: pointer; overflow: hidden; border-radius: 8px; background-color: #f0f0f0; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.sp-gallery-item:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); }
.sp-gallery-item img { display: block; width: 100%; height: auto; }
.sp-gallery-item-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 70%); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 1rem; opacity: 1; }
.sp-gallery-item-info { width: 100%; text-align: center; }
.sp-gallery-item-title { color: #fff; font-size: 1.1rem; font-weight: bold; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); opacity: 0; transition: opacity 0.4s ease; margin-bottom: 10px; }
.sp-gallery-item:hover .sp-gallery-item-title { opacity: 1; }
.sp-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; background-color: rgba(0,0,0,0.5); border-radius: 50%; transition: background-color 0.3s ease; z-index: 3; }
.sp-gallery-item:hover .sp-play-icon { background-color: rgba(0,0,0,0.7); }
.sp-play-icon::after { content: ''; display: block; position: absolute; top: 50%; left: 55%; transform: translate(-50%, -50%); border-style: solid; border-width: 10px 0 10px 20px; border-color: transparent transparent transparent white; }
.sp-grid-read-more { background-color: #F37921; color: #fff; padding: 5px 15px; border-radius: 4px; text-decoration: none; font-size: 0.8rem; font-weight: bold; z-index: 5; display: inline-block; }
.sp-grid-button-wrapper { margin-top: 12px; }

/* --- Immersive Lightbox Styles --- */
#sp-gallery-lightbox { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.3s ease, visibility 0.3s ease; }
#sp-gallery-lightbox.sp-lightbox-is-hidden { opacity: 0; visibility: hidden; }
.sp-lightbox-overlay { position: absolute; inset: 0; background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); }
.sp-lightbox-container { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 60px 80px; box-sizing: border-box; }
.sp-lightbox-content { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 90vw; max-height: calc(100vh - 120px); width: 100%; }
.sp-lightbox-media-wrapper { margin-bottom: 20px; transition: transform 0.3s ease, opacity 0.3s ease; position: relative; line-height: 0; display: flex; justify-content: center; align-items: center; }
.sp-lightbox-media-wrapper.is-video { width: 100%; max-width: 1200px; aspect-ratio: 16 / 9; background-color: #000; border-radius: 4px; overflow: hidden; }
.sp-lightbox-media-wrapper.is-image { background-color: transparent; }
.sp-lightbox-is-loading .sp-lightbox-media-wrapper { opacity: 0.5; transform: scale(0.98); }
.sp-lightbox-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); transition: transform 0.4s ease; cursor: default; }
.sp-lightbox-video-container, .sp-lightbox-video-container iframe, .sp-lightbox-video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.sp-lightbox-info { text-align: center; color: #fff; transition: opacity 0.4s ease; }
.sp-lightbox-title { margin: 0 0 20px 0; font-size: 1.1rem; font-weight: 400; line-height: 1.5; }
.sp-lightbox-button { display: inline-block; padding: 10px 25px; border-radius: 4px; text-decoration: none; font-weight: bold; transition: background-color 0.2s, color 0.2s; }
.sp-lightbox-top-bar { position: absolute; top: 15px; right: 15px; z-index: 10; display: flex; gap: 10px; }
.sp-lightbox-control-btn { background: transparent; border: none; width: 40px; height: 40px; font-size: 28px; line-height: 40px; text-align: center; cursor: pointer; opacity: 0.7; transition: opacity 0.2s, transform 0.2s, color 0.2s; }
.sp-lightbox-control-btn:hover { opacity: 1; transform: scale(1.1); }
.sp-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; color: #fff; border: none; font-size: 60px; font-weight: 100; cursor: pointer; z-index: 10; opacity: 0.7; transition: opacity 0.4s ease; padding: 0 20px; }
.sp-lightbox-nav:hover { opacity: 1; }
.sp-lightbox-prev { left: 0; }
.sp-lightbox-next { right: 0; }
.sp-lightbox-thumbnails { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 80%; max-width: 600px; overflow-x: auto; z-index: 10; transition: opacity 0.4s ease; }
.sp-lightbox-thumbnails::-webkit-scrollbar { display: none; }
.sp-lightbox-thumbnails { -ms-overflow-style: none; scrollbar-width: none; }
.sp-lightbox-thumbnails-inner { display: flex; justify-content: center; gap: 10px; padding: 10px 0; }
.sp-lightbox-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.5; transition: opacity 0.2s, transform 0.2s; border: 2px solid transparent; }
.sp-lightbox-thumb:hover { opacity: 1; transform: scale(1.05); }
.sp-lightbox-thumb.is-active { opacity: 1; }

/* --- Lightbox Pagination --- */
.sp-lightbox-pagination { text-align: center; margin-top: -10px; margin-bottom: 10px; }
.sp-pagination-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.4); margin: 0 4px; cursor: pointer; transition: background-color 0.3s ease; }
.sp-pagination-dot:hover { background-color: rgba(255, 255, 255, 0.7); }
.sp-pagination-dot.is-active { background-color: #fff; }

/* --- Below 1400px screen --- */
@media (max-width: 1500px) {
    
    .sp-lightbox-content{
        max-width: 51vw;
    }
}

@media (min-width: 768px) {
    .sp-lightbox-pagination{
        display: none;
    }
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 767px) {
    .sp-lightbox-container {
        padding: 10px;
    }
    .sp-lightbox-content {
        max-width: 100%;
        max-height: 100%;
    }
    .sp-lightbox-media-wrapper.is-video {
        width: 100%;
    }
    .sp-lightbox-nav {
        display: none;
    }
    .sp-lightbox-thumbnails {
        bottom: 5px;
    }
}
