/* Galleria fotografica FESK — griglia eventi (pagina categoria), griglia foto e
   lightbox (pagina evento). Vanilla CSS, nessuna libreria esterna, coerente con lo
   stile essenziale già in uso nel resto del sito (calendario, area riservata). */

.fesk-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1rem 0 2rem;
}

.fesk-gallery-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fesk-gallery-card:hover,
.fesk-gallery-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.fesk-gallery-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #eee;
}
.fesk-gallery-card-title {
    display: block;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.fesk-gallery-empty {
    padding: 1rem 0;
    color: #666;
}

.fesk-gallery-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    margin: 1.5rem 0;
}
.fesk-gallery-photo {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
    cursor: zoom-in;
}
.fesk-gallery-photo img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    background: #eee;
    transition: opacity 0.15s ease;
}
.fesk-gallery-photo:hover img,
.fesk-gallery-photo:focus img {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .fesk-gallery-photos { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .fesk-gallery-photo img { height: 100px; }
}

/* --- Lightbox overlay (iniettato via JS, vedi lightbox.js) --- */

.fesk-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2.5rem 1rem;
}
.fesk-lightbox-overlay[hidden] { display: none; }

.fesk-lightbox-figure {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.fesk-lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    display: block;
    border-radius: 4px;
}
.fesk-lightbox-counter {
    color: #eee;
    font-size: 0.85rem;
    margin-top: 0.6rem;
}

.fesk-lightbox-close,
.fesk-lightbox-prev,
.fesk-lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fesk-lightbox-close:hover,
.fesk-lightbox-prev:hover,
.fesk-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}
.fesk-lightbox-close { top: 1rem; right: 1rem; }
.fesk-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.fesk-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
    .fesk-lightbox-close, .fesk-lightbox-prev, .fesk-lightbox-next {
        width: 2.25rem; height: 2.25rem; font-size: 1.15rem;
    }
    .fesk-lightbox-overlay { padding: 3.5rem 0.5rem; }
}
