/* ================= MEDIA QUERY ================= */

/* === Layout impianti per dispositivi ≤ 1024px === */
@media (max-width: 1024px) {
  .impianti-section {
    height: auto;
    min-height: 100vh;
  }
  .impianti-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    grid-template-areas:
      "carbonia-img"
      "carbonia-info"
      "santantioco-img"
      "santantioco-info";
    row-gap: 1rem;
    height: auto; /* ← fondamentale */
  }

  .impianto-img {
    background-size: cover; /* o 'cover' se preferisci riempire */
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 16 / 9; /* garantisce proporzione responsive */
    height: auto;
  }

  .impianto-img,
  .impianto-info {
    height: auto; /* consente flessibilità in verticale */
    min-height: unset;
  }
}

@media (max-width: 633px) {
  .hero-overlay {
    top: 2rem;
    right: 1rem;
    max-width: 100%;
    width: 100%;
    padding: 1rem;
    text-align: right;
    box-sizing: border-box;
  }

  .hero-text {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-text h2 {
    font-size: clamp(1rem, 5vw, 2rem);
    line-height: 1.2;
  }

  .hero-text p {
    font-size: clamp(0.6rem, 3.6vw, 1.2rem);
    line-height: 1.3;
  }
}

@media (max-width: 500px) {
  .logo img {
    width: clamp(80px, 35vw, 120px); /* dinamico tra 80 e 120px */
    height: auto;
  }
  .language-selector {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .language-options li {
    font-size: 0.75rem;
  }

  .language-selector svg {
    width: 18px;
    height: 18px;
  }

  .impianto-info h3 {
    font-size: clamp(0.9rem, 4vw, 1.25rem);
  }
  .emergency-contact {
    font-size: clamp(0.8rem, 3.5vw, 1rem);
  }
}

/* Layout orizzontale sopra i 600px */
@media screen and (min-width: 600px) {
  .footer-left,
  .footer-center,
  .footer-right {
    flex: 1;
    margin: 0;
    text-align: center;
  }

  .footer-left {
    text-align: left;
  }

  .footer-right {
    text-align: right;
  }
}

/* Elementi del footer */
@media (max-width: 720px) {
  .site-footer,
  .footer-left a,
  .footer-right a,
  .footer-center p {
    font-size: calc(1.2vw + 0.3rem);
  }
}

@media (max-width: 618px) {
  .footer-company-name {
    display: block;
  }
}
