.works {
  .category-list {
    position: relative;

    .nav-toggle {
      display: none;
    }

    .nav-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      list-style: none;
      margin: 0 0 40px;
      padding: 24px;
      background: #ffffff69;
      border-radius: 10px;
      justify-content: center;

      @media screen and (max-width: 991px) {
        flex-direction: unset;
      }

      & button {
        display: inline-block;
        padding: 0.4em 0.8em;
        background: #b5b5b5;
        border: 0;
        color: #ffffff;
        font-size: 16px;
        font-weight: 600;
        border-radius: 50px;
        cursor: pointer;
        min-width: 150px;

        &.active {
          background: #ffb300 !important;
        }

        @media screen and (max-width: 991px) {
          min-width: 120px;
          font-size: 14px;
        }
      }

      @media screen and (max-width: 560px) {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        z-index: 20;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 6px;
        margin: 0;
        padding: 12px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;

        &.is-open {
          display: flex;
          animation: nav-list-fade 0.25s ease;
        }

        & li {
          width: 100%;
          flex-shrink: 0;
        }

        & button {
          width: 100%;
          min-width: unset;
          font-size: 14px;
          padding: 0.7em 1em;
          text-align: left;
        }
      }
    }

    @media screen and (max-width: 560px) {
      margin-bottom: 24px;

      .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.9em 1.2em;
        background: #ffc107;
        border-radius: 50px;
        color: #ffffff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;

        &::after {
          content: "";
          width: 8px;
          height: 8px;
          border-right: 2px solid #fff;
          border-bottom: 2px solid #fff;
          transform: rotate(45deg) translateY(-2px);
          transition: transform 0.25s ease;
          flex-shrink: 0;
        }

        &[aria-expanded="true"]::after {
          transform: rotate(-135deg) translateY(-2px);
        }
      }
    }
  }

  .cont {
    .box {
      max-width: 1280px;

      .item {
        margin-bottom: 16px;

        .bg-cont {
          width: 100%;

          .block-area {
            display: flex;
            flex-direction: column;
            text-decoration: none;
            color: #333;

            .works-thumb-wrap {
              display: flex;
              gap: 4px;

              &.single {
                display: block;
              }

              & figure {
                flex: 1;
                width: 100%;
                margin: 0;
                overflow: hidden;
                border-radius: 8px;
                height: 180px;

                @media screen and (max-width: 991px) {
                  height: 160px;
                }

                @media screen and (max-width: 560px) {
                  height: 200px;
                }

                &.sp-img {
                  flex: 0.3;
                }

                & img {
                  display: block;
                  width: 100%;
                  height: 100%;
                  object-fit: cover;
                  object-position: top;
                }

                & video {
                  object-fit: cover;
                }
              }
            }

            .works-info {
              padding: 16px;
              background: #ffffff78;
              border-radius: 10px;
              margin-top: 8px;

              .works-ttl {
                font-size: clamp(1rem, 0.9167rem + 0.1736vw, 1.125rem);
                font-weight: 700;
                margin: 0 0 8px;
                display: flex;
                align-items: center;
                gap: 8px;

                &::before {
                  content: "";
                  display: inline-block;
                  width: 4px;
                  height: 1.2em;
                  background: #f90;
                  border-radius: 2px;
                  flex-shrink: 0;
                }
              }

              .works-tags {
                display: flex;
                flex-wrap: wrap;
                gap: 2px 8px;
                line-height: 1.4;

                .works-tag {
                  font-size: 14px;
                  font-weight: 500;
                  color: #686868;
                  display: flex;
                  align-items: center;
                  gap: 5px;

                  .tag-dot {
                    content: "";
                    display: block;
                    background: #f90;
                    border-radius: 50px;
                    width: 6px;
                    height: 6px;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

@keyframes nav-list-fade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.works-detail-thumb-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;

  @media screen and (max-width: 991px) {
    padding: 0px;
    flex-direction: column;
  }
}

.works-slider-pc {
  flex: 1 1 0;
  min-width: 0;
}

.works-slider-sp {
  flex: 0 0 auto;
  width: 120px;

  @media screen and (max-width: 991px) {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
  }

  @media screen and (max-width: 560px) {
    width: 100%;
  }
}

.works-slider-sp img {
  width: 100%;
  height: auto;
}

.cont.single {
  .box {
    display: flex;
    flex-direction: column;
    align-items: center;

    .item-cont {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
      max-width: 90%;

      @media screen and (max-width: 991px) {
        width: 100%;
        max-width: 100%;
      }

      .ttl-area {
        margin-bottom: 24px;

        & h2 {
          font-weight: 900;
        }
      }

      .item {
        display: flex;
        gap: 40px;
        padding: 32px;
        background: #ffffff49;
        border-radius: 15px;
        width: 100%;

        @media screen and (max-width: 991px) {
          padding: 0px;
          flex-direction: column;
          gap: 16px;
          width: 100%;
        }

        .left {
          flex: 1;
        }

        .right {
          flex: 0.7;
          display: block;

          .table-works {
            background: #fff;
            border-radius: 10px;
            padding: 16px;

            & dl {
              display: flex;
              padding: 16px 0;
              border-bottom: 1px solid #ccc;
              margin: 0;

              @media screen and (max-width: 991px) {
                padding: 0px;
                flex-direction: column;
              }

              & dt {
                flex: 1;
                color: #f90;
                padding-left: 16px;
                font-size: 15px;

                @media screen and (max-width: 991px) {
                  padding-left: 4px;
                }
              }

              & dd {
                flex: 2.1;
                font-size: 15px;
                margin: 0;

                @media screen and (max-width: 991px) {
                  padding-left: 16px;
                }
              }
            }
            & dl:last-child {
              border-bottom: none;
            }
          }
        }
      }
    }
  }
}

/* タブナビ：SPのみ表示 */
.works-tab-nav {
  display: none;
}

@media (max-width: 991px) {
  .works-tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
    width: 100%;
  }

  .works-tab-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    background: #b4b4b4;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
  }

  .works-tab-btn.active {
    border-color: #f90;
    color: #fff;
    background: #f90 !important;
  }

  /* SP時はタブで切り替え */
  .works-tab-content {
    display: none;
  }

  .works-tab-content.active {
    display: block;
  }
}

/* PC時は両方並べて表示 */
@media (min-width: 991px) {
  .works-detail-thumb-wrap {
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }

  .works-slider-pc {
    flex: 1 1 0;
    min-width: 0;
  }

  .works-slider-sp {
    flex: 0 0 auto;
    width: 120px;
  }

  .works-tab-content {
    display: block !important;
  }
}

@media (max-width: 991px) {
  .works-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .works-tab-content.active {
    display: block;
    animation: tabFadeIn 0.3s ease forwards;
  }
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button {
  .btn {
    background: linear-gradient(135deg, #f90, #ffb300);
    border-radius: 50px;
    font-weight: 600;
    padding: 16px 24px;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
    color: #fff;

    &:hover {
      opacity: 0.8;
      transform: translateY(-2px);
    }
  }
}

.containerr .mix:after {
  display: unset !important;
  content: unset !important;
  padding: unset !important;
  content: unset !important;
  color: unset !important;
  font-size: unset !important;
  font-family: unset !important;
  display: unset !important;
  vertical-align: unset !important;
  padding: unset !important;
  font-weight: unset !important;
}

.col-md-3 {
  @media (max-width: 991px) {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
  }
  @media (max-width: 560px) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;

  .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: #fff;
    border: 2px solid #e0e0e0;
    text-decoration: none;
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      transform 0.2s ease;

    &:hover {
      background: #fff8e1;
      border-color: #ffb300;
      color: #ffb300;
      transform: translateY(-2px);
    }

    &.current {
      background: linear-gradient(135deg, #f90, #ffb300);
      border-color: transparent;
      color: #fff;
      box-shadow: 0 4px 12px rgba(255, 153, 0, 0.35);
    }

    &.prev,
    &.next {
      font-size: 18px;
      background: #fff;
    }

    &.dots {
      border: none;
      background: none;
      color: #aaa;
      cursor: default;

      &:hover {
        transform: none;
        background: none;
        border-color: transparent;
        color: #aaa;
      }
    }
  }

  @media screen and (max-width: 767px) {
    gap: 6px;

    .page-numbers {
      width: 34px;
      height: 34px;
      font-size: 13px;
    }
  }
}

.works-movie-block {
  margin-bottom: 16px;
}

.works-movie-item {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 10px;

  & iframe,
  & video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  & video {
    object-fit: cover;
  }
}

.works-movie-name,
.works-print-name {
  margin-top: 8px;
  font-size: 14px;
  text-align: center;
}

.works-print-wrap {
  .img {
    margin-bottom: 16px;
  }
}

/* 一覧：大カテゴリタブ */
.works-type-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;

  @media screen and (max-width: 560px) {
    flex-direction: column;
    margin-bottom: 24px;
  }

  .works-type-btn {
    display: inline-block;
    padding: 0.6em 1.2em;
    background: #b5b5b5;
    border: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    min-width: 200px;
    transition: background 0.3s ease;

    &.active {
      background: #ff9900 !important;
      color: #fff !important;
    }

    @media screen and (max-width: 991px) {
      min-width: 140px;
      font-size: 14px;
    }

    @media screen and (max-width: 560px) {
      min-width: unset;
      flex: 1;
      font-size: 16px;
      padding: 0.5em 0.6em;
    }
  }
}

.works-type-content {
  display: none;

  &.active {
    display: block;
    animation: works-type-zoom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@keyframes works-type-zoom {
  from {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.works-type-empty {
  text-align: center;
  padding: 60px 0;
}

/* 一覧：紙媒体カードは固定の高さで画像全体を表示 */
.works .cont .box .item .bg-cont .block-area .works-thumb-wrap figure.works-print-thumb {
  height: auto;
  aspect-ratio: 16 / 9;

  & img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
}

.works .cont .box .item .bg-cont .block-area .works-thumb-wrap figure.works-video-thumb {
  display: flex;
  justify-content: center;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;

  & img,
  & video {
    display: block;
    flex-shrink: 0;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: initial;
    transition: transform 0.5s ease;
  }
}

.works .cont .box .item .bg-cont .block-area:hover .works-thumb-wrap figure.works-video-thumb {
  & img,
  & video {
    transform: scale(1.08);
  }
}

/* 詳細：動画サムネ（クリックで再生） */
.works-movie-facade {
  cursor: pointer;
  background: #000;
  border-radius: 10px;
  overflow: hidden;

  & img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .works-movie-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;

    /* 波紋 */
    &::before {
      content: "";
      position: absolute;
      inset: -1px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.6);
      animation: works-ring-pulse 2s ease-out infinite;
      pointer-events: none;
    }

    /* 再生マーク */
    &::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-35%, -50%);
      border-style: solid;
      border-width: 10px 0 10px 18px;
      border-color: transparent transparent transparent #fff;
    }
  }
}

@keyframes works-ring-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.works .cont .box .item .bg-cont .block-area .works-thumb-wrap figure.works-video-thumb {
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;

  & img,
  & video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
  }
}

.works .cont .box .item .bg-cont .block-area:hover .works-thumb-wrap figure.works-video-thumb {
  & img,
  & video {
    transform: scale(1.08);
  }
}

.works-list .works-item {
  animation: works-item-slide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;

  &:nth-child(odd) {
    --from-x: -40px;
  }
  &:nth-child(even) {
    --from-x: 40px;
  }
  &:nth-child(1) {
    animation-delay: 0s;
  }
  &:nth-child(2) {
    animation-delay: 0.05s;
  }
  &:nth-child(3) {
    animation-delay: 0.1s;
  }
  &:nth-child(4) {
    animation-delay: 0.15s;
  }
  &:nth-child(n + 5) {
    animation-delay: 0.2s;
  }
}

@keyframes works-item-slide {
  from {
    opacity: 0;
    transform: translateX(var(--from-x, 0)) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .works-type-content.active,
  .works-list .works-item {
    animation: none;
  }
}
