/* =========================================================
 * デザイン部品のCSS（公開画面と編集画面の両方）
 *
 * プラグインや文字入り画像を使わずに表示するための部品。
 *  - 会社概要の表（profile-table）
 *  - 囲みボックス（bebai-box）・セクション（bebai-section）
 *  - 画面幅で隠す見出し（sme-hidden-*）
 *  - POINT／STEP のラベル（bebai-label）
 *  - STEP の番号と点線（bebai-step／bebai-steps）
 *  - オレンジの点線（bebai-dotline）
 *  - トップのヒーロー（bebai-hero）
 * ========================================================= */

/* ---------------------------------------------------------
 * 会社概要の表（旧：Flexible Table プラグインの表）
 * 標準の表ブロックに置き換えたため、追加CSSのピンクの表デザインがかからないようにし、
 * 置き換え前と同じ見た目（左列グレー・太字、下線のみ）を保つ。
 * --------------------------------------------------------- */
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table {
	display: block;
	box-shadow: none;
	border-radius: 0;
	overflow: visible;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table table {
	min-width: 0;
	width: 100%;
	border-collapse: collapse;
	border: 0;
	border-top: 1px solid #e0e0e0;
}
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table tbody tr,
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table tbody tr:nth-child(n),
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table tbody tr:hover {
	background-color: transparent;
	box-shadow: none;
	transform: none;
	transition: none;
}
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table td {
	padding: 16px 12px;
	border: 0;
	border-bottom: 1px solid #e0e0e0;
	background-color: transparent;
	font-weight: 400;
	text-align: left;
	vertical-align: top;
}
:is(.post_content, .editor-styles-wrapper) .wp-block-table.profile-table.profile-table td:first-child {
	background-color: #f9f9f9;
	font-weight: 700;
}

/* ---------------------------------------------------------
 * 囲みボックス（旧：Snow Monkey Blocks「ボックス」）
 * 標準の「グループ」ブロック＋クラスで同じ見た目を再現。
 *   bebai-box--plain … 透明・枠なし
 *   bebai-box--pink  … 淡いピンクの背景＋ピンクの枠
 *   bebai-box--card  … 薄いグレーの枠＋影（カード）
 * 枠線はレイアウトがずれないよう内側の影（inset）で描く。
 * --------------------------------------------------------- */
.wp-block-group.bebai-box {
	position: relative;
	padding: 1.6rem;
	border-radius: 20px;
}
.wp-block-group.bebai-box > :first-child,
.wp-block-group.bebai-box > .bebai-box__body > :first-child { margin-top: 0; }
.wp-block-group.bebai-box > :last-child,
.wp-block-group.bebai-box > .bebai-box__body > :last-child { margin-bottom: 0; }
.wp-block-group.bebai-box--plain {
	background-color: transparent;
}
.wp-block-group.bebai-box--pink {
	background-color: #fff2f0;
	box-shadow: inset 0 0 0 1px #f78da7, 16px 0 5px 0 #fff;
}
.wp-block-group.bebai-box--card {
	background-color: transparent;
	box-shadow: inset 0 0 0 1px #eee, 0 0 10px 0 rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------------------
 * セクション（旧：Snow Monkey Blocks「セクション」）
 * 上下の余白は旧ブロックと同じ計算式（画面幅で伸び縮み）。
 * --------------------------------------------------------- */
.wp-block-group.bebai-section {
	padding: clamp(2.8rem, 1.287rem + 6.725vw, 4.2667rem) 1.6rem;
}
.wp-block-group.bebai-section > :first-child,
.wp-block-group.bebai-section > .bebai-box__body > :first-child { margin-top: 0; }
.wp-block-group.bebai-section > :last-child,
.wp-block-group.bebai-section > .bebai-box__body > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------
 * 画面幅で隠す見出し（旧：Snow Monkey Editor の表示切り替え）
 *   sme-hidden-sm … 640px未満で隠す
 *   sme-hidden-md … 640〜1023pxで隠す
 *   sme-hidden-lg-up … 1024px以上で隠す
 * 編集画面では、選択中のときだけ薄く表示して編集できるようにする。
 * --------------------------------------------------------- */
@media not all and (min-width: 640px) {
	.sme-hidden-sm:not(.is-selected):not(.has-child-selected) { display: none !important; }
}
@media (min-width: 640px) and (max-width: 1023.9px) {
	.sme-hidden-md:not(.is-selected):not(.has-child-selected) { display: none !important; }
}
@media (min-width: 1024px) {
	.sme-hidden-lg-up:not(.is-selected):not(.has-child-selected) { display: none !important; }
}
.editor-styles-wrapper :is(.sme-hidden-sm, .sme-hidden-md, .sme-hidden-lg-up):is(.is-selected, .has-child-selected) {
	opacity: 0.3;
}

/* ---------------------------------------------------------
 * POINT／STEP のラベル（旧：文字入り画像 Frame-49-1 など）
 *   段落ブロック + クラス bebai-label（小さい版は bebai-label--s）
 * --------------------------------------------------------- */
:is(.post_content, .editor-styles-wrapper) p.bebai-label {
	display: block;
	width: fit-content;
	min-width: 6.2em;
	margin-left: auto;
	margin-right: auto;
	padding: 0.5em 1.3em;
	border-radius: 999px;
	background-color: #fde6eb;
	color: #e55776;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-align: center;
	white-space: nowrap;
}
:is(.post_content, .editor-styles-wrapper) p.bebai-label--s {
	margin-left: 0;
	font-size: 10.3px;
	padding: 0.5em 1.3em;
	min-width: 0;
}

/* ---------------------------------------------------------
 * STEP の番号と点線（旧：画像 course-preschool-illust-7〜11 など）
 *   1つだけ … 段落ブロック + bebai-step（スマホ用など）
 *   横並び … グループブロック bebai-steps の中に bebai-step を並べる（PC用・3列）
 *   文字は「STEP」と番号を改行して書く（例：STEP<br>4）
 * --------------------------------------------------------- */
:is(.post_content, .editor-styles-wrapper) .bebai-step {
	--bebai-step-size: 46px;
	position: relative;
	display: block;
	box-sizing: border-box;
	width: var(--bebai-step-size);
	height: var(--bebai-step-size);
	margin: 0 0 1em;
	padding: calc(var(--bebai-step-size) * 0.19) 0 0;
	border-radius: 50%;
	background-color: #f58198;
	color: #fff;
	font-size: calc(var(--bebai-step-size) * 0.2);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: 0;
	text-align: center;
	white-space: nowrap;
	overflow: visible;
}
:is(.post_content, .editor-styles-wrapper) .bebai-step strong {
	display: block;
	font-size: calc(var(--bebai-step-size) * 0.48);
	font-weight: 500;
	line-height: 0.95;
}
/* 丸の右に続くオレンジの点線 */
:is(.post_content, .editor-styles-wrapper) .bebai-step::after {
	content: "";
	position: absolute;
	top: 50%;
	left: calc(100% + 4px);
	width: var(--bebai-step-line, 160px);
	height: 6px;
	margin-top: -3px;
	background-image: radial-gradient(circle, #f8a01a 0 2.2px, transparent 2.6px);
	background-size: 10.5px 6px;
	background-repeat: repeat-x;
	background-position: left center;
	pointer-events: none;
}
/* スマホ用など1つだけのとき：点線は本文の右端近くまで（元の画像と同じ） */
:is(.post_content, .editor-styles-wrapper) .bebai-step--single {
	--bebai-step-line: calc(min(400px, 100vw - 45px) - var(--bebai-step-size) - 6px);
}
/* PC用の横並び：上の3列の段組みとそろえる */
:is(.post_content, .editor-styles-wrapper) .wp-block-group.bebai-steps:not(:has(> .wp-block-group__inner-container)),
:is(.post_content, .editor-styles-wrapper) .wp-block-group.bebai-steps > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	container-type: inline-size;
	margin-bottom: 1em;
}
:is(.post_content, .editor-styles-wrapper) .bebai-steps .bebai-step {
	--bebai-step-size: 40px;
	--bebai-step-line: calc((100cqw - 48px) / 3 - 40px + 24px - 8px);
	margin: 0 !important;
}

/* ---------------------------------------------------------
 * オレンジの点線（旧：画像 Line-1-1）
 * --------------------------------------------------------- */
:is(.post_content, .editor-styles-wrapper) hr.wp-block-separator.bebai-dotline {
	/* 元の画像（文中に置いた細い点線）と同じ位置・大きさにそろえる */
	width: 100%;
	max-width: 1000px;
	height: 28.8px;
	margin-left: 0;
	margin-right: auto;
	border: 0;
	opacity: 1;
	background-color: transparent;
	background-image: radial-gradient(circle, #f9a819 0 1.55px, transparent 1.9px);
	background-size: 9.25px 6px;
	background-repeat: repeat-x;
	background-position: 0 17px;
}

/* スマホ・タブレットでは元の画像と同じく、点線全体が本文の幅に縮む（91個の点） */
@media not all and (min-width: 960px) {
	:is(.post_content, .editor-styles-wrapper) hr.wp-block-separator.bebai-dotline {
		--bebai-dot-pitch: calc((100vw - 31px) / 91);
		background-image: radial-gradient(circle, #f9a819 0 calc(var(--bebai-dot-pitch) / 6), transparent calc(var(--bebai-dot-pitch) / 5));
		background-size: var(--bebai-dot-pitch) 6px;
		height: 28.3px;
	}
}

/* ---------------------------------------------------------
 * トップのヒーロー（固定ページ「home」の先頭ブロック）
 * 公開画面ではメインビジュアルの位置に出す（parts/top/main_visual.php）。
 * --------------------------------------------------------- */
.bebai-hero {
	position: relative;
	overflow: hidden;
	padding: 0;
}
/* 公開画面：SWELL のメインビジュアル枠（#main_visual）の中に出す */
.p-mainVisual > .bebai-hero {
	left: 0;
	width: 100%;
	max-width: none !important;
	height: 100%;
	margin: 0 !important;
}
.bebai-hero > .bebai-hero__inner {
	height: 100%;
	max-width: none;
	margin: 0;
}
.bebai-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: #000;
	opacity: .3;
	pointer-events: none;
}
.bebai-hero .bebai-hero__img {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
}
.bebai-hero .bebai-hero__img img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}
.bebai-hero .bebai-hero__text {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	height: 100%;
	max-width: calc(var(--container_size, 0px) + var(--swl-pad_container, 0px) * 2);
	margin: 0 !important;
	padding: 0 var(--swl-pad_container, 0);
	transform: translateX(-50%);
	text-align: left;
	color: #000;
	text-shadow: 1px 1px 0 rgba(255, 255, 255, .2);
	font-family: "Zen Maru Gothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
	font-weight: 700;
}
.bebai-hero .bebai-hero__text > .p-blogParts {
	margin: 0;
	text-align: left;
}
@media not all and (min-width: 960px) {
	.bebai-hero .bebai-hero__text {
		padding: 0 4vw;
	}
}
.bebai-hero .bebai-hero__scroll {
	position: absolute;
	bottom: 16px;
	left: 50%;
	z-index: 9;
	margin: 0 !important;
	transform: translateX(-50%);
	text-align: center;
	line-height: 1;
}
.bebai-hero .bebai-hero__scroll a {
	display: block;
	color: #000;
	opacity: .75;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: var(--swl-letter_spacing, 1px);
	text-decoration: none;
	transition: opacity .25s;
}
.bebai-hero .bebai-hero__scroll a:hover {
	opacity: 1;
}
.bebai-hero .bebai-hero__scroll a::before {
	content: "";
	display: block;
	width: 20px;
	height: 20px;
	margin: 0 auto 4px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M5.9,14.4l-2.9,5C3,19.5,3,19.6,3,19.8c0,0.1,0.1,0.2,0.2,0.3l36.4,21c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l36.4-21 c0.1-0.1,0.2-0.2,0.2-0.3c0-0.1,0-0.3-0.1-0.4l-2.9-5c-0.1-0.1-0.2-0.2-0.3-0.2c-0.1,0-0.3,0-0.4,0.1L40,33.5L6.7,14.2 c-0.1,0-0.2-0.1-0.3-0.1c0,0-0.1,0-0.1,0C6.1,14.2,6,14.3,5.9,14.4z'/%3E%3Cpath d='M5.9,39.1l-2.9,5c-0.1,0.3-0.1,0.6,0.2,0.7l36.4,21c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l36.4-21 c0.2-0.1,0.2-0.2,0.2-0.3s0-0.2-0.1-0.4l-2.9-5c-0.1-0.1-0.2-0.2-0.3-0.2l0,0c-0.1,0-0.3,0-0.4,0.1L40,58.1L6.7,38.9 c-0.1,0-0.2-0.1-0.3-0.1c0,0-0.1,0-0.1,0C6.1,38.8,6,38.9,5.9,39.1z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M5.9,14.4l-2.9,5C3,19.5,3,19.6,3,19.8c0,0.1,0.1,0.2,0.2,0.3l36.4,21c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l36.4-21 c0.1-0.1,0.2-0.2,0.2-0.3c0-0.1,0-0.3-0.1-0.4l-2.9-5c-0.1-0.1-0.2-0.2-0.3-0.2c-0.1,0-0.3,0-0.4,0.1L40,33.5L6.7,14.2 c-0.1,0-0.2-0.1-0.3-0.1c0,0-0.1,0-0.1,0C6.1,14.2,6,14.3,5.9,14.4z'/%3E%3Cpath d='M5.9,39.1l-2.9,5c-0.1,0.3-0.1,0.6,0.2,0.7l36.4,21c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l36.4-21 c0.2-0.1,0.2-0.2,0.2-0.3s0-0.2-0.1-0.4l-2.9-5c-0.1-0.1-0.2-0.2-0.3-0.2l0,0c-0.1,0-0.3,0-0.4,0.1L40,58.1L6.7,38.9 c-0.1,0-0.2-0.1-0.3-0.1c0,0-0.1,0-0.1,0C6.1,38.8,6,38.9,5.9,39.1z'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: FloatVertical 3s ease-in-out infinite alternate;
}

/* ---------------------------------------------------------
 * サイドバーのボタン（旧：文字入り画像。ブログパーツ「あ」ID 507）
 *   段落ブロック + bebai-side-btn
 *   bebai-side-btn--tall   … 2行のボタン（高さ118px）
 *   bebai-side-btn--center … 文字を中央にそろえるボタン（高さ95px）
 * --------------------------------------------------------- */
:is(.post_content, .editor-styles-wrapper) p.bebai-side-btn a {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: 87.6px;
	margin: 0 1.6px;
	padding: 0 0 0 28px;
	border-radius: 20px;
	background-color: #f78da7;
	color: #fff !important;
	font-size: 16px;
	font-weight: 500;
	line-height: 31.4px;
	letter-spacing: 0;
	text-align: left;
	text-decoration: none;
}
:is(.post_content, .editor-styles-wrapper) p.bebai-side-btn--tall a {
	height: 117.9px;
}
:is(.post_content, .editor-styles-wrapper) p.bebai-side-btn--center a {
	justify-content: center;
	height: 95px;
	padding: 0;
}

/* ---------------------------------------------------------
 * ブログ記事の本文の先頭の見出し（タイトルと同じ文）
 * h1 を1ページ1つにするため、表示のときだけ h1 でない要素にしている（inc/seo.php）。
 * 見た目は今までの h1 と同じ。
 * --------------------------------------------------------- */
.post_content .bebai-post-h1 {
	margin-top: 0;
	margin-bottom: 2em;
	color: #333;
	font-family: "Zen Maru Gothic";
	font-size: 2em;
	font-weight: 700;
	line-height: 1.8;
}

/* ---------------------------------------------------------
 * あわせて読みたい（ブログ記事の最後。inc/related.php）
 * --------------------------------------------------------- */
.bebai-related {
	margin: 3em 0 0;
	padding: 1.25em 1.5em;
	border: 2px solid #f78da7;
	border-radius: 10px;
	background: #fff5f8;
}

.post_content .bebai-related__title {
	margin: 0 0 0.5em;
	color: #f78da7;
	font-weight: 700;
}

.post_content .bebai-related__list {
	margin: 0;
	padding-left: 1.2em;
}

.post_content .bebai-related__list li {
	margin: 0.4em 0;
}

/* ---------------------------------------------------------
 * この記事を書いた人（ブログ記事の最後。inc/author-box.php）
 * --------------------------------------------------------- */
.bebai-author {
	margin: 3em 0 0;
	padding: 1.25em 1.5em;
	border-radius: 10px;
	background: #f7f7f7;
}

.post_content .bebai-author__label {
	margin: 0 0 0.75em;
	color: #f78da7;
	font-size: 0.9em;
	font-weight: 700;
}

.bebai-author__body {
	display: flex;
	gap: 1.25em;
	align-items: flex-start;
}

.post_content .bebai-author__img {
	flex: 0 0 80px;
	width: 80px;
	height: 80px;
	margin: 0;
	border-radius: 50%;
	background: #fff;
}

.post_content .bebai-author__text > p {
	margin: 0 0 0.4em;
}

.post_content .bebai-author__name {
	font-weight: 700;
}

.post_content .bebai-author__desc {
	font-size: 0.9em;
}

.post_content .bebai-author__link {
	font-size: 0.9em;
}

@media not all and (min-width: 600px) {
	.post_content .bebai-author__img {
		flex-basis: 56px;
		width: 56px;
		height: 56px;
	}

	.bebai-author__body {
		gap: 0.9em;
	}
}
