/*==============================================================
  12. Cards
================================================================*/
@use "../default/breakpoints" as bp;

.cs_card_style_1 {
  .cs_card_thumbnails {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .cs_card_thumbnail {

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    &:nth-child(1) {
      grid-row: span 2;
    }

    &:nth-child(2) {
      grid-row: span 3;
    }

    &:nth-child(3) {
      grid-row: span 2;
    }

    &:nth-child(4) {
      grid-row: span 1;
    }
  }

  @include bp.down(lg) {
    .cs_card_thumbnails {
      gap: 12px;
    }
  }

  @include bp.down(xs) {
    .cs_card_thumbnails {
      grid-template-columns: repeat(1, 1fr);

      .cs_card_thumbnail {
        grid-row: span auto !important;
      }
    }
  }
}

.cs_card_style_2 {
  height: 100%;
  max-height: 520px;
  overflow: hidden;
  position: relative;

  .cs_card_overlay {
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 70.02%,
        rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
  }

  .cs_card_thumbnail {
    width: 100%;
    height: 100%;
    z-index: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .cs_card_info {
    width: min(100%, 286px);
    padding: 0 20px 20px;
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    z-index: 1;
  }

  @include bp.down(xxl) {
    .cs_card_info {
      padding-block: 20px;
      padding-inline: 15px 10px;
    }
  }
}

.cs_card_style_3 {
  width: 100%;
  height: 100%;
  min-height: 450px;
  display: flex;
  align-items: flex-end;
  position: relative;

  .cs_card_overlay {
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.5) 70.02%,
        rgba(0, 0, 0, 0.5) 100%);
    transition: all 0.3s ease;
  }

  .cs_category {
    display: inline-block;
    padding: 6px 12px;
    width: fit-content;
    transition: all 0.4s ease;

    &:empty {
      display: none;
    }
  }

  .cs_card_info {
    padding: 24px;
    width: 100%;
    position: relative;
    z-index: 1;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      transform: scaleX(0);
      transform-origin: var(--cs-edge-end);
      transition: transform 0.3s cubic-bezier(0.38, 0.55, 0.25, 0.55);
      z-index: 0;
      background-color: var(--gray-color5);
    }

    >* {
      position: relative;
      z-index: 1;
    }

    .cs_card_title {
      color: var(--white-color);
      letter-spacing: -0.24px;

      a {
        background-repeat: no-repeat;
        background-image: linear-gradient(90deg, currentColor 0, currentColor 100%);
        transition: background-size 0.4s cubic-bezier(0.49, 0.49, 0.08, 1);
        background-position: var(--cs-edge-end) calc(100% - 0px);
        background-size: 0 1px;

        &:hover {
          background-size: 100% 1px;
          background-position: var(--cs-edge-start) calc(100% - 0px);
        }
      }
    }

    p {
      color: var(--gray-color5);
      transition: all 0.4s ease;
    }
  }

  &:hover {
    .cs_card_overlay {
      opacity: 0;
    }

    .cs_card_info {
      &::before {
        transform: scaleX(1);
        transform-origin: var(--cs-edge-start);
      }

      .cs_card_title {
        color: var(--primary-color);
      }

      p {
        color: var(--secondary-color);
      }
    }

    .cs_category {
      color: var(--white-color);
      background-color: var(--primary-color);
    }
  }

  @include bp.down(xxl) {
    .cs_card_info {
      padding-block: 20px;
      padding-inline: 15px 10px;
    }
  }

  @include bp.down(md) {
    min-height: 360px;
  }
}

.cs_card_style_4 {
  min-height: 560px;
  padding: 20px;
  display: flex;
  align-items: flex-end;

  .cs_card_info {
    padding: 25px;
  }

  .cs_card_head {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .cs_card_icon {
    padding-block: 11px 12px;
    padding-inline: 12px 11px;
  }

  @include bp.down(lg) {
    padding: 20px 15px;

    .cs_card_info {
      padding: 25px 15px;
    }
  }
}

.cs_card_style_5 {
  position: absolute;
  inset-inline-end: 32px;
  bottom: 32px;
  padding: 20px;
  width: min(400px, 100%);

  .cs_location_details {
    display: flex;
    gap: 12px;
    flex-direction: column;
  }

  li {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    span:first-child {
      color: var(--white-color);
      letter-spacing: -0.192px;
      font-weight: 600;
      font-family: var(--primary-font);
    }

    span:last-child {
      color: var(--gray-color5);
    }
  }
}

/*================================================
 Cards Wrapper
==================================================*/

.cs_card_wrapper_style_1 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);

  @include bp.down(lg) {
    grid-template-columns: repeat(6, 1fr);

    .cs_card_style_2 {
      grid-column: span 2;

      &:nth-child(4),
      &:nth-child(5) {
        grid-column: span 3;
      }
    }
  }

  @include bp.down(md) {
    grid-template-columns: repeat(2, 1fr);

    .cs_card_style_2 {
      max-height: 400px;
      grid-column: span 1;

      &:nth-child(4) {
        grid-column: span 1;
      }

      &:nth-child(5) {
        width: min(100%, 320px);
        grid-column: span 2;
        margin: 0 auto;
      }
    }
  }

  @media (max-width: 450px) {
    grid-template-columns: repeat(1, 1fr);

    .cs_card_style_2 {
      grid-column: span 1 !important;

      &:nth-child(5) {
        width: 100%;
      }
    }
  }
}

/*================================================
 Cards Wrapper Scroll Track
==================================================*/
.cs_card_wrapper_style_1.cs_scroll_slide {
  --cs-card-width: 20%;
  --cs-card-height: 520px;

  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;

  &::-webkit-scrollbar {
    display: none;
  }

  &.cs_dragging {
    cursor: grabbing;
    user-select: none;
  }

  >.cs_card_style_2 {
    flex: 0 0 auto;
    width: var(--cs-card-width);
    height: var(--cs-card-height);
    margin: 0;
    max-width: none;
    max-height: none;
  }

  @include bp.down(lg) {
    --cs-card-width: 33.333%;
  }

  @include bp.down(md) {
    --cs-card-width: 50%;
    --cs-card-height: 400px;
  }

  @include bp.down(sm) {
    --cs-card-width: 70%;
    --cs-card-height: 350px;
  }
}

.cs_card_wrapper_style_2 {
  .cs_section_title {
    letter-spacing: -0.96px;
  }

  .cs_project_banner {
    height: 100%;

    img {
      width: 100%;
      height: 100%;
      min-height: 400px;
      object-fit: cover;
    }
  }

  .cs_card_style_5 {
    padding: 24px;
  }

  @include bp.down(sm) {
    .cs_card_style_5 {
      padding: 24px 15px;
      position: relative;
      inset-inline-end: initial;
      bottom: initial;
      margin: -150px auto 0;
      z-index: 1;
    }
  }
}