body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f3f3f3;
  color: #222;
}

header {
  background-color: #990000;
  color: white;
  padding: 10px 20px;
  text-align: center;
}

.section {
  margin: 40px auto;
  max-width: 1000px;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
  color: #990000;
}

img {
  display: block;
  margin: 10px 0;
  max-width: 100%;
  height: auto;
}

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.9em;
  color: #666;
}

a {
  color: #990000;
  text-decoration: none;
}

.cenere-grid, .tremore-grid {
  display: grid;
  gap: 10px;
}

.cenere-grid {
  grid-template-columns: repeat(4, 1fr);
}

.tremore-grid {
  grid-template-columns: repeat(2, 1fr);
}

.img-wrapper {
  width: 100%;
  aspect-ratio: 4/3; /* Puoi scegliere un altro rapporto come 16/9 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.cenere-grid img, .tremore-grid img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
}

.lightbox img {
  width: 100%;
  height: auto;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);  /* Fondo scuro per focalizzare sull'immagine */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  display: block; /* Rimuove eventuali spazi vuoti */
}

/* Lightbox immagini */
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain; /* Questo mantiene le proporzioni */
}

.lightbox {
  cursor: pointer; /* Aggiungi il cursore per far capire che è possibile cliccare fuori per chiudere */
}

.caption {
  text-align: center;
  font-size: 0.9em;
  margin: 5px 0;
  color: #333;
}
@media (max-width: 600px) {
  .caption {
    font-size: 5px; /* Riduce la dimensione del testo sui dispositivi mobili */
    color: #990000;
  }
}


.lightbox .close {
  position: absolute;
  top: 10px;
  right: 25px;
  color: white;
  font-size: 30px
}

.ocr-search {
  margin-top: 20px;
}

#ocrInput {
  padding: 8px;
  width: 200px;
}

#ocrRisultati {
  margin-top: 10px;
}

#ocrLoader {
  display: none;
  font-size: 16px;
  color: #ff5733;
}
