@charset "utf-8";
/*
====================================
Photo Gallery - Common Styles
====================================
全パターン共通のスタイル
- Lightbox
- 基本レイアウト
- アニメーション
====================================
*/

/* ========================================
   ページ共通スタイル
   ======================================== */

.photo-gallery-page {
  background: #faf8f3;
  min-height: 100vh;
}

/* ========================================
   Hero Section
   ======================================== */

.photo-hero {
  background: linear-gradient(135deg, #2a2522 0%, #4a4543 100%);
  color: white;
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.photo-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(200,184,161,0.1)"/></svg>');
  background-size: 20px 20px;
  opacity: 0.3;
}

.photo-hero-content {
  position: relative;
  z-index: 1;
}

.photo-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.photo-hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
  margin-bottom: 0;
}

/* ========================================
   Category Filter (コメントアウト用)
   ======================================== */

.photo-filter {
  background: white;
  padding: 2rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 88px;
  z-index: 100;
}

.photo-filter-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 1px solid #c8b8a1;
  color: #4a4543;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 400;
}

.filter-btn:hover {
  background: #f5f1ec;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #c8b8a1;
  color: white;
  border-color: #c8b8a1;
}

/* ========================================
   Lightbox
   ======================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  opacity: 0.8;
}

/* ========================================
   Loading Animation
   ======================================== */

.photo-loading {
  text-align: center;
  padding: 4rem 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #c8b8a1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .photo-hero {
    padding: 100px 0 60px;
  }

  .photo-filter {
    padding: 1rem 0;
    top: 70px;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }

  .lightbox-close {
    top: -40px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}

/* ========================================
   ========================================
   Photo Gallery - Pattern 2 (Grid Masonry)
   統合日: 2025-11-30
   ========================================
   ======================================== */

/*
====================================
CSS Grid Masonry Layout
====================================
整然としたグリッド + ランダムな高さ
- 統一されたカラム幅
- ランダムなカードサイズ（small, medium, large）
- PC: 5カラム
- タブレット: 3カラム
- スマホ: 2カラム
====================================
*/

/* ========================================
   Gallery Container
   ======================================== */

.photo-gallery-container {
  width: 100%;
  padding: 40px 20px;
  margin: 0;
  background: #faf8f3;
}

.photo-grid-masonry {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1800px;
  margin: 0 auto;
  grid-auto-rows: 200px; /* 基準の高さ */
}

/* ========================================
   Photo Items with Size Variations
   ======================================== */

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 0; /* 角丸を削除 */
  cursor: pointer;
  background: #f5f1ec;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

  /* 初期状態：非表示（JavaScriptで準備完了後にアニメーション開始） */
  opacity: 0;
  transform: translateY(30px);
}

