/* Page content styles: injected into the block editor (see inc/blocks.php). */

/* ===== Design tokens ===== */
:root {
	/* GeneratePress “System Stack” (keep in sync with style.css) */
	--atesteo-font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	/*
	 * Brand colors — locked to atesteo.com HQ (do not retune for PSI/AA).
	 * green #008684 | purple #4e2453 | orange #e64011
	 * dark: green #045f5d | purple #351e38 | orange #b93510
	 */
	--atesteo-green: #008684;
	--atesteo-green-hover: #8fdad8;
	--atesteo-purple: #4e2453;
	--atesteo-orange: #e64011;
	--atesteo-orange-hover: #E79B86;
	--atesteo-btn-green: var(--atesteo-green);
	--atesteo-btn-green-hover: #045f5d;
	--atesteo-btn-orange: var(--atesteo-orange);
	--atesteo-btn-orange-hover: #b93510;
	--atesteo-btn-purple: var(--atesteo-purple);
	--atesteo-btn-purple-hover: #351e38;
	/* Site-wide type scale: H1 > H2 > body */
	--atesteo-h1-size: 28px;
	--atesteo-h2-size: 20px;
	--atesteo-body-size: 16px;
	--atesteo-accent-sm: var(--atesteo-body-size);
	--atesteo-accent-md: var(--atesteo-h2-size);
	--atesteo-accent-lg: var(--atesteo-h1-size);
	/* Vertical rhythm (block gaps in .entry-content) */
	--atesteo-space-xs: 0.35em; /* heading → following content */
	--atesteo-space-sm: 0.85em; /* default between blocks */
	--atesteo-space-md: 1.25em; /* H3 section / medium break */
	/*
	 * Space above every section H2 (change this one value site-wide).
	 * Applies to mid-column H2 and H2-first-in-column sections alike.
	 */
	--atesteo-space-before-h2: 1.5em;
	--atesteo-space-lg: var(--atesteo-space-before-h2); /* legacy alias */
	--atesteo-line-height: 1.7;
}

/* Editor + front content: System Stack */
body,
.entry-content,
.entry-content button,
.entry-content input,
.entry-content select,
.entry-content textarea,
.wpcf7,
.wpcf7 input,
.wpcf7 select,
.wpcf7 textarea {
	font-family: var(--atesteo-font-family);
}

/* ===== Clickable menu list (image + title + description) ===== */
.atesteo-menu-intro {
	margin-bottom: var(--atesteo-space-md);
}

/* Hub intro + CTA: description then button close on the right */
.entry-content .atesteo-menu-intro-row,
.entry-content .wp-block-group.atesteo-menu-intro-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5em 0.85em;
	margin: 0 0 var(--atesteo-space-md);
}

.entry-content .atesteo-menu-intro-row > .wp-block-group__inner-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5em 0.85em;
	width: 100%;
}

.entry-content .atesteo-menu-intro-row .atesteo-menu-intro {
	margin: 0;
	flex: 0 1 auto;
}

.entry-content .atesteo-menu-intro-row .btn-green,
.entry-content .atesteo-menu-intro-row .btn-orange {
	flex: 0 0 auto;
	margin: 0;
	text-decoration: none !important;
}

.atesteo-menu-list {
	display: flex;
	flex-direction: column;
	gap: var(--atesteo-space-sm);
	margin: 0 0 var(--atesteo-space-md);
}

.atesteo-menu-item,
.wp-block-columns.atesteo-menu-item {
	display: flex;
	align-items: flex-start;
	gap: 1.25em;
	padding: 0.75em;
	text-decoration: none !important;
	color: inherit;
	border: 1px solid transparent;
	border-radius: 4px;
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease;
	margin-bottom: 0 !important;
}

/* Match main-nav hover: soft green fill + inset bottom bar */
.atesteo-menu-item:hover,
.atesteo-menu-item:focus,
.wp-block-columns.atesteo-menu-item:hover,
.wp-block-columns.atesteo-menu-item:focus-within {
	background-color: #e8f5f4;
	border-color: transparent;
	box-shadow: inset 0 -2px 0 rgba(0, 134, 132, 0.4);
	outline: none;
}

/*
 * Scope width overrides under .entry-content so the block editor
 * (no .entry-content wrapper) keeps hub titles + lists on the same measure.
 * Front: parent already constrains; max-width:none only clears nested auto margins.
 */
.entry-content .wp-block-group.atesteo-menu-list {
	display: flex;
	flex-direction: column;
	gap: var(--atesteo-space-sm);
	margin: 0 0 var(--atesteo-space-md);
	max-width: none;
	width: 100%;
}

/* GP/WP group inner often centers with auto side margins — keep hub lists left */
.entry-content .wp-block-group.atesteo-menu-list > .wp-block-group__inner-container {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0;
	padding-right: 0;
}

.wp-block-columns.atesteo-menu-item {
	position: relative;
	cursor: pointer;
	justify-content: flex-start !important;
	width: 100%;
}

.entry-content .wp-block-columns.atesteo-menu-item {
	max-width: none;
}

.wp-block-columns.atesteo-menu-item > .wp-block-column {
	margin: 0;
}

.wp-block-columns.atesteo-menu-item .atesteo-menu-item__img-block,
.wp-block-columns.atesteo-menu-item .atesteo-menu-item__img-block img {
	width: 150px;
	height: 150px;
	object-fit: cover;
	margin: 0 !important;
}

/* Whole-row hit target (parity with legacy <a class="atesteo-menu-item">) */
.wp-block-columns.atesteo-menu-item .atesteo-menu-item__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Keep NEW flag above the row hit-target (same look as elsewhere) */
.wp-block-columns.atesteo-menu-item .atesteo-menu-item__title .atesteo-badge,
.wp-block-columns.atesteo-menu-item .atesteo-menu-item__title .wp-block-atesteo-badge {
	position: relative;
	z-index: 2;
	vertical-align: middle;
}

.wp-block-columns.atesteo-menu-item .atesteo-menu-item__title,
.wp-block-columns.atesteo-menu-item .atesteo-menu-item__title a {
	color: var(--atesteo-green);
	font-size: 20px;
	font-weight: bold;
	line-height: 1.35;
	text-decoration: none !important;
	margin: 0 0 0.35em;
}

.wp-block-columns.atesteo-menu-item:hover .atesteo-menu-item__title,
.wp-block-columns.atesteo-menu-item:hover .atesteo-menu-item__title a {
	color: #045f5d;
	text-decoration: none !important;
}

.wp-block-columns.atesteo-menu-item p.atesteo-menu-item__desc {
	color: #333;
	font-size: 1rem;
	line-height: 1.7;
	margin: 0;
}

