/* =========================================================
   ブロック・パターン用のスタイル
   標準ブロック（ボタン・見出し・ギャラリー・メディアとテキスト）を、
   静的サイトの部品（.btn / .bar-title / 写真3列 / 写真と文章）と同じ見た目にする。
   公開ページとエディターの両方で読み込む。
   ========================================================= */

/* 施設ごとのボタン色・矢印（body の theme-◯◯ で切り替え） */
body { --btn-color: var(--c-pink); --btn-arrow: url(../img/ico-btn-arrow-pink.svg); }
.theme-hinata { --btn-color: var(--c-hinata); --btn-arrow: url(../img/ico-btn-arrow-hinata.svg); }
.theme-kaze { --btn-color: var(--c-kaze); --btn-arrow: url(../img/ico-btn-arrow-purple.svg); }
.theme-higashiyama { --btn-color: var(--c-higashi); --btn-arrow: url(../img/ico-btn-arrow-blue.svg); }
.theme-obukko { --btn-color: var(--c-obukko); --btn-arrow: url(../img/ico-btn-arrow-yellow.svg); }

/* ---------- ボタン：スタイル「矢印つき」（静的サイトの .btn と同じ） ---------- */
.wp-block-buttons:has(.is-style-arrow) { justify-content: center; }
.wp-block-button.is-style-arrow .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 30px;
	padding: 15px 20px 15px 40px;
	border: 0;
	border-radius: 40px;
	background: var(--btn-color);
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .07em;
	text-decoration: none;
}
.wp-block-button.is-style-arrow .wp-block-button__link::after {
	content: "";
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	background: var(--btn-arrow) center / contain no-repeat;
	transition: transform .5s var(--ease-soft);
}
.wp-block-button.is-style-arrow .wp-block-button__link:hover::after { transform: translateX(5px) scale(1.15); }

/* ---------- 見出し：旧スタイル「線つき」（静的サイトの .bar-title--accent と同じ。画像＋文章のパターンで使うので残す） ---------- */
.wp-block-heading.is-style-bar {
	padding: 0 30px;
	border-left: 10px solid var(--accent, var(--c-pink));
	font-size: 24px;
	font-weight: 600;
	line-height: 1.7;
	letter-spacing: .05em;
}

/* ---------- 白い波の帯（パターン「白い波の帯」） ---------- */
.m-band .wave-band__inner { max-width: 1200px; margin-inline: auto; }
.m-band .wave-band__inner > .sec-title { margin-bottom: 60px; }

/* ---------- 写真3列（パターン「写真3列」：ギャラリーブロック） ---------- */
.wp-block-gallery.m-photos {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
	max-width: 1200px;
	margin-inline: auto;
}
.wp-block-gallery.m-photos.has-nested-images figure.wp-block-image:not(#individual-image) {
	width: auto;
	margin: 0;
	aspect-ratio: 390 / 250;
	overflow: hidden;
	border-radius: 16px;
}
.wp-block-gallery.m-photos.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- 写真と文章（パターン「写真と文章」：メディアとテキストブロック） ---------- */
.wp-block-media-text.m-media-text {
	gap: 30px;
	max-width: 1200px;
	margin-inline: auto;
}
.wp-block-media-text.m-media-text > .wp-block-media-text__media { overflow: hidden; border-radius: 16px; aspect-ratio: 540 / 400; }
.wp-block-media-text.m-media-text > .wp-block-media-text__media img { width: 100%; height: 100%; object-fit: cover; }
.wp-block-media-text.m-media-text > .wp-block-media-text__content { padding: 0; }
.wp-block-media-text.m-media-text > .wp-block-media-text__content > * + * { margin-top: 10px; }
.wp-block-media-text.m-media-text p { font-size: 16px; line-height: 1.7; letter-spacing: .05em; }
.wp-block-media-text.m-media-text + .wp-block-media-text.m-media-text { margin-top: 60px; }

