/*
 * VAC Gallery v2 — Filterable Portfolio Grid
 * Rounded image containers · Dominant colour backgrounds
 * Lightbox with prev/next navigation
 */

/* ── WRAPPER ─────────────────────────────────────────────── */
.vac-gallery-wrap {
    width: 100%;
    padding: 0;
}

/* ── FILTER BAR ──────────────────────────────────────────── */
.vac-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
    justify-content: center;
}

.vac-filter-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 9px 22px;
    border: 1px solid #2E2E2E;
    background: transparent;
    color: #8C8C8C;
    cursor: pointer;
    border-radius: 4px;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
    line-height: 1;
    white-space: nowrap;
}

.vac-filter-btn:hover {
    color: #FFFFFF;
    border-color: #4A4A4A;
    background: #141414;
}

.vac-filter-btn.active {
    background: #FF3366;
    border-color: #FF3366;
    color: #FFFFFF;
}

.vac-filter-btn:focus-visible {
    outline: 2px solid #FF3366;
    outline-offset: 3px;
}

/* ── GALLERY GRID ────────────────────────────────────────── */
.vac-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ── GALLERY ITEM ────────────────────────────────────────── */
.vac-gallery-item {
    position: relative;
    cursor: pointer;
}

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

/*
 * .vac-gallery-thumb
 * Outer coloured container — rounded, background = dominant colour
 * padding creates the visible coloured border around the image
 */
.vac-gallery-thumb {
    position: relative;
    border-radius: 14px;
    padding: 7px;
    /* background-color set via inline style from PHP */
    transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.vac-gallery-item:hover .vac-gallery-thumb {
    transform: translateY(-3px);
}

.vac-gallery-thumb img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 9px;
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── HOVER OVERLAY ───────────────────────────────────────── */
/* Inset matches the thumb padding (7px) so overlay covers only the image */
.vac-gallery-overlay {
    position: absolute;
    inset: 7px;
    border-radius: 9px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.35) 45%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 250ms ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    pointer-events: none;
    overflow: hidden;
}

.vac-gallery-item:hover .vac-gallery-overlay {
    opacity: 1;
    pointer-events: all;
}

/* ── OVERLAY INFO ────────────────────────────────────────── */
.vac-gallery-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vac-gallery-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #FFFFFF;
    line-height: 1.2;
    display: block;
}

.vac-gallery-client {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    color: #ADADAD;
    display: block;
}

.vac-gallery-cats {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FF3366;
    display: block;
    margin-top: 2px;
}

/* ── EXPAND BUTTON (top-right of image) ──────────────────── */
.vac-gallery-expand {
    position: absolute;
    /* top/right offset = thumb padding (7) + inner gap (8) */
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 250ms ease, background 150ms ease, border-color 150ms ease;
    padding: 0;
}

.vac-gallery-item:hover .vac-gallery-expand {
    opacity: 1;
}

.vac-gallery-expand:hover {
    background: #FF3366;
    border-color: #FF3366;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.vac-gallery-empty {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    color: #6B6B6B;
    text-align: center;
    padding: 80px 24px;
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.vac-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

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

.vac-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    cursor: pointer;
}

/* ── LIGHTBOX PREV / NEXT ARROWS ────────────────────────── */
.vac-lb-nav {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
    padding: 0;
}

.vac-lb-nav:hover {
    background: #FF3366;
    border-color: #FF3366;
}

.vac-lb-nav:disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.vac-lb-nav:focus-visible {
    outline: 2px solid #FF3366;
    outline-offset: 3px;
}

/* ── LIGHTBOX IMAGE PANEL ───────────────────────────────── */
.vac-lightbox-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transform: scale(0.96);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.vac-lightbox.active .vac-lightbox-inner {
    transform: scale(1);
}

.vac-lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    border: 1px solid #2E2E2E;
}

.vac-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    background: #FF3366;
    border: none;
    color: #FFFFFF;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 150ms ease;
    padding: 0;
    line-height: 1;
}

.vac-lightbox-close:hover {
    background: #CC0044;
}

.vac-lightbox-caption {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #6B6B6B;
    text-align: center;
    text-transform: uppercase;
}

body.vac-lb-open {
    overflow: hidden;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .vac-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .vac-lb-nav { width: 40px; height: 40px; }
}

@media (max-width: 600px) {
    .vac-gallery-grid { grid-template-columns: 1fr; gap: 8px; }
    .vac-filter-bar { margin-bottom: 32px; }
    .vac-filter-btn { font-size: 0.7rem; padding: 8px 16px; }
    /* Always show overlay info on touch devices */
    .vac-gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
    }
    .vac-gallery-expand { opacity: 1; }
    .vac-lightbox-img { max-width: 95vw; max-height: 70vh; }
    .vac-lb-nav { width: 36px; height: 36px; }
    /* Stack arrows below image on very small screens */
    .vac-lightbox {
        flex-direction: column;
        gap: 12px;
    }
    .vac-lb-prev, .vac-lb-next {
        order: 2;
    }
    .vac-lightbox-inner {
        order: 1;
    }
}
