/* 共通 */
body {
  font-family: 'Aboreto', sans-serif;
  margin: 0;
  background: #fff;
  color: #444;
  text-align: center;
}

/* サムネイルグリッド */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto 80px;
  padding: 0 10px;
}

.thumb-item {
  margin: 0; 
  padding: 0;
}

.thumb-item img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  object-fit: cover;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 999;
  padding: 0px;
}

.modal-content {
  background: #fff;
  padding: 40px;
  margin: 0 auto;
  border-radius: 0px;
  max-width: 90%;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.modal img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin-bottom: 10px;
}

.modal p {
  color: #585858;
  font-size: 11px;
  margin: 2px 0;
  text-align: right;
}

.modal-close {
  position: absolute;
  top: 40px;
  right: 40px;
  font-size: 50px;
  color: #fff;
  cursor: pointer;
}

/* 上に戻るボタン */
.back-to-top {
  position: fixed;
  bottom: 50px;
  right: 50px;
  background: #444;
  border-radius: 50%;
  padding: 10px;
  display: none;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background 0.3s;
}

.back-to-top:hover {
  background: #000;
}

.back-to-top svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* SP対応：2列表示 */
@media (max-width: 768px) {
  .thumb-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1px;
    row-gap: 2px;
    padding: 0;
  }

@media (max-width: 768px) {
  .modal-content {
    max-width: 95%; /* スマホでは広くする */
    margin: 0 auto; /* 中央揃え */
    padding: 20px;  /* 余白を少し減らすと見やすい */
  }
}
