:root {
  --colore-testo: #2a2a2a;
  --colore-sfondo: #faf9f6;
  --colore-accento: #7a4a2b;
  --font-testo: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-testo);
  color: var(--colore-testo);
  background: var(--colore-sfondo);
  line-height: 1.6;
}

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid #e2ddd3;
}

.site-header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.03em;
}

.site-header h1 a {
  color: var(--colore-testo);
  text-decoration: none;
}

.sottotitolo {
  margin: 0.25rem 0 1rem;
  color: #7a7a7a;
  font-style: italic;
}

nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin: 0.5rem auto 0;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--colore-accento);
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle.attivo span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.attivo span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.attivo span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

nav a {
  color: var(--colore-accento);
  text-decoration: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page-content h2,
.galleria h2 {
  font-weight: normal;
  border-bottom: 1px solid #e2ddd3;
  padding-bottom: 0.5rem;
}
.pagina-con-foto {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}

.foto-autore {
  flex: 0 0 180px;
}

.foto-autore img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.testo-con-foto {
  flex: 1 1 400px;
}

@media (max-width: 550px) {
  .foto-autore, .foto-autore img {
    flex-basis: 120px;
    width: 120px;
    height: 120px;
  }
}

.griglia-quadri {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.quadro img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.quadro figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #555;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
  font-size: 0.85rem;
}

.footer-contatti {
  margin-bottom: 0.5rem;
  color: var(--colore-testo);
}

.footer-contatti a {
  color: var(--colore-accento);
  text-decoration: none;
}

.footer-contatti a:hover {
  text-decoration: underline;
}

.footer-contatti .separatore {
  margin: 0 0.75rem;
  color: #ccc;
}

/* --- Slideshow galleria --- */
body:has(.slideshow) main {
  max-width: none;
  padding: 0;
}

.slideshow {
  position: relative;
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 400px;
  background: #111;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6%;
}

.slide.attiva {
  opacity: 1;
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.didascalia {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
}

.freccia {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.freccia:hover {
  background: rgba(0,0,0,0.6);
}

.freccia-sx { left: 0; }
.freccia-dx { right: 0; }

.puntini {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.puntino {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s;
}

.puntino.attivo {
  background: #fff;
}
/* --- Layout home a due colonne --- */
.home-layout {
  display: flex;
  flex-wrap: wrap;
  min-height: calc(100vh - 160px);
}

.home-galleria {
  flex: 1 1 55%;
  min-width: 300px;
  position: relative;
}

.home-galleria .slideshow {
  height: 70vh;
  min-height: 400px;
}

.home-testo {
  flex: 1 1 40%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3rem 3rem 2.5rem;
  font-size: 1.05rem;
}

@media (max-width: 700px) {
  .home-testo {
    padding: 2rem 1.5rem;
  }
}
/* --- Adattamenti per schermi piccoli (telefoni) --- */
@media (max-width: 600px) {
  .site-header {
    padding: 1.5rem 1rem 1rem;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

  nav {
    gap: 0.5rem 1rem;
  }

  nav {
    gap: 0.5rem 1rem;
  }

  nav a {
    font-size: 0.8rem;
  }

  .slide {
    padding: 0 3%;
  }

  /* Menu a tendina attivabile da hamburger */
  .menu-toggle {
    display: flex;
  }

  nav#nav-principale {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 1rem;
    width: 100%;
  }

  nav#nav-principale.aperto {
    display: flex;
  }

  .slide {
    padding: 0 3%;
  }

  .freccia {
    font-size: 1.8rem;
    padding: 0.4rem 0.6rem;
  }

  .didascalia {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .puntino {
    width: 8px;
    height: 8px;
  }

  .home-galleria .slideshow {
    height: 50vh;
    min-height: 280px;
  }

  .slideshow {
    height: 60vh;
    min-height: 320px;
  }
}