@charset "utf-8";

/* ===== グリッドレイアウト ===== */
.look-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
  max-width: 1200px;
  margin: 0 auto;
}
@media screen and (min-width: 1025px) {
  .look-grid { grid-template-columns: repeat(4, 1fr); }
}

.look-card {
  position: relative;
  cursor: pointer;
  text-align: center;
}
.look-image {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}
.look-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.look-card:hover img { transform: scale(1.05); }

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transition: .3s ease;
}
.overlay i { font-size: 22px; margin-bottom: 6px; }
.look-card:hover .overlay { opacity: 1; }
.look-title {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
}

/* ===== モーダル基本構造 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}
.modal.is-open { display: flex; }

.gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 90vw;
  max-height: 95vh;
  background: #000;
  border-radius: 12px;
  overflow-y: auto;
}

.gallery-header {
  position: relative;
  padding: 8px 12px;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
    background-color: #fff;
}
.gallery-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
}

/* ===== 画像・ナビゲーションエリア ===== */
.gallery-view {
  position: relative;
  width: 100%;
  background: #fff;
}

.gallery-stage {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.gallery-stage img.active {
  display: block;
  opacity: 1;
}

/* ナビボタン：画像に対して中央配置 */
.nav-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  z-index: 100;
  transition: background .3s;
  padding: 0;
}
.nav-btn:hover { background: rgba(0,0,0,0.8); }
.nav-prev { left: 10px; }
.nav-next { right: 10px; }

/* ===== サムネイル・リンク ===== */
.gallery-thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #fff;
  flex-wrap: wrap;
    position: relative;
}
.gallery-thumbs img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
}
.gallery-thumbs img.active {
  border-color: #000;
  opacity: 1;
}

.gallery-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
}
.gallery-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 11px;
  padding: 12px 5px;
  border: 1px solid #ccc;
  text-align: center;
}
.gallery-links a:last-child:nth-child(odd) { grid-column: span 2; }

/* ===== PCサイズ調整（横幅制限） ===== */
@media screen and (min-width: 769px) {
  .gallery {
    width: 600px;
    max-height: 95vh;
  }
  .gallery-view {
    width: 600px;
    height: 600px;
  }
  .gallery-stage {
    width: 100%;
    height: 100%;
  }
  .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
}