/*
 * Shared primitives for the 561 blocks. Values come only from theme.json
 * custom properties; there are no colours, stacks or radii in this file.
 *
 * .base561-button is the one CTA style every block uses, so a brand's button
 * is decided once (theme.json elements.button + custom.radius.control).
 * Hover, focus, active and focus-visible are all stated, and the selector is
 * two classes deep so a bare `a:hover` from a plugin cannot outrank it
 * (wordpress-development trap 8).
 */

.wp-site-blocks .base561-button,
.editor-styles-wrapper .base561-button {
	display: inline-block;
	padding: 1.05rem 2.25rem;
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-contrast);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.wp-site-blocks .base561-button:hover,
.wp-site-blocks .base561-button:focus,
.wp-site-blocks .base561-button:active,
.wp-site-blocks .base561-button:focus-visible {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-site-blocks .base561-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* Secondary action: a text link, not a second button. */
.wp-site-blocks .base561-link,
.editor-styles-wrapper .base561-link {
	display: inline-block;
	padding-block: 1.05rem;
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.28em;
}

.wp-site-blocks .base561-link:hover,
.wp-site-blocks .base561-link:focus-visible {
	color: var(--wp--preset--color--accent);
}

/* Editor-only hints printed by render.php when a required field is empty. */
.base561-editor-hint {
	margin: 0;
	padding: var(--wp--preset--spacing--20);
	border: var(--wp--custom--rule--width) dashed var(--wp--preset--color--rule);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

@media (prefers-reduced-motion: reduce) {
	.wp-site-blocks .base561-button { transition: none; }
}

/*
 * Full-width 561 blocks keep their content on the same left edge as wide
 * content: the gutter is the root padding, or half the space outside the wide
 * size, whichever is larger. Blocks use it for padding, and bleeding assets
 * use its negative. 100vw includes a classic (Windows) scrollbar, so there the
 * edge can sit about 8px outside the wide column; overlay scrollbars (macOS,
 * iOS, Android) are exact.
 */
[class*="wp-block-five61-"].alignfull {
	--base561-gutter: max(var(--wp--style--root--padding-left), calc((100vw - var(--wp--style--global--wide-size)) / 2));
}

/* Poster-scale headings: a long word or URL must wrap, not push the page
   sideways at 375px. */
.wp-site-blocks :is(h1, h2, h3),
.editor-styles-wrapper :is(h1, h2, h3) {
	overflow-wrap: break-word;
}
