/* ============================================
   Page Hero (works固有: 背景色)
   ============================================ */
.page-hero {
  background: var(--black2);
}

/* ============================================
   Works Section
   ============================================ */
.works-section {
  background: var(--black2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
  padding: 100px max(20px, calc((100% - 1140px) / 2)) 150px;
}

/* ============================================
   Filter Tabs
   ============================================ */
.works-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 15px;
  justify-content: center;
}

.works-filter__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 34px;
  border-radius: 30px;
  border: 1px solid var(--white);
  background: transparent;
  font-family: 'Avenir', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.48px;
  text-transform: uppercase;
  color: var(--white);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.works-filter__btn--active {
  background: var(--white);
  color: var(--black1);
  border-color: var(--white);
}

.works-filter__btn:hover:not(.works-filter__btn--active) {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Works List
   ============================================ */
.works-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
  width: 100%;
}

.works-divider {
  width: 100%;
  height: 1px;
  background: var(--line-black);
  flex-shrink: 0;
  margin: -40px 0;
}

/* ============================================
   Works Card
   ============================================ */
.works-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px 100px;
  width: 100%;
  padding: 0 30px;
  position: relative;
  cursor: pointer;
}

.works-card__content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 330px;
  flex-shrink: 0;
}

.works-card__company {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.54px;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.4;
  white-space: nowrap;
  padding-bottom: 5px;
}

.works-card__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.8;
  letter-spacing: 0.6px;
  color: var(--white);
  width: 330px;
}

.works-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 330px;
}

.works-card__tag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 10px 24px;
  border-radius: 30px;
  background: var(--black3);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.42px;
  color: var(--white);
  white-space: nowrap;
}

.works-card__detail {
  display: flex;
  align-items: center;
  gap: 30px;
  padding-top: 30px;
}

.works-card__detail::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.works-card__detail-text {
  font-family: 'Avenir', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 1.2px;
  color: var(--white);
  white-space: nowrap;
  position: relative;
}

.works-card__detail-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--white);
  transition: width 0.35s ease;
}

.works-card__detail:hover .works-card__detail-text::after {
  width: 100%;
}

.works-card__detail-arrow {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  transition: transform 0.35s ease;
}

.works-card__detail:hover .works-card__detail-arrow {
  transform: translateX(10px);
}

.works-card__detail:hover .btn-arrow__circle {
  fill: white;
}

.works-card__detail:hover .btn-arrow__arrow {
  fill: black;
}

.works-card__image-wrap {
  flex: 1 0 0;
  min-width: 335px;
}

.works-card__image-placeholder {
  width: 100%;
  height: 396px;
  background: #d9d9d9;
  border-radius: 3.734px;
  position: relative;
  overflow: hidden;
}

/* ============================================
   Pagination
   ============================================ */
.works-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.works-pagination__btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 5px;
  border: 1px solid var(--white);
  background: var(--black2);
  font-family: 'Roboto', 'Avenir', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--white);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-pagination__btn--active {
  background: var(--white);
  color: var(--black1);
  border-color: var(--white);
}

.works-pagination__btn:hover:not(.works-pagination__btn--active) {
  background: rgba(255, 255, 255, 0.1);
}

.works-pagination__ellipsis {
  font-family: 'Roboto', 'Avenir', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--white);
  line-height: 1;
}

/* ============================================
   Hidden state for filter
   ============================================ */
.works-card[hidden] {
  display: none;
}

.works-divider[hidden] {
  display: none;
}

/* ============================================
   Responsive — 786px
   ============================================ */
@media (max-width: 786px) {

  /* -- Page Hero (works固有) -- */
  .page-hero {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page-hero__content {
    margin-bottom: 50px;
  }

  .page-hero__breadcrumbs {
    margin-top: 0;
    margin-bottom: 31px;
  }

  .page-hero__line {
    width: 335px;
    margin-top: 0;
  }

  /* -- Works -- */
  .works-section {
    padding: 80px 20px 100px;
    gap: 30px;
  }

  .works-filter {
    gap: 10px;
    padding-bottom: 30px;
    justify-content: flex-start;
    width: 100%;
  }

  .works-filter__btn {
    font-size: 14px;
    padding: 12px 34px;
  }

  .works-list {
    gap: 30px;
  }

  .works-divider {
    margin: 0;
  }

  .works-card {
    flex-direction: column;
    padding: 0;
    gap: 30px;
  }

  /* 画像をコンテンツより先に表示 */
  .works-card__image-wrap {
    order: -1;
    width: 100%;
    min-width: unset;
  }

  /* アスペクト比を維持しながら幅に合わせて拡大 */
  .works-card__image-placeholder {
    height: auto;
    aspect-ratio: 335 / 207;
  }

  .works-card__content {
    min-width: unset;
    width: 100%;
    gap: 16px;
  }

  .works-card__company {
    font-size: 18px;
    white-space: nowrap;
  }

  .works-card__title {
    width: 100%;
    font-size: 18px;
    letter-spacing: 0.54px;
  }

  .works-card__tags {
    min-width: unset;
  }

  /* Detailリンクは非表示 */
  .works-card__detail {
    display: none;
  }

  /* -- Pagination -- */
  .works-pagination {
    padding-top: 30px;
  }

  .works-pagination__btn {
    width: 50px;
    height: 50px;
    font-size: 15px;
    background: #e8e8e8;
    color: #121212;
    border: 1px solid #121212;
  }

  .works-pagination__btn--active {
    background: #121212;
    color: #ffffff;
    border-color: #121212;
  }

  .works-pagination__ellipsis {
    color: #333;
  }
}
