/* ================ RESET BASE ================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================ HTML | BODY ================ */
html,
body {
  /* max-width: 100%; */
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  font-family: "Montserrat", sans-serif;
}

/* ================== HEADER ================== */
header {
  position: sticky;
  top: 0;
  background-color: #fff;
  height: 64px;
  padding: 0 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.header-container {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Hamburger Menu */
.hamburger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.hamburger svg {
  width: 28px;
  height: 28px;
  stroke: #333;
  transition: opacity 0.2s ease;
}

.dropdown {
  position: absolute;
  top: 64px;
  left: 0;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.dropdown a {
  text-decoration: none;
  color: #333;
}

.dropdown a:hover {
  text-decoration: underline;
  font-weight: 700;
}

/* Logo */
.logo img {
  height: 40px;
  object-fit: contain;
}

/* Language Selector */
.language-selector {
  position: relative;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  padding: 5px 12px;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  min-width: 70px;
  width: 70px;
  justify-content: space-between;
}

.language-selector.open {
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
}

.language-selector span {
  margin-right: 8px;
}

.language-selector svg {
  transition: transform 0.3s ease;
}

.language-selector.open svg {
  transform: rotate(180deg);
}

.language-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white; /* Sfondo come .dropdown */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Ombra */
  padding: 1rem; /* Spaziatura interna */
  border-radius: 8px; /* Angoli arrotondati */
  list-style: none; /* Niente puntini */
  margin: 0;
  z-index: 1000;
  width: max-content;
  min-width: 100%; /* Mantiene larghezza coerente col selettore */
}

.language-options li {
  font-weight: normal;
  padding: 0.5rem 1rem;
  color: #333;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.language-options li:hover {
  text-decoration: underline;
  font-weight: 700;
}

.language-selector.open .language-options {
  display: block;
}
/* ============================================ */

/* =================== MAIN =================== */
main {
  padding: 0;
  background: #ffffff;
  min-height: 200vh;
}
/* ============================================ */

/* ================= SECTION ================== */
section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0;
  background-color: #f9f9f9;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section:nth-child(even) {
  background-color: #ffffff;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* sezioni a schermo intero */
.full-section {
  height: calc(100vh - 64px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Section spacer */
.section-spacer {
  margin: 0;
  padding: 0;
  border: none;
  height: 64px;
  background-color: white;
}

/* ----------------- Section Home ----------------- */
/* immagine di sfondo con overlay */
.hero-section {
  background-image: url("../img/home-bg.jpg");
  background-size: cover;
  background-position: center;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.hero-overlay h2 {
  font-size: clamp(1.1rem, 4.8vw, 2.24rem);
}

.hero-overlay p {
  font-size: clamp(0.75rem, 3.2vw, 1rem);
}

/* home section */
#home {
  height: calc(100vh - 64px);
  /*overflow: hidden;*/
  background-image: url("../img/homeDesktop.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  margin: 0;
  padding: 0;
  position: relative;
  border: none;
}

/* Posizionamento testo in alto a destra */
.hero-overlay {
  background: none;
  padding: 1rem 2rem;
  position: absolute;
  top: 4rem;
  right: 2rem;
  text-align: right;
  max-width: 95vw;
  white-space: normal;
}

/* Stile titoli su sfondo */
.hero-overlay h2,
.hero-overlay p {
  color: #001c48;
  margin: 0;
  text-shadow: none;
}

.hero-overlay h2 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.hero-overlay p {
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 600;
}
/* ------------------------------------------------ */

/* --------------- Section Impianti---------------- */

/* altezza fissa ai 4 riquadri (50% sezione - spacer) */
.impianti-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 64px); /* togliamo lo spacer */
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.impianti-grid {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "carbonia-img carbonia-info"
    "santantioco-info santantioco-img";
  gap: 0;
}

/* Assegna le aree ai figli in ordine */
.impianti-grid > :nth-child(1) {
  grid-area: carbonia-img;
}
.impianti-grid > :nth-child(2) {
  grid-area: carbonia-info;
}
.impianti-grid > :nth-child(3) {
  grid-area: santantioco-info;
}
.impianti-grid > :nth-child(4) {
  grid-area: santantioco-img;
}

/* Ogni riquadro (img + info) prende metà altezza */

.impianto-info {
  background-color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #003366;
  font-weight: 300;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Font responsive */
.impianto-info h3 {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.impianto-info ul li {
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.uso-link {
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
}

.impianto-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.carbonia-bg {
  background-image: url("../img/Carbonia.jpeg");
}

.santantioco-bg {
  background-image: url("../img/SantAntioco.jpg");
}

.impianto-info h3 {
  /* margin-bottom: 0.5rem; */
  font-size: 1.5rem;
}

.impianto-info a {
  margin-top: 0.5rem;
  color: #003366;
  text-decoration: none;
}

.impianto-info a:hover {
  text-decoration: underline;
}

.impianto-info a:focus {
  outline: 2px solid #004080;
}

.impianto-info ul li {
  margin-bottom: 0.5rem;
}

.impianto-info h3,
.impianto-info ul,
.impianto-info li {
  margin: 0;
  padding: 0;
}

/* Icona Google Maps */
.impianto-info {
  position: relative; /* per contenere la posizione assoluta dell'icona */
  padding-top: 2.5rem; /* aggiunge spazio per l’icona in alto */
  text-align: left;
}

/* Icona Google Maps accanto al titolo */
.maps-icon-link-inline {
  margin-left: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}
/* Impianti: allinea titolo e icona Google Maps*/
.info-header {
  display: flex;
  align-items: center;
  gap: 8px; /* distanza tra testo e icona * */
  margin-bottom: 1rem;
}

.info-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

.info-header .maps-icon-link-inline {
  margin-left: 1rem;
}

/* Effetto hover sull'icona Google Maps */
.maps-icon-inline {
  width: 25px;
  height: 25px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.maps-icon-link-inline:hover .maps-icon-inline {
  transform: scale(1.5);
  filter: brightness(1.2);
}

/* Link "Indicazioni d'uso" nei box impianti */
.uso-link {
  display: inline-block;
  align-self: flex-end;
  text-align: right;
  font-size: 0.9rem;
  color: #004080;
  text-decoration: none;
  font-weight: bold;
  margin-top: 1rem;
}

.uso-link:hover {
  text-decoration: underline;
}

/* Logo pagina istruzioni */
.istruzioni-logo {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.istruzioni-logo img {
  max-width: 180px;
  height: auto;
}

/* Modal istruzioni */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.8);
  overflow-y: auto;
}

/* Modale a schermo intero */
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  padding: 2rem;
  border-radius: 0;
  position: relative;
  font-family: Montserrat, sans-serif;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-content h2 {
  text-align: center;
}

/* Ingrandisce il bottone di chiusura */
.modal-close {
  font-size: 2rem;
  top: 0.75rem;
  right: 0.75rem;
}

/* Pulsante chiusura sempre visibile */
.modal-close {
  position: fixed; /* Da absolute → fixed */
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 10000; /* Assicura che sia sopra tutto */
}

.modal-close:hover {
  transform: scale(1.4);
  color: #000;
}

.istruzioni-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.istruzioni-logo img {
  width: 150px;
}

.istruzioni-testo h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.istruzioni-testo h3 {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  color: #003366;
}

.istruzioni-testo ol,
.istruzioni-testo ul {
  padding-left: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.istruzioni-testo p {
  line-height: 1.5;
}
/* ------------------------------------------------ */

/* --------------- Section Contatti --------------- */
.scroll-anchor-contatti {
  position: relative;
  top: 0; /* stessa altezza dell'header */
  height: 0;
  visibility: hidden;
}

.contatti-section {
  background-color: #ffffff;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 64px);
  box-sizing: border-box;
  overflow-y: auto;
  scroll-margin-top: 64px;
}

.contatti-container {
  width: 100%;
  max-width: 600px;
  text-align: left;
  font-family: "Montserrat", sans-serif;
}

.contatti-container h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.emergency {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.contact-form label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.contact-form button {
  margin-top: 1.5rem;
  background-color: #0a0a23;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.contact-form button:hover {
  background-color: #333;
}

/* CONTATTI: Emergency Icon */
.emergency-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
  margin-bottom: 1rem;
}

.emergency-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5));
}

.emergency-phone {
  color: #003366;
  text-decoration: none;
  font-weight: bold;
}

.emergency-phone:hover {
  text-decoration: underline;
}

/* Popup conferma invio */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.popup-content p {
  margin-bottom: 1rem;
  color: #003366;
  font-weight: bold;
}

.popup-content button {
  background-color: #003366;
  color: white;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.popup.hidden {
  display: none;
}
/* ============================================ */

/* ================== FOOTER ================== */
.site-footer {
  background-color: #003366;
  color: white;
  padding: 0 1rem;
  font-size: 0.9rem;
  border-top: 1px solid #ddd;
  height: 64px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  height: 100%;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
}

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

.footer-center {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem; /* spazio tra testo e contatore */
}

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

.footer-container a {
  text-decoration: underline;
  color: inherit;
  transition: all 0.2s ease-in-out; /* Smooth animazione */
}

.footer-container a:hover {
  font-weight: bold;
  font-size: 1.05rem;
  text-decoration: none;
}

.web-counter {
  border: 0;
}

/* --------------- Modale Privacy --------------- */
#privacyModal .modal-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

#privacyModal .modal-logo img {
  max-width: 250px;
  height: auto;
}

#privacyModal .modal-content {
  position: relative; /* Necessario per posizionamento assoluto del bottone */
}

/* Titolo principale */
#privacyModal .modal-content h1 {
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Sottotitolo */
#privacyModal .modal-content h2 {
  margin-bottom: 1.5rem;
}

/* Spaziatura tra paragrafi, titoli e liste */
#privacyModal .modal-content p,
#privacyModal .modal-content ol,
#privacyModal .modal-content ul,
#privacyModal .modal-content h3,
#privacyModal .modal-content h4 {
  margin-bottom: 1.2rem;
}

/* Spazio finale prima di "M Wash" */
#privacyModal .modal-content p:last-of-type {
  margin-bottom: 2rem;
}

/* ---------- Elenchi puntati (ul) ---------- */
#privacyModal .modal-content ul {
  padding-left: 1.5rem;
  list-style-position: outside;
  font-weight: normal;
  list-style-type: disc;
}

