/* ============================================================
   プロフィール：写真・動画ギャラリー（profile.php）
   - 1枚目は動画（音なし自動再生・ループ）、2枚目以降は写真
   - 1枚を幅75%にして、右に次の写真が1/3ほど見える＝横にスワイプできると分かる
   - 押すと大きく表示（動画は音なし）。左右スワイプ・矢印・Escで操作
   ============================================================ */
.pg { position: relative; width: 100%; margin: 0 auto; }

.pg-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.pg-track::-webkit-scrollbar { display: none; }

.pg-slide {
  position: relative;
  flex: 0 0 75%;
  aspect-ratio: 3 / 4;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
}
.pg-slide img,
.pg-slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 動画バッジ（左上） */
.pg-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(229, 57, 127, 0.92);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  pointer-events: none;
}
/* 拡大できる目印（右下） */
.pg-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  pointer-events: none;
}

/* PCだけ左右の矢印 */
.pg-arrow {
  position: absolute;
  top: calc(50% - 40px);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 18px;
  line-height: 36px;
  cursor: pointer;
  z-index: 2;
}
.pg-arrow.prev { left: 6px; }
.pg-arrow.next { right: 6px; }
@media (hover: none) { .pg-arrow { display: none; } }

/* サムネイル列 */
.pg-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pg-thumbs::-webkit-scrollbar { display: none; }
.pg-thumb {
  position: relative;
  flex: 0 0 56px;
  height: 75px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  opacity: 0.6;
}
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-thumb.is-active { border-color: #e5397f; opacity: 1; }
.pg-thumb .pg-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* ---------- 拡大表示 ---------- */
.pg-lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
}
.pg-lb.is-open { display: flex; }
.pg-lb-stage {
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-lb-stage img,
.pg-lb-stage video {
  display: block;
  max-width: 100vw;
  max-height: 88vh;
  object-fit: contain;
}
.pg-lb-close,
.pg-lb-prev,
.pg-lb-next {
  position: absolute;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 44px;
}
.pg-lb-close { top: 12px; right: 12px; }
.pg-lb-prev { left: 10px; top: calc(50% - 22px); }
.pg-lb-next { right: 10px; top: calc(50% - 22px); }
.pg-lb-count {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  color: #ddd;
  font-size: 0.8rem;
}
body.pg-lb-lock { overflow: hidden; }
