/* Crezzio Portfolio Gallery v2.0 */

.crezzio-gallery-container {
    --crezzio-gallery-bg: #1a1a1a;
    --crezzio-gallery-gap: 20px;
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 24px 14px 90px;
    box-sizing: border-box;
    background: var(--crezzio-gallery-bg);
}

.crezzio-masonry {
    width: 100%;
    column-gap: var(--crezzio-gallery-gap);
    line-height: 0;
}

.crezzio-masonry.masonry-1 { column-count: 1; }
.crezzio-masonry.masonry-2 { column-count: 2; }
.crezzio-masonry.masonry-3 { column-count: 3; }
.crezzio-masonry.masonry-4 { column-count: 4; }
.crezzio-masonry.masonry-5 { column-count: 5; }

.crezzio-gallery-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 var(--crezzio-gallery-gap);
    padding: 0;
    border: 0;
    background: transparent;
    break-inside: avoid;
    cursor: pointer;
    line-height: 0;
    text-align: left;
}

.crezzio-gallery-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 30px;
    transition: opacity .3s ease, transform .45s cubic-bezier(.2,.7,.2,1);
}

.crezzio-gallery-item:hover .crezzio-gallery-image {
    opacity: .64;
}

.crezzio-column-widget {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 999998;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.38);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.crezzio-col-btn {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 9px;
    background: rgba(255,255,255,.03);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, opacity .2s ease;
}

.crezzio-col-btn:hover {
    border-color: rgba(255,255,255,.38);
}

.crezzio-col-btn.is-active {
    border-color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.09);
}

.crezzio-col-icon {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 14px;
}

.crezzio-col-icon i {
    display: block;
    flex: 1;
    min-width: 2px;
    border-radius: 1px;
    background: rgba(255,255,255,.82);
}

.crezzio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.crezzio-lightbox.is-open {
    display: flex;
}

.crezzio-lightbox-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(82vw, 1400px);
    height: 88vh;
}

.crezzio-lightbox-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 28px;
    object-fit: contain;
}

.crezzio-lightbox-close,
.crezzio-lightbox-nav {
    position: fixed;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.4);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.crezzio-lightbox-close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.crezzio-lightbox-nav {
    top: 50%;
    width: 48px;
    height: 64px;
    transform: translateY(-50%);
    border-radius: 12px;
    font-size: 20px;
}

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

body.crezzio-lightbox-open {
    overflow: hidden !important;
}

.crezzio-gallery-message {
    padding: 48px 20px;
    background: #1a1a1a;
    color: rgba(255,255,255,.55);
    text-align: center;
    font: 14px/1.6 system-ui, sans-serif;
}

@media (max-width: 968px) {
    .crezzio-gallery-container {
        --crezzio-gallery-gap: 15px;
        padding: 22px 14px 86px;
    }

    .crezzio-gallery-image {
        border-radius: 20px;
    }

    .crezzio-lightbox-stage {
        width: 90vw;
    }
}

@media (min-width: 769px) {
    .crezzio-col-1 {
        display: none;
    }
}

@media (max-width: 768px) {
    .crezzio-gallery-container {
        --crezzio-gallery-gap: 12px;
        padding-bottom: 80px;
    }

    .crezzio-gallery-image {
        border-radius: 16px;
    }

    .crezzio-col-4,
    .crezzio-col-5 {
        display: none;
    }

    .crezzio-column-widget {
        bottom: 12px;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 14px;
    }

    .crezzio-col-btn {
        min-width: 42px;
        height: 42px;
    }

    .crezzio-lightbox-stage {
        width: 92vw;
        height: 82vh;
    }

    .crezzio-lightbox-stage img {
        border-radius: 16px;
    }

    .crezzio-lightbox-nav {
        top: auto;
        bottom: 18px;
        width: 46px;
        height: 46px;
        transform: none;
        border-radius: 50%;
    }

    .crezzio-lightbox-prev {
        left: calc(50% - 58px);
    }

    .crezzio-lightbox-next {
        right: calc(50% - 58px);
    }
}

@media (max-width: 480px) {
    .crezzio-gallery-container {
        --crezzio-gallery-gap: 10px;
        padding: 18px 12px 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .crezzio-gallery-image,
    .crezzio-col-btn {
        transition: none;
    }
}
