/* ============================================================
   症例一覧（/case/）独立デザイン
   デザイン：Figma 症例一覧（2200:16419）準拠
   背景ティールの上に白カード。フォントはサイト共通（游明朝系）を継承。
============================================================ */
.p-case {
  --case-main: #51b8c8;
  --case-accent: #d4bc8c;
  --case-accent-text: #927957;
  --case-text: #727576;
}

.p-case__body {
  padding: 120px 0 64px;
  background: var(--case-main);
}
.p-case__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- 悩みチップ ---- */
.p-case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: center;
}
.p-case__tag {
  display: inline-block;
  padding: 3px 24px;
  border: 1px solid var(--case-accent);
  border-radius: 50px;
  background: #fff;
  color: var(--case-accent-text);
  font-size: 14px;
  line-height: 2;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.p-case__tag:hover,
.p-case__tag.is-active {
  background: var(--case-accent);
  color: #fff;
}

/* ---- 施術から探す ---- */
.p-case__search {
  margin-top: 40px;
}
.p-case__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .06em;
  text-align: center;
}
.p-case__head::after {
  content: '';
  width: 24px;
  height: 24px;
  background: url('../../images/common/icon_white.png') no-repeat center / contain;
}
/* 施術リンクは白カード型ボタン（テキスト＋下線だとティール背景に沈んで視認性が低いため） */
.p-case__menu-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-case__menu-list li {
  width: calc(25% - 12px);
}
.p-case__menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 2px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}
.p-case__menu-link:hover,
.p-case__menu-link.is-active {
  background: #fff;
  border-color: #fff;
  color: var(--case-main);
}
.p-case__menu-arrow {
  font-size: 16px;
  line-height: 1;
  opacity: .8;
}

/* ---- SP用：施術から探すセレクトボックス（PCでは非表示） ---- */
.p-case__select-wrap {
  display: none;
}

/* ---- 症例カード ---- */
.p-case__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start; /* トグル開閉時に隣のカードの枠が連動して伸びないように */
  gap: 24px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.p-case__card {
  padding: 24px 16px 16px;
  background: #fff;
  color: var(--case-text);
}
.p-case__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}
.p-case__photo {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.p-case__photo figcaption {
  order: -1;
  padding: 2px 10px;
  background: var(--case-main);
  color: #fff;
  font-size: 15px;
  line-height: 2;
  text-align: center;
}
.p-case__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  background: #e6e6e6;
}
/* 連結1枚（case_image）：正方形・余白なしでそのまま敷く */
.p-case__photos--single {
  display: block;
}
.p-case__photos--single img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e6e6e6;
}

/* 縦横選択（case_photo_orientation）は廃止：一覧は連結1枚（正方形）に統一 */

.p-case__title {
  margin: 20px 0 0;
  color: #4b4b4b;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1.6;
}

/* ---- 限定解除3項目（詳細トグル） ---- */
.p-case__detail {
  margin-top: 14px;
  border-top: 1px solid #e8edee;
  padding-top: 12px;
}
.p-case__detail summary {
  cursor: pointer;
  color: var(--case-main);
  font-size: 13px;
  letter-spacing: .05em;
}
.p-case__detail summary::marker {
  color: var(--case-main);
}
.p-case__detail dl {
  margin: 10px 0 0;
}
.p-case__detail dl div {
  margin-top: 8px;
}
.p-case__detail dt {
  color: var(--case-accent-text);
  font-size: 12px;
  font-weight: 600;
}
.p-case__detail dd {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 2;
}
.p-case__card-note {
  margin: 10px 0 0;
  color: #8a8f90;
  font-size: 11px;
}

/* ---- ページネーション ---- */
.p-case__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 44px;
}
.p-case__pg-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.p-case__pg-num:hover,
.p-case__pg-num.is-current {
  background: #fff;
  color: var(--case-main);
}
.p-case__pg-prev,
.p-case__pg-next {
  margin: 0 8px;
  color: #fff;
  font-size: 15px;
  letter-spacing: .04em;
  text-decoration: none;
}

