/*
 * ReVsults base — always loaded (handle: revsults-style).
 * Only what theme.json cannot express and what every page needs. Everything
 * component-specific lives in assets/css/components and assets/css/blocks
 * and loads on demand.
 */

/* ---------- accessibility ---------- */

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--secondary, var(--wp--preset--color--primary));
	outline-offset: 3px;
	border-radius: var(--wp--custom--radius--small, 0.25rem);
}

.has-contrast-background-color :focus-visible,
.is-style-section-dark :focus-visible,
.is-style-section-brand :focus-visible {
	outline-color: var(--wp--preset--color--accent, currentColor);
}

.is-style-section-accent :focus-visible {
	outline-color: var(--wp--preset--color--contrast);
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--base-2);
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: var(--wp--preset--color--contrast);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ---------- typography niceties ---------- */

h1, h2, h3, summary, .wp-block-post-title {
	text-wrap: balance;
}

p, li, figcaption {
	text-wrap: pretty;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wp--custom--layout--header-height, 4.5rem) + 1rem);
}

/* ---------- media ---------- */

img {
	height: auto;
	max-width: 100%;
}

.wp-block-embed iframe {
	max-width: 100%;
}

.wp-block-post-featured-image a,
.wp-block-post-featured-image img {
	display: block;
	border-radius: inherit;
}

/* ---------- layout shell ---------- */

.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part:last-child {
	margin-block-start: 0;
}

/* Sticky header shell: add the class "revsults-header" plus core's sticky
   position to the header pattern's outer group. */
.revsults-header {
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base-2) 88%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: var(--wp--custom--border--width, 1px) solid var(--wp--preset--color--border);
}

/* Empty slots (language switcher without WPML) take no space. */
.revsults-lang-switcher:empty {
	display: none;
}

/* Placeholder marker for the editor and launch checklist; invisible on the front end. */
.revsults-placeholder {
	position: relative;
}

/* Legal pages (default page template): headings belong to their text. */
.page-template-default .wp-block-post-content > h2,
.page-template-page-legal .wp-block-post-content > h2 {
	margin-block-start: var(--wp--preset--spacing--50);
}

/* ---------- comments / post navigation (blog) ---------- */

.wp-block-post-navigation-link .post-navigation-link__label {
	display: block;
	color: var(--wp--preset--color--contrast-2);
	font-weight: 400;
}

.wp-block-comments .comment-respond {
	margin-top: var(--wp--preset--spacing--50);
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
