/* Work gallery grid */
.work-gallery {
    margin: 16px auto 24px;
    max-width: 100%;
}

.work-gallery-title {
    font-family: 'Cairo',system-ui,-apple-system,Segoe UI,Roboto;
    font-weight: 800;
    color: #4c1d95;
    margin: 8px 0 10px
}

/* Flexbox layout (avoids parser errors and works responsively) */
.work-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}

.work-gallery-grid a.wg-item {
    margin: 5px;
    flex: 0 0 calc(25% - 60px);
}

@media (max-width: 900px) {
    .work-gallery-grid a.wg-item {
        flex:0 0 calc(33.333% - 10px)
    }
}

@media (max-width: 640px) {
    .work-gallery-grid a.wg-item {
        flex:0 0 calc(50% - 10px)
    }
}

@media (max-width: 420px) {
    .work-gallery-grid a.wg-item {
        flex:0 0 calc(100% - 10px)
    }
}

.work-gallery-grid a.wg-item {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 5px solid #7f1fff;
    box-shadow: 0 6px 10px rgb(128 29 251 / 67%), 0 2px 8px rgba(0, 0, 0, .06);
    aspect-ratio: 1/1
}

/* Fallback when aspect-ratio unsupported */
.work-gallery-grid a.wg-item::before {
    content: "";
    display: block;
    padding-top: 100%
}

.work-gallery-grid a.wg-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease
}

.work-gallery-grid a.wg-item:hover img {
    transform: scale(1.05)
}

/* Hover magnifier (on thumbnails) */
.wg-magnifier {
    position: absolute;
    pointer-events: none;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(0,0,0,.22),0 0 0 2px #fff;
    overflow: hidden;
    display: none;
    z-index: 5;
    background-repeat: no-repeat;
    background-size: 320% auto
}

/* Lightbox */
.wg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.wg-lightbox.active {
    display: flex
}

.wg-lightbox .wg-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer
}

.wg-lightbox .wg-img-wrap {
    max-width: min(92vw,1100px);
    max-height: 86vh;
    position: relative
}

.wg-lightbox img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.35)
}

.wg-lightbox .wg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    background: rgba(255,255,255,.22);
    border: none;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4
}

.wg-lightbox .wg-prev {
    left: 10px
}

.wg-lightbox .wg-next {
    right: 10px
}

@media (max-width: 768px) {
    .wg-lightbox .wg-prev {
        left:6px
    }

    .wg-lightbox .wg-next {
        right: 6px
    }
}

/* Lightbox magnifier lens */
.wg-lightbox .wg-lens {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    box-shadow: 0 6px 22px rgba(0,0,0,.35),0 0 0 2px #fff;
    z-index: 3;
    background-repeat: no-repeat;
    background-size: 320% auto
}
