:root {
  /* brand（ロゴ抽出色 #105090 を基準） */
  --navy-900: #0b2c52;
  --navy-800: #0f3b6e;
  --navy-700: #105090;
  --navy-100: #dfe8f3;
  --navy-50: #eef3f9;
  /* 院内の木目・生成り */
  --wood-600: #8a6440;
  --wood-300: #d9c3a5;
  --wood-50: #f6f1ea;
  --paper: #fbfaf7;
  --white: #ffffff;
  /* 文字 */
  --ink: #1d2733;
  --ink-2: #46515e;
  --line: #d9dde3;
  /* 差し色（ロゴの朱）：白文字4.5:1以上を確保した濃度 */
  --accent: #bb4520;
  --accent-dark: #9a3717;

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif;
  --font-head: "Zen Kaku Gothic New", var(--font);
  --fs-body: 17px;
  --lh-body: 1.9;
  --radius: 10px;
  --wrap: 1120px;
  --gutter: 24px;
  --bar-h: 0px; /* SP固定バーの高さ（SPで上書き） */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  max-width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  letter-spacing: .02em;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: var(--navy-700); text-underline-offset: .2em; }
a:hover { color: var(--navy-900); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy-900); line-height: 1.5; margin: 0 0 .6em; font-weight: 700; letter-spacing: .04em; }
/* .prose の外の見出し。:where は優先度 0 なので、.feature h3 や .sec-head h2 などの指定が勝つ */
:where(h2.wp-block-heading) { font-size: clamp(24px, 2.6vw, 30px); }
:where(h3.wp-block-heading) { font-size: 20px; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- ヘッダー ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50; }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy-900); }
.brand img { width: 52px; height: 52px; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: .06em; line-height: 1.3; }
.brand-sub { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; letter-spacing: .04em; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-tel { text-decoration: none; color: var(--navy-900); text-align: right; line-height: 1.35; }
.header-tel .num { font-size: 24px; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.header-tel .num svg { width: 20px; height: 20px; fill: var(--navy-700); }
.header-tel .hours { font-size: 14px; color: var(--ink-2); }
.global-nav { border-top: 1px solid var(--line); }
.global-nav ul { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--wrap); display: flex; justify-content: space-between; }
.global-nav a {
  display: block; padding: 12px 6px; text-decoration: none; color: var(--ink); font-size: 16px; font-weight: 700;
  border-bottom: 3px solid transparent;
}
.global-nav a:hover, .global-nav a[aria-current="page"] { color: var(--navy-700); border-bottom-color: var(--navy-700); }
.menu-btn { display: none; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 28px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 17px; letter-spacing: .06em; line-height: 1.4; border: 2px solid transparent;
  transition: background-color .15s, color .15s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-reserve { background: var(--accent); color: var(--white); }
.btn-reserve svg { fill: currentColor; }
.btn-reserve:hover { background: var(--accent-dark); color: var(--white); }
.btn-tel { background: var(--navy-700); color: var(--white); }
.btn-tel svg { fill: currentColor; }
.btn-tel:hover { background: var(--navy-900); color: var(--white); }
.btn-outline { background: var(--white); color: var(--navy-800); border-color: var(--navy-700); }
.btn-outline:hover { background: var(--navy-50); }
.btn-sm { min-height: 48px; padding: 8px 20px; font-size: 16px; }
.btn small { display: block; font-size: 12px; font-weight: 500; letter-spacing: .02em; opacity: .92; }
.btn .stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; }
.arrow-link { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.arrow-link::after { content: "→"; transition: transform .15s; }
.arrow-link:hover::after { transform: translateX(3px); }

/* ---------- 共通セクション ---------- */
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.bg-white { background: var(--white); }
.bg-wood { background: var(--wood-50); }
.bg-navy { background: var(--navy-900); color: #e9eef5; }
.bg-navy h2, .bg-navy h3 { color: var(--white); }
.bg-navy a { color: #cfe0f5; }
.bg-navy a.btn-outline { color: var(--navy-800); }
.bg-navy a.btn-outline:hover { color: var(--navy-900); background: var(--navy-50); }
.sec-head { margin-bottom: 40px; max-width: 760px; }
.sec-head .kicker { display: block; font-size: 15px; font-weight: 700; color: var(--wood-600); letter-spacing: .12em; margin-bottom: 6px; }
.bg-navy .sec-head .kicker { color: var(--wood-300); }
.sec-head h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: .6em; }
.sec-head p { color: var(--ink-2); margin: 0; }
.bg-navy .sec-head p { color: #c9d4e2; }

/* ---------- ヒーロー（トップ） ---------- */
.hero { background: var(--white); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; align-items: stretch; min-height: 560px; }
.hero-text { padding: 40px 56px 40px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); display: flex; flex-direction: column; justify-content: center; }
.hero-place { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero-place span { font-size: 14px; font-weight: 700; color: var(--navy-800); background: var(--navy-50); border-radius: 999px; padding: 4px 14px; }
.hero h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.45; margin-bottom: 16px; }
.hero h1 .nw { white-space: nowrap; }
.hero h1 .small { display: block; font-size: .5em; color: var(--ink-2); letter-spacing: .08em; margin-bottom: 8px; }
.hero-lead { color: var(--ink-2); margin-bottom: 20px; }
.hero-topics-title { margin: 20px 0 0; font-size: 15px; font-weight: 700; color: var(--navy-900); }
.hero-topics { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.hero-topics-title + .hero-topics { margin-top: 8px; }
.hero-topics li { font-size: 15px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 12px; background: var(--paper); }
.hero-cta { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin-bottom: 30px; }
.hero-cta .btn { width: 100%; justify-content: center; text-align: center; }
.hero-cta .btn .stack { align-items: center; }
.hero-photo { position: relative; min-height: 360px; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 診療時間・アクセスの要約帯 */
.quick { background: var(--navy-900); color: #e9eef5; }
.quick-grid { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 32px; align-items: start; padding-top: 40px; padding-bottom: 40px; }
.quick-grid > .btn { align-self: center; }
.quick .quick-reception { font-size: 13px; }
.quick h2 { font-size: 15px; color: var(--wood-300); letter-spacing: .12em; margin: 0 0 4px; }
.quick p { margin: 0; line-height: 1.7; }
.quick .big { font-size: 19px; font-weight: 700; color: var(--white); }
.quick a.btn-outline { background: transparent; color: var(--white); border-color: #8fa9c8; }
.quick a.btn-outline:hover { background: rgba(255,255,255,.08); }

/* ---------- 受診目的 ---------- */
.purpose-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.purpose-list li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.purpose-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 22px 24px; text-decoration: none; color: var(--ink); height: 100%; }
.purpose-list a:hover { background: var(--navy-50); }
.purpose-list .q { font-size: 18px; font-weight: 700; color: var(--navy-900); grid-column: 1; }
.purpose-list .a { font-size: 16px; color: var(--ink-2); grid-column: 1; line-height: 1.7; }
.purpose-list .go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--navy-700); font-weight: 700; }
.purpose-note { margin-top: 20px; font-size: var(--fs-body); color: var(--ink-2); }

/* ---------- 特徴（交互レイアウト） ---------- */
.feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.feature + .feature { margin-top: 60px; }
.feature.reverse .feature-media { order: 2; }
.feature-media img { border-radius: var(--radius); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.feature-media.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature-media.pair img { aspect-ratio: 4 / 5; }
.feature-num { font-size: 15px; font-weight: 700; color: var(--wood-600); letter-spacing: .14em; display: block; margin-bottom: 8px; }
.feature h2 { font-size: clamp(24px, 2.6vw, 30px); }
.feature h3 { font-size: clamp(22px, 2.4vw, 28px); }
.feature figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.6em; margin-bottom: .4em; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: .7em; height: .38em; border-left: 3px solid var(--navy-700); border-bottom: 3px solid var(--navy-700); transform: rotate(-45deg); }
.cred { list-style: none; padding: 0; margin: 0 0 1em; border-top: 1px solid var(--line); }
.cred li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 16px; }

/* ---------- 内視鏡（トップ内） ---------- */
.endo-top { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.endo-top .photo img { border-radius: var(--radius); aspect-ratio: 6 / 5.6; object-fit: cover; width: 100%; }
.exam-pair { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 8px; }
.exam { background: rgba(255,255,255,.06); border-radius: var(--radius); padding: 24px; }
.exam h3 { font-size: 22px; margin-bottom: 4px; }
.exam .sub { font-size: 16px; color: #b7c6d9; margin-bottom: 12px; }
.exam ul { padding-left: 1.2em; font-size: 16px; line-height: 1.8; }
.exam .btn { width: 100%; margin-top: 8px; }
.before-reserve { margin-top: 28px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 24px; clear: both; width: 100%; max-width: none; grid-column: 1 / -1; }
/* 右カラムの入れ子だと grid-column が効かず、410px の中で nowrap がはみ出す。中の箱を外してグリッドの直下に出す */
.endo-top > .wp-block-group:not(.photo) { display: contents; }
.before-reserve h3 { font-size: 18px; }
.before-reserve ul { font-size: 16px; }

/* ---------- 医師 ---------- */
.doctor { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.doctor-photo img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; object-position: 70% 50%; width: 100%; }
.doctor-name { font-size: 30px; margin-bottom: 0; }
.doctor-name .ruby { font-size: 15px; color: var(--ink-2); margin-left: 12px; font-weight: 500; }
.doctor-role { color: var(--wood-600); font-weight: 700; margin-bottom: 16px; }
.career { font-size: 16px; color: var(--ink-2); }

/* ---------- 院内ギャラリー ---------- */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 240px 240px; gap: 12px; }
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); }
.gallery figure:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 24px 14px 10px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
}

/* ---------- 診療時間・アクセス ---------- */
.hours-access { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; }
.hours-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 16px; text-align: center; }
.hours-table caption { text-align: left; font-weight: 700; color: var(--navy-900); margin-bottom: 8px; font-size: 18px; }
.hours-table th, .hours-table td { border: 1px solid var(--line); padding: 12px 4px; }
.hours-table thead th { background: var(--navy-800); color: #fff; font-weight: 700; }
.hours-table tbody th { background: var(--navy-50); text-align: left; padding-left: 12px; white-space: nowrap; }
.hours-table .on { color: var(--navy-700); font-size: 20px; font-weight: 700; }
.hours-table .off { color: #8a929c; }
@media (max-width: 480px) {
  .hours-table { font-size: 14px; }
  .hours-table th, .hours-table td { padding: 8px 1px; }
  .hours-table thead th { white-space: nowrap; line-height: 1.2; }
  .hours-table tbody th { padding-left: 4px; padding-right: 4px; font-size: 12px; }
  .hours-table .on { font-size: 16px; }
}
.hours-notes { list-style: none; padding: 0; margin: 16px 0 0; font-size: 16px; }
.hours-notes li { padding-left: 1.2em; position: relative; margin-bottom: 4px; }
.hours-notes li::before { content: "・"; position: absolute; left: 0; }
.hours-notes strong { color: var(--navy-900); }
.access dl { display: grid; grid-template-columns: 7em 1fr; margin: 0 0 20px; border-top: 1px solid var(--line); }
.access dt, .access dd { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.access dt { font-weight: 700; color: var(--navy-900); }
.map { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius); background: var(--navy-50); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* ---------- お知らせ（控えめ） ---------- */
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a { text-decoration: none; color: var(--ink); }
.news-list time { color: var(--ink-2); font-size: 15px; }
.news-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 40px; }
.news-wrap h2 { font-size: 36px; }

/* ---------- 下層ページ ---------- */
.breadcrumb { font-size: 14px; padding-top: 14px; padding-bottom: 14px; color: var(--ink-2); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 10px; color: #98a1ab; }
.page-hero { background: var(--white); }
.page-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 40px; padding-bottom: 56px; }
.page-hero h1 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 4px; }
.page-hero h1 small { display: block; font-size: .45em; color: var(--ink-2); letter-spacing: .06em; margin-top: 6px; }
.page-hero .lead { color: var(--ink-2); margin-bottom: 20px; }
.page-hero-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.toc a { display: inline-block; font-size: 15px; font-weight: 700; text-decoration: none; padding: 6px 14px; border-radius: 999px; background: var(--navy-50); color: var(--navy-800); }
.toc a:hover { background: var(--navy-100); }

.prose { max-width: var(--wrap); }
.prose h2 { font-size: clamp(24px, 2.6vw, 30px); margin-top: 0; margin-bottom: 20px; }
.prose h3 { font-size: 20px; margin-top: 1.6em; }
/* 本文だけ。blockGap 0 の margin-block-start: 0 で、段落は下マージンだけ（flow 内は上下とも 0）になり詰まる。見出しの既存値は .prose h2/h3 に残す */
:where(.entry-content) :is(.wrap, .prose).is-layout-flow > :is(p, ul, ol):where(:not(.lead, .kicker, .btn-wrap, .note, .toc, .doctor-role, .sub, .purpose-note, .hours-notes, .purpose-list, .related, .news-list, .review-meta, .feature-num):not(:has(> .btn))),
:where(.entry-content) .prose > :is(p, ul, ol):where(:not(.lead, .kicker, .btn-wrap, .note, .toc, .doctor-role, .sub, .purpose-note, .hours-notes, .review-meta, .feature-num):not(:has(> .btn))),
:where(.entry-content) .feature > .is-layout-flow > :is(p, ul, ol):where(:not(.btn-wrap, .doctor-role, .sub, .feature-num):not(:has(> .btn))) {
  margin-block-start: 1em;
  margin-block-end: 1em;
}
/* ボタン上 20px と、直前の段落・リストの下 1em が足されて約 37px になる。直前側を 0 にして、ボタン側の 20px だけ残す */
:where(.entry-content) :is(.wrap, .prose).is-layout-flow > :is(p, ul, ol):has(+ p > .btn),
:where(.entry-content) .prose > :is(p, ul, ol):has(+ p > .btn),
:where(.entry-content) .feature > .is-layout-flow > :is(p, ul, ol):has(+ p > .btn) {
  margin-block-end: 0;
}
:where(.entry-content) :is(.wrap, .feature):where(:not(.prose)) > :is(h2, h3, h4):where(:not(.related-title)),
:where(.entry-content) .feature > .is-layout-flow > :is(h2, h3, h4):where(:not(.related-title)) {
  margin-block-start: 1.6em;
  margin-block-end: .6em;
}
:where(.entry-content) :is(.wrap, .feature):where(:not(.prose)) > :is(h2, h3, h4):where(:not(.related-title)):first-child,
:where(.entry-content) .feature > .is-layout-flow > :is(h2, h3, h4):where(:not(.related-title)):first-child {
  margin-block-start: 0;
}
/* 「01」などのラベルの下は .feature-num の 8px。見出し側の上余白を足すと、写真の上端とずれる */
.feature > .is-layout-flow > .feature-num + :is(h2, h3, h4) {
  margin-block-start: 0;
}
.lead-box { background: var(--white); border-left: 5px solid var(--navy-700); padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; }

.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.choose-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.choose-item .head { background: var(--navy-800); color: #fff; padding: 20px 24px; }
.choose-item .head h3 { color: #fff; margin: 0; font-size: 24px; }
.choose-item .head p { margin: 0; font-size: 16px; color: #cbd8e8; }
.choose-item .body { padding: 20px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.choose-item .body .btn { margin-top: auto; }

.care { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--line); }
.care > div { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--line); }
.care > div:nth-child(odd) { padding-right: 40px; border-right: 1px solid var(--line); }
.care > div:nth-child(even) { padding-left: 40px; }
.care h3 { font-size: 20px; }
.care p { margin: 0; font-size: 16px; color: var(--ink-2); }

/* 流れ（タイムライン） */
.flow { list-style: none; padding: 0; margin: 0; counter-reset: step; }
ol.flow { margin-top: 10px; }
.flow > li { position: relative; padding: 0 0 36px 76px; counter-increment: step; }
.flow > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy-700); color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center;
}
.flow > li::after { content: ""; position: absolute; left: 25px; top: 56px; bottom: 4px; width: 2px; background: var(--navy-100); }
.flow > li:last-child::after { display: none; }
.flow h3 { font-size: 20px; margin: 10px 0 6px; }
.flow .when { font-size: 14px; font-weight: 700; color: var(--wood-600); letter-spacing: .08em; }
.flow p, .flow ul { font-size: 16px; }
.flow-photo { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; margin-top: 8px; }
.flow-photo img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }

