/*
 * Global custom site CSS.
 *
 * Define client-specific design rules in theme.json first. Add CSS here only
 * when the Global Styles system cannot express the required behaviour.
 */

.skip-link {
	position: absolute;
	inset-inline-start: -9999px;
}

.skip-link:focus {
	inset-block-start: var(--wp--preset--spacing--xx-small);
	inset-inline-start: var(--section-gutter);
	z-index: 100000;
	padding: var(--wp--preset--spacing--xx-small) var(--wp--preset--spacing--x-small);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--small);
}

/*
 * Template-level page layout. ACF blocks can use alignwide or alignfull in
 * their block.json support settings. Full-width blocks own their inner padding.
 */
.site-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, var(--layout-content-max)) minmax(0, 1fr);
	padding-inline: var(--section-gutter);
}

.site-main > * {
	grid-column: 2;
	min-width: 0;
}

.site-main > .alignwide {
	grid-column: 1 / -1;
	width: min(100%, var(--layout-wide-max));
	justify-self: center;
}

.site-main > .alignfull {
	grid-column: 1 / -1;
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
}

/* Keep inline copy links readable on both light and dark block backgrounds. */
:is(.site-main, .editor-styles-wrapper) :where(p, li, blockquote, figcaption) a:not([class]):not(.wp-element-button) {
	color: inherit;
	text-decoration-color: currentColor;
	text-decoration-thickness: 0.0625em;
	text-underline-offset: 0.18em;
	transition: text-decoration-thickness var(--transition);
}

:is(.site-main, .editor-styles-wrapper) :where(p, li, blockquote, figcaption) a:not([class]):not(.wp-element-button):hover,
:is(.site-main, .editor-styles-wrapper) :where(p, li, blockquote, figcaption) a:not([class]):not(.wp-element-button):focus-visible {
	color: inherit;
	text-decoration-thickness: 0.14em;
}

:is(.site-main, .editor-styles-wrapper) :where(p, li, blockquote, figcaption) a:not([class]):not(.wp-element-button):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Top-level page blocks sit in a grid on the front end, so they have no flow gap. */
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > * {
	margin-block-start: 0;
}

/* Accessibility: visible focus, sticky-header clearance and resilient text reflow. */
:root :where(.site-header, .site-main, .site-footer) :is(a, button, input, select, textarea, [tabindex]):focus-visible,
.skip-link:focus-visible {
 outline: 2px solid var(--primary);
 outline-offset: 2px;
 box-shadow: 0 0 0 4px var(--base);
}
.site-main:focus { outline: none; }
:where(.site-header, .site-main, .site-footer) :is(a, button, input, select, textarea, [tabindex]) {
 scroll-margin-block: 9rem 2rem;
}
:where(.site-main, .site-footer) :is(p, h1, h2, h3, h4, h5, h6, li) { overflow-wrap: anywhere; }
.site-footer__social a:focus-visible { opacity: 1; }

/* Default Quote block, shared by the site and the block editor. */
:is(.site-main, .editor-styles-wrapper .block-editor-block-list__layout.is-root-container) blockquote.wp-block-quote:where(:not(.is-style-plain, .is-style-large, .is-large)) {
	margin-block: calc(var(--space-s) * 1.25);
}

blockquote.wp-block-quote:where(:not(.is-style-plain, .is-style-large, .is-large)) {
	margin-inline: 0;
	padding: 0;
	border: 0;
	font-family: var(--font-body);
	font-size: calc(var(--text-s) * 1.15);
	font-style: normal;
	font-weight: var(--body-font-weight);
	line-height: 1.5;
}

blockquote.wp-block-quote:where(:not(.is-style-plain, .is-style-large, .is-large))::before {
	display: inline-block;
	width: clamp(1.75rem, 3vw, 2.5rem);
	aspect-ratio: 422 / 301;
	background: url('../icons/general/quotes-opening.png') center / contain no-repeat;
	content: '';
}

blockquote.wp-block-quote:where(:not(.is-style-plain, .is-style-large, .is-large)) > p {
	margin-block: 0 var(--space-xs);
	padding-left: var(--space-xs);
	font-size: inherit;
	line-height: inherit;
}

blockquote.wp-block-quote:where(:not(.is-style-plain, .is-style-large, .is-large)) > :is(cite, footer) {
	display: block;
	margin-block-start: var(--space-xs);
	padding-left: var(--space-xs);
	color: inherit;
	font-size: var(--text-xs);
	font-style: normal;
	font-weight: 700;
	line-height: 1.4;
}
