/* =========================================================
   本文のスタイル（サイト表示とブロックエディターの両方で使う）
   数値は旧サイト（Joomla テンプレート ookuchi / Bootstrap 3）に合わせている
   ========================================================= */

/* ---------- 見出し ---------- */
h2.wp-block-heading { margin-top: 0; margin-bottom: 1.4em; }
h3.wp-block-heading { margin-top: 10px; margin-bottom: 20px; }
h4.wp-block-heading { margin-top: 10px; margin-bottom: 20px; }
h5.wp-block-heading { margin-top: 5px; margin-bottom: 5px; }
/* 見出しの中のリンクは見出しと同じ色（旧サイトと同じ。マウスを乗せても変えない） */
.wp-block-heading a, .wp-block-heading a:hover { color: inherit; text-decoration: none; }

/* ---------- 段落・リスト ---------- */
p { margin-top: 0; margin-bottom: 10px; line-height: 1.7; }
.wp-block-list { margin-top: 0; margin-bottom: 10px; padding-left: 40px; line-height: 1.42857; }
.wp-block-list .wp-block-list { margin-bottom: 0; }
strong, b { font-weight: 700; }

/* 段組みのリンク一覧（リストのスタイル「段組み」） */
.wp-block-list.is-style-columns {
	list-style: none; padding: 0;
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px;
}
@media (min-width: 768px) { .wp-block-list.is-style-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .wp-block-list.is-style-columns { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 2fr); } }
.wp-block-list.is-style-columns li {
	margin-top: 0; margin-bottom: 5px; padding: 2px 0 2px 18px; line-height: 1.4;
	background: url(../img/ico_circle1.png) no-repeat 0 0.4em;
}
.wp-block-list.is-style-columns a { text-decoration: none; }
.wp-block-list.is-style-columns a:hover { text-decoration: none; }