/* 費用表 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fee { width: 100%; background: var(--white); font-size: 16px; margin: 0 0 1em; }
.fee table { width: 100%; border-collapse: collapse; }
.fee th, .fee td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
.fee thead th { background: var(--navy-50); color: var(--navy-900); }
.fee td.num { text-align: right; white-space: nowrap; }
.note { font-size: 16px; color: var(--ink-2); }
.prose .note { margin-top: 10px; }

/* 注意事項 */
.caution { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.caution h3 { font-size: 19px; margin-top: 0; display: flex; align-items: center; gap: 8px; }
.caution h3::before { content: "!"; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; }
.caution + .caution { margin-top: 16px; }

/* FAQ */
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 56px; position: relative; font-weight: 700; color: var(--navy-900); font-size: 17px; line-height: 1.6;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; position: absolute; left: 20px; top: 16px; font-size: 20px; color: var(--navy-700); }
.faq summary::after { content: "＋"; position: absolute; right: 20px; top: 18px; color: var(--navy-700); }
.faq details[open] summary::after { content: "－"; }
.faq .ans { padding: 0 24px 20px 56px; position: relative; font-size: 16px; }
.faq .ans::before { content: "A"; position: absolute; left: 20px; top: -2px; font-size: 20px; font-weight: 700; color: var(--accent); }

