/* ========================
    SEZIONI
=========================== */

/* --- INTRO ---*/
section.intro {
  position: relative;
  background: url('img/sfondo.jpg') center/cover no-repeat;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 2rem;
  min-height: 60vh;
  overflow: hidden;
  gap: 2rem;
}


section.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 32, 91, 0.5); /* blu semitrasparente */
  z-index: 0;
}

section.intro > p, section.intro > h4 {
  position: relative;
  z-index: 1;
  max-width: 800px;
  line-height: 1.8;
  margin: 0 auto;
}

section.intro > a.button-contact {
  text-decoration: none;
  background-color: white;
  color: var(--primary);
  z-index: 1;
  border: 5px solid var(--gold);
  border-radius: 10px;
  padding: 0.5rem;

  font-weight: bold;
}

/**/
/* --- CONTENT-1 (Immagine + testo) ---*/
section.content-1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  gap: var(--flex-gap);
  background-color: var(--sfondo-section);
  color: var(--text);
  padding: clamp(0.5rem, 6vh, 1rem) 1rem;
}

section.content-1 h2 {
  text-align: center;
  color: var(--primary);
}

.content-1-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1200px;
}

.content-1-wrapper .testo {
  display: flex;
  flex-direction: column;
  gap: var(--flex-gap);
  flex: 1 1 400px;
  color: var(--text);
  line-height: 1.6;
  text-align: justify;
  padding-bottom: 0;
}

.content-1-wrapper .immagine img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- CONTENT-2 (Table) ---*/

/* --- Sezione --- */
section.content-2 {
  background-color: var(--sfondo-section);
  padding: clamp(0.5rem, 6vh, 1rem) clamp(0, 6vh, 2rem);
  text-align: center;
}

section.content-2 h2 {
  color: var(--gold);
  margin-bottom: var(--flex-gap);
}

/* --- Table wrapper --- */
h3 {
  margin-bottom: var(--flex-gap);
}
.table-wrapper {
  overflow-x: auto;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  background-color: #fff;
  border-radius: 8px;
}

/* --- Table --- */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  line-height: 1.6;
  color: var(--text);
}

.modern-table tr {
  border-bottom: 1px solid lightgrey;
}

.modern-table thead {
  color: var(--primary);
  border-bottom: 2px solid lightgray;
}

.modern-table th,
.modern-table td {
  padding: 1rem 1.5rem;
  text-align: left;
}

.modern-table th {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modern-table tbody tr td:first-child {
  font-weight: bold;
}

/* --- Responsive padding / font size --- */
@media (max-width: 768px) {
  .content-2 {
    padding-right: 0;
    padding-left: 0;
  }

  .modern-table {
    width: 100%;
  }

  .modern-table th,
  .modern-table td {
    padding: 0.8rem 1rem;
  }
}

/* --- Mobile: tutto incolonnato --- */
@media (max-width: 600px) {  

  .content-2, .table-wrapper, .modern-table {
    padding-right: 0;
    padding-left: 0;
  }

  .modern-table,
  .modern-table tbody,
  .modern-table tr,
  .modern-table td,
  .modern-table th {
    display: block; /* tutto diventa verticale */
    width: 100%;
  }

  .modern-table thead {
    display: none; /* nasconde intestazione */
  }

  .modern-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
  }

  .modern-table td:last-child {
    border-bottom: 0;
  }
  .content-2 .modern-table td:last-child::before {
    content: "✅ Lösung: ";
  }
}

/* CONTENT-3 Slider*/
/* --- Sezione recensioni --- */

.reviews {
  background: var(--gradiente);
  padding: clamp(0rem, 3vh, 1rem) 0;
  text-align: center;
}
.review {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--flex-gap);
}
.reviews h2, .reviews h3 {
  color: #fff;
}

.slider {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: clamp(0rem, 3vw, 1rem);
}

.review-viewport {
  overflow: hidden;
  flex: 1 1 auto;
  border-radius: 12px;
}

.review-container {
  display: flex;
  scroll-snap-type: x mandatory;
}

