.works-carousel-wrapper {
  position: relative;
  overflow-anchor: none;
}

.works-carousel-container {
  position: relative;
  padding: 0 var(--size-80);
  max-width: var(--size-1100);
  margin: 0 auto;
}

.works-carousel-item {
  height: var(--size-420);
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

.works-carousel-item__link {
  display: flex;
  flex-direction: row;
  background-color: #fff;
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: var(--size-420);
  text-decoration: none;
  color: var(--color-text-black);
  box-shadow: none;
  width: 100%;
  transform-origin: center center;
  will-change: transform, box-shadow;
}

.works-carousel-item__link:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.works-carousel-item__image {
  width: 50%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
  padding: var(--size-24) var(--size-16);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.works-carousel-item__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-light-gray2);
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.works-carousel-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  max-width: 100%;
  max-height: 100%;
}

.works-carousel-item__content {
  padding: var(--size-24) var(--size-16);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  width: 50%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  will-change: scroll-position;
}

.works-carousel-item__title {
  font-size: var(--size-28);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--size-24);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  hyphens: auto;
}

.works-carousel-item__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-8);
  margin-bottom: var(--size-20);
}

.works-carousel-item__category {
  display: inline-block;
  font-size: var(--size-14);
  font-weight: var(--font-weight-bold);
  padding: var(--size-4) var(--size-12);
  border-radius: var(--size-4);
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.works-carousel-item__jigyou {
  background-color: var(--color-main-blue);
  color: #fff;
}

.works-carousel-item__youto {
  background-color: var(--color-accent-red);
  color: #fff;
}

.works-carousel-item__meta {
  margin-top: auto;
  font-size: var(--size-16);
  display: flex;
  flex-direction: column;
  gap: var(--size-8);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.works-carousel-item__meta > div {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.works-carousel-wrapper .swiper-button-next,
.works-carousel-wrapper .swiper-button-prev {
  width: var(--size-56);
  height: var(--size-56);
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 0;
  border: 1px solid var(--color-text-gray);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  top: calc(50% - var(--size-56) + 16px);
}

.works-carousel-wrapper .swiper-button-next {
  right: var(--size-16);
}

.works-carousel-wrapper .swiper-button-prev {
  left: var(--size-16);
}

.works-carousel-wrapper .swiper-button-next:after,
.works-carousel-wrapper .swiper-button-prev:after {
  font-size: var(--size-20);
  font-weight: var(--font-weight-bold);
}

.works-carousel-wrapper .swiper-button-next:hover,
.works-carousel-wrapper .swiper-button-prev:hover {
  background-color: var(--color-frame-black);
  border-color: #fff;
  color: #fff;
  transform: scale(1.05);
}

.works-carousel-wrapper .swiper-pagination {
  position: relative !important;
  bottom: auto !important;
  margin-top: var(--size-32);
  display: flex !important;
  justify-content: center !important;
  gap: var(--size-8);
  width: 100%;
}

.works-carousel-wrapper .swiper-pagination-bullet {
  width: var(--size-40) !important;
  height: var(--size-3) !important;
  border-radius: 0 !important;
  background-color: var(--color-bg-light-gray1) !important;
  opacity: 1 !important;
  margin: 0 !important;
  transition: background-color 0.3s;
}

.works-carousel-wrapper .swiper-pagination-bullet-active {
  background-color: var(--color-accent-red) !important;
  opacity: 1 !important;
}

.swiper-fade .swiper-slide {
  pointer-events: none;
  transition-property: opacity;
}

.swiper-fade .swiper-slide-active {
  pointer-events: auto;
}

.works-carousel-no-results {
  text-align: center;
  padding: var(--size-40) 0;
  color: var(--color-text-gray);
}

@media screen and (max-width: 992px) {
  .works-carousel-item {
    height: var(--size-400);
    overflow: hidden;
  }

  .works-carousel-item__link {
    height: var(--size-400);
  }

  .works-carousel-item__image {
    height: 100%;
    padding: var(--size-24) var(--size-16);
  }

  .works-carousel-item__content {
    padding: var(--size-24) var(--size-16);
  }

  .works-carousel-item__title {
    font-size: var(--size-24);
    margin-bottom: var(--size-16);
  }

  .works-carousel-container {
    padding: 0 var(--size-60);
  }

  .works-carousel-wrapper .swiper-button-next,
  .works-carousel-wrapper .swiper-button-prev {
    width: var(--size-48);
    height: var(--size-48);
    top: calc(50% - var(--size-48) + 16px);
    border-radius: 0;
  }
}

@media screen and (max-width: 768px) {
  .works-carousel-container {
    padding: 0 var(--size-32);
  }

  .works-carousel-item {
    height: var(--size-420);
    overflow: hidden;
  }

  .works-carousel-item__link {
    flex-direction: column;
    height: var(--size-420);
  }

  .works-carousel-item__image {
    width: 100%;
    height: var(--size-220);
    padding: var(--size-16) var(--size-12);
    flex: 0 0 var(--size-220);
  }

  .works-carousel-item__content {
    width: 100%;
    padding: var(--size-16) var(--size-12);
    flex: 0 0 calc(var(--size-420) - var(--size-220));
    height: calc(var(--size-420) - var(--size-220));
    max-height: calc(var(--size-420) - var(--size-220));
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .works-carousel-item__title {
    font-size: var(--size-16);
    margin-bottom: var(--size-10);
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    min-width: 0;
  }

  .works-carousel-item__meta {
    margin-top: var(--size-12);
    font-size: var(--size-14);
    gap: var(--size-10);
  }

  .works-carousel-item__categories {
    margin-bottom: var(--size-12);
    gap: var(--size-8);
    flex-wrap: wrap;
  }

  .works-carousel-item__category {
    font-size: var(--size-11);
    padding: var(--size-2) var(--size-8);
    margin-bottom: var(--size-4);
  }

  .works-carousel-wrapper .swiper-button-next,
  .works-carousel-wrapper .swiper-button-prev {
    width: var(--size-32);
    height: var(--size-32);
    top: calc(50% - var(--size-32) + 16px);
    border-radius: 0;
  }

  .works-carousel-wrapper .swiper-button-next:after,
  .works-carousel-wrapper .swiper-button-prev:after {
    font-size: var(--size-14);
  }

  .works-carousel-wrapper .swiper-pagination-bullet {
    width: var(--size-24) !important;
    height: var(--size-2) !important;
  }
}

.swiper-container.works-carousel {
  overflow: hidden;
  margin-bottom: var(--size-16);
}

.swiper-wrapper {
  overflow: visible;
}

.works-carousel .swiper-slide {
  height: auto;
  overflow: visible;
  padding-top: var(--size-8);
  padding-bottom: var(--size-8);
  transform: translateZ(0);
}
