/* ==========================================================================
   Picolabo — editor features (formats, block styles, patterns, blog card)
   公開側とブロックエディターの両方で読み込む。登録は inc/editor.php。
   ========================================================================== */

/* Text formats
   マーカー・文字色は JINR と同じクラス名。既存記事の装飾もこのルールで表示される。
   -------------------------------------------------------------------------- */
.d--marker1 {
	background: linear-gradient(transparent 60%, #ffeea1 60%);
}

.d--marker2 {
	background: linear-gradient(transparent 60%, rgba(0, 174, 239, 0.22) 60%);
}

.d--bold {
	font-weight: 700;
}

.d--user-color1 {
	color: #c8323f;
}

.d--user-color2 {
	color: #0076b6;
}

.pl-text-small {
	font-size: 0.8125em;
}

.pl-text-large {
	font-size: 1.25em;
	line-height: 1.6;
}

.jinr-d--font-size.d--fontsize-10px { font-size: 10px; }
.jinr-d--font-size.d--fontsize-11px { font-size: 11px; }
.jinr-d--font-size.d--fontsize-12px { font-size: 12px; }
.jinr-d--font-size.d--fontsize-13px { font-size: 13px; }
.jinr-d--font-size.d--fontsize-14px { font-size: 14px; }
.jinr-d--font-size.d--fontsize-15px { font-size: 15px; }
.jinr-d--font-size.d--fontsize-18px { font-size: 18px; }
.jinr-d--font-size.d--fontsize-20px { font-size: 20px; }
.jinr-d--font-size.d--fontsize-22px { font-size: 22px; }
.jinr-d--font-size.d--fontsize-24px { font-size: 24px; }
.jinr-d--font-size.d--fontsize-28px { font-size: 28px; }
.jinr-d--font-size.d--fontsize-32px { font-size: 32px; }

/* Group: boxes
   -------------------------------------------------------------------------- */
.wp-block-group:is(.is-style-pl-box, .is-style-pl-box-line, .is-style-pl-box-blue, .is-style-pl-titled) {
	padding: 1.5em 1.75em;
	border-radius: 12px;
}

.wp-block-group.is-style-pl-box {
	background: #f4f8fb;
}

.wp-block-group.is-style-pl-box-line {
	border: 1px solid #d3dbe1;
}

.wp-block-group.is-style-pl-box-blue {
	background: #eaf6ff;
}

/* タイトル付きボックス：最初の段落を枠の上に乗るラベルとして表示する。 */
.wp-block-group.is-style-pl-titled {
	position: relative;
	margin-top: 2.4em;
	padding-top: 2em;
	border: 1px solid #cfe6f5;
}

.wp-block-group.is-style-pl-titled > :first-child {
	position: absolute;
	top: 0;
	left: 1.25em;
	margin: 0 !important;
	padding: 0.15em 1.1em;
	border-radius: 999px;
	background: #0076b6;
	color: #fff;
	font-size: 0.875em;
	font-weight: 700;
	line-height: 1.8;
	letter-spacing: 0.06em;
	translate: 0 -50%;
}

/* Group: notes (info / point / caution)
   アイコンは 1行目（行の高さ 2em）の中央にそろえる。文字ではなく SVG にして、
   位置と大きさをボックスの文字サイズ基準で計算できるようにしている。
   -------------------------------------------------------------------------- */
.wp-block-group:is(.is-style-pl-note-info, .is-style-pl-note-point, .is-style-pl-note-caution) {
	--pl-note-pad: 1.2em;
	--pl-note-icon: 1.4em;
	--pl-note-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%230076b6'/%3E%3Ccircle cx='12' cy='7.2' r='1.6' fill='%23fff'/%3E%3Crect x='10.6' y='10.2' width='2.8' height='8' rx='1.4' fill='%23fff'/%3E%3C/svg%3E");
	position: relative;
	padding: var(--pl-note-pad) 1.5em var(--pl-note-pad) 3.6em;
	border-radius: 12px;
	background: #eaf6ff;
}

.wp-block-group:is(.is-style-pl-note-info, .is-style-pl-note-point, .is-style-pl-note-caution)::before {
	content: "";
	position: absolute;
	top: calc(var(--pl-note-pad) + (2em - var(--pl-note-icon)) / 2);
	left: 1.3em;
	width: var(--pl-note-icon);
	height: var(--pl-note-icon);
	background: var(--pl-note-image) center / contain no-repeat;
}

.wp-block-group.is-style-pl-note-point {
	--pl-note-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%235fae14'/%3E%3Cpath d='m7.2 12.4 3.2 3.2 6.4-6.8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background: #f1faea;
}

.wp-block-group.is-style-pl-note-caution {
	--pl-note-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23ff6b7a'/%3E%3Crect x='10.6' y='5.6' width='2.8' height='8.4' rx='1.4' fill='%23fff'/%3E%3Ccircle cx='12' cy='17.4' r='1.6' fill='%23fff'/%3E%3C/svg%3E");
	background: #fff1f3;
}

.wp-block-group:is(.is-style-pl-note-info, .is-style-pl-note-point, .is-style-pl-note-caution) > * + * {
	margin-top: 0.8em;
}

/* Group: steps
   子のグループ1つが1手順。各手順の最初の段落が手順名になる。
   -------------------------------------------------------------------------- */
.wp-block-group.is-style-pl-steps {
	counter-reset: pl-step;
}

.wp-block-group.is-style-pl-steps > .wp-block-group {
	position: relative;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 0 1.8em 3.4em;
	counter-increment: pl-step;
}

.wp-block-group.is-style-pl-steps > .wp-block-group::before {
	content: counter(pl-step);
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 2.1em;
	height: 2.1em;
	border-radius: 50%;
	background: #00aeef;
	color: #fff;
	font-family: "Outfit", sans-serif;
	font-weight: 600;
	line-height: 1;
}

.wp-block-group.is-style-pl-steps > .wp-block-group::after {
	content: "";
	position: absolute;
	top: 2.5em;
	bottom: 0.3em;
	left: 1.05em;
	width: 1px;
	background: #d3dbe1;
}

.wp-block-group.is-style-pl-steps > .wp-block-group:last-of-type {
	padding-bottom: 0;
}

.wp-block-group.is-style-pl-steps > .wp-block-group:last-of-type::after {
	display: none;
}

.wp-block-group.is-style-pl-steps > .wp-block-group > :first-child {
	margin-top: 0;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 2;
}

.wp-block-group.is-style-pl-steps > .wp-block-group > * + * {
	margin-top: 0.7em;
}

/* Group: speech balloon
   子は「画像（アイコン。キャプションに名前）」と「吹き出しにする段落かグループ」。
   -------------------------------------------------------------------------- */
.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) {
	display: flex;
	align-items: flex-start;
	gap: 1.1em;
}

