/**
 * Midashi Designs — shared front-end and editor styles.
 */
.mjh-heading-wrap {
	--mjh-accent: #2563eb;
	--mjh-text: currentColor;
	box-sizing: border-box;
	margin-block: 1.8em 1em;
	width: 100%;
}

.mjh-heading-wrap .mjh-heading {
	box-sizing: border-box;
	color: var(--mjh-text);
	font-family: inherit;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.035em;
	line-height: 1.45;
	margin: 0;
	position: relative;
	text-transform: none;
}

.mjh-heading-wrap h2.mjh-heading {
	font-size: clamp(1.55rem, 1.3rem + 0.9vw, 2.1rem);
}

.mjh-heading-wrap h3.mjh-heading {
	font-size: clamp(1.3rem, 1.14rem + 0.55vw, 1.7rem);
}

.mjh-heading-wrap h4.mjh-heading {
	font-size: clamp(1.12rem, 1.02rem + 0.35vw, 1.38rem);
}

.mjh-heading__text {
	position: relative;
	z-index: 1;
}

/* 01: Left line */
.mjh-style-left-line .mjh-heading {
	padding: 0.38em 0.6em 0.38em 0.9em;
}

.mjh-style-left-line .mjh-heading::before {
	background: var(--mjh-accent);
	border-radius: 999px;
	box-shadow: 0.36em 0 0 color-mix(in srgb, var(--mjh-accent) 22%, transparent);
	content: "";
	inset: 0.12em auto 0.12em 0;
	position: absolute;
	width: 0.23em;
}

/* 02: Accent underline */
.mjh-style-underline .mjh-heading {
	border-bottom: 1px solid color-mix(in srgb, var(--mjh-accent) 35%, transparent);
	padding: 0.2em 0.15em 0.52em;
}

.mjh-style-underline .mjh-heading::after {
	background: var(--mjh-accent);
	border-radius: 999px;
	bottom: -2px;
	content: "";
	height: 4px;
	left: 0;
	position: absolute;
	width: min(7rem, 32%);
}

/* 03: Double line */
.mjh-style-double-line .mjh-heading {
	border-bottom: 1px solid var(--mjh-accent);
	border-top: 1px solid var(--mjh-accent);
	padding: 0.58em 0.72em;
}

.mjh-style-double-line .mjh-heading::before,
.mjh-style-double-line .mjh-heading::after {
	background: var(--mjh-accent);
	content: "";
	height: 3px;
	position: absolute;
	width: 18%;
}

.mjh-style-double-line .mjh-heading::before {
	left: 0;
	top: -1px;
}

.mjh-style-double-line .mjh-heading::after {
	bottom: -1px;
	right: 0;
}

/* 04: Modern frame */
.mjh-style-modern-frame {
	padding: 0 0.35em 0.35em 0;
}

.mjh-style-modern-frame .mjh-heading {
	background: var(--mjh-accent);
	border: 2px solid var(--mjh-accent);
	box-shadow: 0.35em 0.35em 0 color-mix(in srgb, var(--mjh-accent) 28%, transparent);
	color: #fff;
	padding: 0.55em 0.8em;
}

/* 05: Ribbon */
.mjh-style-ribbon {
	padding-inline: 0.45em;
}

.mjh-style-ribbon .mjh-heading {
	background: var(--mjh-accent);
	box-shadow: 0 0.35em 1em color-mix(in srgb, var(--mjh-accent) 24%, transparent);
	color: #fff;
	isolation: isolate;
	padding: 0.52em 0.95em;
}

