.ototuan-category-seo {
	margin-top: 2rem;
	margin-bottom: 1.5rem;
}

.ototuan-category-seo__content > :first-child {
	margin-top: 0;
}

.ototuan-category-seo__content > :last-child {
	margin-bottom: 0;
}

.ototuan-category-seo__content h2,
.ototuan-category-seo__content h3,
.ototuan-category-seo__content h4 {
	margin-top: 1.35em;
	margin-bottom: 0.6em;
}

.ototuan-category-seo__content p,
.ototuan-category-seo__content ul,
.ototuan-category-seo__content ol {
	margin-bottom: 1em;
}

.ototuan-category-seo__content ul,
.ototuan-category-seo__content ol {
	padding-left: 1.35em;
}

.ototuan-category-seo__content img {
	max-width: 100%;
	height: auto;
}

.ototuan-category-seo__content a {
	text-decoration-thickness: from-font;
	text-underline-offset: 0.16em;
}

@media (max-width: 849px) {
	.ototuan-category-seo {
		margin-top: 1.5rem;
		margin-bottom: 1.25rem;
	}
}

/* ---------------------------------------------------------------------------
 * Bottom Content collapse.
 *
 * Every rule below is scoped to .ototuan-category-seo* and is inert until
 * JavaScript adds --collapsible, so the content stays fully expanded (and
 * never overlaid) when the script is unavailable. Deliberately independent of
 * the child theme .ott-readmore-* Description toggle: no shared class, ID,
 * state, or custom property.
 * ------------------------------------------------------------------------- */

.ototuan-category-seo {
	--ototuan-category-seo-collapsed-height: 320px;
	--ototuan-category-seo-fade: #ffffff;
	--ototuan-category-seo-accent: #c71117;
	--ototuan-category-seo-accent-contrast: #ffffff;
}

/* max-height, overflow and the gradient exist only once JS has confirmed the
 * content is long (--collapsible) and collapsed it (--collapsed). The rules
 * that follow therefore cannot clip content when JavaScript is off or broken.
 */
.ototuan-category-seo--collapsible .ototuan-category-seo__content {
	position: relative;
	overflow: hidden;
	transition: max-height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ototuan-category-seo--collapsed .ototuan-category-seo__content {
	max-height: var(--ototuan-category-seo-collapsed-height);
}

.ototuan-category-seo--collapsed .ototuan-category-seo__content::after {
	content: '';
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 5.5rem;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0) 0%,
		var(--ototuan-category-seo-fade) 100%
	);
	pointer-events: none;
}

/* Server-rendered button stays invisible until JS confirms it is needed. */
.ototuan-category-seo__toggle[hidden] {
	display: none;
}

/* Trailing empty paragraphs (the editor's habitual <p><br></p>) are dropped at
 * the presentation layer only, so they cannot inflate the measured height. The
 * class is applied by JavaScript; the stored cat_footer value is unchanged.
 */
.ototuan-category-seo__content .ototuan-category-seo__blank-tail {
	display: none;
}

.ototuan-category-seo__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 1rem auto 0;
	padding: 0.5rem 2rem;
	border: 1px solid var(--ototuan-category-seo-accent);
	border-radius: 6px;
	background: var(--ototuan-category-seo-accent-contrast);
	color: var(--ototuan-category-seo-accent);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ototuan-category-seo__toggle-wrap {
	display: flex;
	justify-content: center;
}

.ototuan-category-seo__toggle:hover,
.ototuan-category-seo__toggle:focus-visible {
	background: var(--ototuan-category-seo-accent);
	color: var(--ototuan-category-seo-accent-contrast);
}

.ototuan-category-seo__toggle:focus-visible {
	outline: 3px solid rgba(199, 17, 23, 0.4);
	outline-offset: 2px;
}

.ototuan-category-seo__toggle-icon {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-top: -3px;
	margin-left: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
	vertical-align: middle;
}

.ototuan-category-seo--expanded .ototuan-category-seo__toggle-icon {
	margin-top: 2px;
	transform: rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
	.ototuan-category-seo--collapsible .ototuan-category-seo__content,
	.ototuan-category-seo__toggle,
	.ototuan-category-seo__toggle-icon {
		transition: none;
	}
}