.atesteo-menu-item__img {
	flex: 0 0 150px;
	width: 150px;
	height: 150px;
	object-fit: cover;
	display: block;
	margin: 0 !important;
	float: none !important;
}

.atesteo-menu-item__body {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	min-width: 0;
	padding-top: 0.15em;
}

.atesteo-menu-item__title,
h2.atesteo-menu-item__title,
h3.atesteo-menu-item__title {
	margin: 0;
	color: var(--atesteo-green);
	font-size: var(--atesteo-h2-size);
	font-weight: bold;
	line-height: 1.35;
}

.atesteo-menu-item__desc {
	color: #333;
	font-size: 1rem;
	line-height: 1.7;
}

.atesteo-menu-item__desc:empty {
	display: none;
}

.atesteo-menu-item:hover .atesteo-menu-item__title {
	color: #045f5d;
	text-decoration: none !important;
}

/* Badge (NEW etc.) — orange flag fluttering in wind */
.wp-block-atesteo-badge,
.atesteo-badge,
.atesteo-menu-item__badge,
.atesteo-new-label,
span.atesteo-badge,
span.atesteo-new-label {
	position: relative;
	display: inline-block;
	margin: 0 0.55em 0 0.35em;
	padding: 0.2em 0.75em 0.2em 0.55em;
	vertical-align: middle;
	/* Fold highlights that travel across the cloth */
	background-image: linear-gradient(
		105deg,
		#e85a1a 0%,
		var(--atesteo-orange) 28%,
		#ff9a4a 48%,
		var(--atesteo-orange) 68%,
		#d94a12 100%
	) !important;
	background-size: 220% 100%;
	background-color: var(--atesteo-orange) !important;
	color: #ffffff !important;
	border: none;
	border-radius: 2px 0 0 2px;
	/* Swallowtail tip — shape also animates slightly */
	clip-path: polygon(0 0, calc(100% - 0.45em) 0, 100% 50%, calc(100% - 0.45em) 100%, 0 100%);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
	text-decoration: none !important;
	cursor: default !important;
	pointer-events: none !important;
	user-select: none;
	box-shadow: none;
	transform-origin: left center;
	transform-style: preserve-3d;
	will-change: transform, clip-path, background-position;
	/* Half-cycle 2s → pause 2s → half-cycle 2s → pause 2s (total 8s) */
	animation: atesteo-flag-wave 8s linear infinite;
}

/* Thin “pole” on the left edge of the flag */
.atesteo-badge::before,
.atesteo-menu-item__badge::before,
.atesteo-new-label::before,
span.atesteo-badge::before,
span.atesteo-new-label::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #c2340e;
	border-radius: 1px 0 0 1px;
	z-index: 1;
}

/* Soft cloth fold shadow drifting with the wind */
.atesteo-badge::after,
.atesteo-menu-item__badge::after,
.atesteo-new-label::after,
span.atesteo-badge::after,
span.atesteo-new-label::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(0, 0, 0, 0.06) 35%,
		transparent 55%,
		rgba(255, 255, 255, 0.08) 75%,
		transparent 100%
	);
	background-size: 200% 100%;
	animation: atesteo-flag-fold 8s linear infinite;
	pointer-events: none;
}

@keyframes atesteo-flag-wave {
	/* Move to opposite pose (2s) */
	0% {
		transform: perspective(60px) rotateY(0deg) rotateZ(-0.6deg) skewX(0deg) scaleX(1);
		background-position: 10% 50%;
		clip-path: polygon(0 0, calc(100% - 0.42em) 0, 100% 50%, calc(100% - 0.48em) 100%, 0 100%);
	}
	12.5% {
		transform: perspective(60px) rotateY(5deg) rotateZ(0.4deg) skewX(-2.5deg) scaleX(0.98);
		background-position: 40% 50%;
		clip-path: polygon(0 0, calc(100% - 0.48em) 2%, 100% 46%, calc(100% - 0.4em) 100%, 0 100%);
	}
	25% {
		transform: perspective(60px) rotateY(-2deg) rotateZ(0.8deg) skewX(1.5deg) scaleX(1.01);
		background-position: 70% 50%;
		clip-path: polygon(0 0, calc(100% - 0.38em) 0, 100% 54%, calc(100% - 0.5em) 98%, 0 100%);
	}
	/* Pause (2s) */
	50% {
		transform: perspective(60px) rotateY(-2deg) rotateZ(0.8deg) skewX(1.5deg) scaleX(1.01);
		background-position: 70% 50%;
		clip-path: polygon(0 0, calc(100% - 0.38em) 0, 100% 54%, calc(100% - 0.5em) 98%, 0 100%);
	}
	/* Return (2s) */
	62.5% {
		transform: perspective(60px) rotateY(4deg) rotateZ(-0.2deg) skewX(-2deg) scaleX(0.985);
		background-position: 45% 50%;
		clip-path: polygon(0 0, calc(100% - 0.5em) 3%, 100% 48%, calc(100% - 0.38em) 100%, 0 100%);
	}
	75% {
		transform: perspective(60px) rotateY(0deg) rotateZ(-0.6deg) skewX(0deg) scaleX(1);
		background-position: 10% 50%;
		clip-path: polygon(0 0, calc(100% - 0.42em) 0, 100% 50%, calc(100% - 0.48em) 100%, 0 100%);
	}
	/* Pause (2s) */
	100% {
		transform: perspective(60px) rotateY(0deg) rotateZ(-0.6deg) skewX(0deg) scaleX(1);
		background-position: 10% 50%;
		clip-path: polygon(0 0, calc(100% - 0.42em) 0, 100% 50%, calc(100% - 0.48em) 100%, 0 100%);
	}
}

