/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--dp-gray-light);
  background: none;
  color: var(--dp-black);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.pagination-item:hover:not(.active):not(.disabled) {
  background-color: #f3f4f6;
  color: #374151;
}

.pagination-item.active {
  background-color: var(--dp-blue);
  color: var(--dp-white);
  font-weight: 600;
}

.pagination-item.disabled {
  color: var(--dp-gray);
  cursor: not-allowed;
}

.pagination-item.disabled:hover {
  background: none;
}

.pagination-item.nav-button {
  padding: 0 2px;
  font-size: 16px;
  font-weight: 600;
}

.pagination-item.ellipsis {
  cursor: default;
  font-weight: 600;
}

.pagination-item.ellipsis:hover {
  background: none;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 480px) {
  .pagination {
    gap: 2px;
    padding: 6px;
  }

  .pagination-item {
    min-width: 28px;
    height: 28px;
    font-size: 13px;
  }
}
.carousel-component {
  display: grid;
  grid-template-areas:
  "title controls"
  "slider slider";

  .title {
    grid-area: title;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--dp-gap);

    h3, h1 {
      margin-bottom: 0;
    }
  }

  .slider-control {
    grid-area: controls;
    display: flex;
    justify-content: end;

    button {
      width: 64px;
      height: 64px;
      border: none;
      background-color: initial;
      display: flex;
      align-items: center;
      justify-content: center;

      svg path {
        fill: #1e1e1e;
      }
    }

    button:hover {
      cursor: pointer;
      border-radius: 50%;
      background: rgba(218, 218, 218, 0.20);
    }
  }

  .slider-control.static {
    display: none;
  }

  .slider {
    grid-area: slider;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    li {
      display: flex;
      width: 100%;
      flex-shrink: 0;

    }

    .short {
      width: 44% !important;
      margin-top: calc(50px - var(--dp-gap));
      @media (max-width: 768px) {
        margin-top: 0;
        width: 87% !important;
      }
    }

  }

  .slider:has(li.short) {
    gap: 20px;
    @media (max-width: 768px) {
      gap: 24px;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    li {
      scroll-snap-align: start
    }
  }

  .slider.related {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    gap: 32px;
    scrollbar-width: none;

    li {
      flex: 0 0 calc(100% / 3 - 32px * 2 / 3);
      scroll-snap-align: start;
      min-width: 0;

      @media (max-width: 1024px) {
        flex: 0 0 calc(50% - 16px);
      }

      @media (max-width: 768px) {
        flex: 0 0 100%;
      }
    }
    /*&:has(li:nth-child(3)) li{*/
    /*  */
    /*}*/
  }

  .slider.static {

    flex-wrap: wrap;
    justify-content: center;
    gap: var(--dp-gap);

    li {
      width: 30%;
    }
  }

  &:has(.slider li.short) {
    @media (max-width: 768px) {
      .slider-control {
        display: none;
      }
    }
  }

  &:has(.slider.related) {
    .title {
      @media (max-width: 768px) {
        justify-content: center;
        h3 {
          text-align: center;
        }
      }
    }
  }
}

@media (width <= 1024px) {
  .carousel-component {
    grid-template-areas:
      "title"
      "slider"
      "controls";

    .title {
      h3 {
        text-align: left;
      }
    }

    .slider {
      margin-bottom: var(--dp-gap-small, 12px);
      @media (max-width: 768px) {
        margin-bottom: 0;
      }
    }

    .slider.static {
      column-gap: unset;
      flex-wrap: nowrap;
      justify-content: unset;

      li {
        width: 100%;

      }
    }

    .slider-control {
      grid-area: controls;
      justify-content: center;
    }

    .slider-control.static {
      display: flex;
    }
  }

}

@media (width >= 1024px) {
  .carousel-component {
    grid-template-columns: 3fr 1fr;
  }
}

@media (width >= 1024px) {
  .projects-by-service {
    .carousel-component {
      .slider {
        gap: var(--dp-gap-medium);

        li {
          width: calc(50% - var(--dp-gap-medium) / 2);
        }
      }
    }
  }
}