/* ---- 共通注記・CTA・空表示 ---- */
.p-case__empty {
  margin: 80px 0 0;
  color: #fff;
  text-align: center;
}
.p-case__note {
  margin: 36px 0 0;
  color: #fff;
  font-size: 12px;
  line-height: 2;
  opacity: .92;
}
.p-case__cta {
  margin-top: 40px;
  text-align: center;
}

/* ---- 絞り込み中：ナビ折りたたみ（「条件を変えて探す」） ---- */
.p-case__refine {
  margin: 0;
}
.p-case__refine > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 32px;
  border: 1px solid #fff;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  letter-spacing: .05em;
  line-height: 2;
  list-style: none;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.p-case__refine > summary::-webkit-details-marker {
  display: none;
}
.p-case__refine > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform .25s;
}
.p-case__refine > summary:hover {
  background: #fff;
  color: var(--case-main);
}
.p-case__refine[open] > summary {
  margin-bottom: 48px;
}
.p-case__refine[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

/* ============================================================
   SP
============================================================ */
@media (max-width: 768px) {
  .p-case__body {
    padding: 40px 0 56px;
  }
  .p-case__inner {
    padding: 0 12px; /* サイト共通のSPガター */
  }
  .p-case__tags {
    gap: 10px 12px;
  }
  .p-case__tag {
    padding: 3px 18px;
    font-size: 13px;
  }
  .p-case__search {
    margin-top: 36px;
  }
  .p-case__head {
    font-size: 18px;
    margin-bottom: 20px;
  }
  /* SPは施術リストをセレクトボックスに置き換える（施術数が増えても崩れない） */
  .p-case__menu-list {
    display: none;
  }
  .p-case__select-wrap {
    display: block;
    position: relative;
  }
  .p-case__select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 1px solid var(--case-main);
    border-bottom: 1px solid var(--case-main);
    transform: rotate(45deg);
    pointer-events: none;
  }
  .p-case__menu-select {
    display: block;
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1px solid var(--case-accent);
    border-radius: 2px;
    background: #fff;
    color: #4b4b4b;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    appearance: none;
    -webkit-appearance: none;
  }
  /* ブラウザ標準の黒いフォーカスリングをブランド色に置き換え */
  .p-case__menu-select:focus {
    outline: none;
    border-color: var(--case-main);
    box-shadow: 0 0 0 2px rgba(81, 184, 200, .3);
  }

  /* ---- ヒーロー：カテゴリページの長いh1・リードが360px固定枠から溢れるため、
          症例ページ系だけ高さ可変にする（他の下層ページは従来どおり） ---- */
  .p-case .p-hero {
    height: auto;
    min-height: 360px;
  }
  .p-case .p-hero__title {
    position: relative;
    z-index: 2;
    left: auto;
    top: auto;
    padding: 190px 12px 44px; /* 他の下層ヒーローと同じ開始位置（top:190px相当） */
  }
  /* 文字サイズ・字間は他の下層ヒーローと共通（26px / .2em）のまま。
     カテゴリ名が2行に折り返すページ用に行間だけ確保する */
  .p-case .p-hero__ja {
    line-height: 1.4;
  }
  .p-case__grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }
  .p-case__title {
    font-size: 15px;
  }
  .p-case__pg-num {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .p-case__refine > summary {
    padding: 7px 24px;
    font-size: 13px;
  }
}

/* ============================================================
   症例詳細（/case/<ID>/ single-case.php）
   一覧と同じ .p-case スコープを継承し、詳細用のブロックだけ足す
============================================================ */
.p-case__inner--single {
  max-width: 880px;
}
.p-case__single {
  padding: 32px 32px 40px;
  background: #fff;
  color: var(--case-text);
}
.p-case__single .p-case__photo figcaption {
  font-size: 16px;
}
/* 横型写真：詳細ページはレターボックス（上下黒帯）にせず、原寸比率のまま表示する */
/* 症例詳細：Beforeの帯だけ黒（Afterはティールのまま＝非対称でメリハリ） */
.p-case__single .p-case__photo:first-child figcaption {
  background: #000;
}
/* 症例詳細：before/afterは元画像の縦横比で表示（縦横選択は廃止）。
   2枚のサイズが微妙に違う場合はPHPが--pair-ratioを渡し、
   浅い方の比率に揃えてcoverで数%詰める＝下端が揃う */
