@charset "UTF-8";

.tab-list {
  display: flex;
  justify-content: center;
  padding: 0 20px;
  margin-bottom: 40px;
}
.tab-list li {
  width: 100%;
  max-width: 150px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: solid 1px #1f1f1f;
  border-left: solid 1px #1f1f1f;
  border-right: solid 1px #1f1f1f;
  cursor: pointer;
  font-size: 14px;
  margin-right: 10px;
  transition: all 0.3s ease;
}
.tab-list li:last-child {
  margin-right: 0;
}
.tab-list li:hover {
  background-color: #1f1f1f;
  color: #fff;
}
.tab-list li.active {
  background-color: #1f1f1f;
  color: #fff;
}

.gallery-list {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  display: none;
}
.gallery-list.active {
  display: grid;
}
.gallery-list li {
  position: relative;
}
.gallery-list li .info {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-end;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: all 0.6s ease;
  pointer-events: none; /* 追加:クリックを透過させ、下の画像に届かせる */
}
.gallery-list li:hover .info {
  opacity: 1;
}
.gallery-list li .info .name {
  font-size: 18px;
  margin-bottom: 5px;
}
.gallery-list li .info .date {
  font-size: 14px;
}
.tab-list .tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 4px;
  font-size: 14px;
  color: #999;
  border-bottom: 2px solid transparent;
}
/* 通常の画像は保存しにくくする */
/* モーダルを開くための画像以外は、クリック・ドラッグを防ぐ */
img:not(.modal-open) {
  user-select: none;
  -webkit-user-drag: none;
}
.gallery-item img.modal-open {
  user-select: none;
  -webkit-user-drag: none;
}
.modal-container {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;   /* 見えなくしつつ、クリックも受け付けなくする */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-container.active {
  opacity: 1;
  visibility: visible;
}
.modal-container.active .modal-content {
  transform: translateY(0);      /* activeが付いたら本来の位置へ */
}
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}
.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  margin: 5vh auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(20px);   /* 追加:少し下にずらした状態から */
  transition: transform 0.3s ease;
}
.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}
.modal-caption {
  color: #fff;
  margin-top: 12px;
  font-size: 14px;
}
.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}
.modal-images {
  max-height: 80vh;
  overflow-y: auto;   /* ページ数が多い場合はスクロールで見られるように */
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-images img {
  max-width: 100%;
  width: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.sort-control {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
#sortToggle {
  background: none;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
#sortToggle:hover {
  background-color: #f5f5f5;
}

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

/*-------------------------------------------
スマートフォン
-------------------------------------------*/
@media screen and (max-width: 767px) {
  .tab-list {
    margin-bottom: 10px;
  }
  .tab-list li {
    font-size: 10px;
    margin-right: 5px;
  }
  .gallery-list {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 60px;
  }
}