/* =====================================================================
   CORREZIONI DESKTOP COMUNI (pagine con body.dfix-d)
   Contenimento sicuro per pagine nate solo per smartphone: attivo da 992px,
   il mobile resta invariato.
   ===================================================================== */
@media (min-width: 992px) {
  /* colonna di contenuto */
  .dfix-d main .container, .dfix-d section > .container, .dfix-d section > div > .container,
  .dfix-d .container-2 { max-width: 1100px; margin-left: auto; margin-right: auto; }
  .dfix-d p.justify { text-align: left !important; }

  /* video: altezza massima, proporzioni mantenute, centrati */
  .dfix-d section video, .dfix-d .container video {
    display: block; max-height: 620px; width: auto !important; max-width: 100%; height: auto; margin-left: auto; margin-right: auto;
  }

  /* immagini fotografiche: altezza massima con ritaglio centrato */
  .dfix-d section img:not([src$=".svg"]):not(.logo):not(.avatar):not(.thumbnail),
  .dfix-d > img:not([src$=".svg"]), .dfix-d .happy-join-photo img, .dfix-d .happy-join-photo2 img {
    max-height: 600px; object-fit: cover; object-position: center 35%;
  }

  /* slider con foto grandi */
  .dfix-d .swiper img:not([src$=".svg"]):not(.thumbnail) { max-height: 600px; object-fit: cover; }


  /* pulsanti: larghezza naturale */
  .dfix-d section .btn.w-100, .dfix-d .link-wrap .btn, .dfix-d section button.w-100 {
    width: auto !important; min-width: 280px; padding-left: 40px; padding-right: 40px;
  }
  .dfix-d .link-wrap, .dfix-d .text-center.link-wrap { text-align: center !important; }
}

@media (min-width: 992px) {
  /* illustrazioni SVG: limite di larghezza (le icone piccole non cambiano) */
  .dfix-d section img[src$=".svg"] { max-width: min(100%, 460px); height: auto; }
  .dfix-d section img[src$=".svg"][width="100%"], .dfix-d section img[src$=".svg"][style*="100%"] { display: block; margin-left: auto; margin-right: auto; }

  /* slider di apertura Eklogè / Eklogè Home: a tutta larghezza, altezza fissa */
  .dfix-d .homeEkSwiper, .dfix-d .homeEkHSwiper { max-width: 1200px !important; }
  .dfix-d .homeEkSwiper .swiper-slide img, .dfix-d .homeEkSwiper .swiper-slide video, .dfix-d .homeEkHSwiper .swiper-slide img, .dfix-d .homeEkHSwiper .swiper-slide video {
    display: block; width: 100% !important; height: 560px !important; max-height: none; object-fit: cover; object-position: center 30%;
  }
}

/* =====================================================================
   EKLOGÈ NEXUS (ekloge/nexus.php): layout desktop dedicato (body.nx-d)
   ===================================================================== */
