/* works */
/* ============================================ */

/* ヒーロー装飾 */
.works-hero {
  padding: 230px 0 128px;
  position: relative;
  @media (width <= 896px) {
    padding: 120px 0 40px;
  }
}
.works-hero__bg {
  container-type: inline-size;
  width: min(1922px, ((1922 / 1920) * 100vw));
  height: min(1198px, ((1198 / 1920) * 100vw));
  position: absolute;
  top: min(-335px, ((-335 / 1920) * 100vw));
  right: max(-498px, ((-498 / 1920) * 100vw));
  @media (width <= 896px) {
    width: min(408px * 1.5, ((408 / 375) * 100vw));
    height: min(230px * 1.5, ((230 / 375) * 100vw));
    top: min(16px * 1.5, ((16 / 375) * 100vw));
    right: max(-114px * 1.5, ((-114 / 375) * 100vw));
  }
  img {
    width: 100%;
    max-width: none;
  }
}
.works-hero__blur {
  position: absolute;
  &.works-hero__blur--01 {
    width: calc((481 / 1922) * 100cqw);
    top: 0;
    left: 0;
    @media (width <= 896px) {
      width: calc((82 / 408) * 100cqw);
      top: auto;
      left: auto;
      right: calc((114 / 408) * 100cqw);
      bottom: 0;
    }
  }
  &.works-hero__blur--02 {
    width: calc((169 / 1922) * 100cqw);
    top: calc((268 / 1922) * 100cqw);
    left: calc((654 / 1922) * 100cqw);
    @media (width <= 896px) {
      width: calc((56 / 408) * 100cqw);
      top: calc((40 / 408) * 100cqw);
      left: calc((96 / 408) * 100cqw);
    }
  }
  &.works-hero__blur--03 {
    width: calc((341 / 1922) * 100cqw);
    top: calc((352 / 1922) * 100cqw);
    left: calc((240 / 1922) * 100cqw);
    @media (width <= 896px) {
      width: calc((80 / 408) * 100cqw);
      top: 0;
      left: calc((66 / 408) * 100cqw);
    }
  }
  &.works-hero__blur--04 {
    width: calc((364 / 1922) * 100cqw);
    top: calc((602 / 1922) * 100cqw);
    left: calc((144 / 1922) * 100cqw);
    @media (width <= 896px) {
      width: calc((92 / 408) * 100cqw);
      top: calc((56 / 408) * 100cqw);
      left: 0;
    }
  }
}
.works-hero__visual {
  container-type: inline-size;
  width: calc((1420 / 1922) * 100cqw);
  height: calc((892 / 1922) * 100cqw);
  position: absolute;
  right: 0;
  bottom: 0;
  @media (width <= 896px) {
    width: calc((296 / 408) * 100cqw);
    height: calc((189 / 408) * 100cqw);
    bottom: auto;
    top: 0;
  }
}
.works-hero__photo {
  width: calc((818 / 1420) * 100cqw);
  height: calc((706 / 1420) * 100cqw);
  position: absolute;
  top: calc((27 / 1420) * 100cqw);
  left: calc((160 / 1420) * 100cqw)
}

/* hero ビジュアル：常時ふわふわ動くループ演出（JSで.is-floating付与後に発火） */
.works-hero__bean,
.works-hero__photo {
  will-change: transform;
}
.works-hero__visual.is-floating .works-hero__bean { animation: hero-sway 6.5s ease-in-out infinite; }
.works-hero__visual.is-floating .works-hero__photo { animation: hero-float 7.5s ease-in-out .4s infinite; }

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc((-10 / 1420) * 100cqw)); }
}
@keyframes hero-sway {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(calc((6 / 1420) * 100cqw), calc((-8 / 1420) * 100cqw)); }
  66% { transform: translate(calc((-4 / 1420) * 100cqw), calc((-4 / 1420) * 100cqw)); }
}
@media (prefers-reduced-motion: reduce) {
  .works-hero__visual.is-floating .works-hero__bean,
  .works-hero__visual.is-floating .works-hero__photo {
    animation: none;
  }
}
.works-hero__body {
  width: 56%;
  max-width: 816px;
  @media (width <= 896px) {
    width: 100%;
  }
}


/* 一覧本体 */
/* ============================================ */
.works-list__row {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  @media (width <= 1025px) {
    flex-direction: column;
    gap: 40px;
  }
}