@keyframes atesteo-flag-fold {
	/* Left → right (2s) */
	0% {
		background-position: 0% 50%;
		opacity: 0.35;
	}
	25% {
		background-position: 100% 50%;
		opacity: 0.55;
	}
	/* Pause at right (2s) */
	50% {
		background-position: 100% 50%;
		opacity: 0.55;
	}
	/* Right → left (2s) */
	75% {
		background-position: 0% 50%;
		opacity: 0.35;
	}
	/* Pause at left (2s) */
	100% {
		background-position: 0% 50%;
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atesteo-badge,
	.atesteo-menu-item__badge,
	.atesteo-new-label,
	span.atesteo-badge,
	span.atesteo-new-label {
		animation: none;
		background-image: none !important;
		background-color: var(--atesteo-orange) !important;
		clip-path: polygon(0 0, calc(100% - 0.45em) 0, 100% 50%, calc(100% - 0.45em) 100%, 0 100%);
	}

	.atesteo-badge::after,
	.atesteo-menu-item__badge::after,
	.atesteo-new-label::after,
	span.atesteo-badge::after,
	span.atesteo-new-label::after {
		animation: none;
		opacity: 0;
	}
}

/* Keep flag gradient (光) — never use `background` shorthand here */
.atesteo-badge:hover,
.atesteo-menu-item__badge:hover,
.atesteo-new-label:hover,
a .atesteo-badge,
a .atesteo-new-label,
a:hover .atesteo-badge,
a:hover .atesteo-new-label,
a:hover .atesteo-menu-item__badge {
	background-color: var(--atesteo-orange) !important;
	color: #ffffff !important;
	cursor: default !important;
	text-decoration: none !important;
}

/* Accent text — replaces inline color: var(--atesteo-green) + font-size */
.atesteo-accent {
	color: var(--atesteo-green);
}

.atesteo-accent--sm {
	font-size: var(--atesteo-accent-sm);
}

.atesteo-accent--md {
	font-size: var(--atesteo-accent-md);
}

.atesteo-accent--lg {
	font-size: var(--atesteo-accent-lg);
}

/* Safety: leftover NEW inputs must not look/act like buttons */
input.btn-orange[value='NEW'],
input.btn-green[value='NEW'],
input[type='button'][value='NEW'] {
	display: inline-block !important;
	width: auto !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 0.15em 0.5em !important;
	margin: 0 0.35em 0 0.15em !important;
	background: var(--atesteo-orange) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 2px !important;
	font-size: 11px !important;
	font-weight: 800 !important;
	letter-spacing: 0.08em !important;
	line-height: 1.3 !important;
	cursor: default !important;
	pointer-events: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	box-shadow: none !important;
}

input.btn-orange[value='NEW']:hover,
input.btn-green[value='NEW']:hover,
input[type='button'][value='NEW']:hover {
	background: var(--atesteo-orange) !important;
	color: #ffffff !important;
	cursor: default !important;
}

.atesteo-menu-heading {
	margin: 0 0 0.5em;
	color: var(--atesteo-green);
	font-size: var(--atesteo-h1-size);
	font-weight: bold;
}

.atesteo-menu-heading__sub {
	font-size: 0.85em;
	font-weight: bold;
}

.atesteo-menu-item--wide .atesteo-menu-item__img,
.wp-block-columns.atesteo-menu-item--wide .atesteo-menu-item__img-block,
.wp-block-columns.atesteo-menu-item--wide .atesteo-menu-item__img-block img {
	flex-basis: 250px;
	width: 250px;
	height: auto;
	max-height: 182px;
	object-fit: cover;
}

.atesteo-menu-cta .btn-green,
.atesteo-menu-cta .btn-orange,
.atesteo-menu-intro .btn-green,
.atesteo-menu-intro .btn-orange {
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	vertical-align: middle;
}

/* Button + short description on one row (converted from inline shortcodes) */
.entry-content .atesteo-btn-inline-row,
.entry-content .wp-block-group.atesteo-btn-inline-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em 0.75em;
	margin: 0 0 var(--atesteo-space-sm);
}

.entry-content .atesteo-btn-inline-row > .wp-block-group__inner-container,
.entry-content .wp-block-group.atesteo-btn-inline-row > .wp-block-group__inner-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em 0.75em;
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.entry-content .atesteo-btn-inline-row p,
.entry-content .wp-block-group.atesteo-btn-inline-row p {
	margin: 0;
}

.entry-content .atesteo-btn-inline-row .atesteo-badge,
.entry-content .wp-block-group.atesteo-btn-inline-row .atesteo-badge,
.entry-content .atesteo-btn-inline-row .wp-block-atesteo-badge,
.entry-content .wp-block-group.atesteo-btn-inline-row .wp-block-atesteo-badge {
	margin: 0;
}

@media (max-width: 600px) {
	.atesteo-menu-item,
	.wp-block-columns.atesteo-menu-item {
		gap: 0.85em;
	}

	.atesteo-menu-item__img,
	.atesteo-menu-item--wide .atesteo-menu-item__img,
	.wp-block-columns.atesteo-menu-item .atesteo-menu-item__img-block,
	.wp-block-columns.atesteo-menu-item .atesteo-menu-item__img-block img {
		flex-basis: 96px;
		width: 96px;
		height: 96px;
		max-height: 96px;
	}

	:root {
		--atesteo-h1-size: 22px;
		--atesteo-h2-size: 17px;
	}
}


/*
 * Fix "staircase" floats on Ken-i style menu lists
 * (thumbnail alignleft + title/text + <br> repeated).
 * Each left-floated image starts on a new row.
 */
.entry-content img.alignleft {
	clear: left;
	float: left;
	margin: 0 1.25em 1.25em 0;
}

.entry-content img.alignright {
	clear: right;
	float: right;
	margin: 0 0 1.25em 1.25em;
}


/* ===== Icons (SVG masks — buttons / menu / header / footer) =====
 * Size the ::before glyph only. Footer HTML nests label text inside
 * .icon_mail; fixed width/height on the span would stack CJK chars.
 */
.icon_blank,
.icon_download,
.icon_mail,
.icon_home,
.icon_lock {
	display: inline;
	line-height: 1;
	font-size: 16px;
	color: inherit;
}

.icon_blank::before,
.icon_download::before,
.icon_mail::before,
.icon_home::before,
.icon_lock::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-left: 0.25em;
	vertical-align: -0.15em;
	background-color: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

/* Label nested inside icon span (footer 「お問い合わせ」) → icon is a prefix */
.icon_blank:not(:empty)::before,
.icon_download:not(:empty)::before,
.icon_mail:not(:empty)::before,
.icon_home:not(:empty)::before,
.icon_lock:not(:empty)::before {
	margin-left: 0;
	margin-right: 0.35em;
}

.icon_blank::before {
	-webkit-mask-image: url("icons/blank.svg");
	mask-image: url("icons/blank.svg");
}

.icon_download::before {
	-webkit-mask-image: url("icons/download.svg");
	mask-image: url("icons/download.svg");
}

.icon_mail::before {
	-webkit-mask-image: url("icons/mail.svg");
	mask-image: url("icons/mail.svg");
}

.icon_home::before {
	-webkit-mask-image: url("icons/home.svg");
	mask-image: url("icons/home.svg");
}

.icon_lock::before {
	-webkit-mask-image: url("icons/lock.svg");
	mask-image: url("icons/lock.svg");
}

