/* Reset CSS di base */

.gallery-description {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    text-align: center;
    font-weight: 300;
    line-height: 1.6;
    color: #555;
}

/* Modifica dello stile del titolo della foto */
.photo-title {
    display: none; /* Rimane nascosto di default */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8); /* Sfondo semi-trasparente */
    color: #333;
    text-align: center;
    font-weight: 300;
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

/* Mostra il titolo al passaggio del mouse */
.photo-item:hover .photo-title {
    display: block; /* Si mostra al passaggio del mouse */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Header e navigazione */
header {
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 2rem;
}

nav a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #999;
}

/* Contenuto principale */
main {
    padding: 0 5%;
}

/* Griglia foto */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0 4rem;
    grid-auto-rows: 300px; /* Altezza fissa per tutte le righe */
}

/* Photo item */
.photo-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    background-color: #f5f5f5; /* Sfondo grigio chiaro */
    border: 1px solid #f5f5f5; /* Bordo dello stesso colore dello sfondo per nasconderlo */
}

.photo-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Container per l'immagine */
.img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Stile immagine */
.photo-item img, .gallery-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Mantiene le proporzioni senza ritagliare */
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-title {
    display: none;
}

/* Gallery sulla pagina dedicata */
.gallery-title {
    font-size: 1.2rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 2rem 0;
}

.back-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid #333;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 2rem;
}

.back-link:hover {
    background-color: #333;
    color: #fff;
}

/* Griglia galleria */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    grid-auto-rows: 300px; /* Altezza fissa per tutte le righe */
}

/* Elementi galleria */
.gallery-item {
    height: 100%;
    background-color: #f5f5f5; /* Sfondo grigio chiaro */
    border: 1px solid #f5f5f5; /* Bordo dello stesso colore dello sfondo per nasconderlo */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

/* About section */
.about-section {
    max-width: 890px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.about-section h2 {
    font-weight: 300;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.about-section h3 {
    font-weight: 300;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.about-section p {
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.social-links {
    margin: 1rem 0;
}

.social-links a {
    margin: 0 0.5rem;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #999;
}

/* Fullscreen Image Viewer */
#fullscreen-viewer {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.9); 
    z-index: 2000; 
    cursor: pointer; 
    align-items: center; 
    justify-content: center;
}

#fullscreen-image {
    max-width: 90%; 
    max-height: 90%; 
    object-fit: contain;
}

#close-fullscreen {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    background: none; 
    border: none; 
    color: white; 
    font-size: 30px; 
    cursor: pointer;
}

#prev-image, #next-image {
    position: absolute;
    background: none; 
    border: none; 
    color: white; 
    font-size: 30px; 
    cursor: pointer;
}

#prev-image {
    left: 20px;
}

#next-image {
    right: 20px;
}

/* Footer */
footer {
    padding: 3rem 5%;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 2rem;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1.5rem 5%;
    }
    
    nav {
        margin-top: 1.5rem;
    }
    
    nav li {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .photo-grid, .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        grid-auto-rows: 250px; /* Altezza ridotta per il mobile */
    }
}
