@import '../../../styles/vars/breakpoints.css';

:global(.d-slide-colored) .img  {
  box-shadow: none;
}

.imagecard {
  width: 100%;
  margin: * auto;
  position: relative;
  overflow: hidden;

  &.isBotSlide {
    max-width: unset;
    width: 674px;
    padding-bottom: 45px;

    @media (--sm-and-down) {
      width: 100%;
      padding-bottom: 0;
    }
  }

  &.size {
    &--auto {
      position: relative;
      max-width: unset;
    }

    &--xs {
      max-width: 360px;

      @media (--ms-and-down) {
        max-width: 100%;
      }
    }
    &--s {
      max-width: var(--component-max-width);

      @media (--ms-and-down) {
        max-width: 100%;
      }
    }

    &--m {
      max-width: 945px;

      @media (--ms-and-down) {
        max-width: 100%;
      }
    }

    &--l {
      max-width: 1140px;

      @media (--md-and-down) {
        max-width: 100%;
      }
    }

    &--xl {
      /* size: 100vw 360px; */
      width: 100vw;
      margin: * calc((100vw - 100%) / -2);
      position: relative;

      :global(.flexy-image-img) {
        width: 100vw;
      }

      .img {
        border-radius: 0;
      }
    }
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.img {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  @media (--ms-and-down) {
    .size--auto & {
      position: relative;
    }
  } 

  @media (--sm-and-down) {
    .size--auto.isBotSlide & {
      position: relative;
      height: 0;
      padding-bottom: 53.4%;
    }
  }

  @media (--sm-and-up) {
    .imagecard--with-title &::before {
      content: '';
      display: block;
      position: absolute;
      bottom: 0;
      left: 0;
      /* size: 100% 50%; */
      width: 100%;
      height: 50%;
      background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
      border-bottom-left-radius: inherit;
      border-bottom-right-radius: inherit;
    }
  }
}

.content {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  position: absolute;
  top: 0;
  left: 0;
  /* size: 100% 100%; */
  width: 100%;
  height: 100%;
  padding: 30px;
  box-sizing: border-box;
  align-content: flex-end;

  color: white;

  @media (--ms-and-down) {
    position: relative;
    color: var(--black);
    margin-top: 20px;
    padding: 0;
  }
}

.title {
  position: relative;
  width: 100%;
  flex: 1 0 100%;

  &--xs {
    /* text: 500 rem(20px) 1.35em * 0.4px; */
    font-weight: 500;
    font-size: rem(20px);
    line-height: 1.35em;
    letter-spacing: 0.4px;
  }

  &--s {
    /* text: bold rem(24px) 1.35em * 0.6px; */
    font-weight: bold;
    font-size: rem(24px);
    line-height: 1.35em;
    letter-spacing: 0.6px;
  }
}

.subtitle {
  position: relative;
  width: 100%;
  flex: 1 0 100%;
  margin-top: 10px;
  z-index: 1;

  opacity: 0.6;

  /* text: italic rem(15px) 1.35em * 0.4px; */
  font-style: italic;
  font-size: rem(15px);
  line-height: 1.35em;
  letter-spacing: 0.4px;
}