/* レイアウト準備完了後にアニメーション開始 */
.photo-item.fade-ready {
  animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ホバー時のトランジション */
.photo-item {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* サイズバリエーション */
.photo-item.size-small {
  grid-row: span 1;
}

.photo-item.size-medium {
  grid-row: span 2;
}

.photo-item.size-large {
  grid-row: span 3;
}

/* 特別なワイドサイズ（オプション） */
.photo-item.size-wide {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  z-index: 10;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.photo-item:hover img {
  transform: scale(1.1);
}

/* ========================================
   Overlay Effect
   ======================================== */

.photo-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(42,37,34,0) 0%,
    rgba(42,37,34,0.2) 50%,
    rgba(42,37,34,0.5) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.photo-item:hover::before {
  opacity: 1;
}

/* ========================================
   Info Overlay (ホバー時の情報表示)
   ======================================== */

.photo-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.photo-item:hover .photo-info {
  transform: translateY(0);
}

.photo-info h3 {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.photo-info .photo-category {
  display: inline-block;
  background: rgba(200,184,161,0.9);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* ========================================
   Zoom Icon
   ======================================== */

.photo-zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.photo-item:hover .photo-zoom-icon {
  transform: translate(-50%, -50%) scale(1);
}

.photo-zoom-icon i {
  font-size: 1.5rem;
  color: #4a4543;
}

/* ========================================
   Responsive Grid (Pattern 2)
   ======================================== */

/* タブレット: 3カラム */
@media (max-width: 1199px) {
  .photo-grid-masonry {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    grid-auto-rows: 180px;
  }

  .photo-item.size-wide {
    grid-column: span 1; /* ワイドを無効化 */
  }
}

/* スマホ: 2カラム */
@media (max-width: 767px) {
  .photo-gallery-container {
    padding: 20px 10px;
  }

  .photo-grid-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    grid-auto-rows: 140px;
  }

  .photo-item {
    border-radius: 0; /* スマホでも角丸なし */
  }

  .photo-item:hover {
    transform: translateY(-4px);
  }

  .photo-zoom-icon {
    width: 50px;
    height: 50px;
  }

  .photo-zoom-icon i {
    font-size: 1.2rem;
  }

  .photo-info {
    padding: 1rem;
  }

  .photo-info h3 {
    font-size: 0.85rem;
  }

  .photo-item.size-wide {
    grid-column: span 1;
  }
}

/* ========================================
   Performance Optimization
   ======================================== */

.photo-item {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.photo-item img {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Lazy Loading Placeholder */
.photo-item.loading {
  background: linear-gradient(
    135deg,
    #f5f1ec 0%,
    #e8e4df 50%,
    #f5f1ec 100%
  );
  background-size: 400% 400%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   Fade-In Animation (CSS only - 最軽量)
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 順次フェードイン（20msずつ遅延） */
.photo-item:nth-child(1) { animation-delay: 0ms; }
.photo-item:nth-child(2) { animation-delay: 20ms; }
.photo-item:nth-child(3) { animation-delay: 40ms; }
.photo-item:nth-child(4) { animation-delay: 60ms; }
.photo-item:nth-child(5) { animation-delay: 80ms; }
.photo-item:nth-child(6) { animation-delay: 100ms; }
.photo-item:nth-child(7) { animation-delay: 120ms; }
.photo-item:nth-child(8) { animation-delay: 140ms; }
.photo-item:nth-child(9) { animation-delay: 160ms; }
.photo-item:nth-child(10) { animation-delay: 180ms; }
.photo-item:nth-child(11) { animation-delay: 200ms; }
.photo-item:nth-child(12) { animation-delay: 220ms; }
.photo-item:nth-child(13) { animation-delay: 240ms; }
.photo-item:nth-child(14) { animation-delay: 260ms; }
.photo-item:nth-child(15) { animation-delay: 280ms; }
.photo-item:nth-child(16) { animation-delay: 300ms; }
.photo-item:nth-child(17) { animation-delay: 320ms; }
.photo-item:nth-child(18) { animation-delay: 340ms; }
.photo-item:nth-child(19) { animation-delay: 360ms; }
.photo-item:nth-child(20) { animation-delay: 380ms; }
.photo-item:nth-child(21) { animation-delay: 400ms; }
.photo-item:nth-child(22) { animation-delay: 420ms; }
.photo-item:nth-child(23) { animation-delay: 440ms; }
.photo-item:nth-child(24) { animation-delay: 460ms; }
.photo-item:nth-child(25) { animation-delay: 480ms; }
.photo-item:nth-child(26) { animation-delay: 500ms; }
.photo-item:nth-child(27) { animation-delay: 520ms; }
.photo-item:nth-child(28) { animation-delay: 540ms; }
.photo-item:nth-child(29) { animation-delay: 560ms; }
.photo-item:nth-child(30) { animation-delay: 580ms; }
.photo-item:nth-child(31) { animation-delay: 600ms; }
.photo-item:nth-child(32) { animation-delay: 620ms; }
.photo-item:nth-child(33) { animation-delay: 640ms; }
.photo-item:nth-child(34) { animation-delay: 660ms; }
.photo-item:nth-child(35) { animation-delay: 680ms; }
.photo-item:nth-child(36) { animation-delay: 700ms; }
.photo-item:nth-child(37) { animation-delay: 720ms; }
.photo-item:nth-child(38) { animation-delay: 740ms; }
.photo-item:nth-child(39) { animation-delay: 760ms; }
.photo-item:nth-child(40) { animation-delay: 780ms; }
.photo-item:nth-child(41) { animation-delay: 800ms; }
.photo-item:nth-child(42) { animation-delay: 820ms; }
.photo-item:nth-child(43) { animation-delay: 840ms; }
.photo-item:nth-child(44) { animation-delay: 860ms; }
.photo-item:nth-child(45) { animation-delay: 880ms; }
.photo-item:nth-child(46) { animation-delay: 900ms; }
.photo-item:nth-child(47) { animation-delay: 920ms; }
.photo-item:nth-child(48) { animation-delay: 940ms; }
.photo-item:nth-child(49) { animation-delay: 960ms; }
.photo-item:nth-child(50) { animation-delay: 980ms; }