/* ---------- Lista numerata principale (.par) ---------- */
#privacyModal .modal-content ol.par {
  list-style-position: outside;
  padding-left: 1.5rem;
  counter-reset: section;
}

#privacyModal .modal-content ol.par > li {
  font-weight: bold; /* Grassetto per il numero */
  margin-top: 1.5rem;
}

#privacyModal .modal-content ol.par > li h3 {
  font-weight: bold;
  display: block;
  margin-left: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Paragrafi interni alla lista .par (senza grassetto) */
#privacyModal .modal-content ol.par > li p {
  font-weight: normal;
  margin-left: 0.5rem; /* Allineamento ai titoli h3 */
  margin-bottom: 0;
}

/* ---------- Lista secondaria numerata 8.1, 8.2, ... ---------- */
#privacyModal .modal-content .subsection-list {
  counter-reset: subsection;
  list-style: none;
  padding-left: 1.5rem;
  margin-left: 0;
}

#privacyModal .modal-content .subsection-list > li {
  counter-increment: subsection;
  margin-bottom: 0.5rem;
  padding-left: 2.5rem;
  position: relative;
}
#privacyModal .modal-content .subsection-list > li p {
  padding-left: 0;
  margin-top: 0.5rem;
}

#privacyModal .modal-content .subsection-list > li::before {
  content: "8." counter(subsection) " ";
  position: absolute;
  left: 0;
  font-weight: bold;
  font-size: 1rem;
}

