/* ============================================
   GALLERIA PAGE STYLES
   ============================================ */

.galleria-header {
    display: none; /* Nascondi completamente il container dell'header */
}

.galleria-title {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-top: calc(70px + 20px); /* Spazio per l'header fisso + margine */
    margin-bottom: var(--spacing-md);
    color: var(--color-red);
    text-align: center;
    line-height: 1.2; /* Ridotto line-height per avvicinare le linee */
}

.back-link {
    color: var(--color-red);
    text-decoration: none;
    font-size: 1.125rem;
    transition: color var(--transition-fast);
    display: inline-block;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    text-align: center;
    display: block;
}

.back-link:hover {
    color: var(--color-red-light);
    text-decoration: underline;
}

.galleria-grid-section {
    padding: var(--spacing-xl) 0;
    background: 
        linear-gradient(
            to right,
            rgba(160, 82, 45, 0.35) 0%,      /* Sienna (Brown-Red mix) - inizio */
            rgba(139, 69, 19, 0.4) 25%,      /* Brown (Saddle Brown) */
            rgba(139, 0, 0, 0.38) 50%,       /* Bordeaux (Dark Red) - centro */
            rgba(139, 69, 19, 0.4) 75%,      /* Brown (Saddle Brown) */
            rgba(212, 175, 55, 0.35) 100%    /* Yellow/Gold - fine */
        ),
        linear-gradient(
            to bottom,
            rgba(255, 248, 231, 0.5) 0%,
            rgba(255, 248, 231, 0.4) 100%
        ),
        var(--color-cream); /* Base cream per migliorare la leggibilità */
    position: relative;
}

.galleria-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/2015/scena 10 la nascita.JPG');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(60%) contrast(1.2) brightness(1.1) sepia(50%) hue-rotate(5deg);
    opacity: 0.25; /* Opacità ridotta per far risaltare il gradiente */
    z-index: 0;
    pointer-events: none;
}

.galleria-grid-section > * {
    position: relative;
    z-index: 1;
}

.galleria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.galleria-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-medium);
    background: var(--color-dark);
    opacity: 0;
    transform: scale(0.9);
    animation: fadeInScale 0.6s ease-out forwards;
}

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

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.galleria-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.galleria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.galleria-item:hover img {
    transform: scale(1.15);
}

.galleria-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.galleria-item:hover::after {
    opacity: 1;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    font-size: 1.25rem;
    color: var(--color-gold-dark);
}

.loading-images {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-dark);
    font-size: 1.25rem;
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    font-size: 1.25rem;
    color: var(--color-dark);
}

/* Banda decorativa più stretta con gradiente mattone per pagina galleria */
.galleria-grid-section .title-decoration {
    flex: 1;
    height: 1px; /* Ridotto da 2px a 1px */
    background: linear-gradient(
        to right,
        transparent,
        #1A1A1A 20%,        /* Colore header scuro */
        #8B4513 50%,        /* Mattone scuro (Saddle Brown) */
        #CD853F 80%,        /* Mattone chiaro (Peru) */
        transparent
    );
    max-width: 100px; /* Ridotto da 150px a 100px */
}

/* Responsive */
@media (max-width: 768px) {
    .galleria-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .galleria-grid {
        grid-template-columns: 1fr;
    }
}

