/*
 * Virexa base: reset, typography, layout primitives and accessibility helpers.
 */

/* Reset ------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--vx-header-height) + var(--vx-space-4));
}

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--vx-font-sans);
	font-size: var(--vx-text-body);
	line-height: var(--vx-leading-body);
	color: var(--vx-color-text);
	background: var(--vx-color-background);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body > .site-main {
	flex: 1 0 auto;
}

img,
svg,
video,
canvas,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

img {
	display: block;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

[hidden] {
	display: none !important; /* Must beat component display rules. */
}

/* Typography ------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--vx-space-4);
	font-weight: var(--vx-weight-bold);
	line-height: var(--vx-leading-tight);
	letter-spacing: var(--vx-tracking-tight);
	color: var(--vx-color-text);
	text-wrap: balance;
}

h1 {
	font-size: var(--vx-text-h1);
	font-weight: var(--vx-weight-extrabold);
}

h2 {
	font-size: var(--vx-text-h2);
}

h3 {
	font-size: var(--vx-text-h3);
	line-height: var(--vx-leading-snug);
	letter-spacing: -0.01em;
}

h4,
h5,
h6 {
	font-size: var(--vx-text-h4);
	line-height: var(--vx-leading-snug);
	letter-spacing: 0;
}

p,
ul,
ol,
dl,
blockquote,
figure,
pre,
table {
	margin: 0 0 var(--vx-space-4);
}

p {
	text-wrap: pretty;
}

a {
	color: var(--vx-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--vx-transition);
}

a:hover {
	color: var(--vx-color-primary-dark);
}

strong,
b {
	font-weight: var(--vx-weight-bold);
}

small {
	font-size: var(--vx-text-small);
}

code,
kbd,
pre {
	font-family: var(--vx-font-mono);
	font-size: 0.9em;
}

hr {
	height: 1px;
	margin: var(--vx-space-8) 0;
	border: 0;
	background: var(--vx-color-border);
}

::selection {
	background: var(--vx-color-primary-light);
	color: var(--vx-color-primary-darker);
}

.vx-display {
	font-size: var(--vx-text-display);
	font-weight: var(--vx-weight-extrabold);
	line-height: 1.08;
	letter-spacing: -0.03em;
}

.vx-lead {
	font-size: var(--vx-text-lead);
	color: var(--vx-color-text-muted);
}

.vx-text-muted {
	color: var(--vx-color-text-muted);
}

.vx-text-small {
	font-size: var(--vx-text-small);
}

.vx-caption {
	font-size: var(--vx-text-caption);
	color: var(--vx-color-text-subtle);
}

.vx-highlight {
	color: var(--vx-color-primary);
}

/* Focus ------------------------------------------------------------------ */

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--vx-color-primary);
	outline-offset: 3px;
	border-radius: var(--vx-radius-sm);
}

/* Layout ----------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: calc(var(--vx-container) + 2 * var(--vx-gutter));
	margin-inline: auto;
	padding-inline: var(--vx-gutter);
}

.container--narrow {
	max-width: calc(var(--vx-container-narrow) + 2 * var(--vx-gutter));
}

.section {
	padding-block: var(--vx-section-space);
}

.section--tight {
	padding-block: calc(var(--vx-section-space) * 0.6);
}

.section--alt {
	background: var(--vx-color-surface-alt);
}

.vx-grid {
	display: grid;
	gap: var(--vx-space-6);
}

@media (min-width: 640px) {
	.vx-grid--2,
	.vx-grid--3,
	.vx-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.vx-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.vx-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.vx-stack > * + * {
	margin-top: var(--vx-space-4);
}

.vx-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--vx-space-3);
}

/* Accessibility helpers -------------------------------------------------- */

.screen-reader-text {
	position: absolute !important; /* WordPress core convention. */
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important; /* WordPress core convention. */
}

.skip-link:focus {
	position: fixed !important; /* Must override .screen-reader-text. */
	top: var(--vx-space-2);
	left: var(--vx-space-2);
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--vx-space-3) var(--vx-space-5);
	clip: auto;
	border-radius: var(--vx-radius-md);
	background: var(--vx-color-surface);
	color: var(--vx-color-primary);
	font-weight: var(--vx-weight-semibold);
	box-shadow: var(--vx-shadow-md);
	text-decoration: none;
}

.site-main:focus {
	outline: none;
}

/* WordPress core alignment and caption classes ------------------------- */

.alignleft {
	float: left;
	margin: 0 var(--vx-space-6) var(--vx-space-4) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--vx-space-4) var(--vx-space-6);
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.wp-caption-text,
figcaption {
	margin-top: var(--vx-space-2);
	font-size: var(--vx-text-small);
	color: var(--vx-color-text-subtle);
}