/* Titoli dei sottoparagrafi (es. 8.1, 8.2, ...) */
#privacyModal .modal-content .subsection-list h4 {
  font-size: 1rem;
  font-weight: bold;
  margin: 0.5rem;
}

/* Paragrafi dei sottoparagrafi */
#privacyModal .modal-content .subp {
  margin-left: 0;
  font-weight: normal;
}

/* ---------- Lettere a), b), c) ---------- */
#privacyModal .modal-content .ol-type-a {
  list-style-type: lower-alpha;
  padding-left: 1.5rem; /* Allineate con .subp e h4 */
  margin-top: 0.5rem;
  font-weight: normal;
}

#privacyModal .modal-content .ol-type-a li {
  margin-bottom: 0.5rem;
}

/* Pulsante di chiusura */
#privacyModal .close {
  position: sticky;
  top: 1rem;
  float: right;
  right: 1rem;
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

#privacyModal .close:hover {
  color: #000;
  transform: scale(1.2);
}

#datiSocietariModal .modal-content h2 {
  margin-bottom: 3rem;
  text-align: center;
}

#datiSocietariModal .dati-societari-text p {
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-size: 1rem;
}

#datiSocietariModal .modal-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

#datiSocietariModal .modal-logo img {
  max-width: 250px;
  height: auto;
}

#datiSocietariModal .modal-content {
  position: relative; /* Necessario per il posizionamento assoluto del pulsante */
}

#datiSocietariModal .close {
  position: absolute;
  top: 0.5rem; /* più in alto rispetto alle altre modali */
  right: 0.5rem; /* margine destro coerente */
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

#datiSocietariModal .close:hover {
  color: #000;
  transform: scale(1.2);
}

.faq-background-wrapper {
  position: relative;
  background-image: url("../img/bubbles.png"), url("../img/bubbles.png");
  background-repeat: repeat-y, repeat-y;
  background-position: left center, right center;
  background-size: 220px auto, 220px auto;
  background-color: #f7f7f7;
  padding-left: 100px;
  padding-right: 100px;
  z-index: 0;
  overflow: hidden;
}

/* .faq-background-wrapper::before {
  left: 0;
  background: linear-gradient(to right, transparent, #f7f7f7 100%);
}

.faq-background-wrapper::after {
  right: 0;
  background: linear-gradient(to left, transparent, #f7f7f7 100%);
} */

.scroll-anchor {
  position: relative;
  top: 0;
  height: 0;
  visibility: hidden;
}

.faq-background-wrapper {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.faq-category {
  font-size: 1.3rem;
  font-weight: 600;
  color: #003366;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid #003366;
  padding-left: 0.75rem;
}

.faq-section {
  background-color: #f7f7f7;
  padding: 3rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  font-family: "Montserrat", sans-serif;
}

.faq-title {
  text-align: center;
  font-size: 2rem;
  color: #003366;
  margin-bottom: 2rem;
}

.faq-item {
  border-bottom: 1px solid #ccc;
  padding: 1rem 0;
}

.faq-question {
  background: none;
  border: none;
  color: #003366;
  font-size: 1.1rem;
  font-weight: 300;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: #005499;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-answer.active {
  max-height: 500px; /* abbastanza per un paio di righe */
  margin-top: 0.5rem;
}
