@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&family=Roboto:wght@300;400;500;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
    --colore-sfondo: #d5b59c;
    --colore-primario: #7B1113;
    --colore-secondario: #954535;
    --colore-link: #eca090;
    --colore-accento: #943d3f;
    --colore-scuro: #5c4033;
    --colore-testo: #2c2c2c;
    --colore-testo-light: #555555;
    --colore-border: #e0d5c7;
}

body {
  font-family: "Roboto", sans-serif;
  background: #d5b59c;
  color: #1b1b1b;
  line-height: 1.6;
}

/* HEADER CON SFONDO FISSO */
.image-header {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(
      180deg,
      rgba(123, 17, 19, 0.6),
      rgba(30, 0, 20, 0.8)
    ),
    url("../assets/biografia.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
}

.image-header h1 {
  font-family: "Poppins", sans-serif;
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* NAV */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 25px;
  gap: 12px;
  width: 70%;
  max-width: 1000px;
  margin: 40px auto;
  border-radius: 17px;
}

nav a {
  color: white;
  position: relative;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  transition: background 0.3s;
}

/*nav a:hover {
  background: rgba(255, 255, 255, 0.25);
}*/

nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: red;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* TIMELINE WRAPPER */
.timeline__cover {
  width: 90%;
  max-width: 1000px;
  margin: 60px auto;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 40px 20px;
}

.timeline__title h2 {
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

/* TIMELINE LINEA */
.timeline {
  position: relative;
  padding-top: 30px;
  padding-bottom: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #7b1113;
  transform: translateX(-50%);
  z-index: 0;
}

.timeline ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* TIMELINE ELEMENTI */
/* TIMELINE ELEMENTI */
.timeline ul li {
  position: relative;
  width: 50%;
  margin-bottom: 60px;
  min-height: 220px;
  display: flex;
  align-items: center;
}

/* Alternanza */
.timeline ul li:nth-child(odd) {
  left: 0;
  flex-direction: row-reverse; /* testo a destra */
  text-align: right;
}

.timeline ul li:nth-child(even) {
  left: 50%;
  flex-direction: row; /* testo a sinistra */
  text-align: left;
}
/* Distacco dei box dalla linea centrale */
.timeline ul li:nth-child(odd) .content {
  margin-right: 60px; /* spinge via i box a destra */
}

.timeline ul li:nth-child(even) .content {
  margin-left: 60px; /* spinge via i box a sinistra */
}

/* LINEA CENTRALE */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #7b1113;
  transform: translateX(-50%);
  z-index: 0;
}

/* CONTENUTO */
.content {
  background: #240b15;
  color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  width: 80%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* BADGE */
.badge,
.badgeleft {
  background: #d5b59c;
  color: rgb(0, 0, 0);
  border: none;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease;
  align-self: flex-start;
}

.badge:hover,
.badgeleft:hover {
  background: #97806e;
}

/* Posizionamento alternato */
.timeline ul li:nth-child(odd) .badgeleft {
  align-self: flex-start; /* a sinistra quando testo a destra */
}

.timeline ul li:nth-child(odd) .badge {
  align-self: flex-end; /* a destra se serve */
}

.timeline ul li:nth-child(even) .badge {
  align-self: flex-end; /* a destra quando testo a sinistra */
}

.timeline ul li:nth-child(even) .badgeleft {
  align-self: flex-start; /* a sinistra se serve */
}
@media (max-width: 900px) {
  .timeline ul li {
    width: 100%;
    left: 0 !important;
    flex-direction: column;
    text-align: left !important;
    align-items: flex-start;
    margin-bottom: 50px;
  }

  /* linea più a sinistra */
  .timeline::before {
    left: 25px;
    transform: none;
  }

  /* spostamento del contenuto */
  .content {
    width: calc(100% - 60px);
    margin-left: 60px; /* distanza regolare dalla linea */
  }

  /* rimuove margini desktop */
  .timeline ul li:nth-child(odd) .content,
  .timeline ul li:nth-child(even) .content {
    margin: 0;
    margin-left: 60px;
  }

  /* i badge sempre a sinistra */
  .badge,
  .badgeleft {
    align-self: flex-start !important;
  }
}

/* MAIN */
main {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

/* SEZIONI */
section {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===============================
   FOOTER
   =============================== */
.footer {
  background: var(--colore-primario);
  color: #ffffff;
  padding: 60px 40px 30px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.footer-center {
  display: block;
  text-align: center;
}

.footer-left,
.footer-right {
  display: flex;
  justify-content: center;
}

.logo-link {
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-link:hover {
  transform: scale(1.1) translateY(-5px);
}

.footer-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: all 0.3s ease;
}

.footer-logo:hover {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.footer-link {
  color: var(--colore-link);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.footer-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--colore-link);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }

  .timeline ul li {
    width: 100%;
    left: 0 !important;
    flex-direction: column;
    text-align: left !important;
    align-items: flex-start;
  }

  .timeline::before {
    left: 15px;
    transform: none;
  }

  .content {
    margin-left: 30px;
    margin-top: 20px;
    width: auto;
  }
}

@media (max-width: 1024) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 30px;
  }

  .footer-section {
    flex: 1 1 100%;
    width: 100%;
    min-width: unset;
  }

  .footer-left,
  .footer-right {
    justify-content: center;
  }

  .footer-center {
    order: 2;
    max-width: 400px;
  }

  .footer-left {
    order: 1;
  }

  .footer-right {
    order: 3;
  }

  .footer-logo {
    width: 90px;
    height: 90px;
  }
}

@media (max-width: 1024) {
  .footer-container {
    flex-direction: column;
    gap: 30px;
    padding-bottom: 30px;
  }

  .footer-section {
    min-width: 100%;
  }

  .footer-center {
    order: 2;
  }

  .footer-left {
    order: 1;
  }

  .footer-right {
    order: 3;
  }
}
