/* ============================================
   GALLERIA STORIA - STYLES ANTICO/VINTAGE
   ============================================ */

.galleria-storia-header {
    padding: calc(70px + 40px + 80px) 0 40px; /* 190px totali: 70px header + 40px base + 80px extra */
    background: 
        linear-gradient(
            rgba(139, 69, 19, 0.9) 0%,
            rgba(101, 67, 33, 0.85) 50%,
            rgba(139, 69, 19, 0.9) 100%
        ),
        url('../img/Presepe nella storia web/1952.jpg') center/cover;
    background-attachment: fixed;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Responsive padding per mobile */
@media (max-width: 768px) {
    .galleria-storia-header {
        padding: calc(56px + 40px + 80px) 0 40px; /* 176px totali: 56px header + 40px base + 80px extra */
    }
}

.galleria-storia-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        radial-gradient(
            circle at 20% 50%,
            rgba(212, 175, 55, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 50%,
            rgba(212, 175, 55, 0.1) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.galleria-storia-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #D4AF37;
    text-shadow: 
        3px 3px 0px rgba(0, 0, 0, 0.8),
        6px 6px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 15px;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

.galleria-storia-subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #F4E4BC;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.galleria-storia-grid-section {
    padding: var(--spacing-xl) 0;
    background: 
        linear-gradient(
            to bottom,
            rgba(139, 69, 19, 0.1) 0%,
            rgba(101, 67, 33, 0.15) 50%,
            rgba(139, 69, 19, 0.1) 100%
        ),
        repeating-linear-gradient(
            45deg,
            rgba(212, 175, 55, 0.02) 0px,
            rgba(212, 175, 55, 0.02) 1px,
            transparent 1px,
            transparent 20px
        ),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23000" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    background-attachment: fixed;
    min-height: 80vh;
}

.galleria-storia-grid-section .container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.galleria-storia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
    gap: 25px;
    padding: 20px 0;
    justify-content: center;
    align-items: start;
    width: 100%;
    margin: 0 auto;
}

.galleria-storia-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 0 0 3px rgba(212, 175, 55, 0.3),
        inset 0 0 0 6px rgba(139, 69, 19, 0.2);
    transition: all 0.4s ease;
    background: #2C1810;
    transform-style: preserve-3d;
    width: 280px;
    max-width: 100%;
}

.galleria-storia-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(
            circle at center,
            transparent 0%,
            rgba(0, 0, 0, 0.3) 100%
        );
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.galleria-storia-item:hover::before {
    opacity: 1;
}

.galleria-storia-item:hover {
    transform: translateY(-8px) rotateY(2deg);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 0 3px rgba(212, 175, 55, 0.5),
        inset 0 0 0 6px rgba(139, 69, 19, 0.3);
}

.galleria-storia-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(30%) contrast(1.1) brightness(0.9);
    transition: all 0.6s ease;
    transform: scale(1);
}

.galleria-storia-item:hover img {
    filter: sepia(20%) contrast(1.2) brightness(1);
    transform: scale(1.05);
}

.galleria-storia-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%
    );
    padding: 20px 15px 15px;
    color: #D4AF37;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    z-index: 3;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.galleria-storia-item:hover .galleria-storia-item-caption {
    transform: translateY(0);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #D4AF37;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8B4513;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .galleria-storia-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 200px));
        gap: 15px;
        justify-content: center;
    }
    
    .galleria-storia-item {
        width: 200px;
    }
    
    .galleria-storia-title {
        font-size: 2rem;
    }
    
    .galleria-storia-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .galleria-storia-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 250px));
        justify-content: center;
    }
    
    .galleria-storia-item {
        width: 250px;
        max-width: calc(100% - 20px);
    }
}

