/* ===================================================
   症例詳細ページ専用スタイル
   さくら会グループ — case-detail.html
   =================================================== */

/* ══════════════════════════════════════════════════
   左固定バナー（btnFixBox: width 70px）回避
   PC表示時のみコンテンツ左端を揃える
   ══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .detail-hero,
  .detail-photos,
  .detail-content,
  .detail-nav,
  .related-section {
    padding-left: 80px;
  }
}

/* ══════════════════════════════════════════════════
   写真タイプ切り替えタブ
   ══════════════════════════════════════════════════ */
.photo-type-tabs {
  display: flex;
  gap: 0;
  background: #f5f5f5;
  border-bottom: 2px solid #e8e8e8;
  /* ヒーロー・写真エリアと左端を揃える */
  padding: 10px 0 0;
  max-width: 900px;
  margin: 0 auto;
  margin-bottom: 20px;
  /* タブ背景はsection全体に広げるためsectionにpaddingを持たせる */
}
.photo-type-tab {
  padding: 9px 18px;
  font-size: 15px;
  font-weight: bold;
  color: #888;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: color .2s, border-color .2s;
  border-radius: 6px 6px 0 0;
}
.photo-type-tab:hover {
  color: var(--c-pink);
}
.photo-type-tab.active {
  color: var(--c-pink);
  border-bottom-color: var(--c-pink);
  background: #fff;
}

/* ══════════════════════════════════════════════════
   5枚法：施術前後の合成画像を横並び
   ══════════════════════════════════════════════════ */
.fiveshot-wrap {
  background: #f5f5f5;
  padding: 20px 16px;
}
.fiveshot-pair {
  display: flex;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: flex-start;
}
.fiveshot-pair__item {
  flex: 1;
  min-width: 0;
}
.fiveshot-pair__label {
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding: 5px 0 7px;
  letter-spacing: .05em;
}
.fiveshot-pair__label--before { color: #2a6095; }
.fiveshot-pair__label--after  { color: #a05a00; }
.fiveshot-pair__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
/* SP / iPad：縦積み */
@media (max-width: 768px) {
  .fiveshot-pair {
    flex-direction: column;
    gap: 20px;
  }
}

/* ══════════════════════════════════════════════════
   顔貌写真：合成画像の縦積み（複数セット対応）
   ══════════════════════════════════════════════════ */
.facial-wrap {
  background: #f5f5f5;
  padding: 20px 16px;
}
.facial-sets {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}
.facial-set-item {}
.facial-set-item__label {
  font-size: 12px;
  font-weight: bold;
  color: #555;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid #46bdce;
}
.facial-set-item__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}


/* ギャラリーサムネイルのラベル（5枚法） */
.gallery-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 6px;
  text-align: center;
}

/* ギャラリービューアーのキャプション */
.gallery-viewer__caption {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  padding: 4px 0;
  min-height: 20px;
}

