:root {
  --color-main: #93BFEB;
  --color-sub: #FFEB84;
  --color-text: #2c3e50;
  --color-white: #ffffff;
  --color-card-bg: #e0f0ff;
  --color-card-shadow: #b0d4f2;
  --font-retro: "M PLUS Rounded 1c", sans-serif;
}

/* =========================
   基本設定
========================= */
body {
  font-family: var(--font-retro);
  background: var(--color-white);
  color: var(--color-text);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

/* =========================
   見出し
========================= */
.section-title {
  font-family: 'Rampart One', cursive;
  font-size: 2rem;
  margin-bottom: 16px;
}

.sub-title {
  font-family: 'Rampart One', cursive;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.gallery-lead {
  margin: 0 auto 32px;
  max-width: 640px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.section-lead {
  margin: 0 auto 24px;
  max-width: 600px;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* =========================
   カテゴリセクション
========================= */
.gallery-section {
  background: var(--color-card-bg);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--color-card-shadow);
  padding: 28px 24px;
  margin-bottom: 40px;
}

.gallery-section.portrait-section {
  background: #fff1b8;
  box-shadow: 0 6px 0 #ffe066;
}

/* =========================
   画像グリッド
========================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gallery-grid figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-white);
  box-shadow: 0 3px 0 var(--color-card-shadow);
  aspect-ratio: 1 / 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portrait-section .gallery-grid figure {
  box-shadow: 0 3px 0 #ffe066;
}

.gallery-grid figure:hover {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--color-card-shadow);
}

.portrait-section .gallery-grid figure:hover {
  box-shadow: 0 1px 0 #ffe066;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* =========================
   モーダル
========================= */
.gallery-modal[hidden] {
  display: none;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 40px 16px;
  box-sizing: border-box;
  animation: modalFade 0.2s ease;
}

@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-figure img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: block;
}

.modal-close,
.modal-prev,
.modal-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  font-family: var(--font-retro);
  line-height: 1;
  border-radius: 50%;
  transition: background 0.15s ease, transform 0.15s ease;
}

.modal-close:hover,
.modal-prev:hover,
.modal-next:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.modal-close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
}

.modal-prev,
.modal-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-prev:hover,
.modal-next:hover {
  transform: translateY(-50%) scale(1.05);
}

.modal-prev { left: 16px; }
.modal-next { right: 16px; }

/* スマホ調整 */
@media (max-width: 480px) {
  .modal-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }

  .modal-prev,
  .modal-next {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }

  .modal-figure img {
    max-width: 94vw;
    max-height: 80vh;
  }
}

/* =========================
   タブレット
========================= */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

/* =========================
   スマホ
========================= */
@media (max-width: 480px) {
  .gallery-section {
    padding: 20px 16px;
    margin-bottom: 32px;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .sub-title {
    font-size: 1.2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
