/* =============================================
   GALLERY PAGE — KCSFA Conference 2026
   ============================================= */

/* ---- Hero ---- */
.gallery-hero {
    position: relative;
    background-color: #1B1C13;
    padding: 120px 5% 60px;
    overflow: hidden;
}

.gallery-hero__grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(254, 107, 2, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(254, 107, 2, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.gallery-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, #1B1C13);
    pointer-events: none;
}

.gallery-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gallery-hero__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #FE6B02;
    background: rgba(254, 107, 2, 0.12);
    border: 1px solid rgba(254, 107, 2, 0.3);
    padding: 8px 12px;
    border-radius: 20px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gallery-hero__title {
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.gallery-hero__title em {
    font-family: 'DM Serif Text', serif;
    font-style: italic;
    color: #FE6B02;
}

.gallery-hero__sub {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.45);
    max-width: 500px;
    line-height: 1.7;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.gallery-page {
    background-color: #f7f4f1;
    padding: 0 5% 80px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.gallery-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 40px 0;
}

.gallery-filter-btn {
    background: #fff;
    border: 2px solid #e5e0d8;
    color: #888;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gallery-filter-btn:hover:not(.active) {
    border-color: #1B1C13;
    color: #1B1C13;
}

.gallery-filter-btn.active {
    background-color: #1B1C13;
    border-color: #1B1C13;
    color: #FE6B02;
}

/* ============================================================
   MASONRY GRID
   ============================================================ */

.gallery-grid {
    columns: 4;
    column-gap: 16px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #e5e0d8;
}

.gallery-item.hidden {
    display: none;
}

/* ---- Image wrap ---- */
.gallery-item__img-wrap {
    width: 100%;
    overflow: hidden;
}

/* Default aspect ratio */
.gallery-item .gallery-item__img-wrap {
    aspect-ratio: 4 / 3;
}

/* Tall variant */
.gallery-item.tall .gallery-item__img-wrap {
    aspect-ratio: 3 / 4;
}

/* Wide variant — collapses to normal in column layout, handled by colspan below */
.gallery-item.wide .gallery-item__img-wrap {
    aspect-ratio: 16 / 9;
}

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

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

/* Placeholder (remove once real images are added) */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e3db 0%, #d4cec5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-placeholder .material-icons {
    font-size: 40px;
    color: rgba(27, 28, 19, 0.15);
}

/* ---- Overlay ---- */
.gallery-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 16px 16px;
    background: linear-gradient(to top, rgba(27, 28, 19, 0.85), transparent);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.gallery-item__category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FE6B02;
    background: rgba(254, 107, 2, 0.15);
    border: 1px solid rgba(254, 107, 2, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
}

.gallery-item__caption {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 28, 19, 0.92);
    backdrop-filter: blur(6px);
}

.lightbox__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(90vw, 800px);
    max-height: 90vh;
}

.lightbox__img-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #2a2b22;
}

.lightbox__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2b22, #1B1C13);
}

.lightbox__placeholder .material-icons {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.1);
}

.lightbox__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.lightbox__category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FE6B02;
}

.lightbox__caption {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'DM Serif Text', serif;
}

/* Nav buttons */
.lightbox__close,
.lightbox__prev,
.lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    z-index: 2;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
    background: #FE6B02;
    border-color: #FE6B02;
}

.lightbox__close {
    top: -16px;
    right: -16px;
}

.lightbox__prev {
    left: -56px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__next {
    right: -56px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .gallery-grid {
        columns: 3;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 100px 4% 48px;
    }

    .gallery-page {
        padding: 0 4% 60px;
    }

    .gallery-grid {
        columns: 2;
        column-gap: 12px;
    }

    .gallery-item {
        margin-bottom: 12px;
    }

    .gallery-filters {
        padding: 28px 0 32px;
    }

    .lightbox__prev {
        left: 8px;
    }

    .lightbox__next {
        right: 8px;
    }

    .lightbox__close {
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .gallery-hero__title {
        font-size: 36px;
    }

    .gallery-grid {
        columns: 1;
    }

    .gallery-item.tall .gallery-item__img-wrap,
    .gallery-item.wide .gallery-item__img-wrap,
    .gallery-item .gallery-item__img-wrap {
        aspect-ratio: 16 / 9;
    }

    /* Always show overlay on touch devices */
    .gallery-item__overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .gallery-filter-btn {
        font-size: 11px;
        padding: 8px 14px;
    }
}