.icon_home.black { color: inherit; }
.icon_mail.white,
.icon_blank.white,
.icon_download.white,
.icon_home.white,
.icon_lock.white {
	color: #fff;
}

.main-navigation .icon_home {
	font-size: 18px;
	color: #333;
}

.main-navigation .icon_home::before {
	margin-left: 0;
}

/* ===== box_style (TOC callout — ATESTEO tokens) ===== */
.box_style {
	margin: 0 0 var(--atesteo-space-md);
}

.box_style_blue,
.box_style_green,
.box_style_orange,
.box_style_gray {
	margin-bottom: var(--atesteo-space-md);
	padding: 1px;
	border-radius: 4px;
	background: var(--atesteo-green);
}

.box_style_green {
	background: var(--atesteo-green);
}

.box_style_orange {
	background: var(--atesteo-orange);
}

.box_style_gray {
	background: #5d656c;
}

.box_style_blue .box_inner,
.box_style_green .box_inner,
.box_style_orange .box_inner,
.box_style_gray .box_inner {
	padding: 15px;
	background-color: #f3fbfb;
	border-radius: 3px;
}

.box_style_orange .box_inner {
	background-color: #fff8f5;
}

.box_style_gray .box_inner {
	background-color: #f5f6f7;
}

.box_style_title {
	margin: 0 0 0.5em;
	color: #fff;
	line-height: 1.4;
}

.box_style_title span,
.box_style_title_inner {
	display: inline-block;
	padding: 5px 10px;
	background-color: var(--atesteo-green);
	color: #fff;
	font-weight: bold;
	border-radius: 2px;
}

.box_style_orange .box_style_title span,
.box_style_orange .box_style_title_inner {
	background-color: var(--atesteo-orange);
}

.box_style_gray .box_style_title span,
.box_style_gray .box_style_title_inner {
	background-color: #5d656c;
}

/* TOC etc.: numbers are in the text — no disc markers */
.box_style .wp-block-list,
.box_style ul,
.entry-content .box_style .wp-block-list,
.entry-content .box_style ul {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.box_style .wp-block-list > li,
.box_style ul > li,
.entry-content .box_style .wp-block-list > li,
.entry-content .box_style ul > li {
	padding-left: 0;
}

/* ===== Typography / content (migrated from 賢威) ===== */

.entry-content a,
.widget a {
	text-decoration: none;
}

/* Heading / body sizes — same on every page (H1 > H2 > paragraph) */
.entry-content {
	font-size: var(--atesteo-body-size);
	line-height: var(--atesteo-line-height);
}

/*
 * Vertical rhythm
 * - Default gap from adjacent siblings (* + *)
 * - Exceptions: section break before H2; tighten after headings
 * - Menu list only keeps its own gap
 */
.entry-content > *,
.entry-content .wp-block-column > *,
.entry-content .wp-block-group__inner-container > * {
	margin-top: 0;
	margin-bottom: 0;
}

.entry-content > * + *,
.entry-content .wp-block-column > * + *,
.entry-content .wp-block-group__inner-container > * + * {
	margin-top: var(--atesteo-space-sm);
}

/*
 * Consecutive CTA buttons often sit on one row (inline-flex).
 * Block rhythm (* + *) gives margin-top to the first button only; the next
 * would get the same via * + * then — keep that identical value so tops align.
 * Inside .atesteo-btn-inline-row the group already owns vertical spacing.
 */
.entry-content .atesteo-btn-inline-row > :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange),
.entry-content .atesteo-btn-inline-row > :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange)
	+ :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange),
.entry-content .wp-block-group.atesteo-btn-inline-row .wp-block-group__inner-container > :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange),
.entry-content .wp-block-group.atesteo-btn-inline-row .wp-block-group__inner-container > :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange)
	+ :is(.btn-green, .btn-green-140, .btn-orange, a.btn-green, a.btn-green-140, a.btn-orange) {
	margin-top: 0;
}

/*
 * Section break: space above H2 — single knob (--atesteo-space-before-h2).
 * H2 owns the gap. Columns that start with H2 cancel *+* so it does not double.
 */
.entry-content > * + h2:not(.atesteo-menu-item__title),
.entry-content > * + h2.wp-block-heading:not(.atesteo-menu-item__title),
.entry-content .wp-block-column > * + h2:not(.atesteo-menu-item__title),
.entry-content .wp-block-column > * + h2.wp-block-heading:not(.atesteo-menu-item__title),
.entry-content .wp-block-group__inner-container > * + h2:not(.atesteo-menu-item__title),
.entry-content .wp-block-group__inner-container > * + h2.wp-block-heading:not(.atesteo-menu-item__title),
.entry-content .wp-block-column > h2:first-child:not(.atesteo-menu-item__title),
.entry-content .wp-block-column > h2.wp-block-heading:first-child:not(.atesteo-menu-item__title),
.entry-content .wp-block-group__inner-container > h2:first-child:not(.atesteo-menu-item__title),
.entry-content .wp-block-group__inner-container > h2.wp-block-heading:first-child:not(.atesteo-menu-item__title) {
	margin-top: var(--atesteo-space-before-h2);
}

.entry-content > * + .wp-block-columns:not(.atesteo-menu-item):has(> .wp-block-column > h2:first-child),
.entry-content > * + .wp-block-columns:not(.atesteo-menu-item):has(> .wp-block-column > h2.wp-block-heading:first-child) {
	margin-top: 0;
}

/* Medium break: H3 */
.entry-content > * + h3,
.entry-content > * + h3.wp-block-heading,
.entry-content .wp-block-column > * + h3,
.entry-content .wp-block-column > * + h3.wp-block-heading,
.entry-content .wp-block-group__inner-container > * + h3,
.entry-content .wp-block-group__inner-container > * + h3.wp-block-heading {
	margin-top: var(--atesteo-space-md);
}

/* Heading → following content (not another heading) */
.entry-content > :is(h1, h2, h3, h4, h5, h6) + *:not(:is(h1, h2, h3, h4, h5, h6)),
.entry-content .wp-block-column > :is(h1, h2, h3, h4, h5, h6) + *:not(:is(h1, h2, h3, h4, h5, h6)),
.entry-content .wp-block-group__inner-container > :is(h1, h2, h3, h4, h5, h6) + *:not(:is(h1, h2, h3, h4, h5, h6)) {
	margin-top: var(--atesteo-space-xs);
}

/* Caption-like: paragraph/heading immediately before an image */
.entry-content > :is(p, .wp-block-paragraph) + .wp-block-image,
.entry-content .wp-block-column > :is(p, .wp-block-paragraph) + .wp-block-image,
.entry-content .wp-block-group__inner-container > :is(p, .wp-block-paragraph) + .wp-block-image {
	margin-top: var(--atesteo-space-xs);
}

