/**
 * The Ladd Firm — base layer: type scale, links, lists, quotes, focus.
 *
 * Values are from .claude/docs/measured-design-spec.md. Specificity here is kept as low
 * as it can be while still beating Astra; where an !important is present it is because
 * the winning rule was measured, not guessed. See known-overrides.md.
 */

/* ---------------------------------------------------------------- type ---- */

body,
.entry-content,
.ast-container {
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-body);
	font-weight: var(--ladd-weight-body);
	line-height: var(--ladd-lh-body);
	color: var(--ladd-body);
}

h1, h2, h3, h4, h5, h6,
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
	font-family: var(--ladd-font-heading);
	font-weight: var(--ladd-weight-heading);
	color: var(--ladd-headings);
	/**
	 * The design sets `text-wrap: balance` on every h1/h2/h3 (measured: 1 h1, 17 h2,
	 * 20 h3 — all balance) and `text-wrap: pretty` on p and li. Without it the same
	 * copy at the same width breaks at different words than the design, which is why
	 * headings that measured the right HEIGHT still didn't read the same: the design's
	 * "Lorem ipsum / dolor sit amet / consectetur adipiscing" came out as
	 * "Lorem ipsum dolor sit / amet consectetur / adipiscing".
	 *
	 * Astra's `word-break: break-word` is deliberately left alone — it is what stops a
	 * long unbroken word overflowing at 360px, and the design's `normal` is not worth
	 * that risk.
	 */
	text-wrap: balance;
}

/* Body copy: avoid a one-word last line. Same treatment as the design. */
p, li, .entry-content p, .entry-content li {
	text-wrap: pretty;
}

h1, .entry-content h1 {
	font-size: var(--ladd-fs-h1);
	line-height: var(--ladd-lh-h1);
	letter-spacing: var(--ladd-ls-h1);
}

h2, .entry-content h2 { font-size: var(--ladd-fs-h2); line-height: var(--ladd-lh-h2); }
h3, .entry-content h3 { font-size: var(--ladd-fs-h3); line-height: var(--ladd-lh-h3); }
h4, .entry-content h4 { font-size: var(--ladd-fs-h4); line-height: var(--ladd-lh-h4); }
h5, .entry-content h5 { font-size: var(--ladd-fs-h5); line-height: var(--ladd-lh-h5); }
h6, .entry-content h6 { font-size: var(--ladd-fs-h6); line-height: var(--ladd-lh-h6); }

p { margin: 0 0 var(--ladd-space-6); }
p:last-child { margin-bottom: 0; }

/* Section eyebrow / category label. The standard way to label a section — never a
   colour-shifted heading. Three measured variants; the 13px accent one is default. */
.ladd-eyebrow {
	display: block;
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-eyebrow);
	font-weight: 700;
	line-height: 28px;
	letter-spacing: var(--ladd-ls-eyebrow);
	text-transform: uppercase;
	color: var(--ladd-accent-text);
	margin: 0 0 var(--ladd-space-5);
}

.ladd-eyebrow--muted {
	font-size: var(--ladd-fs-eyebrow-sm);
	letter-spacing: var(--ladd-ls-eyebrow-sm);
	color: var(--ladd-alt-brand);
}

/* On a --ladd-primary background, accent-text fails contrast; the design uses a
   lightened accent instead. */
.ladd-eyebrow--on-dark { color: var(--ladd-accent-on-dark); }

.ladd-lead {
	font-size: var(--ladd-fs-lead);
	line-height: var(--ladd-lh-lead);
}

/* --------------------------------------------------------------- links ---- */

/* Links are underline-free by design. Astra's
   `.ast-single-post .entry-content a` adds an underline at higher specificity and it
   also hits buttons and cards, so it has to be beaten explicitly rather than relying
   on source order. Buttons/cards are excluded below so they never inherit link colour. */
a {
	color: var(--ladd-accent-text);
	text-decoration: none;
	transition: color var(--ladd-duration-fast) var(--ladd-ease);
}

a:hover,
a:focus {
	color: var(--ladd-accent);
	text-decoration: none;
}

.entry-content a:where(:not(.ladd-btn):not(.ladd-card):not(.ladd-card *):not(.wp-block-button__link)) {
	text-decoration: none;
}

.ast-single-post .entry-content a:where(:not(.ladd-btn):not(.ladd-card):not(.ladd-card *):not(.wp-block-button__link)) {
	text-decoration: none;
}

/* Inline prose links are the one place a subtle affordance helps; the design keeps them
   underline-free, so distinguish by colour + weight only. */
.ladd-prose a:not(.ladd-btn) {
	color: var(--ladd-accent-text);
	font-weight: 600;
}

.ladd-prose a:not(.ladd-btn):hover { color: var(--ladd-accent); }

/* --------------------------------------------------------------- focus ---- */

/* Never suppressed. 3px outline, 2px offset — the design's single global rule. */
:focus-visible {
	outline: 3px solid var(--ladd-accent-text);
	outline-offset: 2px;
}

