/**
 * Galleria Index - Stili per la pagina indice delle gallerie fotografiche
 * Coerente con lo stile di eventi.php e galleria-style.css
 */

/* =========================================
   Sezione Gallerie - Griglia Card
   ========================================= */

.galleries-section {
    min-height: 400px;
}

.gallery-index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Card singola galleria */
.gallery-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* Contenitore immagine */
.gallery-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.08);
}

/* Overlay su hover */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-overlay-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.gallery-card-overlay-text i {
    margin-right: 6px;
}

/* Badge conteggio foto */
.gallery-photo-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery-photo-count i {
    margin-right: 4px;
}

/* Corpo della card */
.gallery-card-body {
    padding: 18px 20px;
}

.gallery-card-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
    line-height: 1.3;
}

.gallery-card-body h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gallery-card-body h4 a:hover {
    color: #0d6efd;
}

.gallery-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.gallery-card-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer card */
.gallery-card-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-card-footer .btn {
    font-size: 0.85rem;
    padding: 6px 16px;
}

.gallery-card-location {
    font-size: 0.82rem;
    color: #6c757d;
}

.gallery-card-location i {
    margin-right: 4px;
    color: #0d6efd;
}

/* =========================================
   Filtri
   ========================================= */

.galleries-filter .filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.galleries-filter .filter-btn {
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.galleries-filter .filter-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* =========================================
   Stato vuoto
   ========================================= */

.no-galleries {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.no-galleries i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #adb5bd;
}

.no-galleries h3 {
    color: #495057;
    margin-bottom: 10px;
}

.no-galleries p {
    color: #6c757d;
    max-width: 400px;
}

/* =========================================
   Animazione ingresso
   ========================================= */

.gallery-card {
    animation: galleryFadeIn 0.5s ease forwards;
    opacity: 0;
}

.gallery-card:nth-child(1) { animation-delay: 0.05s; }
.gallery-card:nth-child(2) { animation-delay: 0.1s; }
.gallery-card:nth-child(3) { animation-delay: 0.15s; }
.gallery-card:nth-child(4) { animation-delay: 0.2s; }
.gallery-card:nth-child(5) { animation-delay: 0.25s; }
.gallery-card:nth-child(6) { animation-delay: 0.3s; }
.gallery-card:nth-child(7) { animation-delay: 0.35s; }
.gallery-card:nth-child(8) { animation-delay: 0.4s; }
.gallery-card:nth-child(9) { animation-delay: 0.45s; }

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 991.98px) {
    .gallery-index-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 575.98px) {
    .gallery-index-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-card-body h4 {
        font-size: 1rem;
    }

    .galleries-filter .filter-btn {
        font-size: 0.8rem;
        padding: 5px 14px;
    }
}
