@import "_variables.scss";

.homepage-hero {
  background-color: var(--dora-highlight);
  position: relative;

  .hero-content {
    margin: auto;
    margin-bottom: 24px;
    width: $layout-breakpoint-maxplus;
    max-width: 100vw;

    div.dora {
      width: 100%;
      aspect-ratio: 1440 / 610;
      position: relative;
      div.letters {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-repeat: no-repeat;
        background-size: contain;

        &.d_ra {
          background-image: url(/img/homepage/d_ra.svg);
        }
        &.o {
          background-image: url(/img/homepage/o.gif);
        }
      }
    }
  }

  div.hero-link {
    text-align: right;
    margin-right: 24px;
    @include media-medium {
      display:none;
    }
  }
}

.homepage-lede {
  box-sizing: border-box;
  background-color: var(--dora-primary-light);
  .lede-content-container {
    max-width: $layout-breakpoint-maxplus;
    margin: calc(min(48px, 8vw)) auto;
    .lede-content {
      margin: 12px 36px;
      max-width: 100%;
      width: fit-content;
      display: flex;
      flex-direction: row;
      align-items: center;

      @include media-medium {
        flex-direction: column;
      }

      h1,
      p {
        flex: 1 0 50%;
        text-wrap: balance;
      }

      h1 {
        font-size: calc(min(72px, 7vw));
        font-weight: 600;
        padding-right: 12px;
      }

      p {
        font-family: $font-google-sans;
        font-size: calc(clamp(16px, 2.5vw, 20px));
        font-weight: 500;
      }
    }
  }
}

.homepage-feature-container {
  background-color: var(--dora-primary-dark);

  .homepage-feature {
    margin: auto;
    max-width: $layout-breakpoint-maxplus;
    box-sizing: border-box;
    color: var(--dora-primary-light);
    padding: 48px;

    display: flex;
    align-items: center;

    .content {
      flex-basis: 50%;

      h3 {
        font-size: 12px;
        text-transform: uppercase;
        font-weight: 500;
        letter-spacing: 1px;

        @include media-small {
          font-size:11px;
        }
      }

      p {
        font-family: $font-google-sans;
        font-size: 16px;
        line-height: 1.35;
        font-weight: 400;
      }

      button {
        // display:block;
        margin-top: 20px;

        &:hover {
          background-color: var(--dora-primary-light);
          color: var(--dora-primary-dark);
        }
      }
    }

    .image {
      flex-basis: 50%;
      img {
        width: 340px;
        max-width: 40vw;

        &.stroke {
          border: 0.5px solid var(--dora-primary-light);
        }
      }
    }

    &.image-align-right {
      flex-direction: row;
      .image {
        text-align: right;
      }
    }
    &.image-align-left {
      flex-direction: row-reverse;
      .image {
        text-align: left;
        div.hero-link {
          text-align: right;
          margin-right: 24px;
        }
      }
    }

    @include media-medium {
      flex-direction: column-reverse;

      &.image-align-right , &.image-align-left {
        flex-direction: column-reverse;
      }

      .image {
        text-align: center;
        margin-bottom: 24px;
      }

    }
  }
}

.homepage-snipes-wrapper {
  background-color: var(--dora-primary-light);

  .homepage-snipes-container {
    width: $layout-breakpoint-maxplus;
    box-sizing: border-box;
    max-width: 100%;
    margin: auto;
    padding: 48px;

    .homepage-snipes {
      display: grid;
      gap: 24px;
      grid-template-columns: 1fr 1fr 1fr 1fr;

      @include media-large {
        grid-template-columns: 1fr 1fr;
      }
      @include media-medium {
        grid-template-columns: 1fr;
      }

      .homepage-snipe {
        background-color: var(--grey-50);

        &:nth-child(1) {
          background-color: var(--dora-secondary-a);
          h3 {
            color: var(--dora-secondary-a);
          }
        }

        &:nth-child(2) {
          background-color: var(--dora-secondary-b);
          h3 {
            color: var(--dora-secondary-b);
          }
        }

        &:nth-child(3) {
          background-color: var(--dora-secondary-c);
          h3 {
            color: var(--dora-secondary-c);
          }
        }

        &:nth-child(4) {
          background-color: var(--dora-highlight);
          h3 {
            color: var(--dora-highlight);
          }
        }

        a {
          text-decoration: none;
          color: var(--dora-primary-dark);
        }

        .image {
          border-bottom: 3px solid var(--dora-primary-dark);
          img {
            width: 320px;
            display: block;
            margin: auto;
            max-width: 100%;
          }
        }

        h3 {
          line-height: 18px;
          font-size: 14px;
          margin: 0 0 0 auto;
          width: fit-content;
          padding: 4px 12px;
          color: var(--dora-primary-light);
          background-color: var(--dora-primary-dark);
        }

        .text {
          padding: 18px 24px;

          h2 {
            font-size: 24px;
            font-weight: 500;
            margin: 0;
            margin-bottom: 12px;
          }

          p {
            font-family: $font-google-sans;
            font-size: 16px;
            line-height: 1.35;
            font-weight: 400;
          }
        }
      }
    }
  }
}

// END: new styles for theme dora-2025

// TODO: use the grid.scss styles instead
section.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  place-items: stretch;

  article {
    padding: 0;
    border: 1px solid $border-light;
    border-radius: 8px;

    h2 {
      background-color: $background-light;
      margin: 0;
      padding: 1rem 1rem 0.5rem 1rem;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;

      a {
        color: $color-text;
        text-decoration: none;
      }
    }

    div.content {
      display: flex;
      flex-direction: row;

      .text {
        padding: 1rem;
      }

      .image {
        text-align: center;

        img {
          margin: 1rem;

          &.stroke {
            border: 1px solid $border-light;
          }
        }
      }

      &.image-left {
        flex-direction: row-reverse;

        @include media-medium {
          flex-direction: column-reverse;
        }
      }

      @include media-medium {
        flex-direction: column-reverse;
      }
    }

    &.cols_1 {
      img.feature {
        width: 10rem;
        @include media-large {
          width: 8rem;
        }
      }

      @include media-medium {
        grid-column: span 2;
      }
    }

    &.cols_2 {
      grid-column: span 2;

      img.feature {
        width: 16rem;
        @include media-large {
          width: 12rem;
        }
      }
    }
  }
}
