main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
}

.hero-container {
  display: flex;

  background:
    url("/assets/homepage/cerchio_bianco.png") no-repeat center center / cover,
    url("/assets/homepage/sfondo_carta.png") no-repeat center center / cover;

  padding: 0px;
  margin: 0px;

  width: 100%;
  aspect-ratio: 1.89/1;

  img {
    width: 100%;
  }
}

.left-col {
  padding-left: 3rem;
  padding-top: 10%;
  max-width: 50%;

  * {
    margin: 0.25rem;
  }
}

.torn-container {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto;
  justify-items: center;
  align-items: center;
  height: 100%;
  gap: 0;

  p,
  h1,h2,h3,
  .button {
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
  }

  img {
    grid-column: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .button {
    width: auto;
    justify-self: start;
  }
}

.advantage-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  justify-items: center;
  align-items: center;
  margin: 1rem;
  gap: 0.25rem;

  h1,h2,h3 {
    white-space: nowrap;
    justify-self: flex-start;
  }

  img {
    width: 100%;
  }
}

.advantages-container {
  display: flex;
  flex-direction: column;
  background: var(--primary-color);
  gap: 2.5rem;
  max-width: 100%;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;

  .text {
    display: flex;
    /* necessary to allow z-index on h1,h2,h3 */
    flex-direction: column;

    padding: 1rem;

    h1,h2,h3 {
      margin-bottom: -0.5rem;
      z-index: 1;
    }

    .underline {
      margin-top: 0;
      width: 25vw;
    }
  }

  .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: center;
    width: 100%;

    .photo {
      grid-row: span 2;
      justify-self: center;
      align-self: center;
      height: 80%;
    }
  }

  .row:nth-of-type(odd) {
    background: url("/assets/homepage/wedge1_dx.png") no-repeat left center /
      75% 100%;

    h1,h2,h3,
    p {
      padding-left: 1rem;
    }
  }

  .row:nth-of-type(even) {
    background: url("/assets/homepage/wedge1_sx.png") no-repeat right center /
      75% 100%;

    .text .underline {
      transform: scaleX(-1) translateX(20%);
    }

    h1,h2,h3,
    p {
      padding-right: 1rem;
    }
  }

  /* better alignment of the underlines */
  .row:nth-of-type(1) .text .underline {
    transform: translateX(-1rem) scaleX(0.8);
  }

  .row:nth-of-type(4) .text .underline {
    transform: scaleX(-0.75) translateX(35%);
  }
}

.companies {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;

  h1,h2,h3 {
    margin-bottom: 0;
  }
}

.company-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0rem;
}

.company-images {
  display: flex;
  gap: 3rem;
  align-items: center;

  a {
    display: inline-block; /* makes it behave like an <img> */
    text-decoration: none; /* removes underline */
    color: inherit; /* prevents blue link color */
    background-size: cover; /* if using background-image */
    background-position: center;
    background-repeat: no-repeat;
    line-height: 0; /* removes unwanted spacing */

    max-width: 25vw;
    object-fit: contain;
    padding: 3rem;

    img { width: 100%; }
  }
}

.mobile-only {
  display: none;
}

.curve {
  width: 100%;
  height: 4rem;
}

/* phone */
@media (max-width: 767px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .hero-container {
    background:
      url("/assets/homepage/cerchio-bianco-mobile.png") no-repeat center
        bottom / 100% auto,
      url("/assets/homepage/sfondo_carta.png") no-repeat center center / 100%
        100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 1rem;

    .left-col {
      max-width: 80%;
      padding: 0;
      padding-top: 1rem;
    }

    img {
      width: 50%;
    }
  }

  img {
    width: 100%;
  }

  .torn-container {
    grid-template-columns: auto;

    img {
      max-width: 50%;
      grid-row: 2;
      padding: 1rem;
    }
    & > div {
      grid-row: 1;
      max-width: 90%;
    }
  }

  .advantages-container {
    padding: 0;
    gap: 0;

    .row {
      grid-template-columns: auto;
      background: none !important;

      .text {
        background: white;
      }

      .flourish {
        max-width: 10vw;
        object-fit: contain;
      }

      .photo {
        grid-row: 2;
      }

      .photo {
        max-width: 60%;
        object-fit: contain;
        padding-top: 1rem;
        padding-bottom: 1rem;
      }

      h1,h2,h3,
      p {
        padding-left: 1rem;
        padding-right: 1rem;
      }
      .underline {
        transform: scaleX(-0.75) translateX(0.75rem) !important;
      }
    }
  }

  .company-images {
    flex-direction: column;
    gap: 1rem;

    a {
      max-width: 30vw;
      padding: 0;
    }
  }

  .underline {
    max-width: 75vw;
  }
}
