/* Association Core theme extras — rules theme.json can't express.

   Plugin-token bridge: map the plugin's --ac-* custom properties onto the
   theme's --wp--preset--color--* variables. Because a style variation reliably
   changes the presets, the plugin's events page + reusable blocks follow the
   picked variation automatically — no per-variation --ac-* overrides needed.
   Doubled :root:root (0,2,0) beats the plugin tokens.css :root (0,1,0)
   regardless of stylesheet load order. */

:root:root {
	--ac-primary: var(--wp--preset--color--primary);
	--ac-accent: var(--wp--preset--color--accent);
	--ac-ink: var(--wp--preset--color--ink);
	--ac-muted: var(--wp--preset--color--muted);
	--ac-paper: var(--wp--preset--color--paper);
	--ac-soft: var(--wp--preset--color--soft);
	--ac-surface: var(--wp--preset--color--surface);
	--ac-line: var(--wp--preset--color--line);
	/* Derived soft accent (the plugin uses ~14% alpha). */
	--ac-accent-soft: color-mix(in srgb, var(--wp--preset--color--accent) 14%, transparent);
}

/* Single-heading model: plugin pages (body.ac-plugin-page, added by the plugin)
   render their own heading, so hide the theme's page title — but never the
   hero's title (page-with-hero), which IS the page's single heading. */
.ac-plugin-page .wp-block-post-title:not(.ac-hero-title) {
	display: none;
}

/* Hero fallback: with no featured image the 50% dim would wash primary over
   paper — make the overlay solid so the hero is a full-strength branded band. */
.ac-hero:not(:has(.wp-block-cover__image-background)) .wp-block-cover__background {
	opacity: 1;
}

/* Guard against the classic 100vw-includes-scrollbar overflow from the full-bleed
   hero below (and any alignfull). `clip` prevents horizontal scroll without
   creating a scroll container, so sticky positioning still works. It must be on
   BODY (not only HTML): overflow on the root element propagates to the viewport
   and won't clip a viewport-width breakout — body clips its own descendants. */
html,
body {
	overflow-x: clip;
}

/* The plugin's [association_hero] renders inside the constrained content, so on
   the home page it sits boxed while the theme's Cover hero spans full width.
   Break the plugin hero out to the full viewport so it matches. (The centered
   content container makes 50% - 50vw resolve to the exact left offset.) */
.ac-plugin .ac-hero {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
}