/* 予約ブロック */
.reserve-box { background: var(--white); border: 2px solid var(--navy-700); border-radius: 14px; padding: 36px 40px; }
.reserve-box h2 { font-size: clamp(22px, 2.4vw, 28px); border: 0; padding: 0; }
.reserve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; align-items: stretch; }
.reserve-way { display: flex; flex-direction: column; padding-top: 16px; }
.reserve-way h3 { font-size: 18px; margin: 0 0 8px; }
.reserve-way p { font-size: 16px; }
.reserve-way .btn { width: 100%; margin-top: auto; }
.review-meta { font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 40px; }

/* 関連リンク */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; padding: 0; }
.related a { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-2); }
.related a span { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.related a:hover { border-color: var(--navy-700); }

/* ---------- フッター ---------- */
.site-footer { background: var(--navy-900); color: #d5deea; font-size: 15px; line-height: 1.8; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 19px; margin-bottom: 12px; }
.footer-brand img { width: 44px; height: 44px; background: #fff; border-radius: 50%; }
.site-footer h2 { font-size: 15px; color: var(--wood-300); letter-spacing: .12em; margin-bottom: 8px; }
.footer-nav { list-style: none; padding: 0; margin: 0; columns: 2; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-sns { display: flex; gap: 12px; margin-top: 8px; }
.footer-sns a { display: block; line-height: 0; border-radius: 9px; }
.footer-sns a:hover { opacity: .85; }
.footer-sns svg { width: 40px; height: 40px; }
.site-footer .footer-grid .footer-sns text { font-size: 7.4px; } /* フッター共通の font-size: 14px がSVG内の文字にも効くため戻す */
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 20px; padding-bottom: calc(20px + var(--bar-h)); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer .footer-grid,
.site-footer .footer-grid *,
.site-footer .footer-bottom,
.site-footer .footer-bottom * { font-size: 14px; }
.site-footer .footer-grid .footer-reception { font-size: 13px; }
.site-footer .footer-grid a[href^="tel"] { text-decoration: none; pointer-events: none; }
@media (min-width: 911px) {
  a[href^="tel"] { pointer-events: none; }
}

/* ---------- SP固定バー ---------- */
.fixed-bar { display: none; }

/* =========================================================
   タブレット以下
   ========================================================= */
@media (max-width: 1024px) {
  .global-nav a { font-size: 15px; padding: 12px 2px; }
  .hero-text { padding: 48px 32px 48px var(--gutter); }
}

@media (max-width: 910px) {
  :root { --bar-h: 68px; }
  html { scroll-padding-top: 72px; }

  .header-main { min-height: 64px; max-width: 100%; gap: 8px; }
  .brand { gap: 8px; min-width: 0; flex: 1; }
  .brand img { width: 36px; height: 36px; flex: none; }
  .brand-name { font-size: clamp(12px, 3.6vw, 17px); letter-spacing: 0; white-space: nowrap; line-height: 1.2; }
  .brand-sub { display: none; }
  .header-actions .header-tel, .header-actions .btn-reserve { display: none; }
  .menu-btn {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
    font: inherit; font-size: 11px; font-weight: 700; color: var(--navy-900); cursor: pointer; white-space: nowrap; flex: none; letter-spacing: 0;
  }
  .menu-btn .menu-btn-label { line-height: 1; }
  .menu-btn .bars {
    width: 22px; height: 16px; margin: 0; position: relative;
    background: linear-gradient(currentColor, currentColor) center / 22px 2px no-repeat;
    transition: background-size .2s ease;
  }
  .menu-btn .bars::before, .menu-btn .bars::after {
    content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor;
    transition: transform .2s ease, top .2s ease;
  }
  .menu-btn .bars::before { top: 0; }
  .menu-btn .bars::after { top: 14px; }
  .menu-btn[aria-expanded="true"] .bars { background-size: 0 2px; }
  .menu-btn[aria-expanded="true"] .bars::before { top: 7px; transform: rotate(45deg); }
  .menu-btn[aria-expanded="true"] .bars::after { top: 7px; transform: rotate(-45deg); }
  .global-nav { display: none; }
  .global-nav.open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); max-height: calc(100vh - 64px - var(--bar-h)); overflow-y: auto; }
  .global-nav.open ul, .global-nav.open .menu { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .global-nav.open a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
  .site-footer .footer-grid a[href^="tel"] { text-decoration: underline; pointer-events: auto; }

  .fixed-bar {
    display: grid; grid-template-columns: 1.25fr 1.25fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: var(--bar-h); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .fixed-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1.2; gap: 2px; }
  .fixed-bar a small { font-size: 12px; font-weight: 500; }
  .fixed-bar .fb-reserve { background: var(--accent); color: #fff; }
  .fixed-bar .fb-tel { background: var(--navy-700); color: #fff; }
  .fixed-bar .fb-info { color: var(--navy-900); }
}

@media (max-width: 860px) {
  :root { --fs-body: 16px; --gutter: 16px; }
  .section { padding: 64px 0; }
  .section-tight { padding: 44px 0; }
  .sec-head { margin-bottom: 28px; }

  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; min-height: 0; aspect-ratio: 16 / 10; align-self: start; }
  /* 1枚目の写真を通常配置にして高さを作る（Safari では aspect-ratio だけだと高さが0になることがあるため） */
  .hero-photo .wp-block-image:first-child { position: relative; height: auto; }
  .hero-photo .wp-block-image:first-child img { position: static; display: block; height: auto; aspect-ratio: 16 / 10; }
  .hero-text { padding: 28px var(--gutter) 36px; }
  .hero-place span { font-size: 13px; }
  .hero h1 { font-size: clamp(22px, 6.4vw, 27px); }
  .hero-grid > * { min-width: 0; }
  .hero-cta { display: flex; width: 100%; }
  .hero-cta .btn { flex: 1 1 100%; }
  .quick-grid { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; padding-bottom: 24px; }

  .purpose-list { grid-template-columns: 1fr; }
  .purpose-list a { padding: 18px 16px; }

  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 20px; }
  .feature.reverse .feature-media { order: 0; }
  .feature + .feature { margin-top: 56px; }

  .endo-top, .exam-pair, .doctor, .hours-access, .news-wrap, .choose, .reserve-grid, .page-hero-grid { grid-template-columns: 1fr; }
  .endo-top, .doctor, .hours-access, .page-hero-grid { gap: 28px; }
  .news-wrap { gap: 12px; }
  .doctor-photo img { aspect-ratio: 4/3; }
  .page-hero-grid { padding-top: 16px; padding-bottom: 36px; }
  .page-hero-photo { order: -1; }

  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .gallery figure { aspect-ratio: 4/3; }
  .gallery figure:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16/10; }

  .care { grid-template-columns: 1fr; }
  .care > div, .care > div:nth-child(odd), .care > div:nth-child(even) { padding: 22px 0; border-right: 0; }
  .flow > li { padding-left: 64px; }
  .flow > li::before { width: 44px; height: 44px; font-size: 18px; }
  .flow > li::after { left: 21px; top: 48px; }
  .flow-photo { grid-template-columns: 1fr; }
  .reserve-box { padding: 24px 18px; }
  .related { grid-template-columns: 1fr; }
  .fee th, .fee td { padding: 10px 8px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* =========================================================
   WordPress ブロック向けの調整
   ========================================================= */
.wp-site-blocks { padding: 0; }
.wp-block-post-content > * { margin-top: 0; }
.wp-block-image { margin: 0 0 1em; }
.wp-block-image img { border-radius: var(--radius); }
.wp-block-image figcaption, .wp-element-caption { font-size: 14px; color: var(--ink-2); margin-top: 8px; text-align: left; }
.wp-block-list { margin-top: 0; }
.wp-block-table { overflow-x: auto; }
.wp-block-table thead { border-bottom: 0; }
.wp-block-table th, .wp-block-table td { border: 1px solid var(--line); padding: 12px 14px; }
.wp-block-table figcaption { font-size: 15px; }
.wp-block-heading { margin-top: 0; }
.wp-block-group:empty { display: none; }
.btn-wrap { margin: 16px 0 0; }
.btn-wrap .btn + .btn { margin-left: 8px; }

/* 写真付きブロック内の画像は枠に合わせて切り抜き */
.feature-media .wp-block-image, .gallery .wp-block-image, .doctor-photo .wp-block-image,
.hero-photo .wp-block-image, .page-hero-photo .wp-block-image, .endo-top .photo .wp-block-image { margin: 0; height: 100%; }
.feature-media .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.feature-media.pair .wp-block-image img { aspect-ratio: 4 / 5; }
.page-hero-photo .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.endo-top .photo .wp-block-image img { width: 100%; aspect-ratio: 6 / 5.6; object-fit: cover; }
.doctor-photo .wp-block-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 70% 50%; }
.hero-photo .wp-block-image { position: absolute; inset: 0; }
.hero-photo .wp-block-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
/* トップのヒーロー写真（.hero-slides）。1枚目を下地に、2〜5枚目を5秒ずつ順にフェードで重ねる（1周25秒） */
.hero-slides .wp-block-image + .wp-block-image { opacity: 0; animation: hero-fade 25s linear infinite; }
.hero-slides .wp-block-image:nth-child(2) { animation-delay: 5s; }
.hero-slides .wp-block-image:nth-child(3) { animation-delay: 10s; }
.hero-slides .wp-block-image:nth-child(4) { animation-delay: 15s; }
.hero-slides .wp-block-image:nth-child(5) { animation-delay: 20s; }
@keyframes hero-fade {
  0% { opacity: 0; }
  5% { opacity: 1; }
  20% { opacity: 1; }
  25% { opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slides .wp-block-image + .wp-block-image { animation: none; }
}
.gallery .wp-block-image { position: relative; overflow: hidden; border-radius: var(--radius); }
.gallery .wp-block-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.gallery .wp-block-image figcaption {
  position: absolute; left: 0; bottom: 0; right: 0; margin: 0; padding: 24px 14px 10px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
}
.gallery > .wp-block-image:first-child { grid-row: span 2; }
.flow-photo .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.choose-item .body .wp-block-image img { aspect-ratio: 3 / 2; object-fit: cover; }

/* FAQ（詳細ブロック） */
.faq .wp-block-details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 0; }
.faq .wp-block-details > :not(summary) { padding: 0 24px 0 56px; font-size: 16px; }
.faq .wp-block-details > p:last-child { padding-bottom: 20px; margin-bottom: 0; }
.faq .wp-block-details > summary + * { position: relative; }
.faq .wp-block-details > summary + *::before { content: "A"; position: absolute; left: 20px; top: -2px; font-size: 20px; font-weight: 700; color: var(--accent); }

/* お知らせ・コラム一覧（クエリーループ） */
.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list > li { display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; align-items: baseline; padding: 16px 4px; border-bottom: 1px solid var(--line); margin: 0; }
.news-list .wp-block-post-date { color: var(--ink-2); font-size: 15px; }
.news-list .wp-block-post-title { font-family: var(--font); font-size: 17px; font-weight: 500; margin: 0; letter-spacing: .02em; line-height: 1.7; }
.news-list .wp-block-post-title a { color: var(--ink); text-decoration: none; }
.news-list .wp-block-post-title a:hover { color: var(--navy-700); text-decoration: underline; }
.wp-block-query-pagination { margin-top: 28px; gap: 8px; font-weight: 700; }
.wp-block-query-pagination a, .wp-block-query-pagination .current { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-decoration: none; }
.wp-block-query-pagination .current { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.article-head { border-bottom: 2px solid var(--navy-100); padding-bottom: 16px; margin-bottom: 28px; }
.article-head .wp-block-post-date { color: var(--ink-2); font-size: 15px; }
.article-head .wp-block-post-title { font-size: clamp(24px, 2.8vw, 32px); margin: 4px 0 0; }
.article-body { max-width: var(--wrap); }
.article-body img { border-radius: var(--radius); }

/* ナビゲーション（クラシックメニュー） */
.global-nav .menu { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--wrap); display: flex; justify-content: space-between; }
.global-nav .current-menu-item > a, .global-nav .current-page-ancestor > a, .global-nav .current-menu-ancestor > a { color: var(--navy-700); border-bottom-color: var(--navy-700); }
@media (max-width: 860px) {
  .news-list > li { grid-template-columns: 1fr; gap: 0; }
}

/* 管理バー表示時のSP */
@media (max-width: 600px) { .site-header { top: 0; } }

/* アクセス（ショートコード） */
.access-list { display: grid; grid-template-columns: 7em 1fr; margin: 0 0 20px; border-top: 1px solid var(--line); }
.access-list dt, .access-list dd { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.access-list dt { font-weight: 700; color: var(--navy-900); }
.page-title { font-size: clamp(28px, 3.2vw, 40px); }
.wp-block-post-title { margin-top: 0; }

/* ---------- ブロック構成に合わせた部品 ---------- */
/* ヒーロー：H1の1行目（所在地・診療科）を小さく表示 */
.hero h1::first-line { font-size: .5em; color: var(--ink-2); letter-spacing: .08em; line-height: 2; }
.hero-place { list-style: none; padding: 0; }
.hero-place li { font-size: 14px; font-weight: 700; color: var(--navy-800); background: var(--navy-50); border-radius: 999px; padding: 4px 14px; }
.hero-text .hero-cta { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin-bottom: 30px; }
.hero-text .hero-cta .btn { flex: none; width: 100%; white-space: nowrap; }
.hero-text .hero-cta .btn .stack,
.hero-text .hero-cta .btn small { white-space: nowrap; }
/* PCでは1行で表示。スマホ（860px以下）は折り返す */
@media (min-width: 861px) {
  p.is-full-line { white-space: nowrap; }
}
h3.has-mb-20 { margin-bottom: 20px; }
p:not(.is-stack) > a.btn.btn-outline.btn-sm,
a.btn.is-content-btn { margin-top: 20px; }
/* ボタンが続く2つ目以降は上 20px を足さない。並びの間隔は .btn-wrap の 16px だけ */
p:has(> .btn) + p:not(.is-stack) > a.btn.btn-outline.btn-sm,
p:has(> .btn) + p > a.btn.is-content-btn { margin-top: 0; }
p:not(.is-stack) > a.btn.btn-outline.btn-sm + a.btn.btn-outline.btn-sm { margin-left: 12px; }
.is-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.is-stack > .btn + .btn { margin-left: 0; }
.wp-block-list .list-heading { font-size: 18px; color: var(--navy-900); font-weight: 700; }
.page-endoscopy .wp-block-list .list-heading,
.page-gastroscopy .wp-block-list .list-heading { display: block; }
.page-endoscopy .note { margin-top: 20px; }
.page-colonoscopy .feature { grid-template-columns: 1fr; gap: 40px; align-items: center; }
.page-colonoscopy h3.is-fs-20 { font-size: 20px; }
body.page-colonoscopy .section,
body.page-colonoscopy .section > .wrap,
body.page-colonoscopy .prose {
  overflow: visible;
}
body.page-colonoscopy :is(.wp-block-table, .table-scroll, .fee) {
  width: min(calc(var(--wrap) - var(--gutter) * 2), calc(100vw - 48px)) !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
body.page-colonoscopy :is(.wp-block-table, .table-scroll, .fee) table {
  width: 100% !important;
  max-width: none !important;
}
@media (max-width: 1160px) {
  body.page-colonoscopy :is(.wp-block-table, .table-scroll, .fee) {
    width: 100% !important;
    left: auto;
    transform: none;
  }
}
.hours-access .note { margin-top: 20px; }
.page-privacy h2.wp-block-heading { margin-top: 40px; }
.page-privacy figure.wp-block-table table { margin-top: 20px; }
.page-about h3.is-match-h3 { font-size: clamp(22px, 2.4vw, 28px); }
.page-about .wrap > ul.check-list { margin-top: 20px; margin-block-start: 20px; }
.mt-20 { margin-top: 20px; }
.page-doctor .doctor-role { margin-top: 20px; }
.page-doctor .wp-block-table th { white-space: nowrap; }
/* 自費の胃カメラと略歴。見出しを1行にし、表を本文幅（1120px から左右の余白を除いた幅）まで広げる */
body.page-medical-checkup #gastroscopy,
body.page-medical-checkup #gastroscopy > .wrap.prose,
body.page-doctor #career,
body.page-doctor #career > .wrap.prose {
  overflow: visible;
}
body.page-medical-checkup #gastroscopy .wp-block-table.fee,
body.page-doctor #career .wp-block-table {
  width: min(calc(var(--wrap) - var(--gutter) * 2), calc(100vw - 48px)) !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
body.page-medical-checkup #gastroscopy .wp-block-table.fee table,
body.page-doctor #career .wp-block-table table {
  width: 100% !important;
}
body.page-medical-checkup #gastroscopy .wp-block-table.fee th {
  white-space: nowrap !important;
  width: 1%;
}
body.page-medical-checkup #gastroscopy .fee ~ .caution,
body.page-medical-checkup #gastroscopy .caution.is-zone-after {
  margin-top: 40px !important;
  margin-block-start: 40px !important;
}
body.page-medical-checkup #gastroscopy .caution + .caution {
  margin-top: 16px !important;
  margin-block-start: 16px !important;
}
/* 略歴の表。見出し列を 24% に固定（col.career-label は functions.php が付ける） */
#career .wp-block-table table {
  table-layout: fixed;
  width: 100%;
}
#career .wp-block-table th,
#career .wp-block-table col.career-label {
  white-space: nowrap;
  width: 24%;
}
@media (max-width: 1160px) {
  body.page-medical-checkup #gastroscopy .wp-block-table.fee,
  body.page-doctor #career .wp-block-table {
    width: 100% !important;
    left: auto;
    transform: none;
  }
}
.page-access .is-layout-constrained > .wrap.prose,
.page-access .wrap.prose { max-width: var(--wrap); width: 100%; }
.page-access .hours-table,
.page-access .hours-notes { width: 100%; max-width: var(--wp--style--global--content-size, 800px); margin-left: auto !important; margin-right: auto !important; }
.page-access #hours .reserve-box { margin-top: 40px !important; margin-block-start: 40px !important; }
.page-news .news-intro,
p.news-intro {
  margin-top: 40px !important;
  margin-bottom: 40px !important;
  margin-block-start: 40px !important;
  margin-block-end: 40px !important;
}
.page-news .wp-block-query-pagination,
.page-news .wp-block-query-pagination-numbers { flex-wrap: nowrap; justify-content: center; }
.page-news .wp-block-query-pagination { gap: 4px; }
.page-news .wp-block-query-pagination a,
.page-news .wp-block-query-pagination .current { min-width: 36px; padding: 0 8px; }
.page-news .wp-block-query-pagination .dots { display: inline-grid; place-items: center; min-width: 1.5em; color: var(--ink-2); }
@media (max-width: 480px) {
  .page-news .wp-block-query-pagination { gap: 2px; }
  .page-news .wp-block-query-pagination a,
  .page-news .wp-block-query-pagination .current,
  .page-news .wp-block-query-pagination .dots { min-width: 26px; min-height: 32px; padding: 0 2px; font-size: 14px; }
  .page-news .wp-block-query-pagination-previous,
  .page-news .wp-block-query-pagination-next { display: inline-flex; align-items: center; justify-content: center; font-size: 0; min-width: 26px; }
  .page-news .wp-block-query-pagination-previous::before,
  .page-news .wp-block-query-pagination-next::before { font-size: 16px; line-height: 1; color: inherit; }
  .page-news .wp-block-query-pagination-previous::before { content: "‹"; }
  .page-news .wp-block-query-pagination-next::before { content: "›"; }
}
.article-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 12px; margin-top: 40px; white-space: nowrap; }
.article-pager a { font-weight: 700; text-decoration: none; }
.article-pager-prev { justify-self: start; }
.article-pager-list { justify-self: center; }
.article-pager-next { justify-self: end; }

