/* ==========================================================================
   pages-single.css：投稿（single）
   目的：投稿詳細ページのレイアウト（2カラム）と余白調整
   方針：
   - 固定ページ踏襲（共通は触らない）
   - 2カラムは single の中だけで完結（他ページへ波及させない）
   - 数値（幅/ギャップ/余白）は Cockpit に集約
   ========================================================================== */

/* ==========================================================================
   01) Layout：2カラム（本文＋サイド）
   ========================================================================== */

.p-single {
  margin-top: var(--single-mt);
  margin-bottom: var(--single-mb);
}

.p-single__grid {
  display: grid;
  grid-template-columns: 1fr var(--single-side-w);
  gap: var(--single-gap);
  align-items: start;
}

/* ==========================================================================
   02) Main：本文エリア
   ========================================================================== */

.p-single__main {
  min-width: 0;
}

.p-single__head {
  margin-bottom: 24px;
}

.p-single__date {
  display: block;
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 10px;
}

.p-single__title {
  color: var(--brand-primary);
  font-size: var(--single-title-size);
}

/* meta：カテゴリを右寄せ */
.p-single__meta {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.p-single__cats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* カテゴリ：カプセル */
.p-single__cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-accent-soft);
  background: rgba(230, 164, 180, 0.12);
  color: var(--brand-accent-soft);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
}

.p-single__cat:hover {
  opacity: 0.85;
}

/* ==========================================================================
   03) Sidebar：サイドバー
   ========================================================================== */

.p-single__side {
  position: relative;
  margin-top: 1.8em;
}

.p-sidebar__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-sidebar__menu li {
  margin-bottom: 12px;
}

.p-sidebar__menu a {
  text-decoration: none;
  color: var(--text-main);
}

/* ==========================================================================
   04) Meta：日付・カテゴリ
   ========================================================================== */

.p-single__meta {
  margin: 16px 0 32px;
  font-size: 14px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   05) Content：本文（wp blocks）
   ========================================================================== */

.p-single__content > *:first-child {
  margin-top: 0;
}

.p-single__content > *:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   06) Pager：前後リンク
   ========================================================================== */

.p-single__pager {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.p-single__pager a {
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 59, 88, 0.35);
  padding-bottom: 2px;
  color: var(--brand-primary);
}

.p-single__pager a:hover {
  opacity: 0.85;
}

/* ==========================================================================
   🌹 07）フォトギャラリー
   ========================================================================== */

.p-singleGallery {
  margin-top: 56px;
}

.p-singleGallery__title {
  margin: 0 0 18px 0;
}

.p-singleGallery__en {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.p-singleGallery__jp {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.p-singleGallery__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.p-singleGallery__item {
  display: block;
  border-radius: 10px;
  overflow: hidden;

  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.04);

  box-shadow: 0 0 0 1.5px rgba(230, 164, 180, 0.55);
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.p-singleGallery__item:hover {
  box-shadow:
    0 0 0 1.5px rgba(230, 164, 180, 0.75),
    0 8px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.p-singleGallery__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ トリミング無し：全体表示 */
}

/* 🌹 SP：1列＆クリック無効 */
@media (max-width: 768px) {
  .p-singleGallery__grid {
    grid-template-columns: 1fr;
  }
  .p-singleGallery__item {
    pointer-events: none;
  }
}

/* ==========================================================================
   🌹 08）Lightbox（PCのみ）
   ========================================================================== */

.c-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.c-lightbox.is-open {
  display: block;
}

.c-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.c-lightbox__panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  padding: 24px;
}

.c-lightbox__figure {
  margin: 0;
  text-align: center;
}

.c-lightbox__img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
}

.c-lightbox__cap {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.c-lightbox__close,
.c-lightbox__prev,
.c-lightbox__next {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
}

.c-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
}

html.is-lightbox-open {
  overflow: hidden;
}

/* ==========================================================================
   🌹🌹🌹 基本はresponsive.cssだけどこれだけ特別（将来的に移動して） 🌹🌹🌹
   ========================================================================== */

@media (max-width: 767px) {
  .p-singleGallery__grid {
    grid-template-columns: 1fr;
  }
  .p-singleGallery__item {
    pointer-events: none;
  }
}
