/* Responsive layer for the legacy BusinessNudging markup.
   Loaded last so it can safely override fixed inline dimensions. */

img {
  max-width: 100%;
}

.grey-section {
  z-index: auto;
}

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 7, 3, 0.34), transparent 62%);
  pointer-events: none;
}

.hero-section > .container {
  position: relative;
  z-index: 1;
}

.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
  display: none;
}

.problem-section [style*="height:600px"] {
  height: auto !important;
}

.problem-section [style*="height:600px"] img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.context-section [class*="col-"] img,
.response-section [class*="col-"] img {
  max-width: 100%;
  object-fit: contain;
}

.cases-section .progetto-box {
  height: 100%;
}

.references-section .logo-box {
  min-height: 150px;
  padding: 16px;
}

.references-section .logo-box img {
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  body {
    padding-top: 70px;
  }

  .navbar {
    height: 70px;
  }

  .navbar .container {
    max-width: 100%;
  }

  .navbar-brand img {
    width: min(235px, 68vw);
    height: auto;
    max-height: 48px;
  }

  .navbar-collapse {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    margin: 0 !important;
    padding: 12px 24px 20px !important;
    background: #c74c25;
  }

  .navbar-collapse .navbar-nav {
    flex-direction: row;
    justify-content: flex-end;
    gap: 10px;
  }

  .section {
    padding-block: 52px;
  }

  .problem-section [style*="height:600px"] {
    margin-top: 28px;
  }

  .problem-section [style*="height:600px"] img {
    max-height: 480px;
  }

  .ecosystem-section img[style*="schema_businessnudger"] {
    height: auto !important;
  }

  .references-section .row[style*="gap:20px"] {
    margin-left: 0 !important;
    gap: 16px !important;
  }

  .references-section .logo-box {
    flex: 1 1 calc(33.333% - 16px);
    max-width: calc(33.333% - 11px);
  }

  footer > .container > .row:first-child > div:first-child img,
  footer > .container > .row:nth-of-type(2) > div:first-child img {
    max-width: 260px;
  }
}