.wp-block-group.is-style-pl-balloon-right {
	flex-direction: row-reverse;
}

.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > * {
	max-width: none !important;
	margin: 0 !important;
}

.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > .wp-block-image {
	flex: none;
	width: 6em;
	text-align: center;
}

.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > .wp-block-image img {
	width: 3.6em;
	height: 3.6em;
	border: 1px solid #e4e9ed;
	border-radius: 50%;
	object-fit: cover;
}

.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > .wp-block-image figcaption {
	margin-top: 0.35em;
	color: #66717b;
	font-size: 0.6875em;
	line-height: 1.4;
	letter-spacing: 0;
	text-wrap: balance;
}

/* 既存記事の JINR の吹き出し（jinr-compat.css）と同じ、淡い水色の吹き出し。 */
.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > :not(.wp-block-image) {
	position: relative;
	flex: 1;
	min-width: 0;
	padding: 1em 1.3em;
	border-radius: 18px;
	background: #eaf5fd;
	word-break: auto-phrase;
	text-wrap: pretty;
}

/* しっぽ（アイコンの中心の高さで、アイコンのほうを指す） */
.wp-block-group:is(.is-style-pl-balloon, .is-style-pl-balloon-right) > :not(.wp-block-image)::before {
	content: "";
	position: absolute;
	top: calc(1.8em - 11px);
	left: -14px;
	width: 15px;
	height: 22px;
	background: #eaf5fd;
	clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.wp-block-group.is-style-pl-balloon-right > :not(.wp-block-image)::before {
	right: -14px;
	left: auto;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Lists
   -------------------------------------------------------------------------- */
:is(.entry-content, .is-root-container) :is(ul, ol).is-style-pl-check,
:is(.entry-content, .is-root-container) :is(ul, ol).is-style-pl-num {
	padding-left: 0;
	list-style: none;
}

:is(.entry-content, .is-root-container) :is(ul, ol).is-style-pl-check > li,
:is(.entry-content, .is-root-container) :is(ul, ol).is-style-pl-num > li {
	position: relative;
	padding-left: 2em;
}

.is-style-pl-check > li::before {
	content: "";
	position: absolute;
	top: calc((2em - 1.15em) / 2); /* 行の高さ 2em の中央 */
	left: 0.15em;
	width: 1.15em;
	height: 1.15em;
	border-radius: 50%;
	background: #7ed321 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.is-style-pl-num {
	counter-reset: pl-num;
}

.is-style-pl-num > li {
	counter-increment: pl-num;
}

.is-style-pl-num > li::before {
	content: counter(pl-num);
	position: absolute;
	top: 0.4em;
	left: 0;
	display: grid;
	place-items: center;
	width: 1.45em;
	height: 1.45em;
	border-radius: 50%;
	background: #0076b6;
	color: #fff;
	font-family: "Outfit", sans-serif;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1;
}

/* Table: first column as header
   -------------------------------------------------------------------------- */
:is(.entry-content, .is-root-container) .wp-block-table.is-style-pl-rowhead td:first-child {
	width: 28%;
	min-width: 7em;
	background: #f4f8fb;
	font-weight: 500;
}

/* Buttons
   -------------------------------------------------------------------------- */
:is(.entry-content, .is-root-container) .wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid #d3dbe1;
	background: #fff;
	color: #1e2328;
}

:is(.entry-content, .is-root-container) .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: #1e2328;
}