/* --------------------------------------------------------------- lists ---- */

/* Browser default markers are never used. Unordered: small solid accent dot; nested
   unordered: smaller hollow dot in muted grey. Ordered: filled accent numeral badge;
   nested ordered: smaller outlined lettered badge. */

/* Gravity Forms' legacy markup renders each field as an <li> inside
   ul.gform_fields. Without excluding it, the accent bullet below drew an orange dot
   beside every form label. Same for Astra's own menu/widget lists. */
.ladd-prose ul,
.entry-content ul:not(.ladd-plain):not(.gform_fields):not([class*="wp-block"]):not([class*="uagb"]):not([class*="menu"]) {
	list-style: none;
	margin: 0 0 var(--ladd-space-6);
	padding: 0;
}

.ladd-prose ul > li,
.entry-content ul:not(.ladd-plain):not(.gform_fields):not([class*="wp-block"]):not([class*="uagb"]):not([class*="menu"]) > li {
	position: relative;
	padding-left: var(--ladd-space-6);
	margin-bottom: var(--ladd-space-3);
}

/* Belt and braces: never draw the prose bullet on a form field or menu item. */
.gform_fields > li::before,
.gfield::before,
.menu-item::before {
	content: none !important;
}

.ladd-prose ul > li::before,
.entry-content ul:not(.ladd-plain):not(.gform_fields):not([class*="wp-block"]):not([class*="uagb"]):not([class*="menu"]) > li::before {
	content: "";
	position: absolute;
	left: 0;
	/* centre the dot on the first line's optical middle rather than its box */
	top: calc(var(--ladd-fs-body) * var(--ladd-lh-body) / 2 - 3px);
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ladd-accent);
}

/* Nested unordered — hollow, muted, smaller. */
.ladd-prose ul ul > li::before,
.entry-content ul ul > li::before {
	width: 6px;
	height: 6px;
	background: transparent;
	border: 1.5px solid var(--ladd-alt-brand);
}

.ladd-prose ol,
.entry-content ol:not(.ladd-plain):not([class*="wp-block"]):not([class*="uagb"]) {
	list-style: none;
	counter-reset: ladd-ol;
	margin: 0 0 var(--ladd-space-6);
	padding: 0;
}

.ladd-prose ol > li,
.entry-content ol:not(.ladd-plain):not([class*="wp-block"]):not([class*="uagb"]) > li {
	position: relative;
	counter-increment: ladd-ol;
	padding-left: var(--ladd-space-8);
	margin-bottom: var(--ladd-space-4);
}

.ladd-prose ol > li::before,
.entry-content ol:not(.ladd-plain):not([class*="wp-block"]):not([class*="uagb"]) > li::before {
	content: counter(ladd-ol);
	position: absolute;
	left: 0;
	top: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--ladd-accent);
	color: #FFFFFF;
	font-family: var(--ladd-font-heading);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
}

/* Nested ordered — outlined lettered badge, smaller. */
.ladd-prose ol ol > li,
.entry-content ol ol > li { counter-increment: ladd-ol-nested; }

.ladd-prose ol ol,
.entry-content ol ol { counter-reset: ladd-ol-nested; }

.ladd-prose ol ol > li::before,
.entry-content ol ol > li::before {
	content: counter(ladd-ol-nested, lower-alpha);
	width: 22px;
	height: 22px;
	background: transparent;
	border: 1.5px solid var(--ladd-alt-brand);
	color: var(--ladd-body);
	font-size: 12px;
}

/* -------------------------------------------------------------- quotes ---- */

blockquote,
.entry-content blockquote,
.wp-block-quote {
	margin: var(--ladd-space-8) 0;
	padding: var(--ladd-space-7) var(--ladd-space-8);
	background: var(--ladd-bg-section-alt);
	border-left: 4px solid var(--ladd-accent);
	border-radius: 0;
	font-family: var(--ladd-font-heading);
	font-size: 26px;
	line-height: 1.4;
	font-style: normal;
	color: var(--ladd-headings);
}

blockquote p:last-of-type { margin-bottom: 0; }

blockquote cite,
.wp-block-quote cite {
	display: block;
	margin-top: var(--ladd-space-4);
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-small);
	font-weight: 700;
	font-style: normal;
	color: var(--ladd-accent-text);
}

/* ------------------------------------------------------------ utilities ---- */

.ladd-container {
	width: 100%;
	max-width: var(--ladd-container-max);
	margin-inline: auto;
	padding-inline: var(--ladd-gutter);
}

.ladd-section { padding-block: var(--ladd-section-padding); }
.ladd-section--alt { background: var(--ladd-bg-section-alt); }
.ladd-section--dark { background: var(--ladd-primary); color: #FFFFFF; }
.ladd-section--dark :is(h1, h2, h3, h4, h5, h6) { color: #FFFFFF; }

hr,
.wp-block-separator {
	height: 1px;
	border: 0;
	background: var(--ladd-hair);
	opacity: 1;
}
