/* ==========================================================================
   GALLERY PAGE STYLES
   Shared variables, reset, typography, navbar, buttons, and footer live in
   shared.css. This file only contains styles specific to Gallery.html.
   ========================================================================== */

.GalleryHeadingSection {
    background-color: var(--color-primary-light);
    text-align: center;
    padding-block: clamp(48px, 8vw, 90px);
}

.GalleryHeadingSection h1 {
    margin-bottom: 8px;
}

.GalleryHeadingSection p {
    margin-inline: auto;
    max-width: 60ch;
}

/* =========================
   GALLERY SECTION
   ========================= */

/* Responsive grid: ~3 columns on large screens, ~2 on medium, 1 on mobile. */
.GalleryGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.GalleryItem {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: var(--shadow-small);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.GalleryItem:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

/* Fixed aspect ratio keeps every card the same size in the grid even when
   the source images have different dimensions. object-fit: cover prevents
   stretching; the full image is still viewable in the lightbox on click. */
.GalleryImage {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: pointer;
}

.GalleryImage:focus-visible {
    outline: 3px solid var(--color-primary-dark);
    outline-offset: -3px;
}

.GalleryItemInfo {
    padding: 18px 20px 20px;
}

.GalleryItemInfo h3 {
    margin: 0 0 6px;
    color: var(--color-primary-darker);
    font-size: 1.05rem;
}

.GalleryItemInfo p {
    margin: 0;
    font-size: 0.92rem;
}

/* ---------- Lightbox ---------- */
.GalleryLightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(15, 23, 42, 0.85);
}

.GalleryLightbox.is-open {
    display: flex;
}

.GalleryLightboxImage {
    display: block;
    width: auto;
    height: auto;
    max-width: min(90vw, 1100px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-medium);
}

.GalleryCloseButton {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: var(--color-white);
    color: var(--color-primary-darker);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.GalleryCloseButton:hover {
    background-color: var(--color-primary-light);
}

/* ---------- Responsive ---------- */
/* 1200px and above uses the 3-column base grid defined above. */

/* 768px to 1199px: ~2 images per row */
@media (max-width: 1199px) {
    .GalleryGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Below 768px: 1 image per row */
@media (max-width: 768px) {
    .GalleryGrid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Below 480px: tighten up spacing so cards and controls stay comfortable */
@media (max-width: 480px) {
    .GalleryItemInfo {
        padding: 16px 18px 18px;
    }

    .GalleryCloseButton {
        top: 12px;
        right: 12px;
    }
}
