@import "../../mixins/text";

// Navigation tabs for events listing and calendar views (SDC component).
// Fallback styles - values must match SDC CSS (events-nav-tabs.css).
.view-events-listing,
.view-events-calendar {
  .events-nav-tabs.nav-tabs {
    border-bottom: 1px solid $blue-100;
    margin-bottom: 24px;
    padding-left: 0;

    .nav-item .nav-link {
      font-weight: 500;
      font-size: 0.875rem;
      line-height: 1.5;
      color: $body-tertiary-color;
      background: none;
      border: none;
      padding: 8px 20px 16px 20px;

      &:hover {
        color: $blue-500;
      }

      &.active {
        color: $blue-800;
        background: none;
        border-bottom: 2px solid $blue-500;
      }
    }

    // Align first tab with container content edge.
    .nav-item:first-child .nav-link {
      padding-left: 0;
    }
  }
}

#block-openintranet-theme-views-block-events-blocks-block-1,
.view-events-listing {
  .view-content {
    display: flex;
    flex-direction: column;
    margin: 0 0 24px;
  }

  .views-row {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .event-item {
    display: grid;
    grid-template-columns: 45px 1fr auto;
    gap: 16px;
    padding: 16px 12px;
    margin: 0 -12px;
    border-bottom: 1px solid $blue-50;
    border-radius: 8px;
    color: $body-tertiary-color;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease;

    &:hover {
      background-color: $blue-50;
    }

    .left-side {

      .event-main-date {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        text-transform: uppercase;

        .month {
          margin-bottom: 4px;

          @include body-300;
        }

        .day {
          @include heading-5;

          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }

    .right-side {
      display: flex;
      flex-direction: column;
      gap: 4px;

      .time {
        padding: 0;

        @include body-300;
      }

      .title {
        a {
          color: $blue-500 !important;
          padding: 0 !important;

          @include link-base;
          @include body-400;

          &:hover {
            text-decoration: none;
            background-color: inherit;
          }
        }
      }

      .location {
        padding: 0;

        @include body-300;
      }
    }

    .event-image {
      display: flex;
      align-items: center;
      justify-content: flex-end;

      img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: $border-radius;
      }

      // Hide the wrapper when there is no image.
      &:empty {
        display: none;
      }
    }
  }
}
