@media (max-width: 768px) {
  .leone-history,
  .timeline {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  .timeline ul {
    padding: 30px 0 30px 0;
    position: relative;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
  .timeline ul li {
    width: 2px;
    margin: 0;
    left: 0 !important;
    padding-top: 50px;
    background: #e0e0e0;
    position: relative;
  }
  .timeline ul li div {
    width: 80vw !important;
    max-width: 80vw !important;
    left: 20px !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 1.2rem 1rem 1.2rem 2.2rem !important;
    box-sizing: border-box;
  }
  .timeline ul li:nth-child(even) div,
  .timeline ul li:nth-child(odd) div {
    left: 20px !important;
    right: auto !important;
    transform: none !important;
  }
  .timeline ul li div::before {
    left: -15px !important;
    right: auto !important;
    border-width: 8px 16px 8px 0 !important;
    border-color: transparent #fff transparent transparent !important;
  }
}
.primary_color{
    color: var(--blue-1)!important;
}

.content-wrapper-1{
  padding-top: 2.2rem !important;
  padding-right: 2.2rem !important;
  padding-left: 2.2rem !important;
}

.main-title{
    width: auto !important;
    margin-bottom: 20px !important;
}

.content-wrapper-1 .main-title {
    font-size: 2rem !important;
}

.sub-title{
    color: black!important;
}

.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-bg-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(6, 16, 42, 0.84) 0%, rgba(6, 16, 42, 0.62) 38%, rgba(6, 16, 42, 0.2) 68%, rgba(6, 16, 42, 0) 100%),
        linear-gradient(180deg, rgba(6, 16, 42, 0.12) 0%, rgba(6, 16, 42, 0.44) 100%);
    z-index: 1;
}

.hero-image {
    display: none; /* Hide old class if present on elements not removed */
}

/* Ensure hero content is above the hero media. */
.hero-overlay {
    z-index: 2; 
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

body .hero .hero-content h1 {
    color: #ffffff !important;
}

.story-page .section-title {
    width: 70vw;
    margin-bottom: 2rem;
}

.video-container{
    width: 70vw !important;
    margin: 0 auto;
}

.video-container video {
    width: 100%;
    height: 600px; /* Reduced height as requested */
    object-fit: cover;
}

.history-section-video {
    width: 100%;
    height: clamp(350px, 30vw, 430px);
    object-fit: contain;
    display: block;
    background: #000;
}




/* TIMELINE
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.timeline ul {
  padding: 50px 0;
}

.timeline ul li {
  list-style-type: none;
  position: relative;
  width: 2px; /* Thinner line */
  margin: 0 auto;
  padding-top: 50px;
  background: #e0e0e0; /* Subtle grey line */
  transition: background 0.45s ease-out; /* Slower transition */
  transition-delay: 0s; /* Added delay for the line itself */
}

.timeline ul li.in-view {
  background: var(--blue-1);
}

.timeline ul li::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue-1); 
  z-index: 1;
  transition: background 0.45s ease-out;
  transition-delay: 0s;
}

.timeline ul li:first-child::after {
  bottom: auto;
  top: 0;
}

.timeline ul li:first-child div {
  margin-top: -60px; /* Pull up to align with top dot, negating padding */
}

.timeline ul li:first-child div::before {
   top: 15px;
   bottom: auto;
}

.timeline ul li div {
  position: relative;
  bottom: 0;
  width: 400px;
  padding: 2rem;
  background: #fff;
  border-radius: 8px; /* Soft radius */
  box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Clean shadow */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.45s ease-out, transform 0.45s ease-out, visibility 0.45s;
  transition-delay: 0.08s;
}

/* Arrow pointer */
.timeline ul li div::before {
  content: "";
  position: absolute;
  bottom: 7px;
  width: 0;
  height: 0;
  border-style: solid;
}

.timeline ul li:nth-child(odd) div {
  left: 45px;
  transform: translate3d(200px, 0, 0);
}

.timeline ul li:nth-child(odd) div::before {
  left: -15px;
  border-width: 8px 16px 8px 0;
  border-color: transparent #fff transparent transparent;
}

.timeline ul li:nth-child(even) div {
  left: -439px;
  transform: translate3d(-200px, 0, 0);
}

.timeline ul li:nth-child(even) div::before {
  right: -15px;
  border-width: 8px 0 8px 16px;
  border-color: transparent transparent transparent #fff;
}

time {
  display: block;
  font-size: 1.5rem; /* Larger year */
  font-family: var(--font-primary);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--blue-1);
}

.timeline p, .timeline div {
  color: #555;
  line-height: 1.6;
}

.timeline ul li div p {
  margin: 0;
}

.timeline ul li div p + p {
  margin-top: 1rem;
}



/* EFFECTS
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.timeline ul li.in-view::after {
  background: var(--blue-1);
}

.timeline ul li.in-view div {
  transform: none;
  visibility: visible;
  opacity: 1;
}

/* Mobile timeline rules must come after the desktop alternating layout. */
@media (max-width: 768px) {
  .timeline {
    overflow-x: clip;
  }

  .timeline ul {
    padding: 30px 20px 30px 28px;
  }

  .timeline ul li,
  .timeline ul li:nth-child(odd),
  .timeline ul li:nth-child(even) {
    left: 0 !important;
    width: 2px;
    margin: 0;
  }

  .timeline ul li div,
  .timeline ul li:nth-child(odd) div,
  .timeline ul li:nth-child(even) div {
    left: 20px !important;
    right: auto !important;
    width: calc(100vw - 70px) !important;
    max-width: calc(100vw - 70px) !important;
    padding: 1.2rem 1rem !important;
    box-sizing: border-box;
    transform: none;
  }

  .timeline ul li div::before,
  .timeline ul li:nth-child(odd) div::before,
  .timeline ul li:nth-child(even) div::before {
    left: -15px !important;
    right: auto !important;
    border-width: 8px 16px 8px 0 !important;
    border-color: transparent #fff transparent transparent !important;
  }
}


/* CTA BANNER 
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.cta-banner {
    background-color: #f7f9fa;
    padding: var(--site-section-gap) 0;
    margin-top: 0;
}

.cta-banner h2 {
    font-size: 2.2rem;
    font-family: var(--font-primary);
    color: #121212;
    margin-bottom: 2rem;
    font-weight: 700;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Buttons moved to assets/styles/buttons.css */



/* Prima sezione editoriale: mostra la fotografia senza overlay. */
.leone-history .row-top .history-img-col::after {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .timeline ul li, .timeline ul li::after, .timeline ul li div {
    transition: none;
  }
  .timeline ul li div { visibility: visible; opacity: 1; transform: none; }
}

/* The row already supplies the mobile page gutter. */
@media (max-width: 768px) {
  .leone-history .content-wrapper-1 {
    padding-inline: 0 !important;
  }
}