.wp-block-button.is-style-pl-arrow > .wp-block-button__link::after {
	content: "→";
	display: inline-block;
	margin-left: 0.7em;
	transition: transform 0.3s;
}

.wp-block-button.is-style-pl-arrow > .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* Columns: card menu (image + caption links)
   -------------------------------------------------------------------------- */
.wp-block-columns.is-style-pl-cardmenu {
	gap: 12px;
}

.wp-block-columns.is-style-pl-cardmenu > .wp-block-column {
	overflow: hidden;
	border: 1px solid #e4e9ed;
	border-radius: 12px;
	background: #fff;
	transition: border-color 0.3s, transform 0.3s;
}

.wp-block-columns.is-style-pl-cardmenu > .wp-block-column:hover {
	border-color: #d3dbe1;
	transform: translateY(-2px);
}

.wp-block-columns.is-style-pl-cardmenu > .wp-block-column > * {
	margin: 0 !important;
}

.wp-block-columns.is-style-pl-cardmenu > .wp-block-column > .wp-block-image img {
	width: 100%;
	aspect-ratio: 5 / 2;
	border-radius: 0;
	object-fit: cover;
}

:is(.entry-content, .is-root-container) .wp-block-columns.is-style-pl-cardmenu > .wp-block-column > p {
	padding: 0.7em 0.9em;
	font-size: 0.9375em;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

:is(.entry-content, .is-root-container) .wp-block-columns.is-style-pl-cardmenu a {
	color: inherit;
	text-decoration: none;
}

/* Blog card
   -------------------------------------------------------------------------- */
.pl-blogcard {
	position: relative;
	padding-top: 0.8em;
}

:is(.entry-content, .is-root-container) .pl-blogcard__link {
	display: grid;
	grid-template-columns: 11em minmax(0, 1fr);
	align-items: center;
	gap: 1.2em;
	padding: 1.3em 1.3em 1.1em;
	border: 1px solid #e4e9ed;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.3s, box-shadow 0.3s;
}

:is(.entry-content, .is-root-container) .pl-blogcard__link:hover {
	border-color: #d3dbe1;
	box-shadow: 0 8px 24px rgba(30, 35, 40, 0.08);
}

.pl-blogcard--nothumb .pl-blogcard__link {
	grid-template-columns: minmax(0, 1fr) !important;
}

.pl-blogcard__label {
	position: absolute;
	top: 0;
	left: 1.25em;
	z-index: 1;
	padding: 0.1em 0.95em;
	border-radius: 999px;
	background: #0076b6;
	color: #fff;
	font-size: 0.75em;
	font-weight: 500;
	letter-spacing: 0.06em;
}

.pl-blogcard__thumb {
	display: block;
	aspect-ratio: 1200 / 630;
	overflow: hidden;
	border-radius: 8px;
	background: #f4f8fb;
}

.pl-blogcard__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}

.pl-blogcard__body {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
	min-width: 0;
}

.pl-blogcard__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 0.9375em;
	font-weight: 700;
	line-height: 1.65;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.pl-blogcard__excerpt {
	display: -webkit-box;
	overflow: hidden;
	color: #66717b;
	font-size: 0.8125em;
	line-height: 1.7;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.pl-blogcard__meta {
	color: #66717b;
	font-family: "Outfit", "Noto Sans JP", sans-serif;
	font-size: 0.75em;
	letter-spacing: 0.06em;
}

@media (max-width: 600px) {
	:is(.entry-content, .is-root-container) .pl-blogcard__link {
		grid-template-columns: 7.5em minmax(0, 1fr);
		gap: 0.9em;
		padding: 1.2em 1em 1em;
	}

	.pl-blogcard__excerpt {
		display: none;
	}
}
