/* ===================================
   Coni Group - Gallery Page Styles
   =================================== */

/* ── Gallery Hero ──────────────────────────────────────── */
.gallery-hero {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, #fdf6f0 0%, #f9e8ec 40%, #fce4d6 100%);
  margin-top: 72px; /* navbar height */
}

.gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(232,180,185,0.35) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(252,220,200,0.35) 0%, transparent 50%);
  pointer-events: none;
}

.gh-overlay { display: none; }

.gh-content {
  position: relative;
  z-index: 2;
  padding: 0 1.5rem;
}

.gh-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.ornament-line {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c0737a);
}
.ornament-line:last-child {
  background: linear-gradient(90deg, #c0737a, transparent);
}
.ornament-flower {
  font-size: 1.4rem;
  color: #c0737a;
}

.gh-eyebrow {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b06070;
  margin-bottom: 0.6rem;
}

.gh-title {
  font-family: 'Playfair Display', 'Noto Serif JP', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #7a2030;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.gh-title em { font-style: italic; }

.gh-sub {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  color: #9e4a58;
  margin-bottom: 0.9rem;
  font-weight: 500;
}

.gh-desc {
  font-size: 0.9rem;
  color: #6b4050;
  line-height: 1.8;
}

/* Floating petals */
.gh-petal {
  position: absolute;
  font-size: 2.4rem;
  opacity: 0.18;
  animation: float-petal 6s ease-in-out infinite;
  pointer-events: none;
}
.gh-petal--1 { top: 12%; left: 8%;  animation-delay: 0s; }
.gh-petal--2 { top: 60%; right: 6%; animation-delay: 2s; }
.gh-petal--3 { bottom: 12%; left: 50%; animation-delay: 4s; }

@keyframes float-petal {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-16px) rotate(12deg); }
}

/* ── Filter Bar ────────────────────────────────────────── */
.gallery-filter-bar {
  background: #fff;
  border-bottom: 1px solid #f0dfe2;
  position: sticky;
  top: 72px;
  z-index: 90;
  padding: 0.75rem 0;
  box-shadow: 0 2px 12px rgba(180,100,120,0.06);
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 1.1rem;
  border: 1.5px solid #e8c5cc;
  border-radius: 50px;
  background: transparent;
  color: #8a4050;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}
.filter-btn:hover {
  border-color: #c0737a;
  background: #fdf0f2;
  color: #a8362e;
}
.filter-btn.active {
  background: linear-gradient(135deg, #c0737a, #a8362e);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(168,54,46,0.25);
}

/* ── Gallery Section ────────────────────────────────────── */
.gallery-section {
  padding: 3rem 0 5rem;
  background: #fdf8f5;
}

.gallery-stats {
  text-align: center;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.85rem;
  color: #9e6070;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}
.gallery-stats #photoCount {
  font-size: 1.4rem;
  font-weight: 700;
  color: #a8362e;
  margin-right: 0.15rem;
}

/* ── カテゴリ別統一グリッド ─────────────────────────────── */
/*
  全カテゴリのカードを同一サイズ（固定高さ）で表示し、
  フィルター時にも整然と並ぶよう grid-auto-rows で統一。
*/
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  grid-auto-rows: 320px;
}

/* ── Gallery Card ────────────────────────────────────────── */
.gcard {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(160,80,100,0.10);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.gcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 32px rgba(160,80,100,0.18);
}

/* span クラスは廃止 — 全カードを均一サイズで表示 */

.gcard-img-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.gcard-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.gcard:hover .gcard-img-wrap img {
  transform: scale(1.06);
}

/* Overlay */
.gcard-overlay {
  position: absolute;
  inset: 0;
  background: rgba(90, 25, 35, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gcard:hover .gcard-overlay {
  opacity: 1;
}
.gcard:focus-within .gcard-overlay {
  opacity: 1;
}

.gcard-zoom {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.gcard-zoom:hover {
  background: rgba(255,255,255,0.3);
}

/* Caption */
.gcard-caption {
  padding: 0.85rem 1rem;
  background: #fff;
  flex-shrink: 0;
}
.gcard-cat {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c0737a;
  background: #fdf0f2;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}
.gcard-caption h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4a2030;
  margin: 0 0 0.3rem;
  line-height: 1.4;
}
.gcard-caption p {
  font-size: 0.76rem;
  color: #7a5060;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hidden / filtered out */
.gcard.hidden {
  display: none;
}

/* ── Gallery Empty ─────────────────────────────────────── */
.gallery-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #b08090;
}
.gallery-empty i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.5;
}
.gallery-empty p {
  font-size: 1rem;
  font-family: 'Noto Serif JP', serif;
}

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] {
  display: none;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 5, 10, 0.88);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.lb-window {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: lb-in 0.3s ease;
}

@keyframes lb-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lb-figure {
  background: #1a0810;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  max-width: min(80vw, 860px);
  display: flex;
  flex-direction: column;
  margin: 0;
}

.lb-figure img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  background: #0d0408;
}

.lb-caption {
  padding: 1rem 1.25rem;
  background: #1a0810;
  color: #f5dde5;
}
.lb-cat {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8a0b0;
  margin-bottom: 0.3rem;
}
.lb-caption strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.25rem;
}
.lb-caption p {
  font-size: 0.82rem;
  color: #c8a0b0;
  line-height: 1.6;
  margin: 0;
}

.lb-counter {
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

/* Nav buttons */
.lb-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}
.lb-nav:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.55);
}
.lb-prev { right: calc(100% + 0.75rem); }
.lb-next { left: calc(100% + 0.75rem); }

/* ── Gallery CTA Band ───────────────────────────────────── */
.gallery-cta {
  background: linear-gradient(135deg, #7a2030 0%, #a8362e 100%);
  padding: 4rem 1.5rem;
  text-align: center;
}

.gcta-content {
  max-width: 640px;
  margin: 0 auto;
}

.gcta-ornament {
  font-size: 1.8rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.2rem;
}

.gallery-cta h2 {
  font-family: 'Playfair Display', 'Noto Serif JP', serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: #fff;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.gallery-cta p {
  color: rgba(255,255,255,0.82);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.gcta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn-rose {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  background: #fff;
  color: #a8362e;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.btn-rose:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.btn-fb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.65);
  color: #fff;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-fb:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
  }
}

@media (max-width: 640px) {
  .gallery-hero { height: 340px; }

  .gallery-filter-bar {
    padding: 0.6rem 0;
    overflow-x: auto;
  }
  .filter-list {
    flex-wrap: nowrap;
    padding: 0 1rem;
    justify-content: flex-start;
  }
  .filter-btn {
    white-space: nowrap;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
    gap: 0.75rem;
  }
  .gcard-caption { padding: 0.65rem 0.8rem; }
  .gcard-caption h3 { font-size: 0.8rem; }
  .gcard-caption p  { font-size: 0.7rem; }

  .lb-prev { right: auto; left: 0.25rem; }
  .lb-next { left: auto; right: 0.25rem; }
  .lb-nav {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.45);
    border: none;
    position: fixed;
    top: 50%;
  }
  .lb-figure {
    max-width: 96vw;
  }
}

@media (max-width: 400px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
}
