/* ════════════════════════════════════════════════════
   GALLERY PAGE  —  gallery.css
   Depends on global variables in style.css
   ════════════════════════════════════════════════════ */

body {
    padding-top: var(--navbar-height);
}

/* ─── PAGE HEADER ─────────────────────────────────── */
.gallery-header {
    text-align: center;
    padding: 60px 20px 30px;
    background-color: var(--color-dark);
    color: var(--color-light);
}

.gallery-header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.gallery-header p {
    font-size: 1.1rem;
    opacity: 0.75;
}

/* ─── FILTER BAR ──────────────────────────────────── */
#filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.3rem;
}

/* Base button */
.filter-btn {
    padding: 0.4rem 1.2rem;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

/* Hover — subtle preview */
.filter-btn:hover {
    background: rgba(var(--accent-rgb), 0.15);
}

/* Active — clearly selected filter */
.filter-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35);
}


/* ─── MASONRY GRID ────────────────────────────────── */
#gallery-grid {
    columns: 3 280px;
    gap: 1rem;
    padding: 1rem 2rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* The GLightbox anchor fills the item */
.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
}

.gallery-item a img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Caption overlay — appears on hover */
.gallery-item a .gallery-item__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 0 0 8px 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.gallery-item a:hover .gallery-item__caption {
    opacity: 1;
    transform: translateY(0);
}


/* ─── LIGHTBOX OVERLAY ────────────────────────────── */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#lightbox.hidden {
    display: none;
}

/* Image + caption wrapper */
#lb-media-wrap {
    position: relative;
    display: inline-block;
    border-radius: 6px;
    overflow: hidden;
    max-width: 90vw;
}

#lb-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
}

/* Caption overlay */
#lb-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 0 0 6px 6px;
}

#lb-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
}

#lb-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    margin: 0;
}

/* Close button — top right */
#lb-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
}

/* Prev / Next arrows — vertically centred */
#lb-prev,
#lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0 1rem;
    z-index: 1001;
}

#lb-prev {
    left: 1rem;
}

#lb-next {
    right: 1rem;
}


/* ─── GLIGHTBOX OVERRIDES ─────────────────────────── */

/* Arrows and caption hidden by default, shown on hover */
.glightbox-container .gnext,
.glightbox-container .gprev,
.glightbox-container .gslide-description {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.glightbox-container:hover .gnext,
.glightbox-container:hover .gprev,
.glightbox-container:hover .gslide-description {
    opacity: 1;
}

/* Caption styling */
.glightbox-container .gslide-description {
    background: rgba(0, 0, 0, 0.55) !important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    border-radius: 0 0 6px 6px;
}

.glightbox-container .gdesc-inner {
    padding: 0;
}

.glightbox-container .gslide-title {
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
}

.glightbox-container .gslide-desc {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.82rem;
    margin: 0;
}