/* ========== Hero (mobile-first, ref. pit-homepage-mobile.png) ========== */

.hero {
  background-color: var(--color-bg);
  container-type: inline-size;
  container-name: hero;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  padding-top: 32px;
  padding-bottom: var(--section-pad-y);
}

.hero__headings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.hero__badge {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 6px;
  background-color: var(--color-proof-bar);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 15.6px;
  color: var(--color-text);
}

.hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 46px;
  font-weight: var(--font-weight-bold);
  line-height: 43.2px;
  color: var(--color-text);
  overflow-wrap: normal;
  hyphens: none;
}

.hero__subtitle {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: var(--font-weight-bold);
  line-height: 30.4px;
  color: var(--color-text);
  overflow-wrap: break-word;
}

/* Variante con badge (es. Idraulica): ritmo e proporzioni immagini allineati alla statica. */
.hero--with-badge .hero__inner {
  gap: 32px;
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.hero--with-badge .hero__headings {
  gap: 32px;
}

.hero--with-badge .hero__title {
  font-size: 52px;
  line-height: 46.8px;
}

.hero--with-badge .hero__images {
  gap: 12px;
}

.hero--with-badge .hero__figure {
  border-radius: 16px;
  aspect-ratio: 169 / 200;
}

.hero--with-badge .hero__figure--b2c,
.hero--with-badge .hero__figure--b2b {
  aspect-ratio: 169 / 200;
}

.hero__images {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
}

.hero__figure {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  overflow: hidden;
  border-radius: 13px;
}

.hero__figure--b2c {
  aspect-ratio: 308 / 600;
}

.hero__figure--b2b {
  aspect-ratio: 308 / 417;
}

.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__body {
  margin: 0;
  width: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: var(--font-weight-regular);
  line-height: 22.95px;
  color: var(--color-text);
}

.hero__cta {
  align-self: stretch;
  font-size: 15px;
  line-height: 18px;
}

/*
 * Desktop layout keyed to the hero container width (not the viewport).
 * Avoids the Gutenberg canvas collapsing the text column when a fixed
 * 640px image track is forced inside a narrow editor content area.
 */
@container hero (min-width: 1025px) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 640px);
    grid-template-rows: auto auto auto;
    column-gap: 64px;
    row-gap: 40px;
    align-items: start;
    padding-top: 220px;
    padding-bottom: var(--section-pad-y);
  }

  .hero__headings {
    grid-column: 1;
    grid-row: 1;
    gap: 24px;
  }

  .hero__badge {
    padding: 8px 16px;
    border-radius: 10px;
  }

  .hero__title {
    font-size: 82px;
    line-height: 71.4px;
  }

  .hero__subtitle {
    font-size: 52px;
    line-height: 44.2px;
  }

  .hero__body {
    grid-column: 1;
    grid-row: 2;
    font-size: 21px;
    line-height: 27.3px;
  }

  .hero__cta {
    grid-column: 1;
    grid-row: 3;
    align-self: flex-start;
    justify-self: start;
    width: auto;
    font-size: 16px;
    line-height: 19.2px;
  }

  .hero__images {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    width: 100%;
    max-width: 640px;
    height: 600px;
    aspect-ratio: auto;
    gap: 24px;
  }

  .hero__figure {
    border-radius: 24px;
  }

  .hero__figure--b2c,
  .hero__figure--b2b {
    aspect-ratio: auto;
  }

  .hero__figure--b2b {
    height: 417px;
  }

  .hero--with-badge .hero__inner {
    padding-top: 220px;
    padding-bottom: var(--section-pad-y);
  }

  .hero--with-badge .hero__headings {
    gap: 24px;
  }

  .hero--with-badge .hero__title {
    font-size: 82px;
    line-height: 71.4px;
  }

  .hero--with-badge .hero__images {
    align-items: flex-end;
  }

  .hero--with-badge .hero__figure--b2c {
    flex: 1 1 0;
    align-self: stretch;
    height: auto;
  }

  .hero--with-badge .hero__figure--b2b {
    flex: 0 0 280px;
    width: 280px;
    height: 400px;
  }
}
