/* =========================================================
   院内ツアー / 院内・設備紹介 (slug: facilities)
   デザインカンプ XoXUw4vzh2C2X6RIfJJVGM node 560:6492 (3_Clinic Tour)
   top.css の :root 変数・.page-* / .cta-band 前提（pages.css の後に読み込む）
   ========================================================= */

.fac-page { background: #fff; padding-bottom: 127px; }
.fac-page * { box-sizing: border-box; }

/* ---------- ヒーロー（写真背景 + ピンクグラデ + Concept） ---------- */
.fac-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  /* カンプ 560:6492 ヒーローは「写真の画面」＋「無地コーラルにConceptの画面」の2画面構成。
     カンプ実寸 約1236px。写真が上、下が無地コーラルで本文がはっきり読める。 */
  min-height: 1147px;
}
.fac-hero__bg { position: absolute; left: 0; top: 0; right: 0; height: 657px; z-index: -3; overflow: hidden; }
.fac-hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}
.fac-hero::before {
  /* 写真下端はFigma同様にコーラルへなじませ、水玉は写真側へ乗せない。 */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 367px;
  bottom: 0;
  z-index: -2;
  background: linear-gradient(
    to bottom,
    rgba(229,177,177,0) 7.308%,
    #fc9291 27.667%,
    #fc9291 100%
  );
}
/* 水玉（ボケ）はコーラルの上だけに重ねる。 */
.fac-hero__overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 333px;
  bottom: 0;
  z-index: -1;
  opacity: .22;
  mix-blend-mode: soft-light;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.32) 84px, #000 204px);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.32) 84px, #000 204px);
}
.fac-hero__overlay img {
  position: absolute;
  left: .03%;
  top: -3.62%;
  width: 100%;
  height: 107.13%;
  max-width: none;
  object-fit: cover;
  display: block;
}

.fac-hero__inner {
  /* フルワイド前提で padding により 1280px ゾーンへ中央寄せする。
     max-width を併用すると広い画面で padding が中身を圧迫して折り返しが崩れるため付けない。 */
  padding: 472px 47px 110px;
}
.fac-hero__lead { margin: 0 0 104px; }
.fac-hero__crumb {
  margin: 0 0 18px;
  font-family: var(--ff-noto, inherit);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 2px;
}
.fac-hero__en {
  margin: 0;
  font-family: var(--ff-josefin);
  font-weight: 400;
  font-size: 50px;
  line-height: 1;
  letter-spacing: 1.5px;
}
.fac-hero__ja { margin: 14px 0 0; font-weight: 700; font-size: 14px; letter-spacing: 1.4px; }

.fac-hero__concept { text-align: center; }
.fac-hero__concept-en {
  margin: 0;
  font-family: var(--ff-josefin);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.4px;
  text-shadow: 0 0 14px var(--c-red);
}
.fac-hero__concept-title {
  position: relative;
  margin: 16px 0 0;
  font-weight: 500;
  font-size: clamp(20px, 2.3vw, 27.46px);
  line-height: 1.5;
  letter-spacing: .06em;
  text-shadow: 0 0 14px var(--c-red);
}
/* 句の途中で改行させない（PCは1行、狭い画面は句単位で折り返す） */
.fac-hero__nb { white-space: nowrap; }
/* 傍点（圏点）: 「あたたかい」の各文字の上に・を1つずつ＝カンプの ・・・・・ */
.fac-hero__em {
  font-style: normal;
  -webkit-text-emphasis: filled dot;
  text-emphasis: filled dot;
  -webkit-text-emphasis-position: over right;
  text-emphasis-position: over right;
}
.fac-hero__concept-body {
  margin: 24px auto 0;
  max-width: 1100px; /* 本文カラムを広げ、フォント幅が広い環境でも各行が1行に収まるように */
  font-weight: 500;
  font-size: 16px;
  line-height: 2.26;
  letter-spacing: .15em;
  text-shadow: 0 0 14px var(--c-red);
}

/* ---------- 本文（中央寄せ 1024px・各セクション縦積み） ---------- */
.fac-body {
  width: min(1024px, calc(100% - 48px));
  max-width: 1024px;
  margin: 0 auto;
  padding: 72px 0 0;
  transform: none;
}
.fac-tour { position: relative; margin-bottom: 120px; display: flex; flex-direction: column; }
.fac-body > .fac-tour:first-child { margin-bottom: 119px; }
/* カンプの視覚順は 見出し → 大写真 → サムネ（PHPは photo→thumbs→head の順で出力） */
.fac-tour__head { order: 0; }
.fac-tour__photo--lg { order: 1; }
.fac-tour__thumbs { order: 2; }

