// The margin between two sections
$margin-promotion-sections: 50px;
$margin-promotion-sections-small: 15px;

.docs-header-background {
  overflow: hidden;
  position: relative;
  height: 420px;
  background: var(--mat-sys-primary-container);
}

.docs-homepage-logo {
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.1;
  margin-left: 330px;
  width: 500px;
  height: 500px;
  pointer-events: none;
}

.docs-header-section {
  width: 90%;
  position: absolute;
  z-index: 0;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.docs-homepage-row,
.docs-homepage-carousel-row h2,
a.docs-featured-components-carousel-item,
.docs-homepage-guides-card,
a.docs-link:hover {
  color: var(--mat-sys-on-surface-variant);
}

.docs-header-headline {
  color: var(--mat-sys-on-primary-container);

  h1 {
    font-size: 56px;
    font-weight: 500;
    line-height: 56px;
    margin: 15px 5px;
  }

  h2 {
    font-size: 20px;
    font-weight: 300;
    line-height: 28px;
    margin: 15px 0 25px;
  }
}

.docs-homepage-promo {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 16px;
  width: 75%;
  max-width: 1080px;
  margin: auto;

  a {
    text-decoration: none;
  }

  h2 {
    font-size: 25px;
    font-weight: 400;
    margin: 0 0 16px;
    padding: 0;
  }

  p {
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    margin: 0 0 24px;
    padding: 0;
  }

  mat-divider {
    width: 100%;
  }

  mat-icon {
    vertical-align: middle;
  }
}

.docs-carousel-item {
  width: 48%;

  & + & {
    margin-left: 2%;
  }

  @media (min-width: 1020px) {
    max-width: 32%;
  }
}

.docs-homepage-row {
  display: flex;
  flex-direction: row;
  margin: $margin-promotion-sections 0;
}

.docs-homepage-carousel-row {
  margin: $margin-promotion-sections 0;
  display: flex;
  flex-direction: column;
  width: 100%;

  h2 {
    margin-top: 0;
  }
}

.docs-homepage-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;

  h2 {
    margin: 0;
  }
}

.docs-link {
  display: inline-flex;
  align-items: center;
}

.docs-homepage-guides {
  .docs-homepage-guides-carousel-item {
    display: flex;
    text-decoration: none;
    box-sizing: border-box;

    .mat-mdc-card {
      // Ensures that the cards stretch to the full width of the item.
      width: 100%;
      min-height: 200px;
      justify-content: center;
      text-align: center;
      transition: background 0.3s ease;
    }
  }

  .docs-homepage-guides-card .mat-mdc-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
  }
}

.docs-homepage-featured-components {
  .docs-featured-components-carousel-item {
    text-align: center;
    box-sizing: border-box;
    font-size: 18px;

    .docs-homepage-img-container {
      overflow: hidden;
      margin-bottom: 16px;
      max-height: 200px;
    }

    img {
      transition: 0.3s ease-in-out;
      width: 100%;
    }

    &:hover, &:focus {
      img {
        transform: scale(1.1);
      }
    }
  }
}

.docs-homepage-row-column {
  display: flex;
  flex-direction: column;
  width: 32%;

  & + & {
    margin-left: 2%;
  }
}

.docs-header-start {
  text-align: center;
  margin: $margin-promotion-sections 0 0 0;

  .mat-mdc-raised-button {
    font-size: 15px;
  }
}

@media (max-width: 1200px) {
  .docs-header-background {
    height: 330px;
  }
  .docs-homepage-logo {
    display: none;
  }
}

@media (max-width: 850px) {
  .docs-homepage-logo {
    display: none;
  }

  .docs-introduction {
    flex-direction: column;
  }

  .docs-homepage-row-column {
    width: 100%;

    & + & {
      margin-left: 0;
    }
  }
}

// Rules for when the device is detected to be a small screen.
@media (max-width: 720px) {
  .docs-header-start {
    margin: $margin-promotion-sections-small 0 0 0;
  }

  .docs-homepage-row, .docs-homepage-carousel-row {
    margin: $margin-promotion-sections-small 0;
  }
}

[carousel-item]:hover,
[carousel-item]:focus {
  outline: none;

  .docs-homepage-guides-card {
    background: var(--mat-sys-surface-dim);
  }
}
