/* Gallery Styles - Emotional Memorial Design */

.gallery-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--sky-gradient-start, #E8F4FF) 0%, var(--cream-white, #F8FBFF) 100%);
}

.gallery-section h2 {
    text-align: center;
    color: var(--kanata-blue, #2894FF);
    margin-bottom: 50px;
    font-size: 2.2em;
    font-weight: 300;
    letter-spacing: 0.05em;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(40, 148, 255, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #E8F4FF 0%, #F0F8FF 100%);
}

/* Gradient border effect on hover */
.gallery-item::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    bottom: -3px;
    left: -3px;
    background: linear-gradient(45deg, var(--kanata-blue, #2894FF), var(--gold, #FFD700), var(--kanata-blue-light, #5AAFFF));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(40, 148, 255, 0.3);
}

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

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.4s ease;
}

.gallery-image.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-image:not(.lazy) {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.08);
    filter: brightness(1.05) saturate(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(45, 45, 68, 0.9));
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-artist {
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-artist a {
    color: var(--gold, #FFD700);
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-artist a:hover {
    color: white;
    text-decoration: underline;
}

.gallery-caption {
    font-size: 0.9em;
    opacity: 0.85;
    font-style: italic;
}

.official-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.no-content {
    text-align: center;
    color: var(--kanata-blue, #2894FF);
    grid-column: 1 / -1;
    padding: 60px 20px;
    font-style: italic;
    font-size: 1.1em;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    color: white;
    text-align: center;
    padding: 25px;
    max-width: 650px;
}

.lightbox-artist {
    font-size: 1.2em;
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lightbox-artist a {
    color: var(--gold, #FFD700);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lightbox-artist a:hover {
    color: white;
    text-decoration: underline;
}

.lightbox-caption {
    font-size: 1.05em;
    opacity: 0.9;
    margin-bottom: 8px;
    font-style: italic;
}

.lightbox-date {
    font-size: 0.9em;
    opacity: 0.6;
    color: var(--kanata-blue-light, #5AAFFF);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5em;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(40, 148, 255, 0.2);
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 20px 15px;
    opacity: 0.7;
    transition: opacity 0.3s ease, background 0.3s ease;
    border-radius: 8px;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(40, 148, 255, 0.4);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Contribute notice in gallery section */
.gallery-contribute {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
}

.gallery-contribute p {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-section {
        padding: 50px 0;
    }

    .gallery-section h2 {
        font-size: 1.8em;
        margin-bottom: 35px;
    }

    #gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }

    .gallery-item {
        border-radius: 12px;
    }

    .gallery-item::before {
        top: -2px;
        right: -2px;
        bottom: -2px;
        left: -2px;
        border-radius: 14px;
    }

    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent 40%, rgba(45, 45, 68, 0.9));
        padding: 15px;
    }

    .lightbox-nav {
        padding: 15px 10px;
        font-size: 1.5em;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    #gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-item {
        aspect-ratio: 4 / 3;
    }

    .lightbox-close {
        top: -40px;
        font-size: 2em;
    }
}