@media (min-width: 992px) {
  .nx-d { --nx-max: 1100px; --nx-red: #e30613; --nx-space: clamp(56px, 6vw, 88px); }
  .nx-d .list-button button { max-width: none; }

  /* apertura: foto a fascia, testo a sinistra */
  .nx-d .nx-hero { position: relative; overflow: hidden; }
  .nx-d .nx-hero > img { display: block; width: 100%; height: 560px !important; max-height: none !important; object-fit: cover; object-position: center 25%; }
  .nx-d .nx-hero .text-on-ph { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); max-width: var(--nx-max); margin: 0 auto; padding: 0 32px !important; z-index: 1; }
  .nx-d .nx-hero .text-on-ph img { width: 460px !important; max-width: 50%; }
  .nx-d .nx-hero .text-on-ph p { max-width: 480px; font-size: 1.1rem !important; line-height: 1.55; }

  /* link "Scopri la storia" / "Continua a leggere": riga compatta allineata al contenuto */
  .nx-d .list-button:not(.with-img) { max-width: var(--nx-max); margin: 0 auto; padding: 0 32px; }
  .nx-d .list-button:not(.with-img) button { border-left: 0; border-right: 0; }

  /* blocco t-shirt + elementi: due righe a due colonne */
  .nx-d .nx-a {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; row-gap: 24px; align-items: center;
    max-width: var(--nx-max); margin: var(--nx-space) auto 24px; padding: 0 32px !important;
  }
  .nx-d .nx-a > img:first-of-type { grid-column: 1; grid-row: 1; width: 100% !important; max-width: 420px; margin: 0 auto !important; }
  .nx-d .nx-a > p { grid-column: 2; grid-row: 1; margin: 0; font-size: 1.05rem; line-height: 1.7; }
  .nx-d .nx-a > img:last-of-type { grid-column: 2; grid-row: 2; width: 100% !important; max-width: 380px; margin: 32px auto 0 !important; }
  .nx-d .nx-a > h2 { grid-column: 1; grid-row: 2; margin: 0 !important; font-size: 1.6rem !important; line-height: 1.35; }

  /* scorie: illustrazione a sinistra, testo a destra */
  .nx-d .nx-b {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; align-items: center;
    max-width: var(--nx-max); margin: var(--nx-space) auto 24px; padding: 0 32px !important;
  }
  .nx-d .nx-b > img { width: 100% !important; max-width: 300px; margin: 0 auto !important; }
  .nx-d .nx-b > h2 { margin: 0 !important; font-size: 1.6rem !important; line-height: 1.35; }

  /* 4 azioni: icone su una riga */
  .nx-d .black-box { margin-top: var(--nx-space); padding: 64px 0 !important; }
  .nx-d .black-box .container-2 { max-width: var(--nx-max); }
  .nx-d .black-box .row > [class*="col-"] { flex: 0 0 25%; max-width: 25%; }

  /* "Inoltre": quattro schede affiancate */
  .nx-d .nx-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: stretch;
    max-width: var(--nx-max); margin: var(--nx-space) auto; padding: 0 32px;
  }
  .nx-d .nx-stats > section { margin: 0 !important; padding: 28px 24px !important; border: 1px solid #ececec; display: flex; flex-direction: column; }
  .nx-d .nx-stats > section img { width: 120px !important; height: 120px; object-fit: contain; margin: 0 0 16px !important; }
  .nx-d .nx-stats > section h2, .nx-d .nx-stats > section p.text-size-1 { font-size: 1rem !important; line-height: 1.5; }
  .nx-d .nx-stats > section .text-size-8 { font-size: 3rem !important; line-height: 1; }
  .nx-d .nx-stats > section .btn { margin-top: auto; align-self: flex-start; min-width: 0; }

  /* fascia azzurra: illustrazione a sinistra, elenco a destra */
  .nx-d .nx-blue {
    display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 72px;
    padding: 56px max(32px, calc((100% - var(--nx-max)) / 2 + 32px)) !important;
  }
  .nx-d .nx-blue > img { width: 100% !important; max-width: 280px; margin: 0 auto !important; }
  .nx-d .nx-blue > p { font-size: 1.15rem !important; margin: 0 !important; }

  /* Sicurezza / Manutenzione affiancati */
  .nx-d .nx-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: var(--nx-max); margin: 48px auto; padding: 0 32px; }
  .nx-d .nx-links .list-button button { border: 1px solid #e5e5e5; }
}

/* =====================================================================
   SOTTOPAGINE NEXUS (storia, elementi, scorie, sicurezza, manutenzione): body.nxs-d
   illustrazione a sinistra (fissa durante lo scorrimento), testo a destra
   ===================================================================== */