@media (max-width: 767px) {
	.wp-block-button.is-style-arrow .wp-block-button__link { gap: 20px; padding: 14px 16px 14px 30px; font-size: 15px; }
	.wp-block-heading.is-style-bar { padding: 0 14px; border-left-width: 7px; font-size: 19px; }
	.m-band .wave-band__inner > .sec-title { margin-bottom: 36px; }

	/* 写真3列：スマホは1枚目を大きく、残り2枚を横並び */
	.wp-block-gallery.m-photos { grid-template-columns: 1fr 1fr; gap: 10px; }
	.wp-block-gallery.m-photos.has-nested-images figure.wp-block-image:not(#individual-image) { border-radius: 12px; }
	.wp-block-gallery.m-photos.has-nested-images figure.wp-block-image:first-child { grid-column: 1 / -1; }

	/* 写真と文章：スマホは写真が上・文章が下（左右反転でも同じ順） */
	.wp-block-media-text.m-media-text.is-stacked-on-mobile { grid-template-columns: 100% !important; gap: 20px; }
	.wp-block-media-text.m-media-text.is-stacked-on-mobile > .wp-block-media-text__media { grid-row: 1; }
	.wp-block-media-text.m-media-text.is-stacked-on-mobile > .wp-block-media-text__content { grid-row: 2; }
	.wp-block-media-text.m-media-text p { font-size: 15px; }
	.wp-block-media-text.m-media-text + .wp-block-media-text.m-media-text { margin-top: 40px; }
}

/* ---------- エディター内：表示アニメーション前の要素も最初から見せる ---------- */
.block-editor-block-list__layout .js-fade,
.block-editor-block-list__layout .js-pop { opacity: 1; transform: none; }

/* =========================================================
   トップページ：わたしたちについて／運営施設（標準ブロックで組んだ版）
   静的サイトとの差（画像は figure、ボタンは .wp-block-button の入れ子）を吸収する
   ========================================================= */
.about-card__img.wp-block-image { margin: 0; }
.facility-card__img.wp-block-image { margin-inline: 0; margin-bottom: 0; } /* 上は静的サイト通り -50px（カード背景の上にはみ出す） */
.about-card__img.wp-block-image img,
.facility-card__img.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }

/* 見出しの左右のクローバー（静的サイトは img、ここでは疑似要素） */
.about-card__title.wp-block-heading::before,
.about-card__title.wp-block-heading::after {
	content: "";
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	background: url(../img/clover-small.svg) center / contain no-repeat;
}

/* 施設カード：ボタン色・矢印を施設ごとに */
.facility-card--hinata { --btn-color: var(--c-hinata); --btn-arrow: url(../img/ico-btn-arrow-hinata.svg); }
.facility-card--kaze { --btn-color: var(--c-kaze); --btn-arrow: url(../img/ico-btn-arrow-purple.svg); }
.facility-card--higashiyama { --btn-color: var(--c-higashi); --btn-arrow: url(../img/ico-btn-arrow-blue.svg); }
.facility-card--obukko { --btn-color: var(--c-obukko); --btn-arrow: url(../img/ico-btn-arrow-yellow.svg); }
.facility-card__btns.wp-block-buttons { flex-direction: column; align-items: flex-start; gap: 10px; }
.facility-card--rev .facility-card__btns.wp-block-buttons { align-items: flex-end; }

/* 施設カード右下のクローバー（静的サイトの .facility-card__deco を疑似要素で） */
.facility-card.wp-block-group::after {
	content: "";
	position: absolute;
	right: 34px;
	bottom: 30px;
	width: 114px;
	aspect-ratio: 114.8 / 105.2;
	background: url(../img/clover-outline-1.svg) center / contain no-repeat;
	pointer-events: none;
	animation: sway 7s ease-in-out infinite;
}
.facility-card--rev.wp-block-group::after {
	right: auto;
	left: 54px;
	bottom: 10px;
	width: 131px;
	rotate: 65deg;
	background-image: url(../img/clover-outline-2.svg);
}

@media (max-width: 767px) {
	.about-card__title.wp-block-heading::before,
	.about-card__title.wp-block-heading::after { width: 20px; height: 20px; }
	.facility-card__btns.wp-block-buttons,
	.facility-card--rev .facility-card__btns.wp-block-buttons { align-self: stretch; align-items: center; }
	.facility-card.wp-block-group::after,
	.facility-card--rev.wp-block-group::after { width: 70px; right: 16px; left: auto; bottom: 12px; }
}