/* 受診目的（リストブロック：<a><strong>質問</strong><br>説明</a>） */
.purpose-list a { display: block; position: relative; padding: 22px 56px 22px 24px; font-size: 16px; color: var(--ink-2); line-height: 1.7; }
.purpose-list a strong { display: inline-block; font-size: 18px; color: var(--navy-900); margin-bottom: 2px; }
.purpose-list a::after { content: "→"; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); color: var(--navy-700); font-weight: 700; }
.purpose-list li { margin: 0; }

/* 手順（グループ .flow > .flow-step） */
.flow { counter-reset: step; }
.flow > .flow-step { position: relative; padding: 0 0 36px 76px; counter-increment: step; }
.flow > .flow-step::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy-700); color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center;
}
.flow > .flow-step::after { content: ""; position: absolute; left: 25px; top: 56px; bottom: 4px; width: 2px; background: var(--navy-100); }
.flow > .flow-step:last-child::after { display: none; }
.flow-step .when { font-size: 14px; font-weight: 700; color: var(--wood-600); letter-spacing: .08em; margin: 0; }
.flow-step h3 { font-size: 20px; margin: 4px 0 6px; }
.flow-step p { font-size: 16px; }
.flow-step .wp-block-image { max-width: 320px; }
@media (max-width: 860px) {
  .flow > .flow-step { padding-left: 64px; }
  .flow > .flow-step::before { width: 44px; height: 44px; font-size: 18px; }
  .flow > .flow-step::after { left: 21px; top: 48px; }
  .purpose-list a { padding: 18px 48px 18px 16px; }
  .purpose-list a::after { right: 16px; }
}

