/* ============================================
   TK AFROCARIBBEAN KITCHEN - Gallery Styles
   ============================================ */

/* ---- Filter Buttons ---- */
.gallery-filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

/* ---- Gallery Grid ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ---- Gallery Item ---- */
.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    aspect-ratio: 4 / 3;
}

/* Remove legacy span classes - all items are uniform */
.gallery-item-wide,
.gallery-item-tall {
    grid-column: unset;
    grid-row: unset;
}

.gallery-item-img-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-item-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ---- Item Overlay ---- */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.85) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-item-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.gallery-item-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.gallery-zoom-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.gallery-item:hover .gallery-zoom-icon {
    background: var(--accent);
    color: #0a0a0a;
}

/* Hidden state for filtering */
.gallery-item.hidden {
    display: none;
}

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

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

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
}

.lightbox-caption {
    margin-top: 16px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.lightbox-counter {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.15);
    transform: rotate(90deg);
}

/* Prev / Next buttons */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 240px;
    }

    .gallery-item-wide {
        grid-column: span 2;
    }

    .gallery-item-tall {
        grid-row: span 1;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
    }

    .gallery-item-wide {
        grid-column: span 1;
    }

    .gallery-item-tall {
        grid-row: span 1;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }

    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.8) 100%);
    }

    .gallery-zoom-icon {
        display: none;
    }
}
