@import 'src/styles/variables';

.card_with_icon {
  position: relative;

  display: inline-block;
  width: calc(50% - 12px);
  min-height: 270px;
  margin: 0 var(--space-xxl) var(--space-xxl) 0;
  padding: var(--space-l);

  vertical-align: top;
  text-decoration: none;
  box-sizing: border-box;
  text-align: center;

  border-radius: var(--border-radius-m);
  border: 1px solid var(--color-border);
  background-color: var(--color-white);

  background-repeat: repeat;
  background-size: auto 100%;
  background-position: center center;

  &_icon {
    display: block;
    width: auto;
    height: 90px;
    margin: 10px auto 18px auto;
    box-sizing: border-box;
    vertical-align: top;
  }

  &_value {
    font-weight: bold;
    font-size: 28px;

    display: block;
    margin: 0 0 var(--space-xxs) 0;
    padding: 0;

    text-align: center;

    color: var(--color-11);
  }

  &_title,
  &_description,
  &_scoring {
    font-weight: 100;

    display: block;
    margin: 0 auto;
    padding: 0;

    line-height: 1.3;
    text-align: center;
    text-decoration: none;

    color: var(--color-black);
  }

  &_title {
    font-size: var(--font-m);
    font-weight: 500;
    line-height: 14px;
    margin: 0 0 var(--space-xxs) 0;
  }

  &_description,
  &_scoring {
    font-size: var(--font-xs);
    line-height: 16px;
    color: var(--color-black);
  }

  &_description {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-s);
    margin-top: var(--space-m);
  }

  &_scoring {
    display: inline-block;
    min-width: 80px;
    max-width: 80%;
    padding: var(--space-xxxs) var(--space-xs);
    margin: 0 auto;

    white-space: nowrap;

    border-radius: var(--border-radius-s);
    border: 1px solid var(--color-border);
    background-color: var(--color-white);

    &_wrapper {
      position: absolute;
      bottom: -11px;
      left: 0;
      right: 0;

      text-align: center;
    }
  }

  &_small {
    min-height: auto;
    padding: var(--space-l) 0;
  }

  &_long {
    width: 100%;
    margin: 0 0 var(--space-xxl) 0;
  }

  &_banner {
    font-size: 32px;
    padding: 0;
    line-height: 270px;
  }
}

.card_with_icon_small {
  .card_with_icon_value {
    font-size: var(--font-m);
    font-weight: 100;
    margin-bottom: var(--space-m);
    color: var(--color-button-2);
  }
}

.card_with_icon:nth-child(2n+2) {
  margin-right: 0;
}

@media (max-width: 900px) {
  .card_with_icon {
    min-height: 220px;
    padding: var(--space-l) 0;

    &_title {
      margin: 0;
    }

    &_description {
      display: none;
    }
  }
}

@media (max-width: 650px) {
  .card_with_icon {
    min-height: 190px;
    padding: 32px 0;

    &_value {
      font-size: 22px;
    }

    &_title {
      font-size: var(--font-s);
    }

    &_icon {
      height: auto;
      max-width: 80%;
      max-height: 90px;
    }
  }
}

@media print {
  .card_with_icon {
    min-height: 220px;
    padding: var(--space-l) 0;

    &_icon {
      height: 60px;
    }

    &_value {
      font-size: 22px;
      margin: 0;
    }

    &_title {
      font-size: var(--font-s);
      margin: 0 0 var(--space-s) 0;
    }

    &_description {
      display: block;
    }
  }
}