@media (min-width: 992px) {
  .nxs-d .nxs-wrap {
    display: grid; grid-template-columns: 5fr 7fr; column-gap: 72px; align-items: start;
    max-width: 1100px; margin: 64px auto 80px; padding: 0 32px;
  }
  .nxs-d .nxs-wrap > section:first-child { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 140px; text-align: center !important; }
  .nxs-d .nxs-wrap > section:first-child img { width: 100% !important; max-width: 360px; height: auto; margin: 0 auto !important; padding: 0 !important; }
  .nxs-d .nxs-wrap > section:not(:first-child) { grid-column: 2; padding: 0 0 28px !important; margin: 0; text-align: left !important; }
  .nxs-d .nxs-wrap > section:not(:first-child) + section:not(:first-child) { border-top: 1px solid #ececec; padding-top: 28px !important; }
  .nxs-d .nxs-wrap p { font-size: 1.05rem; line-height: 1.7; }
  .nxs-d .nxs-wrap h1 { font-size: 1.6rem !important; }
  .nxs-d .nxs-wrap h2.red-on-ph { font-size: 2.6rem !important; margin-bottom: 4px; }
  .nxs-d .nxs-wrap section img[src*="elementi-stat"] { width: 100% !important; max-width: 560px; }
}
@media (min-width: 992px) {
  .nx-d .nx-b > img { max-width: 240px; }
  .nx-d .nx-blue { padding-top: 40px !important; padding-bottom: 40px !important; }
  .nx-d .nx-blue > img { max-width: 170px; }
  .nx-d .nx-stats > section { padding: 24px 20px !important; }
}

/* =====================================================================
   EKLOGÈ MISSION (ekloge/mission.php): body.em-d
   ===================================================================== */
@media (min-width: 992px) {
  .em-d { --em-max: 1100px; --em-space: clamp(64px, 7vw, 104px); }

  /* apertura: video verticale a sinistra, testo introduttivo a destra */
  .em-d .em-hero { display: grid; grid-template-columns: 5fr 7fr; column-gap: 72px; align-items: center; max-width: var(--em-max); margin: 48px auto 0; padding: 0 32px; }
  .em-d .em-hero > section { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
  .em-d .em-hero .container { max-width: none; padding: 0 !important; }
  .em-d .em-hero video { height: 560px !important; width: auto !important; max-width: 100%; max-height: none; margin: 0 auto; }
  .em-d .em-hero p { font-size: 1.35rem; line-height: 1.6; margin: 0; }

  /* tre valori: testo e immagine affiancati, alternati */
  .em-d .em-feat {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; align-items: center;
    max-width: var(--em-max); margin: var(--em-space) auto 0 !important; padding: 0 32px !important;
  }
  .em-d .em-feat > .container { max-width: none; padding: 0 !important; margin: 0 !important; grid-column: 1; }
  .em-d .em-feat > .container:has(img.w-100) { grid-column: 2; grid-row: 1 / span 3; }
  .em-d .em-feat-2 > .container { grid-column: 2; }
  .em-d .em-feat-2 > .container:has(img.w-100) { grid-column: 1; }
  .em-d .em-feat .icon-mission { width: 64px; }
  .em-d .em-feat h2 { font-size: 2.4rem !important; line-height: 1.1; }
  .em-d .em-feat p { font-size: 1rem; line-height: 1.7; }
  .em-d .em-feat img.w-100 { max-height: 460px !important; object-fit: cover; border-radius: 50% / 50%; }
  /* pelle vegana: senza immagine propria, testo su due colonne */
  .em-d .em-feat-3 > .container:last-child { grid-column: 2; grid-row: 1 / span 3; align-self: center; }

  /* pellami: fascia, poi campionario e testo affiancati */
  .em-d .em-pelli { display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; align-items: center; margin-top: var(--em-space) !important; }
  .em-d .em-pelli > div:first-child { grid-column: 1 / -1; margin-bottom: 48px !important; }
  .em-d .em-pelli > div:first-child img { height: 440px !important; max-height: none; object-fit: cover; object-position: center; }
  .em-d .em-pelli > .container { max-width: none; margin: 0 !important; padding: 0 32px !important; }
  .em-d .em-pelli > .container:nth-of-type(2) { justify-self: end; max-width: 520px; }
  .em-d .em-pelli > .container:last-child { justify-self: start; max-width: 520px; }
  .em-d .em-pelli img.img-mission-btn2 { max-height: 420px !important; object-fit: cover; border-radius: 50% / 50%; }

  /* progetto sostenibilità */
  .em-d .em-prog { margin-top: var(--em-space) !important; padding: 48px 0 !important; }
  .em-d .em-prog .container { max-width: 760px; }
  .em-d .em-prog img { max-height: 420px !important; object-fit: cover; }
  .em-d .em-prog .btn { width: auto !important; }
}
@media (min-width: 992px) {
  .em-d .em-pelli img.img-mission-btn2 { margin-top: 0 !important; position: static !important; transform: none !important; }
  .em-d .em-pelli > .container:nth-of-type(2) { margin-top: 0 !important; }
  .em-d .em-prog img { max-height: none !important; object-fit: contain; }
  .em-d .em-prog .product { max-width: 640px; margin: 0 auto; }
}
