/**
 * EULAI Global Front-end Foundation
 *
 * Minimal shared foundation for site-wide layout and rendering.
 * Component-specific styles belong in their respective component files.
 */


/* --------------------------------------------------------------
   Box sizing
-------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}


/* --------------------------------------------------------------
   Document
-------------------------------------------------------------- */

html {
	-webkit-text-size-adjust: 100%;

	/*
	 * Enable native smooth scrolling for in-page anchor navigation.
	 * scroll-padding-top preserves clearance for the sticky site header
	 * when navigating to anchored sections.
	 */
	scroll-behavior: smooth;
	scroll-padding-top: 4rem;
}

body {
	margin: 0;
	background: var(--eulai-color-canvas);
	color: var(--eulai-color-text);
	font-family:
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"PingFang SC",
		"Hiragino Sans GB",
		"Microsoft YaHei",
		Arial,
		sans-serif;
}


/* --------------------------------------------------------------
   Media
-------------------------------------------------------------- */

img,
svg {
	max-width: 100%;
	height: auto;
}


/* --------------------------------------------------------------
   Interactive elements
-------------------------------------------------------------- */

button,
input,
select,
textarea {
	font: inherit;
}

a {
	color: inherit;
}


/* --------------------------------------------------------------
   Layout
-------------------------------------------------------------- */

.eulai-container {
	width: min(
		calc(100% - (2 * var(--eulai-page-gutter))),
		var(--eulai-container-max)
	);
	margin-inline: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	color: inherit;
	font-weight: 700;
	line-height: 1.2;
}

/* --------------------------------------------------------------
   Reduced motion
-------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	html {
		/*
		 * Disable animated anchor scrolling when the user has requested
		 * reduced motion.
		 */
		scroll-behavior: auto;
	}
}