/* =========================================================
   BASE: Reset + Typography
   Su dung o: moi trang (global — tang 2)
   Dependencies: tokens.css
   ========================================================= */

/* === Modern reset === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--am-font-body);
	font-size: var(--am-fs-base);
	line-height: var(--am-lh-normal);
	color: var(--am-color-text);
	background: var(--am-color-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* === Typography mac dinh === */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--am-font-heading);
	font-weight: var(--am-fw-bold);
	line-height: var(--am-lh-tight);
	letter-spacing: var(--am-ls-tight);
	color: var(--am-color-text);
	margin-bottom: var(--am-space-4);
}

h1 { font-size: var(--am-fs-3xl); }
h2 { font-size: var(--am-fs-2xl); }
h3 { font-size: var(--am-fs-xl); }
h4 { font-size: var(--am-fs-lg); }
h5 { font-size: var(--am-fs-base); }
h6 {
	font-size: var(--am-fs-sm);
	text-transform: uppercase;
	letter-spacing: var(--am-ls-wide);
}

p { margin-bottom: var(--am-space-4); }

a {
	color: var(--am-color-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--am-duration-fast) var(--am-ease);
}

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

ul, ol {
	margin-bottom: var(--am-space-4);
	padding-left: var(--am-space-5);
}

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

.am__skip-link:focus {
	background: var(--am-color-primary);
	color: var(--am-color-text-invert);
	padding: var(--am-space-3) var(--am-space-4);
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	left: var(--am-space-3);
	top: var(--am-space-3);
	z-index: var(--am-z-toast);
}

:focus-visible {
	outline: 2px solid var(--am-color-primary);
	outline-offset: 2px;
}

/* === Reduced motion (accessibility) === */
@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;
	}
}