.p-case__single .p-case__photo img {
  aspect-ratio: var(--pair-ratio, auto);
  height: auto;
  object-fit: cover;
  background: #e6e6e6;
}
.p-case__single-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 32px 0 4px;
  color: #4b4b4b;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .06em;
}
.p-case__single-head::after {
  content: '';
  width: 48px;
  height: 1px;
  background: var(--case-accent);
}
.p-case__info {
  margin: 20px 0 0;
}
.p-case__info div {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #e8edee;
}
.p-case__info div:first-of-type {
  border-top: 1px solid #e8edee;
}
.p-case__info dt {
  color: var(--case-accent-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 2;
}
.p-case__info dd {
  margin: 0;
  font-size: 13px;
  line-height: 2;
}
.p-case__price-note {
  display: block;
  margin-top: 4px;
  color: #c25f5f; /* 落ち着いたくすみレッド */
  font-size: 11px;
}
.p-case__doctor-comment {
  margin: 24px 0 0;
  padding: 16px 18px;
  background: #f2f9fa;
  border-left: 3px solid var(--case-main);
}
.p-case__doctor-comment-label {
  display: block;
  margin: 0 0 6px;
  color: var(--case-main);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
}
.p-case__doctor-comment p {
  margin: 0;
  font-size: 13px;
  line-height: 2;
}
.p-case__note-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: #8a8f90;
  font-size: 11px;
  line-height: 2;
}
.p-case__note-list li + li {
  margin-top: 2px;
}
.p-case__single-menus {
  margin: 28px 0 0;
  text-align: center;
}
.p-case__single-menus-label {
  display: block;
  margin: 0 0 10px;
  color: var(--case-accent-text);
  font-size: 12px;
  letter-spacing: .08em;
}
.p-case__tags--menus {
  gap: 10px 12px;
}
.p-case__tags--menus .p-case__tag {
  padding: 3px 18px;
  font-size: 13px;
  border-color: var(--case-main);
  color: var(--case-main);
}
.p-case__tags--menus .p-case__tag:hover {
  background: var(--case-main);
  color: #fff;
}
.p-case__head--related {
  margin-top: 64px;
}
.p-case__single-more {
  margin-top: 24px;
  text-align: center;
}

/* ---- 症例カードの詳細リンク（一覧・詳細共通） ---- */
.p-case__photos-link {
  display: block;
  text-decoration: none;
}
.p-case__card-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--case-main);
  font-size: 13px;
  letter-spacing: .05em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .25s;
}
.p-case__card-link:hover {
  opacity: .7;
}

@media (max-width: 768px) {
  .p-case__single {
    padding: 20px 14px 28px;
  }
  .p-case__info div {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 2px;
  }
  .p-case__single-head {
    font-size: 16px;
    margin-top: 28px;
  }
  .p-case__head--related {
    margin-top: 48px;
  }
}


/* ============================================================
   症例カードの高さ揃え（2026-11-05 本番指摘）
   題が2行になる症例だけカードが伸びてトグル・リンク・下端がガタつくため、
   PC/タブレットでは題を常に2行ぶん（line-height1.6×2＝3.2em）確保し、
   「この症例の詳細を見る」はカード下端に固定する。
   ※detailsを開いたときはそのカードだけ伸びる（アコーディオンの通常挙動）
============================================================ */
@media (min-width: 769px) {
  .p-case__card { display: flex; flex-direction: column; }
  .p-case__title { min-height: 3.2em; }
  .p-case__detail { margin-bottom: 12px; }
  .p-case__card-link { margin-top: auto; align-self: flex-start; }
}
