/**
 * トップページ（front-page.php）専用スタイル
 * MV（メインビジュアル）と「お知らせ」欄（どちらも動的セクション）が対象。
 * それ以外はブロックエディタ側の本文なので、block style / パターンのCSSが適用される。
 */

/* ===================================================================
 * MV（メインビジュアル）
 * ブレイクポイント: 768px
 * - 768px超　　: 診療時間表は写真の上に重ねて表示
 * - 768px以下　: 診療時間表は写真の下（白背景）に表示
 * =================================================================== */

.mv {
  position: relative;
  /* 高さ最低700px、それ以外は 100vh からヘッダーの高さ分を引いた値 */
  height: max(700px, calc(100vh - var(--site-header-bottom, 0px)));
}

.mv__media {
  position: absolute;
  /* 「お知らせ」欄左のグラデーション装飾（PC）・写真左下のグラデーション
     装飾（SP）より手前に来るように、常に z-index を高くしておく。 */
  z-index: 1;
  top: 0;
  bottom: 0;
  right: 0;
  /* 画面幅1440pxまでは左端から常に50px。1440pxを超えたら、はみ出した分の
     半分だけ左端を右へ動かす（= 1440px幅の中央寄せコンテナを想定し、その
     左ガター＋50pxの位置）。右端は常に画面右端に固定なので、画像の右側は
     1440px超でも（半分の速度で）伸び続ける。 */
  left: max(50px, calc(50px + (100% - 1440px) / 2));
  overflow: hidden;
  border-top-left-radius: 60px;
  background: var(--wp--preset--color--lavender-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.mv__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* 上下の空きを 2:1 に配分するスペーサー（写真の高さ基準） */
.mv__spacer {
  flex: 2 0 0px;
}

.mv__spacer--bottom {
  flex: 1 0 0px;
}

.mv__overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  /* 写真の左端から60px内側 */
  margin-left: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.mv__badge {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  font-family: var(
    --wp--preset--font-family--heading,
    "YuMincho",
    "Yu Mincho",
    serif
  );
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  padding: 0 20px;
  border-radius: 2px;
}

.mv__headline {
  font-family: var(
    --wp--preset--font-family--heading,
    "YuMincho",
    "Yu Mincho",
    serif
  );
  font-weight: 600;
  font-style: normal;
  font-size: 30px;
  line-height: 32px;
  letter-spacing: 0;
  vertical-align: middle;
  color: var(--wp--preset--color--heading-text);
  margin: 0;
}

.mv__subtext {
  font-family: var(
    --wp--preset--font-family--heading,
    "YuMincho",
    "Yu Mincho",
    serif
  );
  font-weight: 500;
  font-style: normal;
  font-size: 17px;
  line-height: 20px;
  letter-spacing: 0;
  vertical-align: middle;
  color: var(--wp--preset--color--body-text);
  margin: 0;
}

/* バッジ・見出し・サブテキストは PC用／SP用（任意設定）の2種類を出力し、
   breakpoint に応じて表示・非表示を切り替える。SP用テキストは1行ごとに
   display:inline-block の <span class="mv-line"> に分けて出力し、
   禁則処理を保ったまま指定した位置でのみ改行されるようにする。 */
.mv__badge-inner--mobile,
.mv__headline-inner--mobile,
.mv__subtext-inner--mobile {
  display: none;
}

.mv-line {
  display: inline-block;
}

/* 診療時間表：デスクトップは .mv__overlay 内（バッジ〜CTAボタンと同じ列）に
   表示し、モバイルは写真の下（白背景）に表示する。同じショートコード出力を
   2箇所に配置し、breakpoint に応じて表示・非表示を切り替える。 */
.mv__hours--desktop {
  width: auto;
  max-width: 100%;
}

.mv__hours--mobile {
  display: none;
}

/* 写真の左下に重ねるグラデーション装飾（SPのみ） */
.mv__band {
  display: none;
}

/* 診療時間表＋下部テキストを、透過白のボックスに収める */
.mv__hours {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 16px 20px;
}

.mv__cta {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(
        135deg,
        var(--wp--preset--color--pink-bg),
        var(--wp--preset--color--sky-bg)
      )
      border-box;
  border: 10px solid transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mv__cta-icon img {
  width: 120px;
  height: auto;
  color: var(--wp--preset--color--heading-text);
}

.mv__cta-label {
  font-family: var(
    --wp--preset--font-family--heading,
    "YuMincho",
    "Yu Mincho",
    serif
  );
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  color: var(--wp--preset--color--heading-text);
  text-align: center;
  white-space: pre-line;
}

/* 診療時間表そのもののスタイル（[clinic_hours_table] ショートコード共通） */
.clinic-hours-table {
  border-collapse: collapse;
  font-size: 14px;
  color: var(--wp--preset--color--body-text);
}

.clinic-hours-table th,
.clinic-hours-table td {
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  border-bottom: 1px solid #262626;
}

.clinic-hours-table thead th {
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
  border-bottom: 1px solid #262626;
}

.clinic-hours-table tbody th {
  font-weight: 700;
  text-align: left;
}

.clinic-hours-table td {
  color: var(--wp--preset--color--primary);
  font-weight: 700;
}

.clinic-hours-note p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #262626;
}

@media (max-width: 768px) {
  .mv {
    height: auto;
  }

  .mv__media {
    position: relative;
    z-index: 1;
    top: auto;
    bottom: auto;
    right: auto;
    left: auto;
    margin-left: 20px;
    height: 412px;
  }

  /* 上下の空きを 9:2 に配分 */
  .mv__spacer {
    flex: 9 0 0px;
  }

  .mv__spacer--bottom {
    flex: 2 0 0px;
  }

  .mv__overlay {
    margin-left: 20px;
    width: calc(100% - 100px);
    max-width: none;
    gap: 8px;
  }

  .mv__badge {
    display: inline-block;
    width: auto;
    font-size: 12px;
    line-height: normal;
    text-align: left;
    padding: 6px 14px;
  }

  .mv__headline {
    font-size: 24px;
  }

  .mv__subtext {
    font-size: 13px;
  }

  .mv__cta {
    width: 140px;
    height: 140px;
    gap: 0;
  }

  .mv__cta-icon img {
    width: 65px;
  }

  .mv__cta-label {
    font-size: 12px;
  }

  /* SP用テキスト（設定されていればそちら、なければPC用テキストの複製）に切り替え */
  .mv__badge-inner--desktop,
  .mv__headline-inner--desktop,
  .mv__subtext-inner--desktop {
    display: none;
  }

  .mv__badge-inner--mobile,
  .mv__headline-inner--mobile,
  .mv__subtext-inner--mobile {
    display: inline;
  }

  /* 写真の裏側（z-indexを下げて写真より下）に配置し、写真の下端から
     30pxだけ下にはみ出して見えるようにする。写真と重なっている部分は
     .mv__media（z-index:1）の下に隠れる。 */
  .mv__band {
    display: block;
    position: absolute;
    z-index: 0;
    top: 257px;
    left: 0;
    width: 70%;
    max-width: 280px;
    height: 185px;
    background: var(--wp--preset--gradient--hero-gradient);
    pointer-events: none;
  }

  /* 診療時間表は写真の下（白背景）へ移動 */
  .mv__hours--desktop {
    display: none;
  }

  .mv__hours--mobile {
    display: block;
    position: relative;
    z-index: 1;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 16px;
    padding: 16px var(--wp--custom--container--padding, 24px);
    background: none;
    border-radius: 0;
  }

  /* 375px幅でもデザイン同様に収まるよう、文字サイズ・セル余白を縮小
     （実機でのフォント幅の誤差を考慮し、ぴったりではなく少し余裕を持たせる） */
  .clinic-hours-table {
    width: 100%;
    table-layout: fixed;
    font-size: 13px;
  }

  .clinic-hours-table th,
  .clinic-hours-table td {
    padding: 6px 2px;
    white-space: normal;
  }

  /* 1列目（診療時間／時間帯ラベル）だけ他より広く確保する */
  .clinic-hours-table th:first-child,
  .clinic-hours-table td:first-child {
    width: 30%;
    white-space: nowrap;
  }
}

.front-news {
  position: relative;
  max-width: 1100px;
  margin: 48px auto;
  padding: 48px var(--wp--custom--container--padding, 24px);
  /* 装飾（::before）がMVの下へ向かって上にはみ出すので hidden にしない */
  overflow: visible;
}

/* 表示する投稿が無いときは余白（margin/padding）ごと消して、
   スペーサーのような空白が残らないようにする。 */
.front-news.is-hidden {
  margin: 0 auto;
}

/* 直近3ヶ月以内の投稿が無いときはここを .is-hidden にして丸ごと隠す
   （front-page.php 側で出し分け）。 */
.front-news__body {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.front-news__body.is-hidden {
  display: none;
}

/* 見出しの左に入るグラデーション装飾（PCのみ）。
   見出し・リストの表示位置は動かさず、装飾だけ上へはみ出して
   MVの裏に回り込むようにする（z-indexは .mv__media の方を高くしている）。
   左端の位置は .mv__media の left と同じ考え方：画面幅1440pxまでは
   画面の左端にそのまま追従し、1440pxを超えたらそこで追従をやめる
   （= 1440px中央寄せコンテナの左端を基準にする）。
   .front-news 自体は max-width:1100px で中央寄せされているため、
   「画面の左端基準の位置」から「.front-newsの左端基準の位置」に
   換算するために .front-news 自身の中央寄せ量を差し引いている。 */
.front-news::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -120px;
  left: calc(max(0px, (100vw - 1440px) / 2) - max(0px, (100vw - 1100px) / 2));
  width: 360px;
  max-width: 50%;
  height: calc(100% + 120px);
  background: var(--wp--preset--gradient--hero-gradient);
  pointer-events: none;
}

.front-news__title {
  position: relative;
  z-index: 1;
  flex: 0 0 220px;
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--heading-md);
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
  margin: 0;
}

.front-news__list {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.front-news__item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--wp--preset--color--divider);
}

