/* ==========================================================================
   Flavor Gallery — Frontend Styles
   ========================================================================== */

/* Filters
   ========================================================================== */

.flavor-gallery__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
}

.flavor-gallery__filter {
    padding: 8px 20px;
    border: 2px solid #222;
    border-radius: 4px;
    background: transparent;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.flavor-gallery__filter:hover,
.flavor-gallery__filter.is-active {
    background: #222;
    color: #fff;
    border-color: #222;
}

/* Grid
   ========================================================================== */

.flavor-gallery__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}

/* Item
   ========================================================================== */

.flavor-gallery__item {
    overflow: hidden;
    border-radius: 4px;
}

.flavor-gallery__item.is-hidden {
    display: none;
}

.flavor-gallery__link {
    position: relative;
    display: block;
    overflow: hidden;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}

.flavor-gallery__link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    transition: transform 0.4s ease;
}

/* Hover overlay
   ========================================================================== */

.flavor-gallery__overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}

.flavor-gallery__title {
    display: block;
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    padding: 0 16px;
    box-sizing: border-box;
    width: 100%;
    overflow-wrap: break-word;
    word-break: break-all;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (hover: hover) {
    .flavor-gallery__link:hover .flavor-gallery__overlay {
        background: rgba(0, 0, 0, 0.55);
        transition: background 0.35s ease;
    }

    .flavor-gallery__link:hover .flavor-gallery__title {
        opacity: 1;
        transform: translateY(0);
    }

    /* Prevent overlay flash when clicking to open lightbox */
    .flavor-gallery__link:active .flavor-gallery__overlay {
        background: rgba(0, 0, 0, 0) !important;
        transition: none;
    }

    .flavor-gallery__link:active .flavor-gallery__title {
        opacity: 0 !important;
        transition: none;
    }
}

/* Hover zoom modifier (controlled by Elementor toggle) */
.flavor-gallery--zoom .flavor-gallery__link:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.flavor-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.flavor-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.flavor-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 3;
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flavor-lightbox__close svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flavor-lightbox__close:hover svg {
    stroke: #ccc;
}

/* Stage */
.flavor-lightbox__stage {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.flavor-lightbox__stage.slide-out-left {
    transform: translateX(-60px);
    opacity: 0;
}

.flavor-lightbox__stage.slide-out-right {
    transform: translateX(60px);
    opacity: 0;
}

.flavor-lightbox__stage.slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

.flavor-lightbox__stage.slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}

@keyframes slideInRight {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-60px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.flavor-lightbox__img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flavor-lightbox__img.is-loaded {
    opacity: 1;
}

.flavor-lightbox__caption {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
}

/* Arrows */
.flavor-lightbox__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .flavor-lightbox__arrow {
        transition: background 0.25s ease;
    }
    .flavor-lightbox__arrow:hover {
        background: rgba(255, 255, 255, 0.25);
    }
}

@media (hover: none) {
    .flavor-lightbox__arrow,
    .flavor-lightbox__arrow:hover,
    .flavor-lightbox__arrow:focus,
    .flavor-lightbox__arrow:active,
    .flavor-lightbox__arrow:focus-visible {
        background: rgba(255, 255, 255, 0.2) !important;
        outline: none !important;
        transition: none !important;
    }
}

.flavor-lightbox__arrow:focus {
    outline: none;
}

.flavor-lightbox__arrow--prev { left: 16px; }
.flavor-lightbox__arrow--next { right: 16px; }

.flavor-lightbox__arrow svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .flavor-lightbox__arrow {
        width: 48px;
        height: 48px;
    }
    .flavor-lightbox__arrow svg {
        width: 32px;
        height: 32px;
    }
    .flavor-lightbox__arrow--prev { left: 8px; }
    .flavor-lightbox__arrow--next { right: 8px; }
}
