/*
 * CLEAR base layer: typography, links, focus and motion.
 * Scoped to body.clear-site so it outranks Divi defaults without !important.
 */

body.clear-site {
	font-family: var(--clear-font-body);
	font-size: var(--clear-body);
	line-height: 1.7;
	color: var(--clear-text);
	background: var(--clear-white);
}

body.clear-site h1,
body.clear-site h2,
body.clear-site h3,
body.clear-site h4,
body.clear-site h5,
body.clear-site h6 {
	font-family: var(--clear-font-display);
	font-weight: 700;
	color: inherit;
	letter-spacing: -0.02em;
	line-height: 1.1;
	padding-bottom: 0;
}

body.clear-site h1 { font-size: var(--clear-h1); letter-spacing: -0.025em; }
body.clear-site h2 { font-size: var(--clear-h2); }
body.clear-site h3 { font-size: var(--clear-h3); line-height: 1.2; letter-spacing: -0.015em; }

body.clear-site button,
body.clear-site [data-cta],
body.clear-site .et_pb_button {
	font-family: var(--clear-font-display);
	font-weight: 700;
}

body.clear-site p {
	padding-bottom: 0;
}

body.clear-site p + p {
	margin-top: 1em;
}

body.clear-site a {
	color: var(--clear-blue);
	transition: color 0.2s ease;
}

/*
 * Links inside running text are underlined, so they are not identified by colour alone
 * (WCAG 1.4.1: Blue against the navy body text is only 2.57:1). Buttons, cards and navigation keep their own styles.
 */
body.clear-site :is(.et_pb_text, .entry-content, .clear-article-body, .clear-cs) :is(p, li) a:not(.clear-btn):not(.et_pb_button) {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

/* In-page anchors and backwards tabbing stop below the sticky header (WCAG 2.4.11). */
html:has(body.clear-site) {
	scroll-padding-top: calc(var(--clear-header-h, 82px) + 16px);
}

/*
 * Focus: a Blue ring with a 2px white inner ring, so the indicator keeps at least 3:1 on white, tint
 * and navy alike (WCAG 1.4.11, 2.4.7). Sections marked as dark use the light-blue ring instead.
 */
body.clear-site :focus-visible {
	outline: var(--clear-focus);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--clear-white);
}

body.clear-site :is(.clear-on-dark, .clear-bg-navy, .clear-cta-panel, .preset--module--divi-section--clrsecnavy) :focus-visible {
	outline: var(--clear-focus-on-dark);
	box-shadow: none;
}

/* Plain links on navy panels: white instead of Blue (Blue on navy is 2.57:1, WCAG 1.4.3). */
body.clear-site :is(.clear-bg-navy, .clear-cta-panel) a:not(.clear-btn):not(.et_pb_button):not(.clear-pill) {
	color: var(--clear-white);
}

/* Placeholder text: Text muted (5.93:1 on white; browser defaults are about 3.9:1). */
body.clear-site ::placeholder {
	color: var(--clear-text-muted);
	opacity: 1;
}

/* Skip link */
.clear-skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100000;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--clear-dark-blue);
	color: var(--clear-white) !important;
	font-size: 14px;
	font-weight: 700;
}

.clear-skip-link:focus {
	left: 16px;
}

.clear-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

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