/* ---------- 表（標準の表ブロック）：静的サイトの <caption> は上、表ブロックの見出しは下に出るので入れ替える ---------- */
.wp-block-table:has(> figcaption) { display: flex; flex-direction: column; }
.wp-block-table > figcaption.wp-element-caption { order: -1; margin: 0; }
.wp-block-table thead { border-bottom-width: 1px; }
/* 役員表（静的サイトの .exec-table caption と同じ） */
.wp-block-table.exec-table { overflow: visible; }
.wp-block-table.exec-table > figcaption {
	padding: 10px;
	background: var(--c-deep-green);
	color: #fff;
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .1em;
	text-align: center;
}
@media (max-width: 767px) {
	.wp-block-table.exec-table > figcaption { padding: 12px; font-size: 18px; }
}

/* ---------- 写真一覧（静的サイトの <ul><li><img>）：li の指定を画像ブロックに読み替え（自動生成） ---------- */
.center-intro__thumbs > .wp-block-image { flex: 1; aspect-ratio: 185 / 136; overflow: hidden; border-radius: 8px; }
.insta-block__photos > .wp-block-image { width: 150px; overflow: hidden; border-radius: 16px; }
.plaza-intro__thumbs > .wp-block-image { aspect-ratio: 190 / 140; overflow: hidden; border-radius: 8px; }
@media (max-width: 767px) {
	.insta-block__photos > .wp-block-image { width: 30vw; max-width: 110px; }
}
.center-intro__thumbs > .wp-block-image img, .insta-block__photos > .wp-block-image img, .plaza-intro__thumbs > .wp-block-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 写真＋装飾の入れ物：静的サイトの「> img:first-child」を画像ブロック（figure > img）に読み替え ---------- */
.message__photo > .wp-block-image:first-child,
.initiative__img > .wp-block-image:first-child { width: 100%; height: 100%; margin: 0; }
.message__photo > .wp-block-image:first-child img,
.initiative__img > .wp-block-image:first-child img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }

/* =========================================================
   記事本文（おしらせ詳細の .post__content）：担当者が標準ブロックで書いた内容の見た目
   ========================================================= */
.post__content > * { margin: 0; }

