@media screen and (width > 768px) {
  .container {
    padding: 80px 0 70px;
  }
}
@media screen and (width <= 768px) {
  .container {
    padding: 64px 0 48px;
  }
}

/* =========================
  実績一覧
========================= */
/* category-filter */
.category-filter {
  align-items: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 8px;
  margin-bottom: 48px;
}
.category-filter ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
}
.category-filter a {
  border: solid 2px var(--color-primary);
  border-radius: 8px;
  color: var(--color-primary);
  display: block;
}
.category-filter a.active {
  background: var(--color-primary);
  color: var(--color-text-white);
}

.category-filter a:not(.active) {
  background: #fff;
  position: relative;
  transition: 0.2s;
  z-index: 1;
}
.category-filter a:not(.active)::after {
  background: var(--color-primary);
  color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  content: "";
  width: 100%;
  height: 100%;
  transform: scale(0, 1);
  transform-origin: left top;
  transition: 0.2s cubic-bezier(0.45, 0, 0.55, 1);
  z-index: -1;
}
.category-filter a:not(.active):hover {
  color: #fff;
}
.category-filter a:not(.active):hover::after {
  transform: scale(1, 1);
}

@media screen and (width > 768px) {
  .category-filter {
    padding: 0 32px;
  }
  .category-filter ul {
    justify-content: center;
  }
  .category-filter a {
    padding: 14px 24px;
  }
}
@media screen and (width <= 768px) {
  .category-filter {
    flex-direction: column;
    padding: 0 16px;
  }
  .category-filter ul {
    justify-content: center;
  }
  .category-filter a {
    padding: 12px 20px;
  }
}

/* projects-grid */
.projects-grid {
  display: flex;
}
.projects-grid:has(+ .pagination) {
  margin-bottom: 48px;
}
@media screen and (width > 768px) {
  .projects-grid {
    flex-wrap: wrap;
    margin: 0 auto;
    gap: 24px 16px;
    max-width: 1088px;
    width: 100%;
  }
  .project-card {
    width: calc(25% - 12px);
  }
}
@media screen and (width <= 768px) {
  .projects-grid {
    flex-direction: column;
    gap: 24px;
  }
  .project-card {
    width: 100%;
  }
}

.project-card a {
  display: block;
  position: relative;
}
.project-card .project-image {
  margin-bottom: 12px;
}
@media screen and (width > 768px) {
  .project-card .project-image {
    aspect-ratio: 244 / 240;
    border-radius: 4px;
    height: auto;
    overflow: hidden;
    width: 100%;
  }
  .project-card .project-image::before {
    aspect-ratio: 244 / 240;
    background: rgba(0, 0, 0, 0.3);
    content: "";
    display: block;
    height: auto;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
  }
  .project-card .project-image img {
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: 0.3s transform;
    width: auto;
  }
  .project-card a:hover img {
    transform: scale(1.2);
    transition: 0.3s transform;
  }
}

