@use "../abstracts/mixins";

.jenkins-section {
  border-top: var(--jenkins-border);
  padding: var(--section-padding) 0 0 0;
  max-width: 1800px;

  &:last-child {
    padding-bottom: 0;
  }

  &:empty {
    display: none;
  }

  &--no-border {
    border-top: none;
    padding-top: 0;
  }

  &--bottom-padding {
    padding-bottom: var(--section-padding);
  }
}

.jenkins-section__title {
  margin: 0 0 var(--section-padding) 0;
  font-size: 1rem;
  font-weight: var(--font-bold-weight);
}

.jenkins-section__description {
  // Tweaked margin so that it appears visually centred when placed next to `.jenkins-section__title`
  margin: -0.8125rem 0 1rem;
  color: var(--text-color-secondary);
  line-height: 1.66;
}

.jenkins-section__items {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: var(--section-padding);

  @media screen and (width >= 800px) {
    grid-template-columns: 1fr 1fr;
  }

  @media screen and (width >= 1300px) {
    grid-template-columns: 1fr 1fr 1fr;
  }

  @media screen and (width >= 1800px) {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

.jenkins-section__item a {
  @include mixins.item($border: false);

  display: flex;
  text-decoration: none;
  margin: 0;

  &::before,
  &::after {
    inset: -0.65rem;
  }

  dl {
    margin: 0;
    padding: 0;
    min-height: 48px;
  }

  .jenkins-section__item__icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem 0 0;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    color: var(--text-color);

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 100%;
      pointer-events: none;
      background: var(--item-background--active);
      border: var(--jenkins-border--subtle);
    }

    img,
    svg {
      position: relative;
      width: 50% !important;
      height: 50% !important;
      color: currentColor;
    }

    &__badge {
      position: absolute;
      top: -4px;
      right: -4px;
    }
  }

  dt {
    font-size: 0.9375rem;
    font-weight: var(--font-bold-weight);
    margin: 0.1rem 0 0.2rem;
    color: var(--text-color);
  }

  dd {
    color: var(--text-color-secondary);
    font-weight: normal;
    line-height: 1.6;
    margin: 0 0.66rem 0 0;
    font-size: 0.9375rem;
  }
}
