/* =========================================
   Gallery Grid — Frontend Styles
   ========================================= */

.gallery-grid-wrap {
    width: 100%;
    box-sizing: border-box;
}

/* --- Base item --- */
.gallery-grid-wrap .gg-item {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
}

.gallery-grid-wrap .gg-item-inner {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.gallery-grid-wrap .gg-item-ratio {
    width: 100%;
    display: block;
}

.gallery-grid-wrap .gg-no-bg {
    background: #2a2a2a;
}

.gallery-grid-wrap .gg-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.0) 30%,
        rgba(0,0,0,0.55) 70%,
        rgba(0,0,0,0.75) 100%
    );
    z-index: 1;
    border-radius: 6px;
}

.gallery-grid-wrap .gg-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px 18px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-grid-wrap .gg-item-title {
    display: block;
    color: #ffffff;
    font-size: clamp(14px, 1.8vw, 22px);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gallery-grid-wrap .gg-item-subtitle {
    display: block;
    color: rgba(255,255,255,0.85);
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* =========================================
   HOVER EFFECT 1 — Lift
   Tranquillo: si alza di qualche px con ombra
   ========================================= */
.gallery-grid-wrap.gg-hover-lift .gg-item {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.gallery-grid-wrap.gg-hover-lift .gg-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.25);
}
.gallery-grid-wrap.gg-hover-lift .gg-item-overlay {
    transition: background 0.28s ease;
}
.gallery-grid-wrap.gg-hover-lift .gg-item:hover .gg-item-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.0) 20%, rgba(0,0,0,0.6) 65%, rgba(0,0,0,0.8) 100%);
}

/* =========================================
   HOVER EFFECT 2 — Zoom
   Soft: la foto si ingrandisce lentamente
   ========================================= */
.gallery-grid-wrap.gg-hover-zoom .gg-item {
    overflow: hidden;
}
.gallery-grid-wrap.gg-hover-zoom .gg-img-scale {
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
    border-radius: 6px;
}
.gallery-grid-wrap.gg-hover-zoom .gg-item:hover .gg-img-scale {
    transform: scale(1.08);
}
.gallery-grid-wrap.gg-hover-zoom .gg-item-overlay,
.gallery-grid-wrap.gg-hover-zoom .gg-item-content {
    position: absolute;
    z-index: 2;
}

/* =========================================
   HOVER EFFECT 3 — Brighten
   Medio: l'overlay scuro si dissolve
   ========================================= */
.gallery-grid-wrap.gg-hover-brighten .gg-item {
    transition: box-shadow 0.3s ease;
}
.gallery-grid-wrap.gg-hover-brighten .gg-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.gallery-grid-wrap.gg-hover-brighten .gg-item-overlay {
    transition: opacity 0.35s ease;
    opacity: 1;
}
.gallery-grid-wrap.gg-hover-brighten .gg-item:hover .gg-item-overlay {
    opacity: 0.15;
}

/* =========================================
   HOVER EFFECT 4 — Slide Up
   Interessante: il testo emerge dal basso
   ========================================= */
.gallery-grid-wrap.gg-hover-slideup .gg-item {
    overflow: hidden;
}
.gallery-grid-wrap.gg-hover-slideup .gg-item-overlay {
    transition: background 0.35s ease;
    background: linear-gradient(to bottom, rgba(0,0,0,0.0) 50%, rgba(0,0,0,0.55) 80%, rgba(0,0,0,0.7) 100%);
}
.gallery-grid-wrap.gg-hover-slideup .gg-item:hover .gg-item-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.65) 60%, rgba(0,0,0,0.85) 100%);
}
.gallery-grid-wrap.gg-hover-slideup .gg-item-content {
    transform: translateY(12px);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.gallery-grid-wrap.gg-hover-slideup .gg-item:hover .gg-item-content {
    transform: translateY(0);
}
.gallery-grid-wrap.gg-hover-slideup .gg-item-subtitle {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease 0.05s, transform 0.35s ease 0.05s;
}
.gallery-grid-wrap.gg-hover-slideup .gg-item:hover .gg-item-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   HOVER EFFECT 5 — Glitch
   Strano: scorrimento cromatico RGB
   ========================================= */
.gallery-grid-wrap.gg-hover-glitch .gg-item {
    transition: box-shadow 0.15s ease;
}
.gallery-grid-wrap.gg-hover-glitch .gg-item:hover {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff0055, 0 0 0 6px #00ffe5;
    animation: gg-glitch-border 0.6s steps(1) infinite;
}
.gallery-grid-wrap.gg-hover-glitch .gg-item:hover .gg-item-inner {
    animation: gg-glitch-img 0.5s steps(2) infinite;
}
.gallery-grid-wrap.gg-hover-glitch .gg-item-title {
    transition: text-shadow 0.15s ease, letter-spacing 0.15s ease;
}
.gallery-grid-wrap.gg-hover-glitch .gg-item:hover .gg-item-title {
    text-shadow: 2px 0 #ff0055, -2px 0 #00ffe5, 0 1px 4px rgba(0,0,0,0.5);
    animation: gg-glitch-text 0.4s steps(2) infinite;
    letter-spacing: 0.06em;
}

@keyframes gg-glitch-img {
    0%   { filter: none; transform: translateX(0); }
    25%  { filter: hue-rotate(90deg) saturate(2); transform: translateX(-3px); }
    50%  { filter: none; transform: translateX(2px); }
    75%  { filter: hue-rotate(-60deg) saturate(1.5); transform: translateX(-1px); }
    100% { filter: none; transform: translateX(0); }
}

@keyframes gg-glitch-text {
    0%   { clip-path: inset(0 0 100% 0); transform: translateX(0); }
    25%  { clip-path: inset(20% 0 50% 0); transform: translateX(3px); }
    50%  { clip-path: inset(0 0 0 0); transform: translateX(-2px); }
    75%  { clip-path: inset(60% 0 10% 0); transform: translateX(1px); }
    100% { clip-path: none; transform: translateX(0); }
}

@keyframes gg-glitch-border {
    0%   { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff0055, 0 0 0 6px #00ffe5; }
    33%  { box-shadow: 2px 1px 0 2px #fff, -1px 0 0 4px #00ffe5, 1px 0 0 6px #ff0055; }
    66%  { box-shadow: -1px 0 0 2px #fff, 2px 0 0 4px #ff0055, -2px 1px 0 6px #00ffe5; }
    100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff0055, 0 0 0 6px #00ffe5; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .gallery-grid-wrap .gg-item-title    { font-size: 16px; }
    .gallery-grid-wrap .gg-item-subtitle { font-size: 12px; }
    .gallery-grid-wrap .gg-item-content  { padding: 12px 14px 14px; }
}
