/*
==============================================
           GALLERY PAGE STYLES
==============================================
*/

/* --- Uniform Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 1rem 0; /* Adjusted for global body padding */
}

.grid-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
}

.grid-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 8px 15px rgba(0,0,0,0.2);
}

.grid-item a {
    display: block;
    height: 100%;
    position: relative;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* THEME-AWARE BORDER */
    border: 3px solid var(--accent-color);
    border-radius: 12px;
}

/* --- Hover Overlay & Caption --- */
.grid-item .caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.grid-item a:hover .caption-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* --- Video Icon --- */
.grid-item a[data-youtube-id]::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 2.5rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 15px rgba(0,0,0,0.7);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.grid-item a[data-youtube-id]:hover::before {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: var(--accent-color);
}

/* --- Styles for Video in Lightbox --- */
.pswp__video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.pswp__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem 0; /* Adjusted for global body padding */
    }
}
