@use "../../foundations/helpers/forward.helpers.scss" as *;
@use "../button/button.scss" as *;
@use "../../components/group-header/group-header";
@use "../../assets/teaser/teaser.scss" as *;
@use "../../components/teaser-dot/teaser-dot.scss";

$ds-dot-size: ds-px-to-rem(10px);
$ds-teaser-list-vertical-media-icon-size: 20px;

.ds-teaser-list-vertical {
  background-color: $ds-color-surface-primary;

  &.ds-teaser-list-vertical--flexible {
    display: flex;
    flex: 1 0 300px;
    flex-direction: column;
    overflow: hidden;

    .ds-teaser-list-vertical__content {
      overflow-y: auto;
    }
  }

  .ds-teaser-list-vertical__content a {
    @include ds-teaser-focus(-2px);
  }

  .ds-teaser-list-vertical__link {
    position: relative;
    padding: ds-spacing($ds-s-100, rem);

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: ds-border-width(xxs);
      background-color: $ds-color-border-primary;
    }
  }

  .ds-teaser-list-vertical__item {
    padding: ds-spacing($ds-s-075 $ds-s-100, rem);
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    position: relative;

    &:not(:last-child)::after {
      content: "";
      position: absolute;
      bottom: 0;
      height: ds-border-width(xxs);
      width: calc(100% - ds-spacing($ds-s-200));
      background-color: $ds-color-border-primary;
    }

    .ds-teaser-list-vertical__item-text,
    .ds-teaser-list-vertical__item-title {
      margin: 0;
    }

    .ds-teaser-list-vertical__item-vignette {
      display: block;
      margin-bottom: ds-spacing($ds-s-025);
      @include ds-typography($ds-typography-functional-label-sm) {
        color: $ds-theme-color;
      }
    }

    .ds-teaser-list-vertical__item-title {
      word-break: break-word;
      @include ds-typography($ds-typography-expressive-heading-xxs) {
        color: $ds-color-text-primary;
      }

      .ds-teaser-list-vertical__item-highlight {
        color: $ds-theme-color;
      }
    }

    &.ds-teaser-list-vertical__item--italic .ds-teaser-list-vertical__item-title {
      @include ds-typography(
        $ds-typography-expressive-heading-xxs,
        $fontWeight: $ds-fontweight-medium,
        $fontStyle: italic
      );
    }

    .ds-teaser-footer {
      margin-top: ds-spacing($ds-s-050, rem);
    }

    .ds-teaser-list-vertical__item-img {
      flex: 0 0 91px;
      align-self: flex-start;
      position: relative;
      margin-left: ds-spacing($ds-s-100);

      .ds-teaser-list-vertical__item-video-icon {
        width: $ds-teaser-list-vertical-media-icon-size;
        height: $ds-teaser-list-vertical-media-icon-size;
        background: $ds-color-surface-brand;
        color: $ds-color-neutral-white;
        position: absolute;
        z-index: 1;
        bottom: 0;
        left: 0;
        font-size: 0;
      }
    }

    @include ds-hover() {
      &:hover .ds-teaser-list-vertical__item-title {
        @include ds-underline(2px, 1px);
      }
    }
  }
}