.front-news__date {
  flex: 0 0 auto;
  font-size: var(--wp--preset--font-size--base);
  color: #262626;
}

.front-news__category {
  flex: 0 0 auto;
  display: inline-block;
  width: 80px;
  padding: 3px 4px;
  background: var(--wp--preset--color--primary);
  border-radius: 4px;
  color: var(--wp--preset--color--white);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.front-news__link {
  flex: 1 1 0;
  min-width: 200px;
  color: var(--wp--preset--color--heading-text);
  font-size: var(--wp--preset--font-size--base);
  text-decoration: none;
}

.front-news__link:hover {
  color: var(--wp--preset--color--primary-dark);
  text-decoration: underline;
}

@media (max-width: 767px) {
  .front-news {
    padding-block: 32px;
  }

  .front-news__body {
    flex-direction: column;
    gap: 8px;
  }

  .front-news::before {
    display: none;
  }

  .front-news__title {
    flex: none;
    width: 100%;
    text-align: center;
    font-size: var(--wp--preset--font-size--heading-sm);
    margin-bottom: 8px;
  }

  .front-news__item {
    gap: 8px;
  }
  .front-news__link {
    flex-basis: 100%;
    order: 3;
  }
}

/* ===================================================================
 * クイックリンク（アイコン6つのグリッド）
 * =================================================================== */
.quick-links {
  position: relative;
  padding-block: 48px;
  padding-bottom: 128px;
  overflow: hidden;
}

/* コンテンツ（タイル）はここで幅を決める。装飾は .quick-links の直下・
   これと同列（兄弟要素）に置き、コンテンツ幅の影響を受けずに
   はみ出せるようにする（以前は .quick-links 自体の幅で装飾が
   切れてしまっていた）。 */
.quick-links__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: var(--wp--custom--container--padding, 24px);
}