@media (max-width: 767.98px) {
  html {
    scroll-padding-top: 74px;
  }

  body {
    font-size: 16px;
    line-height: 1.6;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
    line-height: 1.12;
  }

  h2 {
    font-size: clamp(1.75rem, 7vw, 2.2rem);
  }

  h3 {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    line-height: 1.25;
  }

  h5 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .container {
    padding-inline: 20px;
  }

  .section {
    padding-block: 44px;
  }

  .section p:last-child {
    margin-bottom: 0;
  }

  .hero-section {
    min-height: 620px;
    background-size: cover !important;
    background-position: 64% center !important;
  }

  .hero-section::before {
    background: linear-gradient(
      180deg,
      rgba(22, 8, 3, 0.2) 0%,
      rgba(22, 8, 3, 0.82) 58%,
      rgba(22, 8, 3, 0.96) 100%
    );
  }

  .hero-section .container,
  .hero-section #carouselHeader,
  .hero-section .carousel-inner {
    min-height: 620px;
  }

  .hero-section .carousel-inner {
    height: 620px;
    padding: 0;
    align-items: flex-end;
  }

  .hero-section .carousel-item {
    height: auto;
    margin: 0 0 40px;
    padding: 0 0 0 18px;
  }

  .hero-section .carousel-item > .row {
    height: auto !important;
  }

  .hero-section h1 {
    max-width: 15ch;
    margin-bottom: 18px;
    font-size: clamp(2rem, 8.6vw, 2.25rem);
    text-wrap: balance;
  }

  .hero-section p[style*="font-size:20px"] {
    max-width: 31ch;
    margin-bottom: 0;
    font-size: 1rem !important;
    line-height: 1.45 !important;
  }

  /* Gli a capo forzati pensati per desktop spezzano male le righe su mobile */
  .hero-section h1 br,
  .hero-section p[style*="font-size:20px"] br:not(:first-child) {
    display: none;
  }

  .hero-section div[style*="margin-top:30px"] {
    gap: 10px !important;
    margin-top: 22px !important;
  }

  .hero-section div[style*="margin-top:30px"] a {
    display: flex !important;
    flex: 1 1 100%;
    justify-content: center;
    padding: 12px 16px !important;
    font-size: 0.78rem !important;
    text-align: center;
  }

  .problem-section .left-line {
    min-height: 90px;
    padding-left: 14px;
  }

  .problem-section .left-line span {
    font-size: 2.15rem;
  }

  .problem-section [style*="height:600px"] img {
    max-height: 390px;
  }

  .context-section .row > [class*="col-6"] {
    margin-bottom: 30px;
  }

  .context-section .row > [class*="col-6"] img {
    width: 96px !important;
    height: 96px !important;
  }

  .context-section .col-12[data-aos] a {
    width: 100%;
    padding: 13px 16px !important;
    font-size: 0.95rem !important;
    line-height: 1.35;
  }

  .response-section h1 span {
    display: inline-block;
    margin-top: 6px;
    font-size: 1.5rem !important;
  }

  .response-section .col-12.col-lg-6:last-child > p:first-child {
    display: none;
  }

  .response-section .col-12.col-lg-6:last-child {
    margin-top: 30px;
  }

  .response-section .col-6 img {
    width: 64px !important;
    height: 64px !important;
  }

  .response-section .col-6 p {
    overflow-wrap: anywhere;
    font-size: 0.9rem;
  }

  .response-section .row > a {
    width: 100%;
    padding: 13px 16px !important;
    text-align: center;
  }

  .cases-section .row > .col-4 {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 18px;
  }

  .cases-section .progetto-box img {
    height: 110px !important;
    object-fit: cover;
  }

  .cases-section .progetto-box p {
    min-height: 0 !important;
  }

  .ecosystem-section .col-lg-6 + .col-lg-6 > p:first-child {
    display: none;
  }

  .ecosystem-section .col-lg-6 + .col-lg-6 {
    margin-top: 18px;
  }

  .ecosystem-section img[src*="schema_businessnudger"] {
    width: calc(100% + 8px) !important;
    max-width: none;
    margin-left: -4px;
  }

  .contact-section .link-cta,
  .team-section .link-cta {
    display: inline-block;
    margin-top: 14px;
  }

  .team-section [style*="display:flex"] {
    flex-wrap: wrap;
  }

  .references-section .row[style*="gap:20px"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px !important;
  }

  .references-section .logo-box {
    width: 100%;
    max-width: none;
    min-height: 108px;
    padding: 12px;
  }

  .references-section .logo-box img {
    width: 100%;
    height: auto !important;
    max-height: 72px;
  }

  footer {
    padding-block: 44px;
  }

  footer > .container > .row:first-child > div:first-child,
  footer > .container > .row:first-child > div:last-child,
  footer > .container > .row:nth-of-type(2) > div:first-child {
    margin-bottom: 28px;
  }

  footer > .container > .row:first-child > div:first-child img,
  footer > .container > .row:nth-of-type(2) > div:first-child img {
    width: auto !important;
    max-width: 240px;
    max-height: 72px;
  }

  footer [class*="col-6"] {
    margin-bottom: 18px;
  }

  footer h6 {
    line-height: 1.5;
  }

  .privacy-page .div-testata {
    height: auto;
    min-height: 260px;
  }

  .privacy-page .titolo-testata {
    height: auto;
    min-height: 220px;
    padding-block: 40px;
  }

  .privacy-page .container-fluid.section .container {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 389.98px) {
  .container {
    padding-inline: 16px;
  }

  .hero-section,
  .hero-section .container,
  .hero-section #carouselHeader,
  .hero-section .carousel-inner {
    min-height: 600px;
  }

  .hero-section .carousel-inner {
    height: 600px;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .problem-section .left-line p {
    font-size: 0.96rem;
  }

  .context-section .row > [class*="col-6"] img {
    width: 84px !important;
    height: 84px !important;
  }
}
