/**
 * BMWP Gallery Styles
 */

/* Container styles */
.bmwp-gallery-container {
    width: 100%;
    margin: 0 auto;
}

.bmwp-gallery-content {
    margin-bottom: 40px;
}

/* Category filter styles */
.bmwp-gallery-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    justify-content: flex-start;
    column-gap: 12px;
    row-gap: 12px;
}

.bmwp-list-link {
    display: inline-block;
    font-size: 18px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--primary);
    background-color: var(--surface-30);
    transition: all 0.3s ease;
    letter-spacing: -0.25px;
}

.bmwp-list-link:hover,
.bmwp-list-link.current {
    background-color: var(--primary);
    color: var(--surface-0);
}

/* Gallery grid styles */
.bmwp-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Gallery items */
.bmwp-gallery-item {
    overflow: hidden;
    transition: all 0.3s ease;
}

.bmwp-gallery-item:hover {
    transform: translateY(-5px);
}

.bmwp-gallery-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.bmwp-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bmwp-gallery-item:hover img {
    transform: scale(1.08);
}

/* Lightbox styles */
.bmwp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.bmwp-lightbox.active {
    display: flex;
}

.bmwp-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.bmwp-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.bmwp-lightbox-close {
    position: absolute;
    top: calc(60px + 1%);
    right: 20px;
    width: 40px;
    height: 40px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.bmwp-lightbox-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.bmwp-lightbox-prev,
.bmwp-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    color: var(--surface-100);
    background: var(--surface-0);
    border: none;
    border-radius: 0;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bmwp-lightbox-next:hover,
.bmwp-lightbox-prev:hover,
.bmwp-lightbox-close:hover {
    background-color: var(--primary) !important;
}

.bmwp-lightbox-prev svg,
.bmwp-lightbox-next svg {
    width: 32px;
    height: 32px;
    fill: var(--surface-100);
}

.bmwp-lightbox-next:hover svg,
.bmwp-lightbox-prev:hover svg {
    fill: var(--surface-0);
}

.bmwp-lightbox-prev {
    left: 0;
    transform: rotate(180deg);
}

.bmwp-lightbox-prev svg {
    transform: rotate(180deg);
}

.bmwp-lightbox-next {
    right: 0;
    transform: rotate(-180deg);
}

/* Hide elements when filtering */
.bmwp-gallery-item.hidden {
    display: none;
}

/* Responsive breakpoints */
@media (min-width: 768px) {
    .bmwp-gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 250px;
        gap: 15px;
    }

    /* Specific layout pattern: 2nd and 4th images span 2 columns */
    .bmwp-gallery-item:nth-child(6n + 2),
    .bmwp-gallery-item:nth-child(6n + 4) {
        grid-column: span 2;
    }
}

@media (min-width: 992px) {
    .bmwp-gallery {
        grid-auto-rows: 480px;
        gap: 20px;
    }
}