/* 背景の葉っぱの装飾（PCのみ。左下を起点に、右へ40度ほど傾けて配置） */
.quick-links::before {
  content: "";
  position: absolute;
  left: 40%;
  bottom: 260px;
  width: 390px;
  height: 774px;
  background: url("../images/quicklinks-bg.png") no-repeat left bottom / contain;
  transform: rotate(40deg) translate(calc(50% - 580px), calc(50% + 130px));
  transform-origin: bottom left;
  pointer-events: none;
  z-index: 0;
}

/* 円の装飾（2つ）：右上の小さい円＋右下の大きい円 */
.quick-links__circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.quick-links__circle--sm {
  top: 53%;
  right: 50%;
  transform: translateX(calc(50% + 390px));
  width: 64px;
  height: 64px;
  background: var(--wp--preset--color--lavender-blue-bg);
}

.quick-links__circle--lg {
  right: 50%;
  transform: translateX(calc(50% + 290px));
  bottom: 10px;
  width: 141px;
  height: 141px;
  background: var(--wp--preset--color--lavender-blue-bg);
}

.quick-links__list {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  /* 正方形のタイル＋アイコン(最大120px)＋16px以上の2行テキストが
     きちんと収まる最小幅を下限にして、収まらなければ自動で列数を
     減らす（580px幅では3列になる）。 */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 40px;
}

