/*___________________________
 GALLERY ページ
 ※ ページネーション(.gallery__pager)のスタイルは past-event.css と同じ。
   共通CSSに移してあれば、ここには不要
___________________________*/

.gallery {
  padding: 4rem 0 6rem;
  background: #fff;
}

.gallery__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.gallery__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.gallery__link {
  display: block;
  overflow: hidden;
  background: #d9d9d9;
}

.gallery__img {
  display: block;
  width: 100%;
  aspect-ratio: 119 / 85;
  object-fit: cover;
  transition: transform 0.5s ease;
}

@media (hover: hover) {
  .gallery__link:hover .gallery__img {
    transform: scale(1.06);
  }
}

/* TOPへ戻るボタン */
.gallery__bottom {
  margin-top: 5rem;
  text-align: center;
}

/* ---------- ページネーション ---------- */
.gallery__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.gallery__pagerBtn {
  position: relative;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    color 0.3s;
}

.gallery__pagerBtn.is-active {
  border-color: #5f87ad;
  background: #5f87ad;
  color: #fff;
  pointer-events: none;
}

@media (hover: hover) {
  .gallery__pagerBtn:not(.is-active):not(:disabled):hover {
    border-color: #5f87ad;
    color: #5f87ad;
  }
}

.gallery__pagerBtn:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery__pagerBtn--prev::after,
.gallery__pagerBtn--next::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.gallery__pagerBtn--prev::after {
  transform: translate(-30%, -50%) rotate(-135deg);
}

.gallery__pagerBtn--next::after {
  transform: translate(-70%, -50%) rotate(45deg);
}

/* ---------- タブレット ---------- */
@media screen and (max-width: 1024px) {
  .gallery__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- SP ---------- */
@media screen and (max-width: 768px) {
  .gallery {
    padding: 2.5rem 0 4rem;
  }

  .gallery__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 2rem;
  }

  .gallery__bottom {
    margin-top: 3rem;
  }

  .gallery__pager {
    gap: 0.375rem;
    margin-top: 2rem;
  }

  .gallery__pagerBtn {
    min-width: 2.5rem;
    height: 2.5rem;
  }
}
