/*
 * Base layer for redesigned templates only. Legacy Divi pages never load this file,
 * so element selectors here cannot leak into Divi Builder content.
 * Element resets skip the header and footer (.uv-chrome), which carry their own resets in chrome.css
 * and must render the same on legacy and redesigned pages. The exclusion sits in :where() so the
 * resets keep their one-class specificity and still override bare element rules in Additional CSS.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--uv-header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body.uv-redesign {
	margin: 0;
	background: var(--uv-bg);
	color: var(--uv-text);
	font-family: var(--uv-font);
	font-size: var(--uv-fs-base);
	font-weight: 450;
	line-height: var(--uv-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01", "cv11";
}

.uv-redesign :where(h1, h2, h3, h4, h5, h6):where(:not(.uv-chrome *)) {
	margin: 0;
	padding: 0;
	color: var(--uv-heading);
	font-family: var(--uv-font);
	font-weight: 750;
	line-height: var(--uv-lh-heading);
	letter-spacing: var(--uv-tracking-tight);
	text-wrap: balance;
}

.uv-redesign :where(h1):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-h1); line-height: var(--uv-lh-tight); font-weight: 800; }
.uv-redesign :where(h2):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-h2); line-height: 1.12; }
.uv-redesign :where(h3):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-h3); }
.uv-redesign :where(h4):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-h4); }
.uv-redesign :where(h5):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-lg); }
.uv-redesign :where(h6):where(:not(.uv-chrome *)) { font-size: var(--uv-fs-base); }

.uv-redesign :where(p, ul, ol, dl, figure, blockquote, table):where(:not(.uv-chrome *)) {
	margin: 0;
	padding: 0;
}

.uv-redesign :where(p):where(:not(.uv-chrome *)) {
	text-wrap: pretty;
}

.uv-redesign :where(p + p):where(:not(.uv-chrome *)) {
	margin-top: 1em;
}

.uv-redesign :where(ul[class], ol[class]):where(:not(.uv-chrome *)) {
	list-style: none;
}

/* Icons keep their own sizing from chrome.css; height:auto would stretch them to 150px. */
.uv-redesign :where(img, svg:not(.uv-icon), video, picture):where(:not(.uv-chrome *)) {
	display: block;
	max-width: 100%;
	height: auto;
}

.uv-redesign :where(a):where(:not(.uv-chrome *)) {
	color: var(--uv-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--uv-dur-fast) var(--uv-ease);
}

.uv-redesign :where(a:hover):where(:not(.uv-chrome *)) {
	color: var(--uv-link-hover);
}

.uv-redesign :where(strong, b):where(:not(.uv-chrome *)) {
	font-weight: 700;
	color: inherit;
}

.uv-redesign :where(button, input, select, textarea):where(:not(.uv-chrome *)) {
	font: inherit;
	color: inherit;
}

.uv-redesign :where(table):where(:not(.uv-chrome *)) {
	width: 100%;
	border-collapse: collapse;
}

.uv-redesign :where(hr):where(:not(.uv-chrome *)) {
	border: 0;
	border-top: 1px solid var(--uv-border);
	margin: var(--uv-space-8) 0;
}

.uv-redesign ::selection {
	background: var(--uv-cyan-200);
	color: var(--uv-navy-900);
}

.uv-redesign :focus-visible {
	outline: 3px solid var(--uv-focus);
	outline-offset: 3px;
	border-radius: 4px;
}
