/* ===== CROCI GALLERY v2 ===== */
.csg2-section, .csg2-section * { box-sizing: border-box; margin: 0; padding: 0; }

.elementor-widget-shortcode .elementor-widget-container,
.e-con, .e-con-inner {
    /* reset solo se contiene la gallery */
}
.elementor-widget-shortcode .elementor-widget-container:has(.csg2-section),
.e-con:has(.csg2-section), .e-con-inner:has(.csg2-section) {
    padding: 0 !important; margin: 0 !important; border: none !important;
}

.csg2-section {
    background: #070707;
    padding: 96px 24px 112px;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

/* HEADER */
.csg2-header {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 64px;
}
.csg2-header__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,.35), transparent);
}
.csg2-header__title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    letter-spacing: -.03em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    line-height: 1;
}

/* GRIGLIA */
.csg2-grid {
    columns: 2;
    column-gap: 20px;
    width: 100%;
}

/* ITEM */
.csg2-item {
    break-inside: avoid;
    display: block;
    margin-bottom: 20px;
    transform: rotate(var(--r, 0deg));
    transition: transform .35s cubic-bezier(.4,0,.2,1), z-index 0s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.csg2-item:hover {
    transform: rotate(0deg) scale(1.02) !important;
    z-index: 10;
}

.csg2-item__inner {
    background: #1a1a1a;
    padding: 6px 6px 22px;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 8px 32px rgba(0,0,0,.45);
    transition: box-shadow .3s;
    overflow: hidden;
}
.csg2-item:hover .csg2-item__inner {
    box-shadow: 0 4px 20px rgba(0,0,0,.7), 0 20px 60px rgba(0,0,0,.55), inset 0 0 0 1px rgba(201,168,76,.2);
}

.csg2-item__inner img {
    width: 100%;
    height: auto;
    display: block;
    filter: sepia(8%) brightness(.88) contrast(1.1) saturate(.9);
    transition: filter .4s ease;
    transform: scale(1.02);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
.csg2-item:hover .csg2-item__inner img {
    filter: sepia(0%) brightness(.96) contrast(1.05) saturate(1.05);
}

/* ANIMAZIONI */
.csg2-item {
    opacity: 0;
    transition: opacity .6s ease, transform .6s ease;
}
.csg2-item.csg2-visible {
    opacity: 1;
}

/* LIGHTBOX */
#csg2-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
#csg2-lb.open {
    display: flex;
}

#csg2-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.96);
    cursor: pointer;
}

#csg2-lb-img {
    position: relative;
    z-index: 1;
    max-width: 88vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 2px;
    box-shadow: 0 32px 80px rgba(0,0,0,.8);
    animation: csg2-pop .28s cubic-bezier(.4,0,.2,1) both;
    user-select: none;
    -webkit-user-drag: none;
}
@keyframes csg2-pop {
    from { opacity: 0; transform: scale(.93); }
    to   { opacity: 1; transform: scale(1); }
}

#csg2-lb-close {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 2;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
#csg2-lb-close:hover { background: rgba(200,16,46,.6); }

#csg2-lb-prev, #csg2-lb-next {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    z-index: 2;
    width: 48px; height: 48px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}
#csg2-lb-prev { left: 16px; }
#csg2-lb-next { right: 16px; }
#csg2-lb-prev:hover { background: rgba(255,255,255,.18); transform: translateY(-50%) scale(1.08); }
#csg2-lb-next:hover { background: rgba(255,255,255,.18); transform: translateY(-50%) scale(1.08); }

#csg2-lb-counter {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .csg2-section { padding: 64px 16px 80px; }
    .csg2-header { margin-bottom: 40px; }
    .csg2-grid { columns: 1; }
    .csg2-item { --r: 0deg !important; }
    .csg2-item__inner { padding: 4px 4px 16px; }
    #csg2-lb-prev { left: 8px; }
    #csg2-lb-next { right: 8px; }
    #csg2-lb-img { max-width: 95vw; max-height: 80vh; }
}
/* ===== END ===== */
