/*
 * 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.
 */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

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

.skip-link:focus {
	inset-block-start: var(--space-xxs);
	inset-inline-start: var(--section-gutter);
	z-index: 100000;
	padding: var(--space-xxs) var(--space-xs);
	background: var(--contrast);
	color: var(--base);
	box-shadow: var(--box-shadow-s);
}

/* Keep assistive text available without leaving it visible in the layout. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/*
 * 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(--content-size)) minmax(0, 1fr);
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	padding-inline: var(--section-gutter);
}

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

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

.site-main > .alignfull {
	grid-column: 1 / -1;
	width: calc(100% + (var(--section-gutter) * 2));
	max-width: none;
	margin-inline: calc(var(--section-gutter) * -1);
}

/* Prevent unbroken strings and embedded media from widening narrow templates. */
.site-main :is(img, video, iframe, embed, object) {
	max-width: 100%;
}

.site-main :is(.ohso-hero__pattern, .ohso-hero__ellipse, .ohso-why-choose__pattern) {
	max-width: none;
}

.site-main :is(p, li, h1, h2, h3, h4, h5, h6, a) {
	overflow-wrap: anywhere;
}

/* Shared WordPress button states for CTAs placed in editable rich content. */
.site-main :is(.wp-element-button, .wp-block-button__link) {
	transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

@media (hover: hover) {
	.site-main :is(.wp-element-button, .wp-block-button__link):hover {
		border-color: var(--primary-dark);
		background-color: var(--primary-dark);
		color: var(--base);
		text-decoration: none;
	}
}

.site-main :is(.wp-element-button, .wp-block-button__link):focus-visible {
	outline: 0.1875rem solid var(--primary-dark);
	outline-offset: 0.1875rem;
}

/* Core/editor content can introduce regular links and form controls. */
.site-main :is(a, button, input, select, textarea, summary):focus-visible {
	outline: 0.1875rem solid var(--primary-dark);
	outline-offset: 0.1875rem;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.site-main :is(.wp-element-button, .wp-block-button__link):hover {
		transform: translateY(-0.125rem);
	}
}

@media (max-width: 30rem) {
	.site-main {
		padding-inline: 1rem;
	}

	.site-main > .alignfull {
		width: calc(100% + 2rem);
		margin-inline: -1rem;
	}
}


/* Prevent gaps between blocks in editor view */
:root :where(.is-layout-flow) > * {
    margin-block-start: 0 !important;
}
