/* ==========================
   Stile generale
========================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: white;
  color: #333;
}

/* ==========================
   Header e menu
========================== */
header {
  background: #222;
  color: white;
  padding: 1rem;
  text-align: center;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 0.5rem 1rem;
}

nav a {
  background: #000;      /* nero */
  color: white;          /* testo bianco */
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 0 0 auto;
}

nav a:link,
nav a:visited {
  color: white;
}

nav a:hover {
  background: #444;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

nav a:active {
  background: #666;
  color: white;
}

/* Responsive menu */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
  }
}

/* ==========================
   Home page immagine
========================== */
.home-image {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.home-image img {
  max-width: 50%;
  max-height: 50%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 10px;
}

@media (max-width: 1024px) {
  .home-image img {
    max-width: 70%;
    max-height: 70%;
  }
}

@media (max-width: 600px) {
  .home-image img {
    max-width: 90%;
    max-height: 90%;
  }
}

/* ==========================
   Galleria immagini
========================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 20px;
}

/* Cella della griglia */
.gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 5px;
}

/* Immagine centrata e non ritagliata */
.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
  display: block;
}

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

/* ==========================
   Lightbox
========================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column; /* permette controlli sotto l'immagine */
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;  /* lascia spazio in basso per le frecce */
  margin-bottom: 20px;
}

.lightbox #close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

/* ==========================
   Frecce lightbox in basso
========================== */
.lightbox-controls {
  display: flex;
  gap: 60px;
  justify-content: center;
  align-items: center;
  z-index: 1010;
}

.lightbox-controls span {
  color: white;
  font-size: 30px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s, color 0.2s;
}

.lightbox-controls span:hover {
  transform: scale(1.2);
  color: #ddd;
}
