
/* Slider Layout */
.sg-slider-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
}

.sg-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    width: 100%;
}

.sg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex: 0 0 100%;
    width: 100%;
    align-content: start;
}

@media (min-width: 768px) {
    .sg-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.sg-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animations for first 10 items */
.sg-item:nth-child(1) { animation-delay: 0.1s; }
.sg-item:nth-child(2) { animation-delay: 0.15s; }
.sg-item:nth-child(3) { animation-delay: 0.2s; }
.sg-item:nth-child(4) { animation-delay: 0.25s; }
.sg-item:nth-child(5) { animation-delay: 0.3s; }
.sg-item:nth-child(6) { animation-delay: 0.35s; }
.sg-item:nth-child(7) { animation-delay: 0.4s; }
.sg-item:nth-child(8) { animation-delay: 0.45s; }
.sg-item:nth-child(9) { animation-delay: 0.5s; }
.sg-item:nth-child(10) { animation-delay: 0.55s; }

.sg-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: block;
}

@media (min-width: 768px) {
    .sg-item img {
        height: 200px;
    }
}

.sg-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Pagination Styles */
.sg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.sg-pagination .page-numbers {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 6px;
    background: #2f2b41;
    border-radius: 2px; /* Square shape */
    font-size: 0 !important; /* Hide the number text */
    line-height: 0 !important;
    color: transparent !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    overflow: hidden;
}

.sg-pagination .page-numbers:hover {
    background: #454061;
    transform: scale(1.1);
}

.sg-pagination .page-numbers.current {
    background: #6366f1; /* Highlight color for current page */
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.sg-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    width: auto;
    height: auto;
    font-size: 14px;
    line-height: 1;
    color: #2f2b41;
}

/* Lightbox Styles */
.sg-lightbox {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.95); 
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.sg-lightbox.open {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.sg-lightbox-content {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    position: relative;
    /* Initial state for animation */
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.sg-lightbox.open .sg-lightbox-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.sg-lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    background: #000;
}

.sg-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s 0.2s, transform 0.3s 0.2s; /* Delayed appearance */
}

.sg-lightbox.open .sg-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Close Button with Animation */
.sg-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(4px);
    -webkit-appearance: none;
    
    /* Animation initial state */
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
    transition: background 0.2s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s, opacity 0.4s ease 0.2s;
}

.sg-lightbox.open .sg-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.sg-close:hover,
.sg-close:focus {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg) scale(1.1) !important; /* Override open state transform */
    transition: transform 0.3s ease, background 0.2s;
    outline: none;
}

.sg-close svg {
    width: 24px;
    height: 24px;
    display: block;
}

@media only screen and (max-width: 700px){
    .sg-lightbox-img {
        width: 100%;
        max-height: 70vh;
    }
    .sg-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}
