/*
 * Global block behavior only. Design values live in theme.json.
 * Keep selectors scoped to content blocks so editor chrome is unaffected.
 */

.wp-block-heading,
.wp-block-post-title,
.wp-block-post-content {
	overflow-wrap: break-word;
}

.wp-block-heading.is-style-editorial-display {
	font-size: var(--wp--preset--font-size--display);
	font-weight: 800;
	line-height: 0.92;
	letter-spacing: 0;
	text-transform: uppercase;
}

.ccf-editorial-lede {
	font-family: var(--wp--preset--font-family--editorial);
	font-size: clamp(1.4rem, 1.15rem + 0.8vw, 2rem);
	font-weight: 500;
	line-height: 1.3;
}

:where(.wp-site-blocks, .editor-styles-wrapper) a {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 0.08em;
	transition: color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing),
		background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing),
		border-color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing);
}

:where(.wp-site-blocks, .editor-styles-wrapper) :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--forest);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px var(--wp--preset--color--ivory);
}

.wp-block-button .wp-block-button__link {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
	text-align: center;
	text-decoration: none;
	transition: color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing),
		background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing),
		border-color var(--wp--custom--motion--fast) var(--wp--custom--motion--easing);
}

/* Respect explicit editor color choices; these are the default variants. */
.wp-block-button:not(.is-style-outline):not(.is-style-editorial-link) .wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--forest-hover);
}

.wp-block-button:not(.is-style-outline):not(.is-style-editorial-link) .wp-block-button__link:not(.has-background):active {
	background-color: var(--wp--preset--color--forest-active);
}

.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background) {
	background-color: transparent;
}

.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color) {
	color: var(--wp--preset--color--forest);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	border: 1px solid currentColor;
}

.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):not(.has-text-color):hover {
	background-color: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--cream);
}

.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):not(.has-text-color):active {
	background-color: var(--wp--preset--color--forest-active);
	color: var(--wp--preset--color--cream);
}

/* Tertiary CTA: native link content, decorative CSS arrow, no new markup. */
.wp-block-button.is-style-editorial-link .wp-block-button__link {
	padding-inline: 0;
	border: 0;
	gap: var(--wp--preset--spacing--2);
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.wp-block-button.is-style-editorial-link .wp-block-button__link:not(.has-background) {
	background-color: transparent;
}

.wp-block-button.is-style-editorial-link .wp-block-button__link:not(.has-text-color) {
	color: var(--wp--preset--color--forest);
}

.wp-block-button.is-style-editorial-link .wp-block-button__link:not(.has-text-color):hover {
	color: var(--wp--preset--color--forest-hover);
}

.wp-block-button.is-style-editorial-link .wp-block-button__link:not(.has-text-color):active {
	color: var(--wp--preset--color--forest-active);
}

.wp-block-button.is-style-editorial-link .wp-block-button__link::after {
	content: "";
	flex: 0 0 1em;
	width: 1em;
	height: 0.65em;
	background-color: currentColor;
	clip-path: polygon(0 44%, 78% 44%, 52% 10%, 60% 0, 100% 50%, 60% 100%, 52% 90%, 78% 56%, 0 56%);
}

:where([dir="rtl"]) .wp-block-button.is-style-editorial-link .wp-block-button__link::after {
	transform: scaleX(-1);
}

/* Native disabled controls only; an anchor requires real behavioral handling. */
:where(.wp-site-blocks, .editor-styles-wrapper) button:disabled {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	border-color: var(--wp--preset--color--control-border);
	cursor: not-allowed;
}

.wp-block-navigation .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.wp-block-image img,
.wp-block-site-logo img {
	max-width: 100%;
}

.wp-block-image figcaption,
.wp-block-gallery figcaption {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
	:where(.wp-site-blocks, .editor-styles-wrapper) a,
	.wp-block-button .wp-block-button__link {
		transition: none;
	}
}
