/*
 * Base: maps Kadence's defaults to our tokens and sets element defaults.
 * Load order: kadence-global (+ its inline CSS) → fonts.css → tokens.css → base.css → site.css.
 *
 * OVERRIDE STRATEGY (decided 2026-11-18, recorded in docs/build-plan.md Phase 2):
 * 1. Kadence is steered through its own CSS variables (--global-palette*, fonts, widths),
 *    redefined here on :root. Kadence's rules then render our values; no fight over specificity.
 *    The Customizer/database colours and fonts stay at Kadence defaults and are NOT the source of truth.
 * 2. Element defaults (body, headings, links, buttons, fields) use plain element selectors.
 *    They load after Kadence's inline CSS, so equal specificity means ours wins.
 * 3. Components (site.css) use one role-named class. Where a Kadence rule still outranks one,
 *    match Kadence's own scope (e.g. `.entry-content .card_title`). Never !important,
 *    except inside prefers-reduced-motion, where it is the standard way to switch motion off.
 */

/* 1. Kadence variables → tokens */
:root {
	--global-palette1: var(--tln-color-accent);          /* links, highlights */
	--global-palette2: var(--tln-color-accent-hover);
	--global-palette3: var(--tln-color-ink);
	--global-palette4: var(--tln-color-body);
	--global-palette5: var(--tln-color-ink-muted);
	--global-palette6: var(--tln-color-denim);           /* decorative only */
	--global-palette7: var(--tln-color-surface-alt);
	--global-palette8: var(--tln-color-surface);         /* page background */
	--global-palette9: var(--tln-color-surface-alt);     /* Kadence "white": content and cards */

	--global-palette-btn-bg: var(--tln-color-brand);     /* the design's dark button (btn-ink) */
	--global-palette-btn-bg-hover: var(--tln-color-brand);
	--global-palette-btn: var(--tln-color-on-dark);
	--global-palette-btn-hover: var(--tln-color-on-dark);

	--global-body-font-family: var(--tln-font-body);
	--global-heading-font-family: var(--tln-font-display);
	--global-primary-nav-font-family: var(--tln-font-body);

	--global-content-width: var(--tln-content-max);
	--global-content-edge-padding: var(--tln-space-5);
}

/* Page background: the design's Cloud Blue, not Kadence's white content box */
body,
.content-bg,
body.content-style-unboxed .site {
	background: var(--tln-color-surface);
}

/* 2. Element defaults */
body,
input,
select,
optgroup,
textarea {
	font-family: var(--tln-font-body);
	font-size: var(--tln-text-base);
	font-weight: 400;
	line-height: var(--tln-leading-body);
	color: var(--tln-color-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 400;
	color: var(--tln-color-ink);
}

h1 {
	font-family: var(--tln-font-display);
	font-size: var(--tln-text-h1);
	line-height: var(--tln-leading-h1);
	color: var(--tln-color-brand);
}

h2 {
	font-family: var(--tln-font-display);
	font-size: var(--tln-text-h2);
	line-height: var(--tln-leading-h2);
	color: var(--tln-color-brand);
}

h3 {
	font-family: var(--tln-font-serif);
	font-size: var(--tln-text-h3);
	line-height: var(--tln-leading-h3);
}

h4,
h5,
h6 {
	font-family: var(--tln-font-body);
	font-size: var(--tln-text-base);
	font-weight: 700;
	line-height: var(--tln-leading-h3);
}

a {
	color: var(--tln-color-accent);
	text-decoration: none;
}

a:hover {
	color: var(--tln-color-accent-hover);
}

/*
 * The design has no underlines. A link inside running text must still differ from the text
 * by more than colour (WCAG 1.4.1), so it is bold, like the design's own text links.
 */
p a,
li a,
td a,
blockquote a {
	font-weight: 700;
}

/* In-page links (the Practice Areas index) glide; off under reduced motion below */
html {
	scroll-behavior: smooth;
}

/* Visible keyboard focus everywhere; the light ring is applied on dark surfaces */
:focus-visible {
	outline: 3px solid var(--tln-color-focus);
	outline-offset: 3px;
}

.surface_dark :focus-visible {
	outline-color: var(--tln-color-focus-on-dark);
}

/* Buttons: the design's dark button. Colours come from the Kadence button variables above. */
button,
.button,
.wp-block-button__link,
input[type="submit"] {
	font-family: var(--tln-font-body);
	font-size: var(--tln-text-ui);
	font-weight: 700;
	line-height: 1.3;
	padding: 16px 28px;
	border: 0;
	border-radius: var(--tln-radius);
	box-shadow: none;
	min-height: 44px;
	cursor: pointer;
	transition: transform var(--tln-zoom-duration) ease;
	transform: translateZ(0);
}

button:hover,
.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover {
	box-shadow: none; /* the design has no button glow; Kadence adds one on hover */
	transform: translateZ(0) scale(var(--tln-zoom-link));
}

/* Form fields */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
select,
textarea {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--tln-color-field-border);
	border-radius: var(--tln-radius);
	background: var(--tln-color-white);
	color: var(--tln-color-ink);
	font-size: var(--tln-text-base);
}

label {
	font-size: var(--tln-text-ui);
	font-weight: 500;
	color: var(--tln-color-ink);
}

/* Motion off for people who ask for less */
@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;
	}

	button:hover,
	.button:hover,
	.wp-block-button__link:hover,
	input[type="submit"]:hover {
		transform: none;
	}
}
