/* ===================================================
   TIMELINE CARRIERA - STUDIO ALBINI
   Layout responsive per Desktop, Tablet e Smartphone
=================================================== */

/* LINK NEI TITOLI */
.timeline-title-link {
  color: inherit;
  text-decoration: underline;
  transition: color 0.2s;
}
.timeline-title-link:hover {
  color: #1a73e8;
  text-decoration: underline;
}

/* RESET E STILE IMMAGINI DELLA TIMELINE (Rimuove il box bianco/ombra dal contenitore) */
.timeline-column .timeline-image,
div.timeline-image {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  width: auto !important;
  height: auto !important;
}

.timeline-image a {
  display: inline-block;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 12px;
  text-decoration: none;
}

.timeline-image a:focus {
  outline: none;
  box-shadow: none !important;
}

.timeline-image img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-image a:hover img {
  transform: scale(1.03);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

/* ===================================================
   RESET PALLINO SECONDO (Ghost Dot da style.css)
=================================================== */
/* Disattiva tassativamente il pallino ::before ereditato da style.css
   che causava il secondo punto sfasato/fuori riga */
.timeline-item::before,
.timeline-column .timeline-item::before {
  content: none !important;
  display: none !important;
}

/* ===================================================
   LAYOUT DESKTOP
=================================================== */

/* WRAPPER GENERALE - Allinea entrambe le colonne in alto indipendentemente dal numero di contenuti */
#timeline-wrapper {
  display: flex !important;
  justify-content: space-between;
  align-items: flex-start !important;
  max-width: 1280px;
  margin: 20px auto 80px;
  gap: 80px;
  width: 100%;
  box-sizing: border-box;
}

/* SEZIONI DELLE DUE COLONNE */
.timeline-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* TITOLI SEZIONE DESKTOP - Altezza fissa identica per far partire le timeline esattamente alla stessa quota */
.timeline-section-title {
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 50px 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  letter-spacing: -0.5px;
  box-sizing: border-box;
}

/* COLONNE */
.timeline-column {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* LINEA DINAMICA VERTICALE */
.timeline-column::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: #222;
  top: var(--line-top, 0px);
  height: var(--line-height, 0px);
  border-radius: 2px;
}

/* ITEM PROGETTO */
.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 110px;
  width: 100%;
  box-sizing: border-box;
}

.timeline-item:last-child {
  margin-bottom: 30px;
}

/* UNICO PALLINO NERO AUTORIZZATO */
.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #000;
  border-radius: 50%;
  z-index: 3;
  border: 2px solid #fff;
  box-sizing: content-box;
}

/* I DUE LATI DEL PROGETTO (DESKTOP): 50% CIASCUNO */
.timeline-item > .timeline-text,
.timeline-item > .timeline-image {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  box-sizing: border-box;
}

/* Elementi a sinistra della linea: distanziati con ampio respiro */
.timeline-item.left > .timeline-text,
.timeline-item.right > .timeline-image {
  padding-right: 55px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

/* Elementi a destra della linea: distanziati con ampio respiro */
.timeline-item.left > .timeline-image,
.timeline-item.right > .timeline-text {
  padding-left: 55px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.timeline-text h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.date {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #333;
}

.desc {
  font-style: italic;
  font-size: 0.92rem;
  color: #666;
  line-height: 1.45;
}

/* IMMAGINI DESKTOP */
.timeline-image {
  display: flex;
  align-items: center;
}

/* ===================================================
   RESPONSIVE DESIGN (TABLET & SMARTPHONE)
=================================================== */
@media (max-width: 900px) {
  .carriera-main {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  #timeline-wrapper {
    flex-direction: column !important;
    gap: 70px;
    margin: 10px auto 60px;
  }

  .timeline-section-title {
    text-align: center;
    font-size: 1.6rem;
    padding: 0;
    margin: 0 0 35px 0;
    height: auto;
  }

  /* La linea verticale si sposta a sinistra */
  .timeline-column::before {
    left: 20px;
    transform: translateX(-50%);
  }

  /* Layout a colonna singola per ogni progetto */
  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 48px;
    margin-bottom: 55px;
  }

  /* Il pallino si allinea perfettamente all'inizio del titolo del progetto e sulla linea */
  .timeline-dot {
    left: 20px;
    top: 6px;
    transform: translate(-50%, 0);
  }

  /* Reset delle due metà 50% su mobile */
  .timeline-item > .timeline-text,
  .timeline-item > .timeline-image,
  .timeline-item.left > .timeline-text,
  .timeline-item.right > .timeline-image,
  .timeline-item.left > .timeline-image,
  .timeline-item.right > .timeline-text {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  /* Su mobile il testo viene sempre prima dell'immagine */
  .timeline-text {
    order: 1;
    width: 100%;
  }

  .left-text,
  .right-text {
    text-align: left;
    margin: 0;
  }

  .timeline-text h3 {
    font-size: 1.15rem;
    margin-bottom: 5px;
  }

  .date {
    font-size: 0.88rem;
    margin-bottom: 8px;
  }

  .desc {
    font-size: 0.9rem;
  }

  /* L'immagine viene sempre dopo il testo ed è fluida e proporzionata */
  .timeline-image {
    order: 2;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-top: 14px;
    justify-content: flex-start;
  }

  .timeline-image a {
    width: 100%;
    display: block;
  }

  .timeline-image img {
    width: 100%;
    max-width: 100%;
    height: 190px;
    object-fit: cover;
  }
}

/* Smartphone piccoli (sotto i 480px) */
@media (max-width: 480px) {
  .carriera-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #timeline-wrapper {
    gap: 55px;
  }

  .timeline-section-title {
    text-align: center;
    font-size: 1.4rem;
    padding: 0;
    margin-bottom: 25px;
  }

  .timeline-column::before {
    left: 16px;
  }

  .timeline-dot {
    left: 16px;
    top: 5px;
    width: 12px;
    height: 12px;
  }

  .timeline-item {
    padding-left: 38px;
    margin-bottom: 45px;
  }

  .timeline-text h3 {
    font-size: 1.05rem;
  }

  .timeline-image {
    max-width: 100%;
  }

  .timeline-image img {
    height: 160px;
  }
}