.project-card .no-image {
  align-items: center;
  background: var(--color-primary10);
  color: var(--color-primary);
  display: flex;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.project-card .project-name {
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 8px;
  text-align: center;
  width: 100%;
}
.project-card a:hover .project-name {
  color: var(--color-primary);
}
.project-card .project-date {
  color: #999;
  font-size: 14px;
  text-align: center;
}

@media screen and (width > 768px) {
  .project-card a .project-image::before {
    opacity: 0;
    transition: 0.2s;
  }
  .project-card a:hover .project-image::before {
    opacity: 1;
    transition: 0.2s;
  }
  .project-card .project-name {
    padding: 0 8px;
  }
}
@media screen and (width <= 768px) {
  .project-card .project-name {
    padding: 0 16px;
  }
}

/* pagination */
.pagination ul {
  align-items: center;
  color: var(--color-primary);
  display: flex;
  gap: 16px;
  justify-content: center;
}
.pagination .page-num {
  align-items: center;
  border: solid 2px var(--color-primary);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  height: 40px;
  width: 40px;
}
.pagination .current {
  align-items: center;
  background: var(--color-primary);
  border-radius: 8px;
  color: #fff;
  display: flex;
  justify-content: center;
  height: 40px;
  width: 40px;
}

.pagination .prev,
.pagination .next {
  border-top: solid 2px var(--color-primary);
  display: block;
  height: 13px;
  width: 13px;
}

.pagination .prev {
  border-left: solid 2px var(--color-primary);
  transform: rotate(-45deg);
}
.pagination .next {
  border-right: solid 2px var(--color-primary);
  transform: rotate(45deg);
}

.pagination .prev.disabled,
.pagination .next.disabled {
  border-color: #bbb;
}

/* =========================
  実績詳細
========================= */
@media screen and (width > 768px) {
  .project-detail {
    margin: 0 auto;
    max-width: 928px;
    padding: 0 24px;
  }
}

.project-title {
  color: var(--color-primary);
  line-height: 1.4;
  margin-bottom: 24px;
  text-align: center;
}
@media screen and (width > 768px) {
  .project-title {
    font-size: 28px;
  }
}
@media screen and (width <= 768px) {
  .project-title {
    font-size: 26px;
  }
}

.project-meta {
  align-items: center;
  color: var(--color-text-light);
  display: flex;
  justify-content: space-between;
  margin-bottom: 48px;
}
@media screen and (width <= 768px) {
  .project-meta {
    padding: 0 24px;
  }
}

.project-meta .project-category {
  background: var(--color-primary10);
  border-radius: 15px;
  padding: 8px 16px;
}

/* プロジェクト画像ギャラリー */
.project-images {
  margin-bottom: 48px;
}

/* メイン画像 */
.main-image {
  width: 100%;
  margin-bottom: 1rem;
  background-color: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 600px;
  object-fit: contain;
}

/* サムネイル一覧 */
.thumbnail-list {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0 8px;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.thumbnail-list li {
  flex: 0 0 auto;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: opacity 0.3s ease;
  display: block;
}

.thumbnail:hover {
  opacity: 0.7;
  border-color: #ddd;
}

.thumbnail.active {
  border-color: var(--color-primary);
  opacity: 1;
}

/* レスポンシブ対応 */
@media (width <= 768px) {
  .main-image {
    border-radius: 0;
  }
  .thumbnail-list {
    justify-content: flex-start;
    gap: 4px;
  }
  .thumbnail-list li {
    width: calc((100% - 16px) / 5);
    height: 64px;
  }
  .thumbnail {
    object-fit: cover;
    object-position: center;
    height: 100%;
    width: 100%;
  }
}

.project-text {
  line-height: 2.5;
  margin: 0 auto 48px;
  max-width: 768px;
  padding: 0 24px;
  text-align: justify;
  width: 100%;
}

.project-info {
  background: var(--color-primary10);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px 0;
  line-height: 1.5;
  margin: 0 auto 48px;
  max-width: 720px;
  width: 100%;
}
@media (width > 768px) {
  .project-info {
    align-items: center;
    padding: 40px 40px;
  }
}
@media (width <= 768px) {
  .project-info {
    padding: 24px 16px 24px 0;
    margin: 0 24px 48px;
    width: calc(100% - 48px);
  }
}

.project-info dt {
  align-items: center;
  color: #999;
  display: flex;
  font-size: var(--font-size-small);
}
.project-info dt::before {
  background: var(--color-primary);
  content: "";
  flex-shrink: 0;
  height: 4px;
  width: 24px;
}
@media (width > 768px) {
  .project-info dt {
    gap: 16px;
    width: 160px;
  }
  .project-info dd {
    width: calc(100% - 160px);
  }
}
@media (width <= 768px) {
  .project-info dt {
    gap: 12px;
    width: 112px;
  }
  .project-info dd {
    width: calc(100% - 112px);
  }
  .project-info dt.project-info-cooperation {
    padding-right: 12px;
    width: 150px;
  }
  .project-info dt.project-info-cooperation + dd {
    width: calc(100% - 150px);
  }
}
