/*
Theme Name: Tema Child Divi
Version: 1.0
Description: Tema child per personalizzare Divi.
Author: Elegant Themes
Author URI: https://elegantthemes.com/
Template: Divi
*/

/* Palette Mattiuzzo (grigio, accessibile WCAG AA)
   Grigio principale ... #6B7280  (testo bianco 4,8:1)
   Grigio scuro ........ #4B5158  (testo bianco 8:1)
   Fucsia .............. #e5157e  (solo decorativo sul grigio)
*/

/* ============================================================
   MATTIUZZO – Fascia NUMERI (Home) – CSS
   Incollare in: Divi → Opzioni del tema → Generale → CSS personalizzato
   ============================================================ */

.mtz-stats {
  --mtz-navy: #6B7280;
  --mtz-fuchsia: #e5157e;
  --mtz-line: rgba(255, 255, 255, .16);
  background: var(--mtz-navy);
  padding: 64px 20px;
  box-sizing: border-box;
}
.mtz-stats *,
.mtz-stats *::before,
.mtz-stats *::after { box-sizing: border-box; }

/* La griglia usa lo spazio di 1px come linea divisoria tra i numeri */
.mtz-stats__grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--mtz-line);
}

.mtz-stat {
  background: var(--mtz-navy);
  text-align: center;
  padding: 18px 16px 22px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Numero grande */
.mtz-stat__value {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap;
}
.mtz-stat__num {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(44px, 4.6vw, 64px);
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.01em;
}
.mtz-stat__unit {
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 600;
  color: #ffffff;
  margin-top: 6px;
}

/* Linea fucsia sotto il numero */
.mtz-stat__value::after { content: none; }
.mtz-stat__bar {
  display: block;
  width: 32px;
  height: 3px;
  background: var(--mtz-fuchsia);
  margin: 0 auto 14px;
  transition: width .4s ease;
}
.mtz-stat:hover .mtz-stat__bar { width: 64px; }

/* Etichetta */
.mtz-stat__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: #ffffff;
  margin: 0;
  padding: 0;
  max-width: 220px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .mtz-stats__grid { grid-template-columns: repeat(3, 1fr); }
  /* 3 + 2: l'ultimo numero occupa due colonne, così non resta un buco */
  .mtz-stat:last-child { grid-column: span 2; }
}
@media (max-width: 600px) {
  .mtz-stats { padding: 44px 16px; }
  .mtz-stats__grid { grid-template-columns: repeat(2, 1fr); }
  /* 2 + 2 + 1: l'ultimo numero va a tutta larghezza */
  .mtz-stat:last-child { grid-column: 1 / -1; }
  .mtz-stat { padding: 22px 10px 24px; }
  .mtz-stat__label { font-size: 12px; letter-spacing: .1em; }
}

@media (prefers-reduced-motion: reduce) {
  .mtz-stat__bar { transition: none; }
}


/* ============================================================
   MATTIUZZO – "La Nostra Evoluzione" – Timeline a forma di strada
   Incollare in: Divi → Opzioni del tema → Generale → CSS personalizzato
   ============================================================ */

.mtz-road {
  --mtz-navy: #6B7280;
  --mtz-navy-dark: #4B5158;
  --mtz-fuchsia: #e5157e;
  --mtz-amber: #f2b705;
  --mtz-asphalt: #1c1e22;
  --road-h: 88px;
  --pin: 28px;
  position: relative;
  overflow: hidden;
  padding: 6px 20px 110px;
  color: #ffffff;
  background:
    radial-gradient(1200px 500px at 85% 10%, rgba(229, 21, 126, .14), transparent 60%),
    radial-gradient(900px 500px at 10% 100%, rgba(242, 183, 5, .08), transparent 60%),
    linear-gradient(180deg, var(--mtz-navy-dark) 0%, var(--mtz-navy) 100%);
  box-sizing: border-box;
}
.mtz-road *,
.mtz-road *::before,
.mtz-road *::after { box-sizing: border-box; }