/*
 * 見出しの装飾（エディターの「スタイル」で 装飾あり／装飾なし を選ぶ）
 * 装飾あり：おしらせ本文では何も選ばない状態もこちら。固定ページでは「装飾あり」を選んだ見出しだけ。
 *   H1 上下に線／H2 左に縦線／H3 下に点線／H4 頭に丸／H5 前後に短い線／H6 装飾なし
 * 装飾なし：H1〜H6 とも本文と同じ大きさの太字
 * .editor-styles-wrapper.post-type-post はおしらせの編集画面（エディターでも同じ見た目にする）
 */
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) :is(h1, h2, h3, h4, h5, h6):where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-deco { position: relative; margin-top: 10px; margin-bottom: 0; padding: 0; border: 0; font-size: 16px; font-weight: 700; line-height: 1.6; letter-spacing: .05em; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h1:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
h1.wp-block-heading.is-style-deco { margin-top: 30px; padding: 12px 4px; border-top: 2px solid var(--c-pink); border-bottom: 2px solid var(--c-pink); font-size: 22px; line-height: 1.5; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h2:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
h2.wp-block-heading.is-style-deco { margin-top: 30px; padding: 4px 20px; border-left: 10px solid var(--c-pink); font-size: 20px; font-weight: 600; line-height: 1.5; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h3:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
h3.wp-block-heading.is-style-deco { margin-top: 20px; padding-bottom: 6px; border-bottom: 2px dotted var(--c-pink); font-size: 18px; font-weight: 600; line-height: 1.5; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h4:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
h4.wp-block-heading.is-style-deco { padding-left: 1.1em; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h4:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar)::before,
h4.wp-block-heading.is-style-deco::before { content: ""; position: absolute; left: 0; top: .5em; width: .6em; height: .6em; border-radius: 50%; background: var(--c-pink); }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h5:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
h5.wp-block-heading.is-style-deco { display: flex; align-items: center; gap: .7em; }
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h5:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar)::before,
:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h5:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar)::after,
h5.wp-block-heading.is-style-deco::before,
h5.wp-block-heading.is-style-deco::after { content: ""; flex: 0 0 20px; height: 1px; background: var(--c-pink); }
/* H5 は横並びにしているので、文字の配置（中央・右）は並びの寄せで合わせる */
h5.wp-block-heading.has-text-align-center { justify-content: center; }
h5.wp-block-heading.has-text-align-right { justify-content: flex-end; }

/* 装飾なし */
:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-plain { margin-top: 10px; margin-bottom: 0; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; line-height: 1.7; letter-spacing: .03em; }
:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-plain::before,
:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-plain::after { content: none; }
/* リスト（静的サイトの .post__list と同じ「・」） */
.post__content ul.wp-block-list { padding-left: 0; list-style: none; }
.post__content ul.wp-block-list li { position: relative; padding-left: 1.2em; line-height: 2; }
.post__content ul.wp-block-list li::before { content: "・"; position: absolute; left: 0; }
.post__content ol.wp-block-list { padding-left: 1.6em; line-height: 2; }
/* 項目リスト（静的サイトの .post__dl と同じ） */
.post__content .wp-block-miraikko-dl { display: flex; flex-direction: column; gap: 10px; }
.post__content .wp-block-miraikko-dl > div { display: flex; align-items: center; }
.post__content .wp-block-miraikko-dl dt { flex: 0 0 137px; font-weight: 500; }
/* 表 */
.post__content .wp-block-table table { border-collapse: collapse; background: #fff; }
.post__content .wp-block-table th,
.post__content .wp-block-table td { padding: 10px 14px; border: 1px solid #f3c6d4; text-align: left; }
.post__content .wp-block-table th,
.post__content .wp-block-table thead td { background: #fff0f5; font-weight: 600; }
.post__content .wp-block-table figcaption { margin-top: 6px; font-size: 13px; }
/* 画像・ギャラリー（静的サイトの .post__gallery と同じ） */
.post__content .wp-block-image img { border-radius: 16px; }
.post__content .wp-block-gallery.has-nested-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.post__content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: auto; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 16px; }
.post__content .wp-block-gallery.has-nested-images figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
/* ボタン（静的サイトの .post__btns：中央に並べる） */
.post__content .wp-block-buttons { justify-content: center; gap: 20px 40px; margin-top: 30px; }

/* 外部リンク・PDFリンクのアイコン（要件定義 6.3）：本文中の文字リンク。is-external / is-pdf は inc/news.php が自動で付ける */
.post__content a:not(.wp-block-button__link) { color: var(--c-pink); text-decoration: underline; text-underline-offset: 3px; }
.post__content a.is-external:not(.wp-block-button__link)::after,
.post__content a.is-pdf:not(.wp-block-button__link)::after {
	content: "";
	display: inline-block;
	width: .9em;
	height: .9em;
	margin-left: .3em;
	vertical-align: -.05em;
	background: currentColor;
	-webkit-mask: url(../img/ico-external-gray.svg) center / contain no-repeat;
	mask: url(../img/ico-external-gray.svg) center / contain no-repeat;
}
.post__content a.is-pdf:not(.wp-block-button__link)::after {
	-webkit-mask-image: url(../img/news/ico-pdf-pink.svg);
	mask-image: url(../img/news/ico-pdf-pink.svg);
}
/* ボタン：外部リンク・PDFは矢印の代わりにアイコン（静的サイトの .icon-btn と同じ白アイコン） */
.post__content .wp-block-button.is-style-arrow .wp-block-button__link.is-external::after { background: url(../img/news/ico-external-white.svg) center / 16px no-repeat; }
.post__content .wp-block-button.is-style-arrow .wp-block-button__link.is-pdf::after { background: #fff; border-radius: 50%; -webkit-mask: url(../img/news/ico-pdf-pink.svg) center / 14px no-repeat; mask: url(../img/news/ico-pdf-pink.svg) center / 14px no-repeat; }

@media (max-width: 767px) {
	:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) :is(h1, h2, h3, h4, h5, h6):where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
	:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-deco { font-size: 15px; }
	:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h1:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
	h1.wp-block-heading.is-style-deco { padding: 10px 2px; font-size: 19px; }
	:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h2:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
	h2.wp-block-heading.is-style-deco { padding: 3px 14px; border-left-width: 7px; font-size: 17px; }
	:is(.post__content, .editor-styles-wrapper.post-type-post, .post-type-post .editor-styles-wrapper) h3:where(.wp-block-heading, :not([class])):not(.is-style-plain, .is-style-bar),
	h3.wp-block-heading.is-style-deco { font-size: 16px; }
	:is(h1, h2, h3, h4, h5, h6).wp-block-heading.is-style-plain { font-size: 14px; }
	.post__content .wp-block-miraikko-dl > div { flex-direction: column; align-items: flex-start; }
	.post__content .wp-block-miraikko-dl dt { flex: none; font-weight: 700; }
	.post__content .wp-block-gallery.has-nested-images { grid-template-columns: 1fr 1fr; gap: 10px; }
	.post__content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { border-radius: 10px; }
}

/* =========================================================
   お問い合わせフォーム（Contact Form 7）：静的サイトの .contact-form と同じ見た目にする
   ========================================================= */
.wpcf7 .contact-form > .hidden-fields-container { display: none; }
.form-row__field .wpcf7-form-control-wrap { display: block; }

/* 同意のチェック（静的サイトの .agree と同じ丸いチェック） */
.form-row--agree .wpcf7-list-item { margin: 0; }
.form-row--agree .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.6; cursor: pointer; }
.form-row--agree .wpcf7-list-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.form-row--agree .wpcf7-list-item-label { display: inline-flex; align-items: center; gap: 10px; }
.form-row--agree .wpcf7-list-item-label::before {
	content: "";
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	box-sizing: border-box;
	border: 2px solid #ae8680;
	border-radius: 50%;
	background: #fff;
	transition: border-color .3s, background .3s;
}
.form-row--agree input:checked + .wpcf7-list-item-label::before { border-color: var(--c-pink); background: radial-gradient(circle, var(--c-pink) 0 8px, #fff 8.5px); }
.form-row--agree input:focus-visible + .wpcf7-list-item-label::before { box-shadow: 0 0 0 4px rgba(255, 107, 154, .25); }
.form-row--agree .wpcf7-list-item-label a { display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-underline-offset: 3px; }
.form-row--agree .wpcf7-list-item-label a::after { content: ""; width: 15px; height: 15px; background: url(../img/ico-external-gray.svg) center / contain no-repeat; }
/* 送信ボタン（input 要素なので疑似要素は使えない） */
.contact-form__submit input.submit-btn { font-family: inherit; font-size: 20px; font-weight: 700; letter-spacing: .1em; border: 0; cursor: pointer; }
.contact-form__submit .wpcf7-spinner { position: absolute; }
/* エラー・送信結果 */
.wpcf7-not-valid-tip { margin-top: 6px; color: #e0457b; font-size: 14px; font-weight: 500; }
.wpcf7 form .wpcf7-response-output { max-width: 980px; margin: 30px auto 0; padding: 14px 20px; border: 2px solid var(--c-pink); border-radius: 8px; font-size: 15px; text-align: center; }
/* 送信結果のメッセージは送信ボタンの上に出す（ボタンを押した位置で気付けるように） */
.wpcf7 form.wpcf7-form.contact-form > .wpcf7-response-output { order: 1; width: 100%; margin: 28px 0 0; border-color: var(--c-pink); background: #fff0f5; color: #e0457b; font-weight: 700; line-height: 1.7; }
.wpcf7 form.contact-form > .contact-form__submit { order: 2; }
.wpcf7 form.contact-form:is(.invalid, .unaccepted, .spam, .failed, .aborted) > .contact-form__submit { margin-top: 0; }
@media (max-width: 767px) {
	.wpcf7 form.wpcf7-form.contact-form > .wpcf7-response-output { margin-top: 10px; padding: 12px 14px; font-size: 14px; text-align: left; }
	.form-row--agree .wpcf7-list-item label { font-size: 14px; flex-wrap: wrap; }
	.contact-form__submit input.submit-btn { font-size: 18px; }
}

/* おたより（PDF）：未登録時の案内 */
.newsletter__empty { margin-top: 20px; font-size: 15px; text-align: center; }

/* リンク付きの画像ブロック：リンクが行として扱われて画像の下にすき間ができるのを防ぐ */
figure.wp-block-image > a { display: block; }

/* エディター内：ブロックに付く position: relative に負けないよう、重ねて配置する文字は指定を強める */
.cutlery__row > p.cutlery__growup { position: absolute; margin: 0; }