/* 内視鏡帯（紺）のカード */
.bg-navy .exam ul { color: #e9eef5; }
.bg-navy .exam .btn-wrap { margin-top: 8px; }
.bg-navy .exam .btn { width: 100%; }
.choose-item .head * { color: #fff; }
.choose-item .body .btn-wrap { margin-top: auto; }
.choose-item .body .btn { width: 100%; }
.care > .wp-block-group { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--line); }
.care > .wp-block-group:nth-child(odd) { padding-right: 40px; border-right: 1px solid var(--line); }
.care > .wp-block-group:nth-child(even) { padding-left: 40px; }
@media (max-width: 860px) {
  .care > .wp-block-group, .care > .wp-block-group:nth-child(odd), .care > .wp-block-group:nth-child(even) { padding: 22px 0; border-right: 0; }
}
.related li { margin: 0; }
.doctor .kicker { display: block; font-weight: 700; color: var(--wood-600); letter-spacing: .12em; margin: 0 0 4px; }
.hours-access .btn-row, .hours-access .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
/* 予約・電話ボタンの並びは、PC・スマホともヒーローのボタンと同じ見た目にする */
.hours-access .btn-row:has(.btn-reserve) { flex-direction: column; align-items: stretch; }
.hours-access .btn-row:has(.btn-reserve) .btn { width: 100%; white-space: nowrap; }
.hours-access .btn-row:has(.btn-reserve) .btn .stack { align-items: center; }
.h1-sub { color: var(--ink-2); font-weight: 700; letter-spacing: .06em; margin-bottom: 16px; }
.related a strong { display: block; color: var(--navy-900); }
.related-title { font-size: 22px; margin-top: 40px; margin-bottom: 20px; }
.related-title + .related { margin-top: 0; }
:is(.prose, .article-body):is(.is-layout-constrained) > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-table):not(.table-scroll):not(.fee)),
:is(.prose, .article-body) :where(.is-layout-constrained) > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-table):not(.table-scroll):not(.fee)) {
  max-width: none;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
:is(.prose, .article-body) :is(.wp-block-table, .table-scroll, .fee):not(.alignwide):not(.alignfull) {
  width: 100%;
  max-width: 800px;
  margin-left: 0 !important;
  margin-right: auto !important;
}
/* 予防接種の料金セクションを本文幅（1120px）まで広げ、表の800px上限を外す */
body.page-vaccination #price {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.page-vaccination #price > .wrap.prose {
  width: 100% !important;
  max-width: var(--wrap) !important;
}
body.page-vaccination #price .wp-block-table.fee {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.page-vaccination #price .wp-block-table.fee table {
  width: 100% !important;
  table-layout: fixed !important;
}
body.page-vaccination #price .wp-block-table.fee :is(th, td) {
  min-width: 0 !important;
  max-width: none;
  white-space: normal !important;
}
/* 料金表の列幅。左から ワクチン / 対象年齢 / 回数 / 助成対象の方 / 助成あり / 助成なし */
body.page-vaccination #price .wp-block-table.fee col.fee-c1,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(1) { width: 16% !important; }
body.page-vaccination #price .wp-block-table.fee col.fee-c2,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(2) { width: 16% !important; }
body.page-vaccination #price .wp-block-table.fee col.fee-c3,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(3) { width: 16% !important; }
body.page-vaccination #price .wp-block-table.fee col.fee-c4,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(4) { width: 20% !important; }
body.page-vaccination #price .wp-block-table.fee col.fee-c5,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(5) { width: 16% !important; }
body.page-vaccination #price .wp-block-table.fee col.fee-c6,
body.page-vaccination #price .wp-block-table.fee thead th:nth-child(6) { width: 16% !important; }
.page-vaccination .wp-block-table.fee thead :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(5)),
.page-vaccination .wp-block-table.fee tbody tr:has(> :nth-child(6)) > :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(5)),
.page-vaccination .wp-block-table.fee tbody tr:not(:has(> :nth-child(6))) > :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(4)) {
  white-space: nowrap;
}
.page-vaccination .wp-block-table.fee :is(th, td)[rowspan] {
  vertical-align: middle;
  white-space: normal;
}
#price .wp-block-table.fee table {
  table-layout: fixed !important;
  width: 100% !important;
}
#price .wp-block-table.fee :is(th, td) {
  min-width: 0 !important;
  white-space: normal !important;
}
#price .wp-block-table.fee col.fee-c1,
#price .wp-block-table.fee thead th:nth-child(1) { width: 16% !important; }
#price .wp-block-table.fee col.fee-c2,
#price .wp-block-table.fee thead th:nth-child(2) { width: 16% !important; }
#price .wp-block-table.fee col.fee-c3,
#price .wp-block-table.fee thead th:nth-child(3) { width: 16% !important; }
#price .wp-block-table.fee col.fee-c4,
#price .wp-block-table.fee thead th:nth-child(4) { width: 20% !important; }
#price .wp-block-table.fee col.fee-c5,
#price .wp-block-table.fee thead th:nth-child(5) { width: 16% !important; }
#price .wp-block-table.fee col.fee-c6,
#price .wp-block-table.fee thead th:nth-child(6) { width: 16% !important; }
/* 帯状疱疹：見出し（生ワクチン／組換ワクチン）の下に、回数または金額 */
#price .wp-block-table.fee .fee-split {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}
#price .wp-block-table.fee .fee-split-label,
#price .wp-block-table.fee .fee-split-value {
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
}
#price .wp-block-table.fee .fee-split-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-700);
}
#price .wp-block-table.fee .fee-split-value {
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
#price .wp-block-table.fee .fee-split-value:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.feature + .wp-block-heading, .feature + .wp-block-group:not(.feature) { margin-top: 64px; }

