/*
 * Best of Lime USA: site-wide base styles.
 * Loaded on the front end and in the block editor canvas by bol-usa-site.php.
 * Tag-level defaults only. Component classes (bol-*) live in Oxygen through insert-stylesheet.
 * Tokens: see design-system.md. The --bol-* colour variables come from Oxygen's global palette.
 */

/* Heading scale. Oxygen derives h1-h6 from a 1.25 ratio (h1 39px); the UK site sets them directly.
   :root:root outranks Oxygen's own :root block whatever order the stylesheets load in. */
:root:root {
	--bde-h1-font-size: 50px;
	--bde-h2-font-size: 26px;
	--bde-h3-font-size: 18px;
	--bde-h4-font-size: 16px;
	--bde-h5-font-size: 16px;
	--bde-h6-font-size: 16px;
	--bde-links-color-hover: #4A5A08;
	--bol-accent-font: 'Merriweather', Georgia, serif;
	--bol-focus: #265362;
}
@media (max-width: 1023px) {
	:root:root { --bde-h1-font-size: 42px; --bde-h2-font-size: 24px; }
}
@media (max-width: 767px) {
	:root:root { --bde-h1-font-size: 34px; --bde-h2-font-size: 22px; }
}

body { line-height: 1.625; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
h1 { font-weight: 400; line-height: 1.2; }
h2, h3, h4 { font-weight: 700; }
/* body h3 (0,0,2) beats Oxygen's h1-h6 colour rule, which loads after this file. .bol-on-dark h3 still wins. */
body h3 { color: #5F730A; line-height: 1.4; }

/* Links that sit inside running text are underlined, so colour is never the only cue (WCAG 1.4.1).
   Menus, buttons and cards are not. */
:where(p, dd, td, th, figcaption, blockquote, .breakdance-rich-text-styles li, .wp-block-list li) a:not([class*="button"]):not([class*="bol-btn"]) {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

/* Focus: a 3px ring on everything focusable, never removed. Teal on light surfaces,
   white wherever an ancestor carries .bol-on-dark (teal and olive sections). */
:focus-visible {
	outline: 3px solid var(--bol-focus);
	outline-offset: 3px;
}
.bol-on-dark { --bol-focus: #FFFFFF; color: #FFFFFF; }

/* The header's teal bar and the burger panel take a white ring; the white desktop dropdowns go back to teal. */
.bol-mainbar { --bol-focus: #FFFFFF; }
.bol-mainbar .breakdance-dropdown-body { --bol-focus: #265362; }

/* The sticky main bar is 96px tall (72px on phones), so anything focused or jumped to lands below it (WCAG 2.4.11). */
html { scroll-padding-top: 112px; }
@media (max-width: 767px) { html { scroll-padding-top: 88px; } }

/* Text on teal and olive surfaces. Headings default to teal and links to olive, both unreadable there. */
.bol-on-dark :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption) { color: #FFFFFF; }
.bol-on-dark a:not([class*="bol-btn"]) { color: #FFFFFF; }
.bol-on-dark a:not([class*="bol-btn"]):hover { color: #FFFFFF; text-decoration-thickness: 2px; }

/* Skip link: Oxygen's own .oxy-skip-link, white with teal text, picks up the focus ring above. */

/* Consent banner (ckm-consent) in the brand colours. The plugin declares its variables on .ckm itself,
   so they are set on body .ckm (0,1,1) to outrank it rather than on :root, which would be shadowed. */
body .ckm {
	--ckm-accent: #265362;
	--ckm-accent-fg: #FFFFFF;
	--ckm-fg: #363636;
	--ckm-border: #265362;
	--ckm-focus: #265362;
	--ckm-font: 'Lato', sans-serif;
}

/* Motion off for anyone who asks for it. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms;
		animation-iteration-count: 1;
		transition-duration: 0.01ms;
		scroll-behavior: auto;
	}
}