.quick-links__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1;
  padding: 14px;
  box-sizing: border-box;
  border: 4px solid transparent;
  background:
    linear-gradient(
        var(--wp--preset--color--white),
        var(--wp--preset--color--white)
      )
      padding-box,
    linear-gradient(
        135deg,
        var(--wp--preset--color--lavender-bg),
        var(--wp--preset--color--lavender-blue-bg)
      )
      border-box;
  text-decoration: none;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.quick-links__link:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.quick-links__icon {
  display: flex;
  justify-content: center;
  width: 100%;
}

.quick-links__icon img {
  width: 60%;
  max-width: 120px;
  height: auto;
}

.quick-links__label {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--base);
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .quick-links {
    padding-block: 24px;
    padding-bottom: 72px;
  }

  .quick-links::before,
  .quick-links__circle {
    display: none;
  }

  .quick-links__list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
  }

  .quick-links__link {
    padding: 14px;
    gap: 8px;
  }

  .quick-links__icon img {
    width: 50%;
  }
}

/* ===================================================================
 * 診療案内（Medical）一覧
 * 3列 → タブレット幅で2列 → SP幅で1列、に自動で折り返す。
 * =================================================================== */
.medical-list {
  position: relative;
  padding-block: 64px;
  padding-bottom: 144px;
  margin-bottom: 80px;
  background: url("../images/medical-bg.jpg") no-repeat center top / cover;
}

.medical-list__header {
  max-width: 1200px;

  margin: 0 auto;
  padding-inline: var(--wp--custom--container--padding, 24px);
}

.medical-list__heading {
  margin: 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 100px;
  line-height: 1.2;
  color: var(--wp--preset--color--primary);
}

.medical-list__subheading {
  font-size: var(--wp--preset--font-size--base);
  color: var(--wp--preset--color--body-text);
}

.medical-list__panel {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 50px;
  background: var(--wp--preset--color--white);
}

.medical-list__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.medical-list__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
}

.medical-list__image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.medical-list__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.medical-list__number {
  display: block;
  margin-top: -38px;
  margin-bottom: -26px;
  padding-left: 20px;
  position: relative;
  z-index: 1;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--lavender-bg) 60%,
    var(--wp--preset--color--lavender-blue-bg)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.medical-list__body {
  width: 100%;
  margin-top: 24px;
  padding: 20px 24px;
  border-left: 1px solid #d1e4f5;
}

/* 3の倍数番目（各行の一番右）のアイテムだけ右側にも区切り線を入れる */
.medical-list__item:nth-child(3n) .medical-list__body {
  border-right: 1px solid #d1e4f5;
}

.medical-list__title {
  display: block;
  margin: 4px 0 0;
  font-size: var(--wp--preset--font-size--card-heading, 18px);
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
}

.medical-list__subtitle {
  display: block;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #cd9ed7;
}

.medical-list__button {
  display: flex;
  width: 240px;
  align-items: center;
  justify-content: space-between;
  align-self: flex-start;
  margin-top: 24px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px 24px;
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--lavender-bg),
    var(--wp--preset--color--lavender-blue-bg)
  );
  font-size: 16px;
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
  text-decoration: none;
}

.medical-list__arrow {
  transition: transform 0.2s ease;
}

.medical-list__card:hover .medical-list__arrow {
  transform: translateX(4px);
}

/* タブレット幅：2列（3つ目の項目は単独で2行目、区切り線は消す） */
@media (max-width: 900px) {
  .medical-list__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .medical-list__item:nth-child(3n + 3) .medical-list__body {
    border-left: none;
    border-right: none;
  }
}

/* SP幅：1列（区切り線は左右両方に統一） */
@media (max-width: 600px) {
  .medical-list {
    padding-block: 40px;
    margin-bottom: 48px;
  }

  .medical-list__heading {
    font-size: 32px;
  }

  .medical-list__panel {
    margin-top: 24px;
    padding: 24px 16px;
  }

  .medical-list__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .medical-list__body {
    border-left: 1px solid #d1e4f5 !important;
    border-right: 1px solid #d1e4f5 !important;
    padding: 16px;
  }

  .medical-list__card {
    padding-inline: 8px;
  }

  .medical-list__number {
    font-size: 48px;
    margin-top: -28px;
    margin-bottom: -20px;
  }
  .medical-list__button {
    padding: 6px 24px;
  }
}

