@use '../../_global/styles/mixins' as *;
@use '../../_global/styles/vars' as *;

.event-teaser {
  background-color: var(--color-background);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  transition: 0.3s ease;
  text-decoration: none;
  position: relative;
  @include focus-visible;

  &:hover {
    color: var(--color-text-accent);

    .date-box {
      background-color: var(--color-text-accent);
    }
  }

  .date-box {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-color: var(--color-button-primary-background);
    color: var(--color-button-primary-text);
    margin-right: 18px;
    font-family: "Korb", sans-serif;
    min-height: 80px;
    font-size: 14px;
    line-height: 1;
    text-transform: uppercase;
    padding: 7px 12px 8px;
    min-width: 80px;
    transition: 0.2s ease;

    @media(max-width: 767px) {
      margin-right: 12px;
      justify-content: flex-start;
      padding-top: 10px;
    }

    span {
      white-space: nowrap;
      abbr {
        text-decoration: none;
      }
    }

    span:nth-child(2) {
      font-size: 36px;
      margin-left: -2px;
    }

    &.no-date {
      align-items: flex-start;

      &:before {
        @include icon-sanduhr;
        font-family: 'Icons', sans-serif;
        font-size: var(--icon-size);
        line-height: 1;
        margin-bottom: 4px;
        margin-top: 5px;
      }

      * {
        display: none;
      }
    }
  }

  .text-box {
    align-self: center;
    padding: 10px 18px 10px 0;
    line-height: 1.2;

    @media(max-width: 767px) {
      font-size: var(--font-size-small);
    }
  }

  p {
    margin: 0;

    &:not(:last-child) {
      margin: 2px 0 0.3em;
    }
  }

  .ev-title {
    ~ div {
      display: inline-block;
      font-size: var(--font-size-small);
      line-height: 1.2em;
      margin-right: 15px;
      margin-bottom: 2px;
      color: var(--color-text);

      &::before {
        position: relative;
        display: inline-block;
        font-family: 'Icons', sans-serif;
        font-size: 18px;
        line-height: 20px;
        margin-right: 5px;
        vertical-align: top;
        color: var(--color-text);
      }

      @media(max-width: 567px) {
        display: block;
        padding-left: 24px;
        position: relative;

        &:before {
          position: absolute;
          left: 0;
        }
      }

      &.date::before {
        @include icon-xsmall-kalender;
      }
      &.time::before {
        @include icon-xsmall-uhr;
      }
      &.location::before {
        @include icon-xsmall-pin;
      }
      &.interested-parties::before {
        @include icon-xsmall-liste;
      }
      &.price::before {
        @include icon-xsmall-euro;
      }
      &.status {
        &::before {
          @include icon-xsmall-offen;
          color: var(--color-text-accent);
        }

        &.interested-parties, &.waiting-list {
          &::before {
            @include icon-xsmall-liste;
            color: var(--color-text);
          }
        }

        &.reserved::before {
          @include icon-xsmall-geschlossen;
          color: var(--feedback-error);
        }
      }
    }
  }

  .teaser--link {
     position: absolute;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     z-index: 10;
   }
}
