/* Reset di base e font */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px; /* Ridotto leggermente per il mobile */
}

body {
  font-family: Arial, sans-serif;
  background-color: #e0f2f1; 
  color: #00334e;            
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #00796b, #00acc1); 
  color: #ffffff;
  text-align: center;
  padding: 2.5rem 1rem;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

/* --- BARRA DI NAVIGAZIONE ANNI MOBILE-FIRST --- */
.year-nav {
  background-color: #004d40; 
  position: sticky;          
  top: 0;
  z-index: 900;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-title {
  color: #b2dfdb; 
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  white-space: nowrap; /* Impedisce al testo di andare a capo */
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto; /* Permette lo swipe orizzontale su smartphone */
  scrollbar-width: none; /* Nasconde la barra di scorrimento su Firefox */
  padding-diagonal: 5px;
}

.nav-list::-webkit-scrollbar {
  display: none; /* Nasconde la barra di scorrimento su Chrome/Safari */
}

.year-nav a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background-color: #00796b; 
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.2s;
}

.year-nav a:hover {
  background-color: #00acc1; 
  transform: translateY(-2px);
}

/* --- CONTENITORE E SEZIONI --- */
.container {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.anno-section {
  margin-bottom: 2.5rem;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 10px rgba(0, 128, 128, 0.15);
  border-left: 6px solid #00acc1; 
}

.anno-title {
  font-size: 1.6rem;
  color: #00695c; 
  margin-bottom: 1rem;
  border-bottom: 2px solid #b2dfdb;
  padding-bottom: 0.4rem;
}

/* Griglia flessibile automatica */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.photo-card {
  background-color: #f0fdf4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #b2ebf2;
}

.photo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 150, 136, 0.25);
}
/* ---in origine: "height: 300px;" --- */

.photo-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.photo-caption {
  display: block;
  text-align: center;
  padding: 0.75rem;
  font-weight: bold;
  color: #004d40;
  background-color: #e0f7fa; 
}

/* --- LIGHTBOX OTTIMIZZATO --- */
.gallery-img {
  cursor: pointer;
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 33, 46, 0.95); 
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 95%;
  max-height: 80%;
  border-radius: 6px;
  border: 3px solid #b2ebf2; 
  box-shadow: 0 0 20px rgba(0, 172, 193, 0.5);
  animation: zoomIn 0.25s ease;
}

#lightbox-caption {
  color: #e0f2f1; 
  font-size: 1.1rem;
  margin-top: 12px;
  font-weight: 500;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #20B2AA; 
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  padding: 5px; /* Area di tocco più grande per i pollici */
}

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

footer {
  text-align: center;
  padding: 1.25rem;
  background-color: #004d40;
  color: #ffffff;
  margin-top: 2rem;
}

/* --- STRUMENTI SPECIFICI PER SMARTPHONE (Sotto i 576px) --- */
@media (max-width: 576px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  .anno-section {
    padding: 1rem;
    border-left-width: 4px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr; /* Una sola foto per riga sugli schermi molto stretti */
  }

  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 40px;
  }
}
