/**
 * ERPSAP global base styles.
 *
 * @package ERPSAP_Theme
 */

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

/* Document foundation. */
html {
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	margin: 0;
	background: var(--erpsap-color-background);
	color: var(--erpsap-color-text);
	font-family: var(--erpsap-font-sans);
	font-size: var(--erpsap-font-size-base);
	line-height: var(--erpsap-line-height-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Media elements. */
img,
picture,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

iframe {
	max-width: 100%;
	border: 0;
}

/* Form elements. */
button,
input,
select,
textarea {
	font: inherit;
}

button,
input,
select,
textarea {
	max-width: 100%;
}

/* Links. */
a {
	color: var(--erpsap-color-link);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

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

a:active {
	color: var(--erpsap-color-primary-active);
}

/* Typography. */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: 0 0.75em;
	color: var(--erpsap-color-heading);
	font-weight: 700;
	line-height: var(--erpsap-line-height-heading);
	text-wrap: balance;
}

h1 {
	font-size: clamp(2rem, 5vw, var(--erpsap-font-size-3xl));
}

h2 {
	font-size: clamp(1.625rem, 4vw, var(--erpsap-font-size-2xl));
}

h3 {
	font-size: var(--erpsap-font-size-xl);
}

h4 {
	font-size: var(--erpsap-font-size-lg);
}

h5,
h6 {
	font-size: var(--erpsap-font-size-md);
}

p {
	margin-block: 0 1.25em;
}

ul,
ol {
	margin-block: 0 1.25em;
	padding-inline-start: 1.5em;
}

blockquote {
	margin: 0 0 var(--erpsap-space-5);
	padding-inline-start: var(--erpsap-space-4);
	border-inline-start:
		0.25rem solid var(--erpsap-color-primary);
	color: var(--erpsap-color-muted);
}

code,
kbd,
samp,
pre {
	font-family: var(--erpsap-font-mono);
}

code {
	padding: 0.125em 0.35em;
	border-radius: var(--erpsap-radius-sm);
	background: var(--erpsap-color-surface);
	font-size: 0.9em;
}

pre {
	max-width: 100%;
	overflow-x: auto;
	padding: var(--erpsap-space-4);
	border: var(--erpsap-border-width) solid
		var(--erpsap-color-border);
	border-radius: var(--erpsap-radius-md);
	background: var(--erpsap-color-surface);
}

pre code {
	padding: 0;
	background: transparent;
}

/* Tables. */
table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: var(--erpsap-space-3);
	border: var(--erpsap-border-width) solid
		var(--erpsap-color-border);
	text-align: start;
	vertical-align: top;
}

th {
	background: var(--erpsap-color-surface);
	color: var(--erpsap-color-heading);
	font-weight: 700;
}

/* Main content region. */
.site-main {
	min-height: 50vh;
}

/* Keyboard focus. */
:focus-visible {
	outline: 3px solid var(--erpsap-color-primary);
	outline-offset: 3px;
}

/* Screen-reader-only content. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* Make hidden accessibility links visible on focus. */
.screen-reader-text:focus {
	position: fixed;
	z-index: 100000;
	top: var(--erpsap-space-3);
	left: var(--erpsap-space-3);
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--erpsap-space-3) var(--erpsap-space-4);
	overflow: visible;
	clip: auto;
	clip-path: none;
	border-radius: var(--erpsap-radius-sm);
	background: var(--erpsap-color-navy);
	color: var(--erpsap-color-white);
	font-weight: 700;
	text-decoration: none;
}

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