/* 列の多い表（5列以上）はスマートフォンで表の中だけ横スクロール */
@media (max-width: 700px) {
  .wp-block-table:has(tr > :nth-child(5)) table { min-width: 640px; }
  .wp-block-table:has(tr > :nth-child(5))::before {
    content: "← 表は横にスクロールできます →"; display: block; font-size: 13px; color: red; margin-top: 16px; margin-bottom: 6px; text-align: center;
  }
  .wp-block-table th, .wp-block-table td { word-break: keep-all; overflow-wrap: anywhere; }
  .page-vaccination .wp-block-table.fee thead :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(5)),
  .page-vaccination .wp-block-table.fee tbody tr:has(> :nth-child(6)) > :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(5)),
  .page-vaccination .wp-block-table.fee tbody tr:not(:has(> :nth-child(6))) > :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(4)) {
    overflow-wrap: normal;
    word-break: keep-all;
  }
}

/* <strong class="red"> を赤文字にする */
strong.red {
  color: red;
}

/* 取材・執筆・監修のお問い合わせ（Contact Form 7） */
:is(.page-media_contact, .page-media-contact) .page-hero {
  padding-top: 46px;
  padding-bottom: 50px;
}
:is(.page-media_contact, .page-media-contact) .media-note {
  background: var(--navy-50);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 0 !important;
  margin-bottom: 40px !important;
  margin-block-start: 0 !important;
  margin-block-end: 40px !important;
}
body:is(.page-media_contact, .page-media-contact) .section {
  padding-top: 40px;
}
:is(.page-media_contact, .page-media-contact) .media-note + .wp-block-heading {
  margin-top: 0;
  margin-block-start: 0;
}
body:is(.page-media_contact, .page-media-contact) .section .wrap.prose {
  max-width: 1120px;
  padding-left: 20px;
  padding-right: 20px;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 {
  box-sizing: border-box;
  width: 100%;
  max-width: 1080px;
  margin: 28px auto 0;
  padding: 50px 60px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
:is(.page-media_contact, .page-media-contact) .wpcf7 form {
  display: grid;
  gap: 18px;
  margin-top: 0;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 label,
:is(.page-media_contact, .page-media-contact) .wpcf7 .media-field-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--navy-900);
}
:is(.page-media_contact, .page-media-contact) .wpcf7 label:has(.wpcf7-validates-as-required) {
  grid-template-columns: auto 1fr;
  align-items: center;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 label:has(.wpcf7-validates-as-required)::before {
  content: "必須";
  grid-row: 1;
  grid-column: 1;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 700;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 label:has(.wpcf7-validates-as-required) > .wpcf7-form-control-wrap {
  grid-column: 1 / -1;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 .media-field-label.is-required {
  grid-template-columns: auto 1fr;
  align-items: center;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 .media-field-label.is-required::before,
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-acceptance .wpcf7-list-item-label::before {
  content: "必須";
  display: inline-block;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 700;
  vertical-align: middle;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  max-width: 960px;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="text"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="email"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="tel"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="date"],
:is(.page-media_contact, .page-media-contact) .wpcf7 select,
:is(.page-media_contact, .page-media-contact) .wpcf7 textarea {
  width: 100%;
  max-width: 960px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 12px 20px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
}
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="text"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="email"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="tel"],
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="date"],
:is(.page-media_contact, .page-media-contact) .wpcf7 select {
  padding: 8px 12px;
  line-height: 1.4;
}
/* 日付（カレンダー選択）：日付の長さに合わせた幅。iPhoneでは未入力だと高さが縮むため最低の高さを指定 */
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="date"] {
  max-width: 240px;
  min-height: 42px;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 textarea { min-height: 160px; }
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-list-item { margin: 0 16px 8px 0; font-weight: 400; }
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--navy-700);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
:is(.page-media_contact, .page-media-contact) .wpcf7 input[type="submit"]:hover { background: var(--navy-900); }
:is(.page-media_contact, .page-media-contact) .wpcf7 form .wpcf7-response-output { margin: 8px 0 0; }
@media (max-width: 700px) {
  :is(.page-media_contact, .page-media-contact) .wpcf7 { padding: 32px 16px; }
}

/* 診療案内の料金表（診断書など・健康診断）。2つの表の列幅を「診断書など」にそろえる */
#fees .wp-block-table.fee table { table-layout: fixed; }
#fees .wp-block-table.fee :is(th, td):first-child { width: 56%; }

/* 当院について「そのほかの院内」。スマホでは全写真を受付と同じ大きさ（1列・16:10）にする */
@media (max-width: 700px) {
  .page-about .gallery { grid-template-columns: 1fr; }
  .page-about .gallery > .wp-block-image,
  .page-about .gallery > .wp-block-image:first-child { grid-column: auto; grid-row: auto; aspect-ratio: 16 / 10; }
}

/* 予防接種の料金表（スマホ）。表を760pxにし、1列目（ワクチン名）を20%に広げて文字の重なりを防ぐ */
@media (max-width: 700px) {
  body.page-vaccination #price .wp-block-table.fee table { min-width: 760px; }
  body.page-vaccination #price .wp-block-table.fee col.fee-c1,
  body.page-vaccination #price .wp-block-table.fee thead th:nth-child(1) { width: 20% !important; }
  body.page-vaccination #price .wp-block-table.fee col.fee-c4,
  body.page-vaccination #price .wp-block-table.fee thead th:nth-child(4) { width: 16% !important; }
}

/* SPメニュー：スクロールしてヘッダーが見えなくなったら、メニューボタンだけ右上に追従（body.menu-floating・menu-open は main.js が付ける） */
@media (max-width: 910px) {
  body.menu-floating .menu-btn { position: fixed; top: 8px; right: var(--gutter); z-index: 70; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
  body.menu-floating .global-nav.open { position: fixed; top: 72px; z-index: 69; max-height: calc(100vh - 72px - var(--bar-h)); }
  /* メニューを開いている間は、背景（ページ本体と下の固定バー）を暗くする。ヘッダーとメニューはその上に出す */
  body.menu-open::before { content: ""; position: fixed; inset: 0; z-index: 62; background: rgba(0, 0, 0, .45); }
  body.menu-open .site-header { z-index: 65; }
}

/* メインメニューの「トップ」（メニュー項目のCSSクラス sp-only）はスマホのメニューにだけ表示 */
@media (min-width: 911px) {
  .global-nav .sp-only { display: none; }
}

/* 取材フォーム：未入力・形式エラーの項目を赤枠にし、その下に理由を表示 */
:is(.page-media_contact, .page-media-contact) .wpcf7 :is(input, select, textarea).wpcf7-not-valid { border-color: #d63638; background: #fff5f5; }
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-radio.wpcf7-not-valid { display: block; border: 1px solid #d63638; border-radius: 8px; background: #fff5f5; padding: 8px 12px 0; }
:is(.page-media_contact, .page-media-contact) .wpcf7 .wpcf7-not-valid-tip { display: block; margin-top: 6px; color: #d63638; font-size: 14px; font-weight: 700; }
:is(.page-media_contact, .page-media-contact) .wpcf7 form.invalid .wpcf7-response-output { border-color: #d63638; color: #d63638; }

/* 新しいタブで開くテキストリンク（class="external-link"）：文字の後ろに別窓アイコン。色は文字色に合わせる */
a.external-link::after {
  content: "";
  display: inline-block;
  width: .9em;
  height: .9em;
  margin-left: .2em;
  vertical-align: -.05em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
}
