/**
 * Base layer — element defaults and resets.
 *
 * Targets raw HTML elements (no class hooks). Consumes design tokens from
 * tokens.css. Components inherit these defaults and override only what
 * their UI specifically needs.
 *
 * @package OpcinaTema
 */

*,
*::before,
*::after {
	box-sizing: border-box;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

*::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

html {
	min-height: 100%;
	overflow-x: hidden;
	scroll-behavior: smooth;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	overflow-x: clip;
	background: var(--mt-page-background);
	color: var(--mt-ink);
	font-family: var(--mt-font-sans);
	font-size: var(--mt-type-body);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
}

@supports not (overflow: clip) {
	body {
		overflow-x: hidden;
	}
}

body > main {
	flex: 1 0 auto;
}

a {
	color: inherit;
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.16em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid var(--mt-color-primary-bright);
	outline-offset: 3px;
}

img {
	display: block;
	height: auto;
	max-width: 100%;
}

p {
	margin-block: 0 var(--mt-space-md);
}

p:last-child {
	margin-block-end: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: 0 var(--mt-space-md);
	font-weight: 700;
	line-height: 1.25;
}

h1 { font-size: var(--mt-heading-size-1); }
h2 { font-size: var(--mt-heading-size-2); }
h3 { font-size: var(--mt-heading-size-3); }
h4 { font-size: var(--mt-heading-size-4); }
h5 { font-size: var(--mt-heading-size-5); }
h6 { font-size: var(--mt-heading-size-6); }

ul,
ol {
	margin-block: 0 var(--mt-space-md);
	padding-inline-start: var(--mt-space-xl);
}

ul ul,
ul ol,
ol ol,
ol ul {
	margin-block-end: 0;
}

li {
	margin-block: var(--mt-space-xs) 0;
}

blockquote {
	margin: 0 0 var(--mt-space-lg);
	padding-inline-start: var(--mt-space-md);
	border-inline-start: 3px solid var(--mt-color-border, #d9dde1);
}

hr {
	border: 0;
	border-top: 1px solid var(--mt-color-border, #d9dde1);
	margin-block: var(--mt-space-lg);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
	background: transparent;
	border: 0;
	padding: 0;
}

label {
	display: inline-block;
}

figure {
	margin: 0;
}

table {
	border-collapse: collapse;
	width: 100%;
}

.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 {
	z-index: 1000;
	top: 1rem;
	left: 1rem;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	clip: auto;
	background: var(--mt-ink);
	color: var(--mt-paper);
}

/*
 * Respect the OS "reduce motion" preference: neutralise transitions, animations,
 * and smooth scrolling for users who request it (WCAG 2.3.3). Near-zero rather
 * than 0 so animation/transition end events still fire.
 */
@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;
	}
}
