@use 'pix-design-tokens/breakpoints';
@use 'pix-design-tokens/fonts';
@use 'pix-design-tokens/colors';

.challenge {
  &__content {
    width: 100%;
    max-width: 990px;
    padding: 0 20px;

    @include breakpoints.device-is('desktop') {
      padding: 0;
    }
  }

  /* CSS patch to delete when screen improved */
  &-statement {
    p + p {
      margin-top: var(--pix-spacing-1x);
    }

    h2 {
      font-weight: bold;
      font-size: 1.5em;
    }

    ol,
    ul {
      margin: 1em 0;
      padding-inline-start: 40px;
      list-style-type: decimal;
    }

    ul {
      list-style-type: disc;
    }
  }

  /* ! End of CSS patch */

  &__banner {
    width: 100%;
    margin-bottom: 73px;
  }

  &__feedback {
    z-index: 1;
    width: 100%;
    max-width: 990px;
    margin: var(--pix-spacing-4x) 0;
    padding: 0 20px;
    text-align: left;

    @include breakpoints.device-is('desktop') {
      padding: 0;
    }
  }

  &__info-alert {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    color: var(--pix-primary-900);
    border-radius: 51px;
    box-shadow: 0 10px 20px 0 var(--pix-primary-700);

    &::before {
      position: absolute;
      z-index: -1;
      background-color: var(--pix-primary-100);
      opacity: 0.95;
      content: '';
      inset: 0;
    }

    &.challenge__info-alert--hide {
      height: 0;
      opacity: 0;
    }

    &.challenge__info-alert--show,
    &:focus.challenge__info-alert--could-show {
      position: sticky;
      bottom: 10px;
      height: auto;
      margin: 20px auto 0;
      padding: 24px 32px;
      opacity: 1;

      @include breakpoints.device-is('tablet') {
        padding: 24px 98px;
      }
    }
  }
}

.challenge-info-alert {
  font-family: fonts.$font-roboto;

  &__icon {
    width: 49px;
    height: 55px;
    margin-bottom: 8px;
    background-image: url('/images/focused-challenge-info-alert-icon.svg');
  }

  &__title {
    margin: auto 0 7px;
    font-weight: var(--pix-font-medium);
    font-size: 1.125rem;
    line-height: 1.625rem;
    letter-spacing: 0.011rem;
  }

  &__subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.375rem;
    letter-spacing: 0.009rem;
  }
}

.focus-zone-warning--triggered {
  z-index: 1;
  background-color: var(--pix-neutral-20);
  border-radius: 5px;
  outline: 5px dashed colors.$pix-shades-100;
  outline-offset: -5px;
}

.focus-zone-warning__overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 50%);
}
