/* Stili responsive per la pagina fotografie - allineati con la home */

/* Stili di base per tutti i dispositivi */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Fix per le immagini */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Stili per la galleria */
.gallery {
    display: grid !important;
    gap: 1.5rem !important;
    margin: 1.5rem 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Stili per gli elementi della galleria */
.gallery-item {
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: #FFFFFF !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.gallery-image {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.gallery-caption {
    padding: 1rem !important;
}

.gallery-title {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    color: #5D4037 !important;
    font-size: 1.2rem !important;
}

.gallery-description {
    margin-bottom: 0 !important;
    font-style: italic !important;
    color: #8D6E63 !important;
}

/* Stili per il layout principale */
main {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.content, .sidebar {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Stili per la lightbox */
.lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0,0,0,0.9) !important;
    z-index: 1000 !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 2rem !important;
    box-sizing: border-box !important;
}

.lightbox-content {
    max-width: 90% !important;
    max-height: 90% !important;
}

.lightbox-image {
    max-width: 100% !important;
    max-height: 80vh !important;
    border: 5px solid #FFFFFF !important;
}

.lightbox-caption {
    color: #FFFFFF !important;
    text-align: center !important;
    margin-top: 1rem !important;
    font-style: italic !important;
}

.lightbox-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    color: #FFFFFF !important;
    font-size: 2rem !important;
    cursor: pointer !important;
    z-index: 1001 !important;
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    /* Stili per l'header su mobile */
    header.page-header {
        padding: 1.5rem 0 !important;
        text-align: center !important;
        background-color: #5D4037 !important;
        color: #FFFFFF !important;
    }
    
    .header-content {
        position: relative !important;
        z-index: 2 !important;
        padding: 1rem !important;
    }
    
    h1 {
        font-size: 2rem !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .subtitle {
        font-size: 1rem !important;
        margin-top: 0 !important;
    }
    
    /* Stili per il menu su mobile */
    nav.desktop-nav {
        display: none !important;
    }
    
    /* Stili per il contenuto principale su mobile */
    main {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .content, .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
        padding: 1rem !important;
        margin: 0 !important;
    }
    
    /* Stili per la galleria su mobile */
    .gallery {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .gallery-item {
        margin-bottom: 0 !important; /* Rimuoviamo il margin-bottom perché abbiamo già il gap */
    }
    
    .gallery-image {
        height: 200px !important;
    }
    
    /* Stili per la lightbox su mobile */
    .lightbox {
        padding: 1rem !important;
    }
    
    .lightbox-content {
        max-width: 95% !important;
    }
    
    .lightbox-image {
        max-height: 70vh !important;
    }
    
    .lightbox-close {
        top: 10px !important;
        right: 10px !important;
        font-size: 1.5rem !important;
    }
    
    /* Stili per le sezioni su mobile */
    .section {
        margin-bottom: 1.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    h2, h3 {
        font-size: 1.5rem !important;
        margin-top: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* Media query per tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Stili per la galleria su tablet */
    .gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Stili per il layout principale su tablet */
    main {
        padding: 1rem !important;
    }
}

/* Media query per desktop */
@media (min-width: 1025px) {
    /* Stili per l'header su desktop */
    header.page-header {
        padding: 3rem 0 !important;
        text-align: center !important;
        background-color: #5D4037 !important;
        color: #FFFFFF !important;
    }
    
    .header-content {
        max-width: 800px !important;
        margin: 0 auto !important;
    }
    
    h1 {
        font-size: 3rem !important;
        margin-bottom: 1rem !important;
    }
    
    .subtitle {
        font-size: 1.5rem !important;
    }
    
    /* Stili per la galleria su desktop */
    .gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
    
    /* Stili per il layout principale su desktop */
    main {
        display: grid !important;
        grid-template-columns: 3fr 1fr !important;
        gap: 2rem !important;
        max-width: 1200px !important;
        margin: 2rem auto !important;
        padding: 0 2rem !important;
    }
    
    .content, .sidebar {
        margin: 0 !important;
    }
    
    /* Effetti hover per gli elementi della galleria su desktop */
    .gallery-item:hover {
        transform: translateY(-5px) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    }
    
    .gallery-item:hover .gallery-image {
        transform: scale(1.05) !important;
    }
}

/* Fix per il menu mobile */
#mobile-menu-container {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
}

/* Fix per lo scorrimento */
body {
    overflow: auto !important;
    height: auto !important;
}

main, .content, .sidebar, .gallery, .gallery-item {
    overflow: visible !important;
}

/* Fix per le sezioni */
.section {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Fix per le citazioni */
.quote {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 1rem 0 !important;
    padding: 1rem !important;
}

/* Fix per i titoli */
h1, h2, h3, h4, h5, h6 {
    width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
}

/* Fix per i paragrafi */
p {
    width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
}

/* Fix per le liste */
ul, ol {
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 1.5rem !important;
}

/* Fix per i link */
a {
    word-wrap: break-word !important;
}

/* Fix per il footer */
footer {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 1rem !important;
    text-align: center !important;
}

/* Fix per il menu mobile quando è aperto */
#mobile-menu-items {
    max-height: 80vh !important;
    overflow-y: auto !important;
}