/* ---------- 画像 ---------- */
.wp-block-image { margin-top: 0; margin-bottom: 0; }
.wp-block-image img { max-width: 100%; height: auto; vertical-align: bottom; }
.wp-block-image figcaption,
.wp-element-caption { font-size: 14px; color: #666; margin-top: 0.4em; }
/* 枠付きの画像（画像のスタイル「枠付き」） */
.wp-block-image.is-style-frame img { padding: 4px; background: #fff; border: 1px solid rgba(0, 0, 0, .1); }
/* 横並びの画像（グループ「横並び」で画像を並べたもの） */
.wp-block-group.is-layout-flex { gap: 10px 30px; }
.wp-block-group.is-layout-flex > .wp-block-image { margin: 0; }

/* ---------- 表 ---------- */
.wp-block-table { margin-top: 5px; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 横スクロール用の枠で囲まれていた表（外来担当表など）：下の余白を次の要素の余白と重ねない */
.wp-block-table.is-wrapped { margin-top: 0; margin-bottom: 0; padding: 5px 0 20px; }
.wp-block-table table { width: 100%; border-collapse: collapse; border: 2px solid #4d4d4d; line-height: 1.42857; }
/* ブロックの標準CSS（後から読み込まれる .wp-block-table td の線・余白）より優先させるため figure を付ける */
figure.wp-block-table th,
figure.wp-block-table td { border: 2px solid #4d4d4d; padding: 8px; vertical-align: top; }
.wp-block-table th { background: #e6e6e6; color: #4d4d4d; font-weight: 700; text-align: left; }
/* 旧サイトと同じく見出しセルの上・左の線なし（隣のセル・表の外枠の線で表示される） */
figure.wp-block-table th { border-top: 0; border-left: 0; }
figure.wp-block-table thead { border-bottom: 0; }
.wp-block-table .has-text-align-center { text-align: center; }
.wp-block-table .has-text-align-right { text-align: right; }
.wp-block-table td p, .wp-block-table th p { margin: 0; line-height: inherit; }
/* 枠線の少ない表（表のスタイル「シンプル」：旧サイトの所在地の表など） */
.wp-block-table.is-style-simple table { border: 0; }
.wp-block-table.is-style-simple th,
.wp-block-table.is-style-simple td { border: 0; border-top: 1px solid #ddd; padding: 5px; background: none; }
/* 列の多い表：スマホでは横にスクロールして見る（表のスタイル「横スクロール」） */
@media (max-width: 767px) {
	.wp-block-table.is-style-scroll table { min-width: 640px; }
}

/* ---------- ボタン ---------- */
.wp-block-buttons { margin-top: 0; margin-bottom: 10px; gap: 0 4px; }
.wp-block-button { margin-bottom: 5px; }
.wp-block-button__link { text-decoration: none; border: 1px solid transparent; }
.wp-block-button__link:hover { text-decoration: none; }
.wp-block-button__link::before {
	/* 旧サイトの矢印アイコン（幅0.357em）＋右5px と同じ幅にする */
	content: ""; display: inline-block; width: 0.357em; height: 0.357em; margin-right: 5px;
	border-top: 2px solid currentColor; border-right: 2px solid currentColor;
	transform: translateY(-0.12em) rotate(45deg);
}
.wp-block-button__link.has-navy-background-color:hover { background-color: #010168 !important; }

/* ---------- 区切り線 ---------- */
.wp-block-separator { border: 0; border-top: 1px solid #eee; margin-top: 20px; margin-bottom: 20px; opacity: 1; }
.wp-block-separator:not(.is-style-dots) { width: 100%; }

/* ---------- カラム ---------- */
.wp-block-columns { margin-top: 0; margin-bottom: 10px; gap: 10px 30px; }

/* ---------- グループ（背景色つき） ---------- */
.wp-block-group.has-background { padding: 50px 15px; }
.wp-block-group.has-primary-background-color,
.wp-block-group.has-navy-background-color { color: #fff; }
.wp-block-group.has-primary-background-color a:not(.wp-block-button__link),
.wp-block-group.has-navy-background-color a:not(.wp-block-button__link),
.wp-block-group.has-primary-background-color :is(h2, h3, h4),
.wp-block-group.has-navy-background-color :is(h2, h3, h4) { color: #fff; }

/* ---------- 枠囲み（グループのスタイル「枠囲み」：旧サイトのパネル） ---------- */
.wp-block-group.is-style-panel {
	border-radius: 4px; padding: 15px; background: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, .4);
}
.wp-block-group.is-style-panel:not(.has-text-color) { color: #4d4d4d; }
.wp-block-group.has-background .wp-block-group.is-style-panel a:not(.wp-block-button__link) { color: inherit; }
.wp-block-group.has-background .wp-block-group.is-style-panel :is(h2, h3) { color: #0071bc; }

/* ---------- 地図などの埋め込み ---------- */
.entry-content iframe { max-width: 100%; }

/* 表の見出しセルは、PCでは旧サイトと同じく折り返さない（最長15文字程度） */
@media (min-width: 768px) {
	.wp-block-table th { white-space: nowrap; }
}

/* ボタンのスタイル「小さめ」（旧サイトの標準サイズのボタン） */
.wp-block-button.is-style-small .wp-block-button__link { font-size: 14px; line-height: 1.42857; padding: 6px 12px; border-radius: 4px; }

/* リストのスタイル「丸印」（旧サイトの list-ico） */
.wp-block-list.is-style-circle { list-style: none; padding-left: 0; margin-bottom: 16px; }
.wp-block-list.is-style-circle li {
	margin: 0 0 5px; padding: 2px 0 2px 18px; line-height: 1.4;
	background: url(../img/ico_circle1.png) no-repeat 0 0.4em;
}

/* 枠囲み（パネル）の下の余白 */
.wp-block-group.is-style-panel { margin-bottom: 20px; }

/* 地図などの埋め込み（カスタムHTMLブロックの iframe）は本文の幅いっぱいに */
.entry-content > iframe { display: block; width: 100%; max-width: var(--content, 1170px); margin-left: auto; margin-right: auto; }

/* 見出しのスタイル「大見出し」（旧サイトの記事タイトル風の見出し：30px・太字） */
.wp-block-heading.is-style-large { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 0; margin-bottom: 42px; }
/* グループのスタイル「記事タイトル枠」（旧サイトの page-header：上40px・下に薄い線） */
.wp-block-group.is-style-page-header { display: flow-root; margin-top: 40px; margin-bottom: 20px; padding-bottom: 9px; border-bottom: 1px solid #eee; }

/* 表の列幅は、旧サイトと同じく内容に合わせて自動で決める（WordPress 標準の「固定幅」を打ち消す） */
.wp-block-table table.has-fixed-layout { table-layout: auto; }
/* 標準の word-break: break-word（列が細くなりすぎる）をやめ、旧サイトと同じ折り返しにする */
figure.wp-block-table .has-fixed-layout :is(td, th) { word-break: normal; }
/* 旧サイトで折り返さない指定（nowrap）があった表 */
.wp-block-table.is-nowrap :is(td, th) { white-space: nowrap; }

/* 記事のまとまり（グループ「記事」）：旧サイトと同じく、中の余白は重なり、まとまりの境目では重ならない */
.wp-block-group.is-style-section { display: flow-root; }
/* WordPress 標準では、グループの最後の要素の下余白が0になるが、旧サイトでは記事の最後の余白（区切り線の下20pxなど）が残っていた */
.entry-content .wp-block-group.is-style-section > .wp-block-separator:last-child { margin-bottom: 20px; }
.entry-content .wp-block-group.is-style-section > p:last-child { margin-bottom: 10px; }

/* =========================================================
   余白の最終調整（トップページ以外）
   WordPress 標準の「グループ・カラムの中の最初と最後の要素の余白を0にする」指定より優先させ、
   旧サイト（Bootstrap）と同じく、枠囲み・列・記事のまとまりの中でも余白を残す
   ========================================================= */
.entry-content:not(.entry-content--home) h2.wp-block-heading { margin-top: 0; margin-bottom: 1.4em; }
.entry-content:not(.entry-content--home) h3.wp-block-heading,
.entry-content:not(.entry-content--home) h4.wp-block-heading { margin-top: 10px; margin-bottom: 20px; }
.entry-content:not(.entry-content--home) h5.wp-block-heading { margin-top: 5px; margin-bottom: 5px; }
.entry-content:not(.entry-content--home) .wp-block-heading.is-style-large { margin-top: 0; margin-bottom: 42px; }
.entry-content:not(.entry-content--home) div.wp-block-group.is-style-page-header { margin-top: 40px; margin-bottom: 20px; }
.entry-content:not(.entry-content--home) p { margin-top: 0; margin-bottom: 10px; }
.entry-content:not(.entry-content--home) .wp-block-table :is(td, th) p { margin: 0; }
.entry-content:not(.entry-content--home) ul.wp-block-list,
.entry-content:not(.entry-content--home) ol.wp-block-list { margin-top: 0; margin-bottom: 10px; }
.entry-content:not(.entry-content--home) ul.wp-block-list.is-style-circle { margin-bottom: 16px; }
.entry-content:not(.entry-content--home) .wp-block-list .wp-block-list { margin-bottom: 0; }
.entry-content:not(.entry-content--home) figure.wp-block-image { margin-top: 0; margin-bottom: 0; }
.entry-content:not(.entry-content--home) figure.wp-block-table { margin-top: 5px; margin-bottom: 20px; }
.entry-content:not(.entry-content--home) figure.wp-block-table.is-wrapped { margin-top: 0; margin-bottom: 0; }
.entry-content:not(.entry-content--home) div.wp-block-buttons { margin-top: 0; margin-bottom: 10px; }
.entry-content:not(.entry-content--home) hr.wp-block-separator { margin-top: 20px; margin-bottom: 20px; }
.entry-content:not(.entry-content--home) div.wp-block-columns { margin-top: 0; margin-bottom: 10px; }
.entry-content:not(.entry-content--home) div.wp-block-group.is-style-panel { margin-top: 0; margin-bottom: 20px; }
.entry-content:not(.entry-content--home) div.wp-block-group.is-style-section { margin-top: 0; margin-bottom: 0; }
/* 旧サイトの行（row）には下余白がない */
.entry-content:not(.entry-content--home) div.wp-block-columns { margin-bottom: 0; }
/* 枠囲み（パネル）の最後の要素の下余白は、旧サイトと同じく枠の内側に含めない */
.entry-content:not(.entry-content--home) div.wp-block-group.is-style-panel > :last-child { margin-bottom: 0; }
/* 枠囲み（パネル）の上端の青い見出し帯（旧サイトの panel-heading） */
.wp-block-group.is-style-panel > .wp-block-group.has-background:first-child {
	/* 下の15pxは透明な線で空ける（旧サイトの panel-body の余白と同じく、次の要素の上余白と重ならない） */
	margin: -15px -15px 0; border-bottom: 15px solid transparent; background-clip: padding-box;
	padding: 10px 15px; border-radius: 3px 3px 0 0;
}
.wp-block-spacer { margin: 0; }
/* 枠囲み（パネル）の中の段落は下余白なし（旧サイトの #main .panel-body p { margin-bottom: 0 }） */
.entry-content:not(.entry-content--home) div.wp-block-group.is-style-panel p { margin-bottom: 0; }
.entry-content .wp-block-group.is-style-panel .wp-block-spacer { height: 27px !important; }

/* 結合したセル（rowspan）は上下中央（旧サイトと同じ）。旧サイトで上揃えだった表は has-rowspan-top */
.wp-block-table :is(td, th)[rowspan] { vertical-align: middle; }
.wp-block-table.has-rowspan-top :is(td, th)[rowspan] { vertical-align: top; }

/* 表のセルの中のリスト（旧サイト：上0・下10px） */
.wp-block-table :is(td, th) :is(ul, ol) { margin-top: 0; margin-bottom: 10px; }
