/*
Plugin Name: Custom Image Gallery
Description: Styles for the custom image gallery.
*/

:root {
    --primary-color: #FE5A0E;
    --bg-color: #FFFFFF;
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --hover-shadow: 0 15px 40px rgba(254, 90, 14, 0.2);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.custom-gallery-container {
    padding: 20px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
/* Add more for larger galleries if needed */

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(254, 90, 14, 0.15) 0%, transparent 70%);
    opacity: 0;
    z-index: 1;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(254, 90, 14, 0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover::before {
    opacity: 1;
}

/* Lightbox Styles */
.custom-gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.98);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.custom-gallery-lightbox.active {
    display: flex;
    opacity: 1;
}

.custom-gallery-lightbox .lightbox-img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.custom-gallery-lightbox.active .lightbox-img {
    transform: scale(1);
}

.custom-gallery-lightbox .close-btn,
.custom-gallery-lightbox .prev-btn,
.custom-gallery-lightbox .next-btn {
    position: absolute;
    color: var(--text-color);
    font-size: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.custom-gallery-lightbox .close-btn {
    top: 20px;
    right: 20px;
}

.custom-gallery-lightbox .prev-btn {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.custom-gallery-lightbox .next-btn {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.custom-gallery-lightbox .close-btn:hover,
.custom-gallery-lightbox .prev-btn:hover,
.custom-gallery-lightbox .next-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1) translateY(-50%); /* Adjusted for prev/next */
}

.custom-gallery-lightbox .close-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

@media (max-width: 768px) {
    .custom-gallery-lightbox .close-btn,
    .custom-gallery-lightbox .prev-btn,
    .custom-gallery-lightbox .next-btn {
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
    .custom-gallery-lightbox .close-btn {
        top: 10px;
        right: 10px;
    }
    .custom-gallery-lightbox .prev-btn {
        left: 10px;
    }
    .custom-gallery-lightbox .next-btn {
        right: 10px;
    }
    .custom-gallery-lightbox .lightbox-img {
        max-width: 95%;
        max-height: 95%;
    }
}