/* ── ヒーローエリア ─────────────────────────── */
.detail-hero {
  border-bottom: 1px solid var(--c-border);
  background: #fff;
  padding: 20px 20px 18px;
}
.detail-hero__inner {
  max-width: 900px;
  margin: 0 auto;
}
.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.detail-cat-badge {
  display: inline-block;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: var(--r-sm);
  letter-spacing: .04em;
}
.detail-case-no {
  font-size: 11px;
  color: var(--c-text-muted);
}
.detail-case-date {
  font-size: 11px;
  color: var(--c-text-sub);
}
.detail-title {
  font-size: clamp(18px, 3vw, 26px);
  font-weight: bold;
  color: var(--c-text);
  line-height: 1.4;
  margin-bottom: 12px;
}
.detail-patient-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── 写真エリア ─────────────────────────────── */
.detail-photos {
  background: #f5f5f5;
  border-bottom: 1px solid var(--c-border);
  padding: 20px 20px 24px;
  transition: min-height .25s ease;
}
.detail-photos__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.detail-photo-col {
  flex: 1;
  min-width: 0;
}
.detail-photo-label {
  font-size: 15px;
  font-weight: bold;
  color: var(--c-text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-photo-label--before { color: #666; }
.detail-photo-label--after  { color: var(--c-pink); }

.detail-photo-frame {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--c-border);
  background: #e8e8e8;
  aspect-ratio: 4/3;
  position: relative;
  cursor: zoom-in;
}

.detail-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* ドラッグ・選択禁止 */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;  /* クリックはフレームdiv側で受ける */
}

/* 顔貌専用フレーム: 3:4や1:1の画像に対応するため、アスペクト比を自動にしてcontainにする */
.facial-frame {
  aspect-ratio: auto;
  background: transparent;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.facial-frame img {
  object-fit: contain;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 450px;
  border-radius: var(--r-md);
  border: 2px solid var(--c-border);
}

/* レントゲン専用フレーム */
.xray-frame {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--c-border);
  background: #fff;
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
  cursor: zoom-in;
}
.xray-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.detail-after-caption {
  font-size: 14px;
  color: var(--c-pink);
  font-weight: bold;
  margin-top: 8px;
  text-align: center;
}
.detail-duration-badge {
  background: var(--c-pink);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 9px;
  border-radius: var(--r-pill);
}
.detail-photo-arrow {
  font-size: 28px;
  color: var(--c-border-case);
  flex-shrink: 0;
  align-self: center;
  padding-top: 28px;
}

/* ── コンテンツ本文 ──────────────────────────── */
.detail-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* セクション共通 */
.detail-section {
  margin-bottom: 24px;
}
.detail-section__label {
  font-size: 18px;
  font-weight: bold;
  color: var(--c-text-sub);
  border-left: 4px solid var(--c-pink);
  padding-left: 10px;
  margin-bottom: 10px;
  line-height: 1;
}

/* 主訴テキスト */
.detail-complaint {
  font-size: 16px;
  color: var(--c-text);
  line-height: 1.8;
  background: var(--c-bg-section);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
}

/* ドクターコメント（既存サイト accordion-title 風） */
.detail-doctor-comment {
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--c-pink-shadow);
}
.detail-doctor-comment__header {
  background: var(--c-pink);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-doctor-icon { font-size: 10px; opacity: .8; }
.detail-doctor-comment__text {
  background: #fff9f9;
  padding: 16px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--c-text);
  margin: 0;
}

/* 施術情報テーブル */
.detail-info-table {
  border: 1px solid var(--c-border-case);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.detail-info-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid var(--c-border);
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-th {
  background: var(--c-pink-pale);
  padding: 12px 12px;
  font-size: 15px;
  font-weight: bold;
  color: var(--c-text-sub);
  display: flex;
  align-items: center;
}
.detail-info-td {
  padding: 12px 14px;
  font-size: 16px;
  color: var(--c-text);
  line-height: 1.75;
}
.detail-info-price {
  font-size: 20px;
  font-weight: bold;
  color: var(--c-pink);
  display: inline;
}
.detail-info-tax {
  font-size: 12px;
  font-weight: normal;
  color: var(--c-text-sub);
}
.detail-info-note {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin: 6px 0 0;
}

/* タグ */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}
.detail-tags .tag {
  background: #fff;
  border: 1px solid var(--c-border-case);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--c-text-sub);
}
.detail-tags .tag::before { content: '#'; color: var(--c-pink); margin-right: 2px; }

/* 前後ナビ（btn_02スタイル） */
.detail-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.detail-nav__btn {
  display: inline-block;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: bold;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-family: var(--font);
}
.detail-nav__btn--prev {
  background: #fff;
  color: var(--c-text-sub);
  border: 2px solid var(--c-border-case);
  box-shadow: 3px 3px 0 #d2d2d2;
}
.detail-nav__btn--prev:hover {
  border-color: var(--c-text-sub);
  color: var(--c-text);
  box-shadow: none;
  transform: translate(3px, 3px);
}
.detail-nav__btn--list {
  background: #fff;
  color: var(--c-pink);
  border: 2px solid var(--c-pink);
  flex: 1;
  text-align: center;
  min-width: 140px;
  transition: background .2s, color .2s;
}
.detail-nav__btn--list:hover {
  background: var(--c-pink);
  color: #fff;
}
.detail-nav__btn--next {
  background: var(--c-pink);
  color: #fff;
  border: 2px solid var(--c-pink);
  box-shadow: 3px 3px 0 var(--c-pink-shadow);
}
.detail-nav__btn--next:hover {
  color: #fff;
  box-shadow: none;
  transform: translate(3px, 3px);
}
.detail-nav__btn.disabled {
  opacity: .35;
  pointer-events: none;
}