/* 見出し（中央：JP 36px ブラウン + EN 14px コーラル） */
/* カンプ準拠：英語(EN)を上、日本語(JA)を下に */
.fac-tour__head { text-align: center; margin: 0 0 50px; display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; }
.fac-equip__head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 6px; }
.fac-tour--pair .fac-tour__head { margin-bottom: 47px; }
.fac-tour__title {
  margin: 0;
  color: var(--c-brown);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.4;
  letter-spacing: .1em;
}
.fac-tour__en {
  margin: 0;
  font-family: var(--ff-josefin);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--c-pink);
}
.fac-tour__title--left, .fac-tour__en--left { text-align: left; }

/* 大写真（1024 x 572, radius 12） */
.fac-tour__photo--lg {
  width: 100%;
  aspect-ratio: 1024 / 572;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.fac-tour__photo--lg img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* サムネ列 */
.fac-tour__thumbs { display: flex; gap: 12px; }
.fac-tour__thumb {
  flex: 0 0 calc((100% - 60px) / 6);
  min-width: 0;
  aspect-ratio: 160 / 111;
  border-radius: 4px;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: .78;
  transition: opacity .2s ease, filter .2s ease, transform .2s ease;
}
.fac-tour__thumbs--4 .fac-tour__thumb { flex: 0 0 calc((100% - 60px) / 6); }
.fac-tour__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fac-tour__thumb:hover,
.fac-tour__thumb:focus-visible,
.fac-tour__thumb.is-active {
  opacity: 1;
  filter: saturate(1.06);
}
/* リフトはホバー時のみ。クリック（.is-active）では位置をずらさない */
.fac-tour__thumb:hover { transform: translateY(-5px); }
.fac-tour__thumb:focus-visible { outline: 3px solid rgba(228, 74, 63, .24); outline-offset: 2px; }

/* カウンセリング: 横並び2枚 */
.fac-tour--pair .fac-tour__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.fac-tour__pair-img {
  display: block;
  width: 100%;
  aspect-ratio: 499 / 306;
  overflow: hidden;
  background: #f1efe9;
}
.fac-tour__pair-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 院内設備のご紹介（カード9枚・3列） ---------- */
.fac-equip { margin-bottom: 0; }
.fac-equip__head { min-height: 108px; margin: 0 0 51px; }
.fac-equip__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 32px;
}
.fac-equip__card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 459px;
}
.fac-equip__media { width: 100%; aspect-ratio: 320 / 234; overflow: hidden; background: #f1efe9; }
.fac-equip__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fac-equip__text { padding: 30px 0 24px; flex: 1 1 auto; }
.fac-equip__name {
  margin: 0;
  color: var(--c-red);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-align: center;
  /* タイトルの行数差で説明文の開始位置がずれないよう2行分を確保 */
  min-height: calc(1.4em * 2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fac-equip__desc {
  margin: 22px 0 0;
  color: var(--c-brown2);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .12em;
}

.fac-body + .cta-band { margin-top: 120px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 820px) {
  .fac-hero { min-height: 640px; }
  .fac-hero__inner { padding: 250px 20px 48px; }
  .fac-hero__lead { margin-bottom: 36px; }
  .fac-hero__en { font-size: 38px; }
  .fac-hero__concept-body { font-size: 14px; line-height: 2; letter-spacing: .04em; }

  .fac-body { width: auto; max-width: 1024px; padding: 64px 18px 0; transform: none; }
  .fac-page { padding-bottom: 120px; }
  .fac-tour { margin-bottom: 72px; }
  .fac-tour__head { margin-bottom: 30px; }
  .fac-tour__thumbs--4 .fac-tour__thumb { flex: 1 1 0; }
  .fac-equip__head { margin-bottom: 32px; }
  .fac-equip__grid { grid-template-columns: repeat(2, 1fr); gap: 18px 18px; }
  .fac-equip__card { height: auto; }
  .fac-equip__text { padding: 20px 0 18px; }
  .fac-equip__name { font-size: 16px; }
  .fac-equip__desc { font-size: 14px; }
  .fac-body + .cta-band { margin-top: 72px; }
}

@media (max-width: 540px) {
  .fac-tour__thumbs { flex-wrap: wrap; }
  .fac-tour__thumb { flex: 0 0 calc((100% - 24px) / 3); }
  .fac-tour--pair .fac-tour__pair { grid-template-columns: 1fr; gap: 16px; }
  .fac-equip__grid { grid-template-columns: 1fr; }
  /* スマホ幅では1行が収まらないため改行を解除して自然に折り返す */
  .fac-hero__concept-body br { display: none; }
}

/* SPレビュー反映: 初期表示は写真全面 + 左下パンくず/ページ名のみ。Conceptは次セクション扱い。 */
@media (max-width: 820px) {
  .fac-hero {
    min-height: 0 !important;
    height: auto !important;
  }

  .fac-hero__bg {
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
  }

  .fac-hero::before {
    top: calc(100vh - 60px) !important;
    top: calc(100svh - 60px) !important;
    bottom: 0 !important;
    background: #fc9291 !important;
  }

  .fac-hero__overlay {
    top: calc(100vh - 60px) !important;
    top: calc(100svh - 60px) !important;
    opacity: .22 !important;
  }

  .fac-hero__inner {
    padding: 0 !important;
  }

  .fac-hero__lead {
    min-height: calc(100vh - 60px) !important;
    min-height: calc(100svh - 60px) !important;
    margin: 0 !important;
    padding: 0 24px 58px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
  }

  .fac-hero__crumb {
    margin: 0 0 16px !important;
    line-height: 1.8 !important;
  }

  .fac-hero__concept {
    position: relative;
    z-index: 1;
    padding: 58px 20px 70px !important;
    background: #fc9291;
  }
}

/* SP最終調整: 写真とタイトルを小さめに整え、グラデーション上で読ませる。 */
@media (max-width: 820px) {
  .fac-hero {
    min-height: auto !important;
    height: auto !important;
  }

  .fac-hero__bg {
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
  }

  .fac-hero__bg img {
    object-position: center center !important;
  }

  .fac-hero::before {
    top: 0 !important;
    background: linear-gradient(to bottom, rgba(252,146,145,0) 0%, rgba(252,146,145,.12) 42%, rgba(252,146,145,.58) 70%, rgba(252,146,145,.96) 100%) !important;
  }

  .fac-hero__overlay {
    top: 48% !important;
    opacity: .18 !important;
  }

  .fac-hero__lead {
    padding: 0 22px 46px !important;
  }

  .fac-hero__crumb {
    color: #fff !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .fac-hero__en {
    font-size: clamp(38px, 11vw, 48px) !important;
  }

  .fac-hero__ja {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }
}

/* SP画像サイズ調整: Clinic Tour FVの写真を短めに戻す。 */
@media (max-width: 820px) {
  .fac-hero {
    min-height: 0 !important;
    height: auto !important;
  }

  .fac-hero__bg {
    height: 390px !important;
  }

  .fac-hero__lead {
    min-height: 390px !important;
    padding: 0 22px 34px !important;
  }

  .fac-hero::before {
    background: linear-gradient(to bottom, rgba(252,146,145,0) 0%, rgba(252,146,145,.12) 36%, rgba(252,146,145,.58) 68%, rgba(252,146,145,.96) 100%) !important;
  }

  .fac-hero__concept {
    display: block !important;
    padding: 44px 22px 58px !important;
    background: #fc9291 !important;
  }
}

/* SP補正: 院内・設備FVの文字下までグラデーションを強め、白文字が切れず読めるようにする。 */
@media (max-width: 820px) {
  .fac-hero::before {
    background:
      linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.08) 24%, rgba(252,146,145,.48) 54%, rgba(252,146,145,.86) 78%, #fc9291 100%) !important;
  }

  .fac-hero__lead {
    width: 100% !important;
  }

  .fac-hero__crumb,
  .fac-hero__en,
  .fac-hero__ja {
    text-shadow: 0 1px 12px rgba(73,50,21,.24) !important;
  }

  .fac-hero__en {
    max-width: calc(100vw - 44px) !important;
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: clamp(36px, 10.6vw, 44px) !important;
    letter-spacing: .04em !important;
  }
}

/* SP補正: スタッフ紹介と同じく左下にタイトルを置き、文字下までグラデーションをつなげる。 */
@media (max-width: 820px) {
  .fac-hero__bg {
    height: 400px !important;
  }

  .fac-hero__bg img {
    object-fit: cover !important;
    object-position: center center !important;
  }

  .fac-hero__lead {
    min-height: 400px !important;
    padding: 0 22px 20px !important;
  }

  .fac-hero::before {
    background:
      linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.08) 20%, rgba(252,146,145,.44) 50%, rgba(252,146,145,.82) 74%, #fc9291 100%) !important;
  }

  .fac-hero__overlay {
    top: 0 !important;
    opacity: .16 !important;
  }
}

/* SP最終: 初期表示ではConceptを見せず、写真+グラデ+左下タイトルだけを1画面に収める。 */
@media (max-width: 820px) {
  .fac-hero__bg,
  .fac-hero__lead {
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
    min-height: calc(100vh - 60px) !important;
    min-height: calc(100svh - 60px) !important;
  }

  .fac-hero__lead {
    padding: 0 22px 44px !important;
  }

  .fac-hero::before {
    top: 0 !important;
    bottom: auto !important;
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
    background:
      linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.08) 28%, rgba(252,146,145,.34) 58%, rgba(252,146,145,.76) 82%, #fc9291 100%) !important;
  }

  .fac-hero__overlay {
    top: 0 !important;
    bottom: auto !important;
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
    opacity: .18 !important;
  }

  .fac-hero__concept {
    padding-top: 58px !important;
  }

  .fac-hero__concept-title {
    max-width: calc(100vw - 36px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    /* 1行に詰め込んで極小になっていたのを、2つの __nb 単位で改行できるようにし
       読みやすいサイズに拡大（各 __nb は nowrap で語のまとまりを維持）。 */
    font-size: clamp(15px, 4.4vw, 19px) !important;
    line-height: 1.7 !important;
    letter-spacing: .02em !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-wrap: balance !important;
  }

  .fac-hero__concept-title .fac-hero__nb {
    white-space: nowrap !important;
  }
}

/* 最終補正: SPの写真面からConcept面への境目をなじませる。 */
@media (max-width: 820px) {
  .fac-hero {
    background: #fc9291 !important;
  }

  .fac-hero__overlay {
    height: 520px !important;
    bottom: auto !important;
    opacity: .16 !important;
  }

  .fac-hero::before {
    background:
      linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.07) 24%, rgba(252,146,145,.44) 54%, rgba(252,146,145,.82) 78%, #fc9291 100%) !important;
  }

  .fac-hero__concept {
    margin-top: -1px !important;
    background:
      linear-gradient(to bottom, #fc9291 0%, #fc9291 100%) !important;
  }

  .fac-hero__concept::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: -92px !important;
    height: 92px !important;
    pointer-events: none !important;
    background: linear-gradient(to bottom, rgba(252,146,145,0) 0%, rgba(252,146,145,.78) 72%, #fc9291 100%) !important;
  }

  .fac-equip__name {
    min-height: 0 !important;
    line-height: 1.55 !important;
  }
}

/* SP最終補正: 写真面とConcept面の境目を消すため、グラデーションのつなぎを強める。 */
@media (max-width: 820px) {
  .fac-hero {
    background-color: #fc9291 !important;
  }

  .fac-hero::before {
    background:
      linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.06) 20%, rgba(252,146,145,.38) 48%, rgba(252,146,145,.82) 76%, #fc9291 100%) !important;
  }

  .fac-hero__overlay {
    height: 560px !important;
    opacity: .18 !important;
  }

  .fac-hero__concept {
    margin-top: -1px !important;
    overflow: visible !important;
    background: #fc9291 !important;
  }

  .fac-hero__concept::before {
    top: -132px !important;
    height: 132px !important;
    background: linear-gradient(to bottom, rgba(252,146,145,0) 0%, rgba(252,146,145,.58) 52%, #fc9291 100%) !important;
  }
}

/* Final SP guard: remove visible seam between photo and concept. */
@media (max-width: 820px) {
  .fac-hero {
    background-color: #fc9291 !important;
    overflow: hidden !important;
  }

  .fac-hero__bg,
  .fac-hero__lead,
  .fac-hero::before,
  .fac-hero__overlay {
    height: calc(100vh - 60px) !important;
    height: calc(100svh - 60px) !important;
    min-height: calc(100vh - 60px) !important;
    min-height: calc(100svh - 60px) !important;
  }

  .fac-hero__bg img {
    object-fit: cover !important;
    object-position: center center !important;
  }

  .fac-hero::before {
    top: 0 !important;
    bottom: auto !important;
    background: linear-gradient(to bottom, rgba(73,50,21,0) 0%, rgba(73,50,21,.06) 24%, rgba(252,146,145,.30) 50%, rgba(252,146,145,.76) 78%, #fc9291 100%) !important;
  }

  .fac-hero__overlay {
    top: 0 !important;
    bottom: auto !important;
    opacity: .18 !important;
  }

  .fac-hero__lead {
    padding: 0 22px 44px !important;
  }

  .fac-hero__concept {
    position: relative !important;
    margin-top: -1px !important;
    padding: 58px 20px 60px !important;
    overflow: visible !important;
    background: #fc9291 !important;
  }

  .fac-hero__concept::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: -170px !important;
    height: 170px !important;
    z-index: -1 !important;
    pointer-events: none !important;
    background: linear-gradient(to bottom, rgba(252,146,145,0) 0%, rgba(252,146,145,.36) 36%, rgba(252,146,145,.82) 76%, #fc9291 100%) !important;
  }

  .fac-hero__concept-title,
  .fac-hero__concept-body {
    max-width: calc(100vw - 32px) !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
  }
}

/* SP first-view labels should be pure white, without glow. */
@media (max-width: 820px) {
  .fac-hero__crumb,
  .fac-hero__crumb *,
  .fac-hero__en,
  .fac-hero__ja {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
  }

  .fac-hero::before,
  .fac-hero__overlay {
    z-index: 1 !important;
    pointer-events: none !important;
  }

  .fac-hero__lead,
  .fac-hero__inner {
    position: relative !important;
    z-index: 5 !important;
  }
}
