@import "./common.css";
@import "./header.css";
@import "./footer.css";

.wrapper .pc_nav .gnav ul li.gnav-works {
  background-size: 100% 2px;
}
.section.title {
  .h1 {
    margin-bottom: 60px;
  }
}
.form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;

  .search-box {
    display: flex;
    align-items: center;
    width: 400px;
    padding: 4px 8px;
    border: 1px solid var(--sub-color);
    border-radius: 9999px;
  }

  .search-box i {
    margin-right: 8px;
    color: #666;
  }

  .search-box input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    outline: none;
  }
}

.categories .category:has(+ .cat-radio:checked) {
  .btn {
    background-color: var(--sub-bg-color);
  }
}

.section {
  margin-bottom: 96px;
}

.worksList .wrapper {
  position: relative;
}

.catMenu {
  padding: 0 39px;
  margin-bottom: 16px;

  .categories {
    display: flex;
    flex-wrap: wrap;
    gap: 2%;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
  }
  .category {
    margin-bottom: 2rem;
  }
  .btn {
    color: var(--sub-color);
    background-color: var(--main-color);
    border: solid 1px var(--sub-color);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    margin-bottom: 1rem;

    &:hover {
      background-color: var(--sub-bg-color);
    }

    &.btn_normal {
      width: 120px;
      height: 36px;
      margin-bottom: 0;
      font-size: 1rem;
      border-radius: 9999px;
      line-height: 36px;
      text-align: center;
    }
  }
}
.masonry {
  position: relative;
  padding: 1em;

  .item {
    position: absolute;
    width: calc((100% - 3em) / 4); /* 4列 - gap分 */
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;

    /* アニメーション初期状態 */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
  }
  /* アニメーション後の状態 */
  .item.show {
    opacity: 1;
    transform: translateY(0);
  }
  .item img {
    width: 100%;
    display: block;
    height: auto;

    &:hover {
      transform: scale(1.05);
      transition: transform 0.2s ease;
    }
  }
}

/* ローディング表示 */
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--gray);
}

.btn.btn_circle {
  position: relative;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  font-size: var(--font-size-normal);
  color: var(--main-color);
  background-color: var(--sub-color);
  border: none;
  &:hover {
    color: var(--sub-color);
    background-color: var(--sub-bg-color);
  }

  &.btn_next {
    &::before {
      content: ">";
      font-size: 2rem;
    }
  }
  &.btn_prev {
    &::before {
      content: "<";
      font-size: 2rem;
    }
  }
}
@media (max-width: 780px) {
  .form {
    .search-box {
      width: 80%;
    }
  }
  .worksList {
    .wrapper {
      .masonry {
        position: relative;
        padding: 1em;

        .item {
          position: absolute;
          width: calc((100% - 1em) / 2); /* 2列 - gap分 */
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
          border-radius: 6px;
          overflow: hidden;
          opacity: 0;
          transform: translateY(20px);
          transition: all 0.6s ease;

          &.show {
            opacity: 1;
            transform: translateY(0);
          }

          img {
            width: 100%;
            display: block;
            height: auto;

            &:hover {
              transform: scale(1.05);
              transition: transform 0.2s ease;
            }
          }
        }
      }
    }
  }
}
@media screen and (max-width: 480px) {
  .section.title {
    height: 350px;
    padding-top: 143px;
    .h1 {
      margin-bottom: 60px;
    }
  }
}