/* 「同じカテゴリの症例」見出し */
.detail-related__title {
  font-size: 22px;
  font-weight: bold;
  color: var(--c-text);
  margin-bottom: 16px;
}

/* 関連症例カルーセル */
.related-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.related-carousel__window {
  flex: 1;
  /* 指でのスワイプ・トラックパッドの横スクロールをそのまま使う */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  /* 端まで来たときにページごと動いたり、戻る操作が誤発動するのを防ぐ */
  overscroll-behavior-x: contain;
  /* スクロールバーは出さない（前後ボタンがあるため） */
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.related-carousel__window::-webkit-scrollbar { display: none; }
.related-carousel__track {
  display: flex;
  gap: 12px;
}
.related-carousel__btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.related-carousel__btn:hover {
  background: var(--c-pink);
  border-color: var(--c-pink);
  color: #fff;
}
.related-carousel__btn:disabled {
  opacity: .3;
  pointer-events: none;
}
.related-card {
  flex: 0 0 calc(33.333% - 8px);
  min-width: 180px;
  scroll-snap-align: start;
  border: 2px solid var(--c-border-case);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  text-decoration: none;
  display: block;
}
.related-card:hover {
  border-color: var(--c-pink);
  box-shadow: 0 3px 12px rgba(0,0,0,.09);
}
.related-card__img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  display: block;
}
.related-card__body { padding: 9px 10px 11px; }
.related-card__cat { font-size: 12px; font-weight: bold; margin-bottom: 3px; }
.related-card__title {
  font-size: 14px;
  font-weight: bold;
  color: var(--c-text);
  line-height: 1.4;
}

/* Not found */
.detail-not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--c-text-sub);
}
.detail-not-found__text {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
}
.btn-back-catalog {
  display: inline-block;
  padding: 10px 28px;
  background: var(--c-pink);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: bold;
  font-size: 15px;
  box-shadow: 4px 4px 0 var(--c-pink-shadow);
  transition: all 0.3s;
  text-decoration: none;
}
.btn-back-catalog:hover {
  color: #fff;
  box-shadow: none;
  transform: translate(4px, 4px);
}

/* ── レスポンシブ ───────────────────────────── */
@media screen and (max-width: 640px) {
  .detail-photos__inner {
    flex-direction: column;
    gap: 12px;
  }
  .detail-photo-arrow {
    align-self: center;
    transform: rotate(90deg);
    padding-top: 0;
    font-size: 22px;
  }
  .detail-related__grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-info-row {
    grid-template-columns: 88px 1fr;
  }
  .detail-nav {
    gap: 8px;
  }
  .detail-nav__btn {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* iPad横向き最適化 */
@media screen and (min-width: 768px) {
  .detail-photos {
    padding: 28px 20px;
  }
  .detail-photo-frame {
    border-width: 3px;
  }
  .detail-photo-arrow {
    font-size: 36px;
  }
}

/* ══════════════════════════════════════════════════
   「全ての写真を見る」ボタン
   ══════════════════════════════════════════════════ */
.gallery-btn-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 20px 20px;
  background: #f5f5f5;
}

.btn-open-gallery {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #fff;
  border: 2px solid var(--c-pink);
  border-radius: 999px;
  color: var(--c-pink);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s, color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.btn-open-gallery:hover {
  background: var(--c-pink);
  color: #fff;
}
.gallery-btn-icon { font-size: 16px; }
.gallery-btn-count {
  background: var(--c-pink);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 2px;
  transition: background .2s;
}
.btn-open-gallery:hover .gallery-btn-count {
  background: rgba(255,255,255,.3);
}

/* ══════════════════════════════════════════════════
   シンプルライトボックス
   ══════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
}
.lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  border: 2px solid rgba(255, 255, 255, .3);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  z-index: 1;
}
.lightbox__close:hover {
  background: rgba(255, 255, 255, .35);
}