.mtz-road__inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* ---------- Intestazione ---------- */
.mtz-road__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
}
.mtz-road__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 14px;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--mtz-fuchsia);
}
.mtz-road__title {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.15;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 12px;
  padding: 0;
}
.mtz-road__sub {
  font-size: 19px;
  font-style: italic;
  color: #ffffff;
  margin: 0;
  padding: 0;
}

/* ---------- Tracciato ---------- */
.mtz-road__track {
  position: relative;
  padding-bottom: var(--road-h);
}

.mtz-road__stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}
.mtz-stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Scheda */
.mtz-stop__card {
  position: relative;
  flex: 1;
  width: 100%;
  background: #ffffff;
  color: #3a3f47;
  padding: 26px 24px 24px;
  border-top: 4px solid var(--mtz-fuchsia);
  box-shadow: 0 22px 44px rgba(17, 19, 23, .35);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1), filter .6s ease;
}
.mtz-stop__year {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  color: #6B7280;
  margin: 0 0 8px;
}
.mtz-stop__title {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--mtz-navy-dark);
  margin: 0 0 10px;
  padding: 0;
}
.mtz-stop__text {
  font-size: 18px;
  line-height: 1.6;
  color: #59606b;
  margin: 0;
  padding: 0;
}

/* Gambo tratteggiato tra scheda e punto (disegnato dalla scheda) */
.mtz-stop__card { margin-bottom: 46px; }
.mtz-stop__card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 46px;
  margin-left: -1px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .7) 0 6px, transparent 6px 12px);
}
.mtz-stop__stem { display: none !important; }
.mtz-road p:empty { display: none; }

/* Punto sulla strada */
.mtz-stop__pin {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pin) / -2);
  width: var(--pin);
  height: var(--pin);
  margin-left: calc(var(--pin) / -2);
  border-radius: 50%;
  background: var(--mtz-fuchsia);
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 6px rgba(229, 21, 126, .22);
  z-index: 3;
  transition: background .4s ease, box-shadow .4s ease, transform .4s ease;
}
.mtz-stop__pin::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--mtz-fuchsia);
  opacity: 0;
}

/* ---------- Asfalto ---------- */
.mtz-road__road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--road-h);
  z-index: 1;
}
/* Asfalto a tutta larghezza dello schermo */
.mtz-road__road::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 40%),
    var(--mtz-asphalt);
  border-top: 3px solid rgba(255, 255, 255, .75);
  border-bottom: 3px solid rgba(255, 255, 255, .75);
}
/* Mezzeria tratteggiata */
.mtz-road__road::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 100vw;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, var(--mtz-amber) 0 34px, transparent 34px 64px);
  opacity: .85;
}

/* Scia fucsia percorsa dal camion */
.mtz-road__trail {
  position: absolute;
  left: 0;
  top: -2px;
  height: 4px;
  width: var(--x, 0px);
  background: var(--mtz-fuchsia);
  box-shadow: 0 0 14px rgba(229, 21, 126, .9);
  z-index: 2;
}