/* ===================================================================
 * 院長紹介（Greeting）
 * =================================================================== */
.greeting {
  padding-block: 64px;
  margin-bottom: 80px;
  background: url("../images/greeting-bg.jpg") no-repeat center / cover;
}

.greeting__header {
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: var(--wp--custom--container--padding, 24px);
}

.greeting__heading {
  margin: 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 100px;
  line-height: 1.2;
  color: var(--wp--preset--color--primary);
}

.greeting__subheading {
  margin: 8px 0 0;
  font-size: var(--wp--preset--font-size--base);
  color: var(--wp--preset--color--body-text);
}

.greeting__body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1100px;
  margin: 70px auto 0;
  padding-inline: var(--wp--custom--container--padding, 24px);
}

/* 画面左端からテキストの右端（コンテンツ幅の右端）まで横断する帯状の装飾。
   写真の高さの途中から、写真の下端より少し下まで続く。
   .greeting__body は中央寄せなので、コンテンツ幅の分だけ画面中央から
   右に広げつつ、左端は viewport の左端まで伸ばす（左右非対称のはみ出し）。 */
.greeting__band {
  position: absolute;
  z-index: 0;
  top: 75px;
  /* 高さは固定値ではなく、幅に対する縦横比（PC基準：1035:452）で決める。
  幅（width/max-width）はビューポート幅に応じて可変のため、
  ウィンドウ幅が縮んでもこの帯の縦横比が保たれ、高さも一緒に収縮する。 */
  aspect-ratio: 1035 / 452;
  height: auto;
  left: 0;
  width: 100%;
  max-width: calc(50vw + 550px);
  background: #f7f2f9;
  pointer-events: none;
}

.greeting__photo-wrap {
  position: relative;
  z-index: 1;
  flex: 0 0 40%;
}

.greeting__photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.greeting__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.greeting__content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.greeting__headline {
  margin: 0;
  font-size: var(--wp--preset--font-size--heading-sm, 22px);
  line-height: 1.5;
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
}

.greeting__text {
  margin: 24px 0 0;
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.9;
  color: var(--wp--preset--color--body-text);
}

.greeting__profile {
  margin-top: 24px;
}

.greeting__position {
  display: block;
  font-size: 14px;
  color: var(--wp--preset--color--body-text);
}

.greeting__name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
}

.greeting__name-en {
  margin-left: 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--wp--preset--color--primary);
}

.greeting__qualification {
  display: inline-block;
  margin: 8px 0 0;
  padding: 6px 16px;
  background: var(--wp--preset--color--white);
  font-size: 13px;
  color: var(--wp--preset--color--body-text);
}

.greeting__qualification-label {
  margin-right: 12px;
  padding-right: 12px;
  border-right: 2px solid var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
}

.greeting__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 12px 28px;
  background: var(--wp--preset--gradient--hero-gradient);
  font-size: 15px;
  font-weight: 700;
  color: var(--wp--preset--color--heading-text);
  text-decoration: none;
}

.greeting__arrow {
  transition: transform 0.2s ease;
}

.greeting__button:hover .greeting__arrow {
  transform: translateX(4px);
}

@media (max-width: 767px) {
  .greeting {
    padding-block: 40px;
    margin-bottom: 48px;
  }

  .greeting__header {
    text-align: center;
  }

  .greeting__heading {
    font-size: 32px;
  }

  .greeting__body {
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
  }

  /* SPは写真と同じ範囲ではなく、画面の端から端まで（左右にはみ出す）
     色のついた帯を写真の裏に敷く。PC用の calc(50vw + 550px) は使わず、
     幅は常に 100vw にする。 */
  .greeting__band {
    display: block;
    top: -12px;
    /* 写真の高さ（横幅 = 100vw - 左右padding48px、aspect-ratio 4/5）に
       24px（上下12pxずつ）を足した値。%指定は親の高さ全体を拾ってしまうため
       使えず、vw から直接計算している。 */
    height: calc((100vw - 48px) * 1.25 + 24px);
    left: 50%;
    margin-left: -50vw;
    width: 100vw;
  }

  .greeting__photo-wrap {
    flex-basis: auto;
    width: 100%;
    max-width: none;
  }

  .greeting__headline {
    font-size: 18px;
  }

  .greeting__text {
    font-size: 14px;
    line-height: 1.8;
  }

  .greeting__name {
    font-size: 20px;
  }

  /* 院長名エリア・ボタンはSPでは最大幅を持たせる（他のテキストは全幅のまま） */
  .greeting__button {
    max-width: 320px;
  }

  /* 通常のドキュメントフロー内では inline-flex のままだと margin:auto による
     中央寄せが効かない（インラインレベルの箱として扱われるため）。
     ブロックレベルの flex コンテナに切り替えたうえで左右marginをautoにする。 */
  .greeting__button {
    display: flex;
    width: 100%;
    margin-inline: auto;
    justify-content: center;
    text-align: center;
  }
}

