/* Thumbnail Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 0;
    margin-top: 15px;
}

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

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

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

.gallery-item {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f4f4f4;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

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

/* Lightbox Overlay */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

/* Lightbox Content */
#lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Controls */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.lightbox-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

#lightbox-prev {
    left: 30px;
}

#lightbox-next {
    right: 30px;
}

#lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    transform: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
}

#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Mobile responsivity for arrows */
@media (max-width: 768px) {
    #lightbox-prev {
        left: 10px;
        width: 40px;
        height: 40px;
    }

    #lightbox-next {
        right: 10px;
        width: 40px;
        height: 40px;
    }

    #lightbox {
        padding: 20px 0;
        /* guarantees minimum gap top & bottom; left/right can touch edges */
        box-sizing: border-box;
    }

    #lightbox-img {
        max-width: 100vw;
        max-height: calc(100vh - 40px);
        /* 20px top + 20px bottom padding */
        border-radius: 0;
    }
}

/* Archive Accordions */
.archive-accordions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.archive-details {
    background: #f4f4f4;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    transition: box-shadow 0.3s ease;
}

.archive-details[open] {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.archive-summary {
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    color: #333;
    outline: none;
    transition: color 0.2s ease;
}

.archive-summary:hover {
    color: #458ccc;
}

.archive-summary::-webkit-details-marker {
    display: none;
}

.archive-summary::before {
    content: "";
    width: 14px;
    height: 14px;
    margin-right: 12px;
    background-image: url(/images/right-triangle.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    display: inline-block;
}

.archive-details[open] .archive-summary::before {
    transform: rotate(90deg);
}

.archive-details[open] .archive-summary {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}