/* Camion */
.mtz-road__truck {
  position: absolute;
  left: var(--x, 0px);
  bottom: 6px;
  width: 160px;
  height: 56px;
  transform: translateX(-50%);
  z-index: 3;
  will-change: left, top;
}
.mtz-road__truck svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.mtz-wheel {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(var(--spin, 0deg));
}
/* Fascio dei fari quando il camion si muove */
.mtz-road__truck::after {
  content: "";
  position: absolute;
  left: 96%;
  top: 34%;
  width: 110px;
  height: 40px;
  background: linear-gradient(90deg, rgba(255, 214, 107, .55), rgba(255, 214, 107, 0));
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.mtz-road__truck.is-moving::after { opacity: 1; }
.mtz-road__truck.is-moving svg { animation: mtz-bob .32s ease-in-out infinite; }

@keyframes mtz-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1.5px; }
}
@keyframes mtz-pulse {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Stati (solo con JavaScript attivo) ---------- */
.mtz-road.is-js .mtz-stop__card {
  opacity: .28;
  transform: translateY(18px);
  filter: saturate(.3);
}
.mtz-road.is-js .mtz-stop__stem { opacity: .25; }
.mtz-road.is-js .mtz-stop__pin {
  background: #9CA3AF;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .06);
}
.mtz-road.is-js .mtz-stop.is-active .mtz-stop__card {
  opacity: 1;
  transform: none;
  filter: none;
}
.mtz-road.is-js .mtz-stop.is-active .mtz-stop__stem { opacity: 1; }
.mtz-road.is-js .mtz-stop.is-active .mtz-stop__pin {
  background: var(--mtz-fuchsia);
  box-shadow: 0 0 0 6px rgba(229, 21, 126, .25);
  transform: scale(1.1);
}
.mtz-road.is-js .mtz-stop.is-current .mtz-stop__pin::after {
  animation: mtz-pulse 1.6s ease-out infinite;
}

/* ---------- Contenitore scorrevole (sempre orizzontale) ---------- */
.mtz-road__scroller { position: relative; }

.mtz-road__hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ffffff;
  transition: opacity .4s ease;
}
.mtz-road__hint span {
  display: inline-block;
  color: var(--mtz-fuchsia);
  font-size: 20px;
  animation: mtz-nudge 1.2s ease-in-out infinite;
}
.mtz-road__hint.is-hidden { opacity: 0; }
@keyframes mtz-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* Schermi stretti: la strada resta orizzontale e si scorre col dito */
@media (max-width: 900px) {
  .mtz-road { padding: 70px 0 70px; }
  .mtz-road__head { margin-bottom: 40px; padding: 0 16px; }

  .mtz-road__scroller {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 0 24px;
    outline: none;
  }
  .mtz-road__scroller::-webkit-scrollbar { display: none; }

  .mtz-road__track {
    width: max-content;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: var(--road-h);
  }
  .mtz-road__stops {
    grid-template-columns: repeat(4, 290px);
    gap: 22px;
  }
  .mtz-stop__card { padding: 22px 20px 20px; }
  .mtz-stop__year { font-size: 40px; }

  /* L'asfalto copre tutto il tracciato scorrevole */
  .mtz-road__road::before,
  .mtz-road__road::after {
    left: 0;
    width: 100%;
    transform: none;
  }

  .mtz-road__hint { display: flex; }
}

@media (max-width: 480px) {
  .mtz-road { --road-h: 80px; }
  .mtz-road__stops { grid-template-columns: repeat(4, 260px); }
  .mtz-stop__text { font-size: 14.5px; }
  .mtz-road__truck { width: 136px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .mtz-stop__card,
  .mtz-stop__pin,
  .mtz-road__truck::after { transition: none; }
  .mtz-road__truck.is-moving svg,
  .mtz-road__hint span,
  .mtz-road.is-js .mtz-stop.is-current .mtz-stop__pin::after { animation: none; }
}

/* ---------- Interazione: passando sopra una tappa o un punto ---------- */
.mtz-stop__card { cursor: pointer; }
.mtz-stop__pin { cursor: pointer; }
.mtz-stop__pin::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
}
.mtz-road.is-js .mtz-stop:hover .mtz-stop__pin,
.mtz-road.is-js .mtz-stop:focus-within .mtz-stop__pin {
  background: var(--mtz-fuchsia);
  transform: scale(1.3);
  box-shadow: 0 0 0 8px rgba(229, 21, 126, .3);
}
.mtz-road.is-js .mtz-stop:hover .mtz-stop__card,
.mtz-road.is-js .mtz-stop:focus-within .mtz-stop__card {
  opacity: 1;
  transform: translateY(-6px);
  filter: none;
  box-shadow: 0 28px 54px rgba(17, 19, 23, .45);
}
.mtz-stop__card:focus-visible { outline: 3px solid var(--mtz-fuchsia); outline-offset: 3px; }