.review {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.review p {
  margin: 0 0 1rem;
  color: #fff;
  font-style: italic;
  line-height: 1.6;
}
.review h3 {
  margin: 0;
  color: white;
  font-weight: 600;
}

.arrow {
  background: none;
  border: none;
  color: white;
  font-size: 1.9rem;
  cursor: pointer;
  padding: clamp(0rem, 3vw, 0.4rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, color .18s ease;
}

.arrow:hover {
  transform: scale(1.14);
  color: var(--accent);
}

.arrow:active {
  transform: scale(0.98);
}

.arrow, .arrow * {
  user-select: none;
}

/* PALLINI DI NAVIGAZIONE */
.dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(218, 228, 247, 0.25);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.dot.active {
  background-color: var(--gold);
  transform: scale(1.2);
}

.dot:hover {
  background-color: var(--light-bg);
}

/*==========================
  CONTENT - 3 COLONNE
===========================*/

.contenuto-colonne-grid.colonne-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto auto; /* 4 righe comuni */
  gap: 2rem;
  align-items: start;
  justify-items: start;
}

/* Ogni colonna usa la griglia genitore */
.colonne-3 .colonna {
  display: grid;
  grid-template-rows: subgrid; /* eredita le righe */
  grid-row: span 4;            /* copre tutte le righe */
  gap: 0.5rem;
}

/* Fallback automatico per browser che non supportano subgrid */
@supports not (grid-template-rows: subgrid) {
  .colonne-3 .colonna {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Icona */
.content-4 .colonna > .icon {
  justify-self: center;
  width: 80px;
  height: 80px;
}

.content-4 .colonna > .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Titolo */
.content-4 .colonna > .titolo {
  color: var(--primary);
  line-height: 1.3;
  margin: 0;
  text-align: left;
}

/* Testo */
.content-4 .colonna > .testo {
  color: #444;
  line-height: 1.6;
  text-align: justify;
  margin: 0;
}

/* Lista */
.content-4 .colonna > ul.list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 768px) {
  .contenuto-colonne-grid.colonne-3 {
    grid-template-columns: 1fr;
    grid-template-rows: none; /* non servono più righe comuni */
    justify-items: center;
    gap: 2rem;
  }

  .colonne-3 .colonna {
    grid-template-rows: none;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
  }

  .colonne-3 .colonna .icon {
    margin-bottom: 1rem;
  }

  .colonne-3 .colonna ul.list {
    text-align: left;
  }
}




/* ========================
   ABOUT US
=========================== */
.content-aboutus {
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: var(--flex-gap);
}
.content-aboutus h2 {
  color: var(--gold);
}
.content-aboutus h3 {
  text-align: left;
}
.content-aboutus h4 {
  text-align: left;
}
.content-aboutus p {
  text-align: justify;
}

.content-aboutus .testo-centrato {
  font-weight: bold;
  text-align: center;
}

/* ========================
   TEAM / COLONNE-2
=========================== */
.contenuto-colonne-grid.colonne-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  grid-template-rows: auto auto auto auto auto; /* 5 righe */
  gap: 2rem;
}

.colonne-2 .colonna {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 5; /* estende la colonna su tutte le righe */
  gap: 0.5rem;
}

/* Foto */
.colonne-2 .colonna .foto {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 280px;
  margin: 0 auto;
}

.colonne-2 .colonna .foto img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

/* Nome */
.colonne-2 .colonna .nome h3 {
  color: var(--primary);
  margin: 0;
}

/* Ruolo */
.colonne-2 .colonna .ruolo h4 {
  font-weight: normal;
  text-align: left;
  margin: 0;
}

/* Citazione */
.colonne-2 .colonna .quote p {
  font-style: italic;
  font-weight: bold;
  text-align: center;
  margin: 0
}

/* Testo */
.colonne-2 .colonna .testo p {
  text-align: justify;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .contenuto-colonne-grid.colonne-2 {
    grid-template-columns: 1fr;
  }
  .colonne-2 .colonna > * {
    margin:0;
  }
  .colonne-2 .colonna {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ========================
   COLLABORAZIONI
=========================== */
section.collaborazioni {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items:start;
  text-align: justify;
  gap: var(--flex-gap);
}

.collaborazioni ul.list {
  width: fit-content;       /* si adatta alla larghezza del contenuto */
  margin-left: clamp(3rem, 3vw, 10rem);           /* centra orizzontalmente */
  padding-left: 0;          /* rimuove margine sinistro extra */
  text-align: left;         /* mantiene il testo allineato a sinistra */
}

/* ========================
   CONTATTI
=========================== */
.contatti {
  padding: 1rem;
  display: flex;
  justify-content: start;
  align-items:start;
  flex-direction: column;
  color: var(--primary);

  text-align: left;
  background-color: var(--light-blue-bg);
}

.contatti-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: var(--flex-gap);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/*
.contatti-list li {
  position: relative;
  padding-left: 2.5rem; 
  text-align: left;
}

.contatti-list li.telefono::before,
.contatti-list li.email::before,
.contatti-list li.web::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.contatti-list li.telefono::before {
  background-image: url('icon/telephone.png');
}

.contatti-list li.email::before {
  background-image: url('icon/mail.png');
}

.contatti-list li.web::before {
  background-image: url('icon/world-wide-web.png');
}

.contatti-list a {
  color: var(--primary);
  text-decoration: none;
}

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

*/
.contatti .contatti-list li {
  display: flex;
  flex-direction: row;
  justify-content:start;
  
  max-width: 200px;
  gap: var(--flex-gap);;
}

.contatti .contatti-list img {
  max-width: 20px;
  height: 20px;
}

/*=======================
  FORM EMAIL STILIZZATO
=========================*/

section.contact-form {
  display: flex;
  justify-content: center;
  padding: var(--flex-gap) 1rem;
  background: #faf9f6; /* leggero sfondo neutro */
}

section.contact-form form {
  display: flex;
  flex-direction: column;
  gap: var(--flex-gap);
  width: 100%;
  max-width: 450px;
  background: white;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

section.contact-form h2 {
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.5px;
}

section.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

section.contact-form label {
  font-weight: 600;
  color: #444;
}

section.contact-form input,
section.contact-form textarea {
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
  background: #fff;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* Effetto focus */
section.contact-form input:focus,
section.contact-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(218,165,32,0.2); /* dorato semitrasparente */
}

/* Textarea: auto resize + no scroll */
section.contact-form textarea {
  resize: none;
  overflow: hidden;
  min-height: 100px;
}

/* Bottone */
section.contact-form button {
  align-self: center;
  background: var(--gradiente);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

section.contact-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

section.contact-form button:active {
  transform: translateY(0);
  box-shadow: none;
}

.success-message,
.error-message {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.4s ease;
  margin-bottom: 1rem;
}

.success-message {
  background-color: #e6ffed;
  color: #1b4332;
  border: 1px solid #95d5b2;
}

.error-message {
  background-color: #ffe6e6;
  color: #7a1c1c;
  border: 1px solid #e59595;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-message,
.error-message {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.success-message.hide,
.error-message.hide {
  opacity: 0;
  transform: translateY(-10px);
}