/* サイドバー絞り込み */
/* ============================================ */
.works-filter {
  flex-shrink: 0;
  width: 360px;
  max-width: 100%;
  @media (width <= 1025px) {
    width: 100%;
  }
}
.works-filter__form {
  display: flex;
  flex-direction: column;
}
.works-filter__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  &:not(:empty) {
    margin-bottom: 24px;
    @media (width <= 896px) {
      margin-bottom: 20px;
    }
  }
}
.works-filter__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: calc((4 / 12) * 1em) calc((8 / 12) * 1em) calc((4 / 12) * 1em) calc((12 / 12) * 1em);
  background: color-mix(in srgb, var(--main_c) 10%, transparent);
  border: 1px solid var(--main_c);
  border-radius: 9999px;
  color: var(--main_c);
  font-size: clamp(0.625rem, 0.4792rem + 0.2604vw, 0.75rem); /* 12~10(1664~896) */
  letter-spacing: .05em;
  transition: opacity .3s ease-out;
  &:hover {
    @media (hover: hover) {
      opacity: .7;
    }
  }
  span {
    font-size: calc((14 / 12) * 1em);
    line-height: 1;
  }
}
.works-filter__search {
  position: relative;
  display: flex;
  align-items: center;
}
.works-filter__search-input {
  width: 100%;
  height: 44px;
  padding: 0 72px 0 14px;
  background: #fff;
  border: 1px solid var(--line_c);
  border-radius: 8px;
  color: var(--font_c);
  font-size: calc((16 / 16) * 1rem);
  letter-spacing: .05em;
  transition: border-color .2s ease-out, background-color .2s ease-out, box-shadow .2s ease-out;
  @media (width <= 896px) {
    background: #F7F7F7;
  }
  &::placeholder {
    color: var(--line_c);
  }
  /* ブラウザ標準の×（クリアボタン）は非表示にし、独自のクリアボタンに差し替える */
  &::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
  }
  &:focus-visible {
    background: #e8f4ea;
    border-color: var(--main_c);
    outline: none;
    box-shadow: 0 0 20px 0 rgba(44, 137, 58, .4);
  }
}
.works-filter__search-clear {
  position: absolute;
  right: 42px;
  display: none;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  color: var(--line_c);
  cursor: pointer;
  svg {
    width: 100%;
    height: 100%;
  }
}
.works-filter__search-input:not(:placeholder-shown) ~ .works-filter__search-clear {
  display: inline-flex;
}
.works-filter__search-icon {
  position: absolute;
  right: 14px;
  display: inline-flex;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  color: var(--main_c);
  cursor: pointer;
  svg {
    width: 100%;
    height: 100%;
  }
}
.works-filter__group {
  padding: 24px 0;
  border-bottom: 1px solid var(--line_c);
}
.works-filter__group-ttl {
  padding-left: 8px;
  border-left: 2px solid var(--main_c);
  font-size: var(--fs_m); /* 16~14 */
  font-weight: 700;
  letter-spacing: .04em;
  color: #222;
}
.works-filter__list {
  display: flex;
  flex-direction: column;
  gap: 4px 8px;
  margin-top: 16px;
  @media (width <= 896px) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
.works-filter__list--2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.works-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.works-check__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.works-check__box {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 1px solid var(--line_c);
  border-radius: 4px;
  color: #fff;
  transition: background-color .2s ease-out, border-color .2s ease-out;
}
.works-check__mark {
  width: 14px;
  height: 11px;
  opacity: 0;
  transition: opacity .2s ease-out;
}
.works-check__label {
  font-size: calc((13 / 16) * 1rem);
  letter-spacing: .03em;
  color: var(--font_c);
}
.works-check__input:checked ~ .works-check__box {
  background: var(--main_c);
  border-color: var(--main_c);
}
.works-check__input:checked ~ .works-check__box .works-check__mark {
  opacity: 1;
}
.works-check__input:focus-visible ~ .works-check__box {
  outline: 2px solid var(--main_c);
  outline-offset: 2px;
}
.works-filter__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
}
.works-filter__submit {
  text-align: center;
  width: 100%;
  isolation: isolate;
  overflow: clip;
  background: var(--main_c);
  border-radius: 9999px;
  color: #fff;
  font-size: calc((14 / 16) * 1rem);
  font-weight: 700;
  letter-spacing: .08em;
  padding: calc((14 / 14) * 1em) calc((48 / 14) * 1em);
  cursor: pointer;
  position: relative;
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 9999px;
    background: var(--font_c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease-out;
  }
  &:hover {
    @media (hover: hover) {
      &::before {
        transform: scaleX(1);
      }
    }
  }
}
.works-filter__submit-icon {
  display: inline-flex;
  width: calc((20 / 14) * 1em);
  height: calc((20 / 14) * 1em);
  position: absolute;
  top: 50%;
  right: calc((24 / 14) * 1em);
  translate: 0 -50%;
  svg {
    width: 100%;
    height: 100%;
  }
}
.works-filter__clear {
  position: relative;
  display: inline-block;
  margin-top: 20px;
  font-size: calc((12 / 16) * 1rem); /* 12px */
  letter-spacing: .05em;
  color: var(--main_c);
  padding-bottom: calc((4 / 12) * 1em);
  cursor: pointer;
  @media (width <= 896px) {
    margin-top: 16px;
  }
  &::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--main_c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease-out;
  }
  @media (hover: hover) {
    &:hover::after {
      transform: scaleX(1);
    }
  }
}