/* ============================================================
   MATTIUZZO – "Come lavoriamo – Il processo" – CSS
   Incollare in: Divi → Opzioni del tema → Generale → CSS personalizzato

   Classi da assegnare (Avanzate → ID e classi CSS → Classe CSS):
   - alla SEZIONE che contiene le due righe ...... mtz-steps
   - a OGNI modulo Hero (le 6 fasi) .............. mtz-step
   Nelle righe attivare: Design → Dimensionamento →
   "Rendi uguali le altezze delle colonne".
   Togliere dai titoli i numeri "1)", "2)"…: li mette il CSS.
   ============================================================ */

/* Numerazione automatica 01–06, nell'ordine delle colonne */
.mtz-steps { counter-reset: mtz-fase; }

/* La colonna fa riempire tutta l'altezza alla scheda */
.mtz-steps .et_pb_column {
  display: flex;
  flex-direction: column;
}
.mtz-steps .et_pb_column > .mtz-step { flex: 1; }

/* ---------- Scheda ---------- */
.mtz-step {
  counter-increment: mtz-fase;
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 240px;
  background: #6B7280 !important;
  padding: 72px 32px 36px !important;
  border-top: 4px solid #e5157e;
  transition: transform .35s ease, box-shadow .35s ease, background .35s ease;
}
.mtz-step:hover {
  transform: translateY(-6px);
  background: #4B5158 !important;
  box-shadow: 0 22px 44px rgba(55, 60, 68, .35);
}

/* Etichetta "FASE 01" in alto */
.mtz-step::before {
  content: "Fase " counter(mtz-fase, decimal-leading-zero);
  position: absolute;
  top: 30px;
  left: 32px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1;
}

/* Numero grande "in filigrana" in basso a destra */
.mtz-step::after {
  content: counter(mtz-fase, decimal-leading-zero);
  position: absolute;
  right: 18px;
  bottom: -26px;
  z-index: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 150px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, .06);
  transition: color .35s ease, transform .35s ease;
  pointer-events: none;
}
.mtz-step:hover::after {
  color: rgba(229, 21, 126, .18);
  transform: translateY(-8px);
}

/* Contenuto sopra la filigrana, allineato a sinistra */
.mtz-step > *,
.mtz-step .et_pb_fullwidth_header_container,
.mtz-step .header-content-container,
.mtz-step .header-content,
.mtz-step .et_pb_header_content_wrapper {
  position: relative;
  z-index: 1;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  background: transparent !important;
}

/* Titolo */
.mtz-step h1,
.mtz-step h2,
.mtz-step h3,
.mtz-step h4,
.mtz-step .et_pb_module_header {
  color: #ffffff !important;
  font-size: 26px !important;
  line-height: 1.25 !important;
  font-weight: 500 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Linea fucsia sotto il titolo, si allunga al passaggio del mouse */
.mtz-step h1::after,
.mtz-step h2::after,
.mtz-step h3::after,
.mtz-step h4::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  margin-top: 14px;
  background: #e5157e;
  transition: width .35s ease;
}
.mtz-step:hover h1::after,
.mtz-step:hover h2::after,
.mtz-step:hover h3::after,
.mtz-step:hover h4::after { width: 72px; }

/* Testo */
.mtz-step p,
.mtz-step .et_pb_header_content_wrapper {
  color: #ffffff !important;
  font-size: 18px !important;
  line-height: 1.65 !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Nasconde pulsanti e sottotitoli lasciati vuoti */
.mtz-step .et_pb_button_wrapper:empty,
.mtz-step .et_pb_fullwidth_header_subhead:empty,
.mtz-step p:empty { display: none !important; }

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
  .mtz-step {
    min-height: 0;
    padding: 64px 28px 32px !important;
  }
  .mtz-step::before { left: 28px; }
  .mtz-step::after { font-size: 120px; }
  .mtz-steps .et_pb_column { margin-bottom: 24px !important; }
}

/* ---------- Smartphone ---------- */
@media (max-width: 767px) {
  .mtz-step { padding: 60px 22px 28px !important; }
  .mtz-step::before { top: 26px; left: 22px; }
  .mtz-steps .et_pb_column { margin-bottom: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mtz-step,
  .mtz-step::after,
  .mtz-step h1::after,
  .mtz-step h2::after,
  .mtz-step h3::after,
  .mtz-step h4::after { transition: none; }
}