/* ============================================
   SANFELICE LEGNAMI — Responsive
   Mobile-first breakpoints
   ============================================ */

/* --- Base (0–575px) — Mobile portrait --- */

.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

.nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: 999;
}

.nav.open {
  display: flex;
}

.nav.open .nav__link {
  font-size: 1.25rem;
  color: #fff;
}

.nav-toggle {
  display: flex;
}

.hero {
  min-height: 50vh;
  background-attachment: scroll;
}

.hero__title {
  font-size: clamp(1.75rem, 8vw, 2.5rem);
}

.hero__actions {
  flex-direction: column;
}

.hero__actions .btn {
  width: 100%;
  justify-content: center;
}

.counter-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.footer__grid {
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  text-align: center;
}

.footer__social {
  justify-content: center;
}

.timeline {
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.timeline::before {
  top: 0;
  bottom: 0;
  left: 50%;
  right: auto;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

/* Home brands mobile */
.hero-home {
  height: auto;
  min-height: 100vh;
}

.hero-home__brands {
  grid-template-columns: 1fr;
}

.brand-card {
  min-height: 200px;
}

/* Chi siamo blocks e contatti */
.chi-siamo-block {
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* Mobile: testo Crescita allineato a sinistra */
.chi-siamo-block--reverse .chi-siamo-block__text {
  text-align: left;
}

.contatti-grid {
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* --- sm: 576px+ — Mobile landscape --- */
@media (min-width: 576px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }

  .hero__actions {
    flex-direction: row;
  }

  .hero__actions .btn {
    width: auto;
  }
}

/* --- md: 768px+ — Tablet --- */
@media (min-width: 768px) {
  .hero-home {
    height: 200vh;
  }

  .hero-home__brands {
    grid-template-columns: repeat(3, 1fr);
  }

  .brand-card {
    min-height: auto;
  }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }

  .hero {
    min-height: 55vh;
  }

  .chi-siamo-block {
    grid-template-columns: 1fr 1fr;
  }

  /* Variante "stretch": immagine a piena altezza testo, colonna testo più larga */
  .chi-siamo-block--stretch {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: stretch;
  }
  .chi-siamo-block--stretch .chi-siamo-block__media {
    height: 100%;
    min-height: 420px;
  }
  .chi-siamo-block--stretch .chi-siamo-block__media img {
    height: 100%;
    object-fit: cover;
  }

  .contatti-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .blog-nav {
    grid-template-columns: 1fr 1fr;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }
}

/* --- lg: 992px+ — Desktop small --- */
@media (min-width: 992px) {
  .nav {
    display: flex;
    position: static;
    background: none;
    flex-direction: row;
  }

  .nav-toggle {
    display: none;
  }

  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }

  .hero {
    min-height: 70vh;
    background-attachment: fixed;
  }

  .counter-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .timeline {
    flex-direction: row;
    align-items: flex-start;
  }

  .timeline::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
    transform: translateY(-50%);
  }
}

/* --- xl: 1200px+ — Desktop --- */
@media (min-width: 1200px) {
  .hero__title {
    font-size: var(--text-hero);
  }
}


/* Blog nav prev/next */
.blog-nav {
  grid-template-columns: 1fr;
}

/* --- Disable parallax on mobile (performance) --- */
@media (max-width: 768px) {
  .parallax-bg {
    background-attachment: scroll;
  }
}