/* First block / first section H2: no top gap */
.entry-content > :first-child {
	margin-top: 0;
}

.entry-content > .wp-block-columns:first-child > .wp-block-column > h2:first-child,
.entry-content > .wp-block-columns:first-child > .wp-block-column > h2.wp-block-heading:first-child,
.entry-content > h2:first-child,
.entry-content > h2.wp-block-heading:first-child {
	margin-top: 0;
}

/* Menu list only: own gap — disable generic sibling margins inside */
.entry-content .atesteo-menu-list > * + *,
.entry-content .wp-block-group.atesteo-menu-list > * + *,
.entry-content .atesteo-menu-list .wp-block-group__inner-container > * + *,
.entry-content .wp-block-group.atesteo-menu-list .wp-block-group__inner-container > * + *,
.entry-content .atesteo-menu-item > * + *,
.entry-content .wp-block-columns.atesteo-menu-item > * + * {
	margin-top: 0;
}

.entry-content ul,
.entry-content ol,
.entry-content .wp-block-list {
	font-size: var(--atesteo-body-size);
}

.entry-content li {
	font-size: var(--atesteo-body-size);
	line-height: var(--atesteo-line-height);
	font-weight: normal;
}

/* Nested lists: outer ● / inner ○ */
.entry-content ul:not(.atesteo-list--triangle),
.entry-content .wp-block-list:not(.atesteo-list--triangle) {
	list-style-type: disc;
}

.entry-content ul ul,
.entry-content ul .wp-block-list,
.entry-content .wp-block-list ul,
.entry-content .wp-block-list .wp-block-list {
	list-style-type: circle;
}