/* カード一覧 */
/* ============================================ */
.works-main {
  min-width: 0;
  flex: 1;
}
.works-main__count {
  font-size: calc((14 / 16) * 1rem); /*14px */
  display: flex;
  align-items: center;
  gap: .4em;
  color: #222;
  @media (width <= 896px) {
    justify-content: center;
  }
}
.works-main__count-num {
  font-size: calc((40 / 16) * 1rem); /* 40px */
  font-weight: 600;
  line-height: 1;
}
.works-main__empty {
  line-height: 1.8;
  margin-top: 8px;
}
.works-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 32px;
  @media (width <= 1367px) {
    grid-template-columns: repeat(2, 1fr);
  }
  @media (width <= 896px) {
    gap: 10px;
    margin-top: 24px;
  }
  @media (width <= 600px) {
    grid-template-columns: repeat(1, 1fr);
  }
}
.works-card {
  background: #fff;
  border-radius: 16px;
  overflow: clip;
  height: 100%;
  transition: box-shadow .3s ease-out;
  @media (hover: hover) {
    &:has(.works-card__link:hover) {
      box-shadow: 0 0 20px 0 color-mix(in srgb, var(--main_c) 40%, transparent);
    }
  }
}
.works-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  &:hover {
    @media (hover: hover) {
      opacity: 1;
    }
  }
}
.works-card__thumb {
  display: block;
  overflow: hidden;
}
.works-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 360 / 202;
  object-fit: cover;
  object-position: top center;
  transition: scale .4s ease-out;
  .works-card__link:hover & {
    @media (hover: hover) {
      scale: 1.08;
    }
  }
}
.works-card__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-top: 1px solid var(--bg_c);
}
.works-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.works-card__label {
  display: inline-flex;
  align-items: center;
  padding: calc((4 / 12) * 1em) calc((16 / 12) * 1em);
  background: var(--bg_c);
  border: 1px solid var(--main_c);
  border-radius: 9999px;
  color: var(--main_c);
  font-size: calc((12 / 16) * 1rem); /* 12px */
  font-weight: 900;
  letter-spacing: .08em;
}
.works-card__hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 12px;
  font-size: calc((14 / 16) * 1rem);
  letter-spacing: .05em;
  color: var(--main_c);
}
.works-card__client {
  font-size: calc((14 / 16) * 1em);
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--main_c);
}
.works-card__ttl {
  display: block;
  font-size: calc((16 / 16) * 1rem);
  font-weight: 600;
  line-height: 1.8;
  color: var(--font_c);
  margin-top: 4px;
}
.works-card__txt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: var(--fs_m); /* 16~14 */
  line-height: 1.8;
  letter-spacing: .03em;
  color: var(--font_c);
  margin-top: 8px;
}


/* ページネーション */
/* ============================================ */
.works-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  @media (width <= 896px) {
    gap: 8px;
    margin-top: 40px;
  }
}
.works-pagination__prev,
.works-pagination__next {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs_ms); /* 18~16 */
  color: var(--font_c);
  &:hover {
    @media (hover: hover) {
      opacity: 1;
      color: var(--main_c);
    }
  }
}
.works-pagination__prev--disabled {
  pointer-events: none;
  opacity: .4;
}
.works-pagination__label {
  font-size: clamp(0.75rem, 0.4583rem + 0.5208vw, 1rem); /* 16~12(1664~896) */
  @media (width <= 896px) {
    display: none;
  }
}
.works-pagination__arrow {
  display: inline-flex;
  width: 20px;
  height: 20px;
  &::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--main_c);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }
}
.works-pagination__prev .works-pagination__arrow::after {
  -webkit-mask-image: url(../images/common/arrow_left.svg);
  mask-image: url(../images/common/arrow_left.svg);
}
.works-pagination__next .works-pagination__arrow::after {
  -webkit-mask-image: url(../images/common/arrow_right.svg);
  mask-image: url(../images/common/arrow_right.svg);
}
.works-pagination__list {
  display: flex;
  align-items: center;
  gap: 8px;
  @media (width <= 896px) {
    gap: 4px;
  }
}
.works-pagination__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--font_c);
  font-family: var(--font_en);
  font-size: calc((14 / 16) * 1rem); /* 14px */
  font-weight: 600;
  background: #fff;
  @media (width <= 896px) {
    width: 40px;
    height: 40px;
    font-size: calc((12 / 16) * 1rem); /* 12px */
  }
}
.works-pagination__num--current {
  background: var(--main_c);
  color: #fff;
}
.works-pagination__num:hover {
  @media (hover: hover) {
    opacity: 1;
    background: var(--main_c);
    color: #fff;
  }
}
.works-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--font_c);
}
.works-pagination__num-item--sp-hidden {
  @media (width <= 896px) {
    display: none;
  }
}
