/* フォトギャラリー専用スタイル */

/* ギャラリーセクション全体 */
#gallery {
  background-color: #fff;
  text-align: center;
  padding: 100px 0;
}

/* ギャラリータイトル */
.gallery-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}

.gallery-title i {
  font-size: 36px;
  margin-right: 15px;
  color: #E17A42;
}

.gallery-title h2 {
  font-size: 30px;
  font-weight: 500;
}

/* ギャラリーグリッド */
.gallery-feed {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* ギャラリーアイテム */
.gallery-item {
  width: 16.666%;
  padding: 5px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

/* ギャラリーオーバーレイ */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* クリックイベントを通過させる */
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay i {
  color: #fff;
  font-size: 24px;
  pointer-events: none;
}

/* インスタグラムフォローボタン */
.gallery-follow {
  margin-top: 30px;
}

.gallery-follow a {
  display: inline-block;
  padding: 12px 30px;
  background-color: #E17A42;
  color: #fff;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.gallery-follow a:hover {
  background-color: #D15E20;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(225, 122, 66, 0.3);
}

.gallery-follow a i {
  margin-right: 8px;
}

/* レスポンシブ対応 */
@media screen and (max-width: 1024px) {
  .gallery-item {
    width: 33.333%;
  }
}

@media screen and (max-width: 768px) {
  .gallery-item {
    width: 50%;
  }
}

@media screen and (max-width: 480px) {
  .gallery-item {
    width: 100%;
  }
}

/* 横スクロール用のスタイル */
.gallery-row {
  /* 横一列で並べたいので、flexを使う */
  display: flex;
  gap: 10px; /* 画像間の余白 */
  overflow-x: auto; /* 横方向にスクロール可能 */
  -webkit-overflow-scrolling: touch; /* iOS系でスムーススクロール */
  scroll-snap-type: x mandatory; /* スクロールスナップ(お好み) */
  padding-bottom: 10px; /* 下部に余白を加えてバーがかぶらないようにする */
}

/* スクロールバーの装飾（お好み） */
.gallery-row::-webkit-scrollbar {
  height: 6px;
}
.gallery-row::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

/* 個々の画像アイテム */
.gallery-item {
  flex: 0 0 auto; /* 画像が自動で横に並ぶように */
  width: 200px;   /* 画像表示サイズの一例。好みに合わせて */
  position: relative; /* オーバーレイをポジショニングするため */
  scroll-snap-align: center; /* スナップ(お好み) */
}

/* 画像本体 */
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* ホバー時の拡大(PC用) */
.gallery-item:hover img {
  transform: scale(1.05);
}

/* オーバーレイは従来通り */
.gallery-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* カテゴリ見出し (例) */
.gallery-category {
  margin: 20px 0 10px;
  font-size: 1.2rem;
  color: #333;
}

/* スマートフォン対応でギャラリー幅を可変にしたい場合 */
@media screen and (max-width: 768px) {
  .gallery-item {
    width: 160px; /* モバイル時はもう少し小さめ */
  }
}