/* TOC / box_style: keep unstyled (must follow disc rule — same specificity) */
.entry-content .box_style ul,
.entry-content .box_style .wp-block-list,
.entry-content .box_style ul.wp-block-list {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

/* ▶ already marks the item — hide the default disc */
.entry-content .wp-block-list.atesteo-list--triangle,
.entry-content ul.atesteo-list--triangle {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.entry-content .atesteo-list--triangle > li {
	padding-left: 0;
}

/* － already marks the line — hide the default disc */
.entry-content .wp-block-list > li.atesteo-li--dash {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

/* Keep image + table note stacked (caption never sits beside the chart) */
.entry-content .wp-block-image {
	display: block;
	clear: both;
	max-width: 100%;
}

.entry-content .wp-block-image img {
	display: block;
	height: auto;
	max-width: 100%;
}

.entry-content .wp-block-image figcaption,
.entry-content .wp-block-image .wp-element-caption {
	display: block;
	width: 100%;
	clear: both;
	text-align: left;
}

.entry-content p.atesteo-table-note,
.entry-content .atesteo-table-note {
	display: block;
	clear: both;
	margin-top: var(--atesteo-space-xs);
	margin-bottom: var(--atesteo-space-sm);
	padding-left: 1.5em;
}

/* Wide tables (e.g. torque range matrix): scroll instead of clipping */
.entry-content .wp-block-table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.entry-content .wp-block-table table {
	width: max-content;
	min-width: 100%;
	border-collapse: collapse;
}

.entry-content .wp-block-table td,
.entry-content .wp-block-table th {
	white-space: nowrap;
	padding: 0.35em 0.45em;
	font-size: 0.9em;
}

/* Result chart: conditions (left) + table (right) */
.entry-content .wp-block-columns.atesteo-chart-row {
	align-items: flex-start;
	gap: var(--atesteo-space-md);
	margin-top: var(--atesteo-space-md);
	margin-bottom: var(--atesteo-space-md);
}

.entry-content .wp-block-columns.atesteo-chart-row > .wp-block-column {
	margin: 0;
}

.entry-content .wp-block-columns.atesteo-chart-row > .wp-block-column > * + * {
	margin-top: 0.35em;
}

.entry-content .wp-block-columns.atesteo-chart-row .wp-block-image {
	margin-top: 0;
}

@media (max-width: 781px) {
	.entry-content .wp-block-columns.atesteo-chart-row {
		flex-wrap: wrap;
	}

	.entry-content .wp-block-columns.atesteo-chart-row > .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* Labels under a multi-panel figure — keep label row = image width.
 * GP applies content padding to .wp-block-group__inner-container (30–40px);
 * reset it here so H2 → figure spacing stays --atesteo-space-xs. */
.entry-content .atesteo-fig-with-labels,
.entry-content .atesteo-fig-with-labels > .wp-block-group__inner-container {
	display: block;
	width: fit-content;
	max-width: 100%;
	padding: 0;
}

.entry-content .atesteo-fig-with-labels .wp-block-image,
.entry-content .atesteo-fig-with-labels .wp-block-image img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0;
}

.entry-content .atesteo-fig-with-labels .wp-block-columns.atesteo-fig-labels {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-top: var(--atesteo-space-xs);
	margin-bottom: var(--atesteo-space-sm);
	gap: 0;
}

.entry-content .atesteo-fig-labels .atesteo-fig-label,
.entry-content p.atesteo-fig-label {
	text-align: center;
	margin: 0;
	font-weight: bold;
}

@media (max-width: 781px) {
	.entry-content .atesteo-fig-with-labels {
		width: 100%;
	}
}

/* Image + text side-by-side, text close to the figure (no wide column gap) */
.entry-content .wp-block-columns.atesteo-media-text {
	display: flex !important;
	flex-wrap: nowrap;
	justify-content: flex-start !important;
	align-items: flex-start;
	align-self: flex-start;
	gap: 0.75em;
	column-gap: 0.75em;
	/* fit-content: avoid max-content + max-width:100% cyclic sizing that
	   stretches the media column and pushes text far right */
	width: fit-content !important;
	max-width: 100%;
	margin-top: var(--atesteo-space-xs);
	margin-bottom: var(--atesteo-space-sm);
	margin-left: 0;
	margin-right: auto;
}

/* Beat WP core equal-width columns (flex-grow:1 / flex-basis:0) */
.entry-content .wp-block-columns.atesteo-media-text > .wp-block-column,
.entry-content .atesteo-media-text > .wp-block-column {
	flex: 0 0 auto !important;
	flex-grow: 0 !important;
	flex-shrink: 0 !important;
	flex-basis: auto !important;
	width: fit-content !important;
	max-width: none;
	margin: 0 !important;
	padding: 0 !important;
	min-width: 0;
}

.entry-content .atesteo-media-text__media {
	flex: 0 0 auto !important;
	width: fit-content !important;
	max-width: min(100%, 400px) !important;
}

.entry-content .atesteo-media-text__media .wp-block-image,
.entry-content .atesteo-media-text__media .wp-block-image img {
	display: block;
	width: auto;
	max-width: min(100%, 400px);
	height: auto;
	margin: 0;
}

.entry-content .atesteo-media-text__text {
	flex: 0 1 auto !important;
	width: fit-content !important;
	max-width: 26em !important;
}

/* Product blurb + figure: full-width row, content packed to the left edge */
.entry-content .wp-block-columns.atesteo-media-text--product {
	width: 100%;
	max-width: 100%;
	justify-content: flex-start;
	margin-left: 0;
	margin-right: 0;
}

.entry-content .atesteo-media-text--product .atesteo-media-text__text {
	flex: 0 1 28em !important;
	width: fit-content !important;
	max-width: 32em !important;
	text-align: left;
}

.entry-content .atesteo-media-text--product .atesteo-media-text__media {
	max-width: min(100%, 360px) !important;
}

.entry-content .atesteo-media-text--product .atesteo-media-text__media .wp-block-image img {
	max-width: min(100%, 360px);
}

/* How-to: left figure / right text — same column widths on stacked rows */
.entry-content .wp-block-columns.atesteo-media-text--howto {
	width: 100%;
	max-width: 100%;
	justify-content: flex-start;
	margin-left: 0;
	margin-right: 0;
}

.entry-content .atesteo-media-text--howto .atesteo-media-text__media {
	flex: 0 0 200px !important;
	width: 200px !important;
}

.entry-content .atesteo-media-text--howto .atesteo-media-text__media .wp-block-image,
.entry-content .atesteo-media-text--howto .atesteo-media-text__media .wp-block-image img {
	width: 200px;
	max-width: 200px;
	height: auto;
}

.entry-content .atesteo-media-text--howto .atesteo-media-text__text {
	flex: 1 1 auto !important;
	max-width: none;
}

.entry-content .atesteo-media-text__text > * + * {
	margin-top: 0.35em;
}

@media (max-width: 781px) {
	.entry-content .wp-block-columns.atesteo-media-text {
		flex-wrap: wrap;
		width: 100%;
	}

	.entry-content .atesteo-media-text__media,
	.entry-content .atesteo-media-text__text {
		flex-basis: 100% !important;
		max-width: 100%;
	}

	.entry-content .atesteo-media-text__media .wp-block-image img {
		max-width: 100%;
	}
}

.entry-content h1,
.entry-content h1.wp-block-heading,
.entry-content h1.entry-title {
	background: transparent !important;
	border: none;
	padding: 0;
	margin-bottom: 0;
	color: var(--atesteo-green);
	font-size: var(--atesteo-h1-size);
	font-weight: bold;
	line-height: 1.35;
}

.entry-content h2,
.entry-content h2.wp-block-heading {
	background: transparent !important;
	border: none;
	padding: 0;
	margin-bottom: 0;
	color: var(--atesteo-green);
	font-size: var(--atesteo-h2-size);
	font-weight: bold;
	line-height: 1.35;
}

.entry-content > h2:first-child,
.entry-content > h2.wp-block-heading:first-child {
	margin-top: 0;
}

/* Menu card titles stay tight inside the row */
.entry-content h2.atesteo-menu-item__title,
.entry-content .atesteo-menu-item h2 {
	margin-top: 0;
}

/* H3: paragraph size, green (e.g. 一般データ) */
.entry-content h3,
.entry-content h3.wp-block-heading {
	background: transparent !important;
	border: none;
	padding: 0;
	margin-bottom: 0;
	color: var(--atesteo-green);
	font-size: var(--atesteo-body-size);
	font-weight: bold;
	line-height: 1.5;
}

/* Leftover h4–h6 render at H2 size until content is normalized */
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	border: none;
	padding: 0;
	margin-bottom: 0;
	color: var(--atesteo-green);
	font-size: var(--atesteo-h2-size);
	font-weight: bold;
	line-height: 1.35;
}

.entry-content p,
.entry-content .wp-block-paragraph,
.entry-content li,
.entry-content .wp-block-list {
	font-size: var(--atesteo-body-size);
	line-height: var(--atesteo-line-height);
}

/* Override GeneratePress default p { margin-bottom: 1.5em } */
.entry-content p,
.entry-content .wp-block-paragraph {
	margin-bottom: 0;
}

/* Inline emphasis used for video audio notices */
.entry-content .red,
.entry-content span.red {
	color: #c00;
}

/* Sitewide video: block, max 800px (same settings everywhere) */
.entry-content video,
.entry-content .wp-block-video {
	display: block;
	width: 100%;
	max-width: 800px;
	height: auto;
	margin-left: 0;
	margin-right: auto;
}

.entry-content .wp-block-video video {
	width: 100%;
	max-width: 800px;
	height: auto;
	margin: 0;
}

/* Homepage: video left-aligned, CTAs stacked below */
.entry-content .atesteo-home-video {
	max-width: 800px;
	margin-left: 0;
	margin-right: auto;
}

.entry-content .atesteo-home-video .wp-block-video {
	margin-bottom: var(--atesteo-space-sm);
}

.entry-content .atesteo-home-video .atesteo-btn,
.entry-content .atesteo-home-video a.btn-green,
.entry-content .atesteo-home-video a.btn-orange {
	display: inline-flex;
	margin-top: var(--atesteo-space-xs);
	margin-right: 0;
}

/* Accent spans only color text; size comes from heading / paragraph */
.entry-content h1 .atesteo-accent,
.entry-content h2 .atesteo-accent,
.entry-content h3 .atesteo-accent,
.entry-content h4 .atesteo-accent,
.entry-content h1 .atesteo-accent--sm,
.entry-content h1 .atesteo-accent--md,
.entry-content h1 .atesteo-accent--lg,
.entry-content h2 .atesteo-accent--sm,
.entry-content h2 .atesteo-accent--md,
.entry-content h2 .atesteo-accent--lg,
.entry-content h3 .atesteo-accent--sm,
.entry-content h3 .atesteo-accent--md,
.entry-content h3 .atesteo-accent--lg {
	font-size: inherit;
}

.entry-content td {
	padding: 3px;
}

/* Spec-table PDF buttons (datasheet / catalog column) */
.entry-content table a.btn-green,
.entry-content table a.btn-green-140 {
	margin: 0.2em 0;
	max-width: 100%;
	white-space: nowrap;
}

/* Hover / click-to-pin image preview (was Ken-i linkImg) */
.entry-content a.atesteo-img-preview,
.entry-content a.atesteo-img-preview:link,
.entry-content a.atesteo-img-preview:visited,
.entry-content a.atesteo-img-preview:hover,
.entry-content a.atesteo-img-preview:focus,
.entry-content a.atesteo-img-preview:active,
.entry-content a.atesteo-img-preview.is-pinned {
	position: relative;
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
	cursor: pointer;
}

a.atesteo-img-preview > span {
	display: none;
	position: absolute;
	top: 2.5em;
	left: 20px;
	z-index: 5;
}

a.atesteo-img-preview:hover > span,
a.atesteo-img-preview.is-pinned > span {
	border: none;
	display: block;
	width: 400px;
}

a.atesteo-img-preview > span img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Inline formula images in datasheet cells (black glyphs, not link-colored) */
.entry-content table img.atesteo-formula-img {
	display: inline-block;
	vertical-align: middle;
	width: 160px;
	height: auto;
	max-width: 100%;
	margin: 0;
	border: 0;
	box-shadow: none;
}

/* Text tips from former title= tooltips — hover or click-to-pin */
.entry-content table span.atesteo-tip {
	position: relative;
	cursor: pointer;
}

.entry-content table span.atesteo-tip__bubble {
	display: none;
	position: absolute;
	top: calc(100% + 0.35em);
	left: 0;
	z-index: 6;
	box-sizing: border-box;
	width: max-content;
	max-width: min(22em, 70vw);
	padding: 0.55em 0.75em;
	background: #fff;
	border: 1px solid var(--atesteo-green);
	border-radius: 2px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	color: #222;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.5;
	text-align: left;
	white-space: normal;
}

.entry-content table span.atesteo-tip:hover > .atesteo-tip__bubble,
.entry-content table span.atesteo-tip.is-pinned > .atesteo-tip__bubble {
	display: block;
}

/* Room below the table so the last-row preview stays on-screen.
 * Apply to the <table> only — not .wp-block-table (avoids doubling). */
.entry-content table:has(a.atesteo-img-preview),
.entry-content table:has(span.atesteo-tip) {
	margin-bottom: 12em;
}

/* ===== Buttons — color ONLY via .btn-green / .btn-green-140 / .btn-orange ===== */
.btn-green,
.btn-green-140,
.btn-orange,
a.btn-green,
a.btn-green-140,
a.btn-orange,
button.btn-green,
button.btn-green-140,
button.btn-orange,
input.btn-green,
input.btn-green-140,
input.btn-orange {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 32px;
	min-height: 32px;
	line-height: 1;
	padding: 0 12px;
	margin: 0 5px 0 0;
	border: none;
	border-radius: 3px;
	font-family: inherit;
	font-size: 14px;
	font-weight: bold;
	color: #ffffff !important;
	text-align: center;
	text-decoration: none !important;
	vertical-align: middle;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

.btn-green,
.btn-green-140,
a.btn-green,
a.btn-green-140,
button.btn-green,
button.btn-green-140,
input.btn-green,
input.btn-green-140 {
	background: var(--atesteo-btn-green);
}

.btn-green:hover,
.btn-green-140:hover,
a.btn-green:hover,
a.btn-green-140:hover,
button.btn-green:hover,
button.btn-green-140:hover,
input.btn-green:hover,
input.btn-green-140:hover {
	background: var(--atesteo-btn-green-hover);
}

.btn-green-140,
a.btn-green-140,
button.btn-green-140,
input.btn-green-140 {
	width: 140px;
	padding-left: 0;
	padding-right: 0;
}

.btn-orange,
a.btn-orange,
button.btn-orange,
input.btn-orange {
	background: var(--atesteo-btn-orange);
}

.btn-orange:hover,
a.btn-orange:hover,
button.btn-orange:hover,
input.btn-orange:hover {
	background: var(--atesteo-btn-orange-hover);
}

/* Icons on colored buttons are always white */
.btn-green .icon_download,
.btn-green .icon_blank,
.btn-green .icon_lock,
.btn-green .icon_mail,
.btn-green-140 .icon_download,
.btn-green-140 .icon_blank,
.btn-green-140 .icon_lock,
.btn-green-140 .icon_mail,
.btn-orange .icon_download,
.btn-orange .icon_blank,
.btn-orange .icon_lock,
.btn-orange .icon_mail {
	color: #ffffff !important;
	margin-left: 0.35em;
}

/* Non-clickable year / status chips (history timeline etc.) */
span.atesteo-year-label {
	cursor: default;
	pointer-events: none;
	user-select: none;
}

/* History / events timeline (div or block columns) — same vertical rhythm as body */
.atesteo-timeline,
.wp-block-group.atesteo-timeline {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	text-align: left;
}

.entry-content .atesteo-timeline,
.entry-content .wp-block-group.atesteo-timeline {
	max-width: none !important;
}

/* History: don't center/constrain — keep years flush left with headings */
.entry-content .atesteo-timeline .wp-block-group__inner-container,
.entry-content .wp-block-group.atesteo-timeline .wp-block-group__inner-container,
.entry-content .atesteo-timeline.is-layout-constrained,
.entry-content .wp-block-group.atesteo-timeline.is-layout-constrained,
.entry-content .wp-block-group.atesteo-timeline .is-layout-constrained {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	text-align: left;
}

/* History only (year chip + text columns) */
.wp-block-columns.atesteo-timeline__row {
	display: grid !important;
	grid-template-columns: 4.75em minmax(0, 1fr);
	column-gap: 1em;
	align-items: center;
	justify-content: start !important;
	width: 100%;
	margin-bottom: 0 !important;
	padding: 0 !important;
	text-align: left;
}

.entry-content .wp-block-columns.atesteo-timeline__row {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.wp-block-columns.atesteo-timeline__row > .wp-block-column {
	margin: 0;
	padding: 0;
	flex-basis: auto !important;
	width: auto !important;
	text-align: left;
}

.wp-block-columns.atesteo-timeline__row > .wp-block-column:first-child {
	justify-self: start;
}

.atesteo-timeline .atesteo-year-label,
.atesteo-timeline span.btn-green.atesteo-year-label,
.wp-block-group.atesteo-timeline .atesteo-year-label {
	width: 4.75em;
	min-width: 4.75em;
	max-width: 4.75em;
	margin: 0;
	justify-content: center;
	flex-shrink: 0;
}

.atesteo-timeline__text {
	display: block;
	line-height: 1.5;
}

/* Events: date | content aligned columns, flush left with「イベント」 */
.atesteo-timeline--events,
.wp-block-group.atesteo-timeline--events {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	text-align: left;
}

.entry-content .atesteo-timeline--events,
.entry-content .wp-block-group.atesteo-timeline--events {
	max-width: none !important;
}

.entry-content .atesteo-timeline--events .wp-block-group__inner-container,
.entry-content .wp-block-group.atesteo-timeline--events .wp-block-group__inner-container,
.entry-content .atesteo-timeline--events.is-layout-constrained,
.entry-content .wp-block-group.atesteo-timeline--events.is-layout-constrained,
.entry-content .wp-block-group.atesteo-timeline--events .is-layout-constrained {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.atesteo-timeline--events p.atesteo-timeline__row,
.wp-block-group.atesteo-timeline--events p.atesteo-timeline__row,
.entry-content .atesteo-timeline--events p.atesteo-timeline__row {
	display: grid !important;
	grid-template-columns: 13.5em minmax(0, 1fr);
	column-gap: 1em;
	align-items: baseline;
	width: 100%;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	padding: 0 !important;
	text-align: left !important;
	font-size: var(--atesteo-body-size);
	line-height: var(--atesteo-line-height);
}

.atesteo-timeline--events .atesteo-timeline__date,
.wp-block-group.atesteo-timeline--events span.atesteo-timeline__date {
	display: block;
	grid-column: 1;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
	margin: 0;
	padding: 0;
}

.atesteo-timeline--events .atesteo-timeline__text,
.wp-block-group.atesteo-timeline--events .atesteo-timeline__text {
	display: block;
	grid-column: 2;
	min-width: 0;
	margin: 0;
	padding: 0;
	line-height: 1.6;
}

.atesteo-timeline--events .atesteo-timeline__text .btn-green,
.atesteo-timeline--events .atesteo-timeline__text .btn-orange,
.atesteo-timeline--events .atesteo-timeline__text a.btn-green,
.atesteo-timeline--events .atesteo-timeline__text a.btn-orange {
	display: inline-flex;
	vertical-align: middle;
	margin: 0 0 0 0.5em;
	position: relative;
	top: -1px;
}

/* Event row block: 日付 | 内容 + その他（ボタンは内容の直後） */
.atesteo-timeline--events .atesteo-timeline__event-row,
.wp-block-group.atesteo-timeline--events .atesteo-timeline__event-row,
.entry-content .atesteo-timeline--events .atesteo-timeline__event-row,
.atesteo-timeline__event-row.is-editor {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 1em;
	row-gap: 0.15em;
	width: 100%;
	max-width: none !important;
	margin: 0 !important;
	padding: 0.15em 0;
	text-align: left !important;
	font-size: var(--atesteo-body-size);
	line-height: var(--atesteo-line-height);
}

.atesteo-timeline__event-row .atesteo-timeline__date {
	flex: 0 0 13.5em;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
	margin: 0;
}

.atesteo-timeline__event-row .atesteo-timeline__text {
	flex: 0 1 auto;
	max-width: 100%;
	min-width: 0;
	line-height: 1.6;
	margin: 0;
}

.atesteo-timeline__event-row .atesteo-timeline__extra {
	display: inline-flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em 0.5em;
	margin: 0 0 0 0.35em;
	min-width: 0;
}

.atesteo-timeline__event-row .atesteo-timeline__extra .btn-green,
.atesteo-timeline__event-row .atesteo-timeline__extra .btn-orange,
.atesteo-timeline__event-row .atesteo-timeline__extra .atesteo-badge,
.atesteo-timeline__event-row .atesteo-timeline__extra .atesteo-menu-item__badge {
	margin: 0;
}

/* Editor chrome for the “その他” slot */
.atesteo-timeline__event-row.is-editor {
	border: 1px dashed #c5d0d0;
	border-radius: 4px;
	padding: 0.5em;
	margin: 0 0 0.5em !important;
	background: #fafcfc;
}

.atesteo-timeline__event-row.is-editor .atesteo-timeline__extra {
	border: 1px dashed #c5d0d0;
	border-radius: 3px;
	padding: 0.25em 0.4em;
	min-height: 2.25em;
	margin-left: 0.35em;
}

.atesteo-timeline__extra-label {
	display: none;
	font-size: 11px;
	color: #6a7a7a;
	width: 100%;
	margin: 0 0 0.2em;
}

.atesteo-timeline__event-row.is-editor .atesteo-timeline__extra-label {
	display: block;
}

@media only screen and (max-width: 544px) {
	.wp-block-columns.atesteo-timeline__row {
		grid-template-columns: 4.25em minmax(0, 1fr);
		column-gap: 0.65em;
	}

	.atesteo-timeline .atesteo-year-label,
	.atesteo-timeline span.btn-green.atesteo-year-label,
	.wp-block-group.atesteo-timeline .atesteo-year-label {
		width: 4.25em;
		min-width: 4.25em;
		max-width: 4.25em;
		font-size: 13px;
		padding: 0 6px;
	}

	.atesteo-timeline--events p.atesteo-timeline__row,
	.wp-block-group.atesteo-timeline--events p.atesteo-timeline__row {
		grid-template-columns: 1fr;
		row-gap: 0.1em;
	}

	.atesteo-timeline--events .atesteo-timeline__date,
	.wp-block-group.atesteo-timeline--events span.atesteo-timeline__date,
	.atesteo-timeline__event-row .atesteo-timeline__date {
		flex-basis: 100%;
		white-space: normal;
	}

	.atesteo-timeline__event-row .atesteo-timeline__extra {
		margin-left: 0;
	}
}

/* Body size is controlled only by --atesteo-body-size (not 1.2em),
   so lists / paragraphs stay the same size. */

/* Dark/colored panels: force white headings & body (override site green h2) */
.entry-content .atesteo-panel,
.entry-content .wp-block-column.atesteo-panel {
	color: #fff;
}

.entry-content .atesteo-panel .wp-block-heading,
.entry-content .atesteo-panel h1,
.entry-content .atesteo-panel h2,
.entry-content .atesteo-panel h3,
.entry-content .atesteo-panel p,
.entry-content .atesteo-panel li,
.entry-content .atesteo-panel a {
	color: #fff !important;
}

.entry-content .atesteo-panel--teal {
	background: var(--atesteo-green);
	padding: 10px;
}

.entry-content .atesteo-panel--gray {
	background: #5d656c;
	padding: 10px;
}

/* Password form (/contact-pw/): space above submit */
.page-id-1215 .wpcf7 .wpcf7-submit,
.page-contact-pw .wpcf7 .wpcf7-submit {
	margin-top: 1.5em;
}
