/* サムネイル画像コンテナ */

.modal-thumbnail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4%;
  margin-top: 8%;
}

@media (min-width: 768px) {
  .modal-thumbnail {
    grid-template-columns: repeat(3, 1fr);
  }
}

.modal-thumbnail__item {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid #ddd;
  border-radius: 6px;
}

@media (min-width: 768px) {
  .modal-thumbnail__item:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  }
}

/* サムネイル画像 */
.modal-thumbnail__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: auto;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-container {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
}

@media (min-width: 1200px) {
  .modal-container {
    max-width: 1100px;
    width: 80%;
  }
}

.modal-content {
  width: 100%;
  height: 100%;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 閉じるボタン */
.modal-close {
  position: absolute;
  top: -25%;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 10001;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .modal-close {
    top: -12%;
  }
}

@media (min-width: 1024px) {
  .modal-close {
    top: -8%;
  }
}