.mjh-style-ribbon .mjh-heading::before,
.mjh-style-ribbon .mjh-heading::after {
	background: color-mix(in srgb, var(--mjh-accent) 72%, #000);
	bottom: -0.42em;
	content: "";
	height: 0.55em;
	position: absolute;
	width: 0.45em;
	z-index: -1;
}

.mjh-style-ribbon .mjh-heading::before {
	clip-path: polygon(100% 0, 100% 100%, 0 0);
	left: 0;
}

.mjh-style-ribbon .mjh-heading::after {
	clip-path: polygon(0 0, 100% 0, 0 100%);
	right: 0;
}

/* 06: Brackets */
.mjh-style-brackets .mjh-heading {
	padding: 0.5em 1.05em;
}

.mjh-style-brackets .mjh-heading::before,
.mjh-style-brackets .mjh-heading::after {
	border-block: 3px solid var(--mjh-accent);
	content: "";
	inset-block: 0;
	position: absolute;
	width: 0.45em;
}

.mjh-style-brackets .mjh-heading::before {
	border-left: 3px solid var(--mjh-accent);
	left: 0;
}

.mjh-style-brackets .mjh-heading::after {
	border-right: 3px solid var(--mjh-accent);
	right: 0;
}

/* 07: Dot line */
.mjh-style-dot-line .mjh-heading {
	padding: 0.42em 0.2em 0.65em 1.05em;
}

.mjh-style-dot-line .mjh-heading::before {
	background: var(--mjh-accent);
	border-radius: 50%;
	box-shadow: 0 0 0 0.22em color-mix(in srgb, var(--mjh-accent) 18%, transparent);
	content: "";
	height: 0.42em;
	left: 0.25em;
	position: absolute;
	top: 0.92em;
	width: 0.42em;
}

.mjh-style-dot-line .mjh-heading::after {
	background-image: radial-gradient(circle, var(--mjh-accent) 1.5px, transparent 1.8px);
	background-position: left center;
	background-repeat: repeat-x;
	background-size: 8px 4px;
	bottom: 0;
	content: "";
	height: 4px;
	left: 0;
	opacity: 0.72;
	position: absolute;
	right: 0;
}

/* 08: Corner */
.mjh-style-corner .mjh-heading {
	background: color-mix(in srgb, var(--mjh-accent) 7%, transparent);
	padding: 0.68em 0.85em;
}

.mjh-style-corner .mjh-heading::before,
.mjh-style-corner .mjh-heading::after {
	content: "";
	height: 0.72em;
	position: absolute;
	width: 0.72em;
}

.mjh-style-corner .mjh-heading::before {
	border-left: 3px solid var(--mjh-accent);
	border-top: 3px solid var(--mjh-accent);
	left: 0;
	top: 0;
}

.mjh-style-corner .mjh-heading::after {
	border-bottom: 3px solid var(--mjh-accent);
	border-right: 3px solid var(--mjh-accent);
	bottom: 0;
	right: 0;
}

/* 09: Center line */
.mjh-style-center-line .mjh-heading {
	align-items: center;
	display: flex;
	gap: 0.75em;
	justify-content: center;
	text-align: center;
}

.mjh-style-center-line .mjh-heading::before,
.mjh-style-center-line .mjh-heading::after {
	background: linear-gradient(90deg, transparent, var(--mjh-accent));
	content: "";
	flex: 1 1 2rem;
	height: 2px;
	max-width: 6rem;
}

.mjh-style-center-line .mjh-heading::after {
	background: linear-gradient(90deg, var(--mjh-accent), transparent);
}

/* 10: Level label */
.mjh-style-level-label .mjh-heading {
	align-items: center;
	border-bottom: 2px solid var(--mjh-accent);
	display: flex;
	gap: 0.65em;
	padding: 0.35em 0 0.5em;
}

.mjh-style-level-label .mjh-heading::before {
	background: var(--mjh-accent);
	border-radius: 0.35em;
	color: #fff;
	content: attr(data-level);
	font-family: ui-sans-serif, system-ui, sans-serif;
	font-size: 0.48em;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1;
	padding: 0.62em 0.55em;
}

/* data-level lives on the wrapper; repeat it on the pseudo-element via inheritance workaround. */
.mjh-style-level-label[data-level="H2"] .mjh-heading::before { content: "H2"; }
.mjh-style-level-label[data-level="H3"] .mjh-heading::before { content: "H3"; }
.mjh-style-level-label[data-level="H4"] .mjh-heading::before { content: "H4"; }

@media (max-width: 600px) {
	.mjh-heading-wrap {
		margin-block: 1.45em 0.85em;
	}

	.mjh-style-center-line .mjh-heading {
		gap: 0.5em;
	}

	.mjh-style-center-line .mjh-heading::before,
	.mjh-style-center-line .mjh-heading::after {
		max-width: 2.5rem;
	}
}

@media (forced-colors: active) {
	.mjh-heading-wrap .mjh-heading {
		border-color: currentColor;
	}
}