/* =====================================================
   アクセスエリア（電話番号・地図・所在地・診療時間）
   PC: 左カラム675px（ロゴ＋電話番号／地図）＋ 右カラム378px
       （所在地／アクセス方法／診療時間）、間隔46px（合計1100px）。
   参考: monad_tcd110_child/inc/access-area.php ・ access-area.css
   ===================================================== */

.access {
  padding-block: 64px 80px;
}

/*
 * TOPページ以外（固定ページ・投稿ページ）でのみ付与するバリエーション。
 * この直後にパンくずバー（.cwt-page-breadcrumb-bar）が続くため、
 * 境目としてベージュ背景の下端にグレーの罫線を引く。
 * .accessは横幅を制限していない（内側の.access__innerだけがmax-width）ため、
 * 背景・罫線ともhtml構造を変えずに画面幅いっぱいに広がる。
 */
.access--section {
  background-color: var(--wp--preset--color--white);
  border-bottom: 1px solid var(--wp--preset--color--border-neutral);
}

.access__inner {
  display: flex;
  gap: 46px;
  max-width: 1148px;
  margin: 0 auto;
  padding-inline: var(--wp--custom--container--padding, 24px);
  box-sizing: border-box;
}

/* ── 左カラム（ロゴ＋電話番号 → 地図） ── */
.access__left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.access__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

/* ロゴ枠：モックでは中身未確定（透過プレースホルダー）のため、枠だけ用意する */
.access__logo {
  flex-shrink: 0;
  display: block;
  width: 140px;
  height: 60px;
}

.access__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.access__tel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.access__tel-number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: 35px;
  line-height: 1.3;
  color: var(--wp--preset--color--primary);
  text-decoration: none;
  white-space: nowrap;
}

.access__tel-icon {
  display: flex;
  align-items: center;
}

.access__tel-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.access__tel-note {
  font-size: 15px;
  font-weight: 700;
  color: var(--wp--preset--color--primary);
  text-align: center;
}

.access__map {
  width: 100%;
  height: 279px;
  flex-shrink: 0;
}

.access__map iframe {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── 右カラム（所在地／アクセス方法／診療時間） ── */
.access__right {
  flex: 0 0 378px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.access__section-title {
  margin: 0 0 10px;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.access__divider {
  margin: 0 0 10px;
  border: none;
  border-top: 1px solid var(--wp--preset--color--lavender-bg);
}

.access__section-text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--wp--preset--color--body-text);
}

/* 右カラム（378px）は clinic-hours-table の通常サイズ（14px・nowrap）だと
   8列（診療時間 + 7曜日）が収まらないため、PCでもここだけ専用に縮小する。 */
.access__hours .clinic-hours-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}

.access__hours .clinic-hours-table th,
.access__hours .clinic-hours-table td {
  padding: 5px 2px;
  white-space: normal;
}

.access__hours .clinic-hours-table th:first-child,
.access__hours .clinic-hours-table td:first-child {
  width: 34%;
  text-align: left;
  padding-left: 0;
}

@media (max-width: 767px) {
  .access {
    padding-block: 40px;
  }

  /* 左カラムのラッパーを解除し、head / map をこのセクション直下の
     flexアイテムとして扱う。地図だけ表示順を最後（備考の下）に
     動かすため、右カラムと合わせて3つを order で並び替える。 */
  .access__inner {
    flex-direction: column;
    gap: 24px;
  }

  .access__left {
    display: contents;
  }

  .access__head {
    order: 1;
  }

  .access__right {
    order: 2;
  }

  .access__map {
    order: 3;
    height: 240px;
  }

  .access__head {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .access__logo {
    width: 100%;
  }

  .access__tel {
    align-items: center;
  }

  .access__tel-number {
    font-size: 24px;
  }
}
