/**
 * The Ladd Firm — components: buttons, cards, sliders, FAQ, forms.
 *
 * All sizing from .claude/docs/measured-design-spec.md.
 *
 * Note on buttons: the design's `.ld-btn-outline` class has NO base rule — only a
 * :hover. Its appearance comes from inline styles that set a SOLID accent background,
 * so every "outline" button in the design actually renders solid. The genuine outline
 * treatment described in STYLE.md is implemented here as `--outline` for inner pages,
 * but it is deliberately unused on the homepage.
 */

/* ------------------------------------------------------------- buttons ---- */

.ladd-btn {
	display: inline-block;
	font-family: var(--ladd-font-button);
	font-size: 18px;
	font-weight: var(--ladd-weight-button);
	line-height: 28px;
	text-align: center;
	text-decoration: none;
	padding: 14px 26px;
	border: 2px solid transparent;
	border-radius: var(--ladd-radius-button);
	cursor: pointer;
	transition:
		background-color var(--ladd-duration-fast) var(--ladd-ease),
		border-color var(--ladd-duration-fast) var(--ladd-ease),
		color var(--ladd-duration-fast) var(--ladd-ease);
}

/* Measured variants of the same solid button. */
.ladd-btn--wide { padding: 14px 30px; }
.ladd-btn--lg { font-size: 20px; padding: 18px 40px; }

.ladd-btn--primary {
	background-color: var(--ladd-accent);
	border-color: var(--ladd-accent);
	color: #FFFFFF;
}

/* Hover always darkens — never lightens, never an opacity fade. */
.ladd-btn--primary:hover,
.ladd-btn--primary:focus {
	background-color: var(--ladd-accent-hover);
	border-color: var(--ladd-accent-hover);
	color: #FFFFFF;
}

/* On a --ladd-primary or image background. */
.ladd-btn--on-dark {
	background-color: transparent;
	border-color: #FFFFFF;
	color: #FFFFFF;
}

.ladd-btn--on-dark:hover,
.ladd-btn--on-dark:focus {
	background-color: #FFFFFF;
	border-color: #FFFFFF;
	color: var(--ladd-primary);
}

/* STYLE.md's true outline. System component; unused on the homepage. */
.ladd-btn--outline {
	background-color: transparent;
	border-color: var(--ladd-accent);
	color: var(--ladd-accent-text);
}

.ladd-btn--outline:hover,
.ladd-btn--outline:focus {
	background-color: var(--ladd-accent);
	border-color: var(--ladd-accent);
	color: #FFFFFF;
}

/* Tertiary / ghost — no border, no fill. */
.ladd-btn--ghost {
	background-color: transparent;
	border-color: transparent;
	color: var(--ladd-headings);
	padding-inline: 0;
}

.ladd-btn--ghost:hover { color: var(--ladd-accent-text); }

.ladd-btn[aria-disabled="true"],
.ladd-btn:disabled {
	background-color: #E6E4E1;
	border-color: #E6E4E1;
	color: #9B9B9B;
	cursor: not-allowed;
}

.ladd-btn[aria-disabled="true"]:hover,
.ladd-btn:disabled:hover {
	background-color: #E6E4E1;
	border-color: #E6E4E1;
	color: #9B9B9B;
}

/* --------------------------------------------------------------- cards ---- */

.ladd-card {
	border-radius: var(--ladd-radius-card);
	/* A card is always separated from its surroundings by fill OR border, never
	   neither. Variants below supply one or the other. */
	background-color: #FFFFFF;
	border: 1px solid var(--ladd-hair);
	/* Lift OR shadow-increase, never both. This design has no card shadows, so lift. */
	transition: transform var(--ladd-duration-fast) var(--ladd-ease);
}

.ladd-card--interactive:hover { transform: translateY(-3px); }

.ladd-card--pa { padding: 36px 32px; }
.ladd-card--review { padding: 34px 32px; }

/* Photo cards place the image full-bleed at the top with no padding. */
.ladd-card--team {
	background-color: var(--ladd-bg-card);
	border: 0;
	padding: 0;
	overflow: hidden;
}

.ladd-card--blog {
	padding: 0;
	overflow: hidden;
}

.ladd-card__media { display: block; width: 100%; }
.ladd-card__media img { display: block; width: 100%; height: auto; }
.ladd-card__body { padding: var(--ladd-space-6) var(--ladd-space-7) var(--ladd-space-7); }

/* Icon cards get a circular accent-filled badge above the heading. */
.ladd-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: var(--ladd-space-5);
	border-radius: 50%;
	background-color: var(--ladd-accent);
	color: #FFFFFF;
}

.ladd-card h3 {
	font-size: var(--ladd-fs-h5);
	line-height: var(--ladd-lh-h5);
	margin: 0 0 var(--ladd-space-3);
}

/* ------------------------------------------------------------- sliders ---- */

/* Per rule 20 nothing here is a hardcoded card width or per-view count: the card width
   is DERIVED from the track width and the gap. Change --ladd-per-view and the maths
   follows. Measured baseline: 3 across at 1120px inner width with a 28px gap = 355px.
   Falls back to CSS scroll-snap so the track is usable with no JS at all. */
.ladd-track {
	display: flex;
	gap: var(--ladd-card-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	/* hide the native bar without disabling the scroll */
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-bottom: 2px;
	--ladd-per-view: 3;
}

.ladd-track::-webkit-scrollbar { display: none; }

.ladd-track > * {
	flex: 0 0 calc(
		(100% - (var(--ladd-per-view) - 1) * var(--ladd-card-gap)) / var(--ladd-per-view)
	);
	scroll-snap-align: start;
}

@media (max-width: 1023px) { .ladd-track { --ladd-per-view: 2; } }
@media (max-width: 767px)  { .ladd-track { --ladd-per-view: 1; } }

/**
 * carousel.js sets nav.hidden when the track does not overflow. `.ladd-slider-nav` is a
 * class selector (0-1-0) and beats the user-agent's `[hidden] { display: none }`, so the
 * attribute had no effect and the controls kept their space — the homepage blog strip
 * measured 1020px against the design's 926px, with a dead pair of arrows on desktop.
 */
.ladd-slider-nav[hidden] { display: none !important; }

/* Circular prev/next controls: accent-bordered, white fill. */
.ladd-slider-nav {
	display: flex;
	gap: var(--ladd-space-3);
	justify-content: center;
	margin-top: var(--ladd-space-8);
}

.ladd-slider-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	background-color: #FFFFFF;
	border: 2px solid var(--ladd-accent);
	border-radius: 50%;
	color: var(--ladd-accent-text);
	cursor: pointer;
	transition:
		background-color var(--ladd-duration-fast) var(--ladd-ease),
		color var(--ladd-duration-fast) var(--ladd-ease);
}

.ladd-slider-btn:hover {
	background-color: var(--ladd-accent);
	color: #FFFFFF;
}

.ladd-slider-btn[disabled] {
	border-color: var(--ladd-hair);
	color: var(--ladd-alt-brand);
	cursor: not-allowed;
}

/* ----------------------------------------------------------------- FAQ ---- */

/* Native <details>/<summary> for accessibility, disclosure triangle always hidden,
   state signalled by a +/- glyph in accent orange. Hairline rule between items; no
   shadow, no background box, no icon rotation. */
.ladd-faq { border-bottom: 1px solid var(--ladd-hair); }

.ladd-faq > summary {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--ladd-space-6);
	padding: 24px 0;
	font-family: var(--ladd-font-heading);
	font-size: var(--ladd-fs-faq);
	font-weight: var(--ladd-weight-heading);
	line-height: 1.4;
	color: var(--ladd-headings);
	cursor: pointer;
	list-style: none;
}

/* Both are required: Safari uses ::-webkit-details-marker, others list-style. */
.ladd-faq > summary::-webkit-details-marker { display: none; }
.ladd-faq > summary::marker { content: ""; }

.ladd-faq > summary::after {
	content: "+";
	flex: 0 0 auto;
	font-family: var(--ladd-font-body);
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	color: var(--ladd-accent);
}

.ladd-faq[open] > summary::after { content: "\2212"; } /* proper minus, not a hyphen */

.ladd-faq__answer { padding: 0 0 24px; }
.ladd-faq__answer p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- forms ---- */

/* Every field has a visible bold label above it — never placeholder-as-label. */
.ladd-field { margin-bottom: var(--ladd-space-5); }

.ladd-label,
.ladd-field label {
	display: block;
	margin-bottom: var(--ladd-space-2);
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-label);
	font-weight: var(--ladd-weight-label);
	line-height: 28px;
	color: var(--ladd-headings);
}

.ladd-input,
.ladd-field input[type="text"],
.ladd-field input[type="tel"],
.ladd-field input[type="email"],
.ladd-field textarea,
.ladd-field select {
	width: 100%;
	height: 56px;
	padding: 0 16px;
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-input);
	font-weight: 400;
	color: var(--ladd-headings);
	background-color: var(--ladd-bg-form);
	/* Measured: inputs use their own border colour, NOT --ladd-hair. */
	border: 1px solid var(--ladd-input-border);
	border-radius: var(--ladd-radius-input);
	transition: border-color var(--ladd-duration-fast) var(--ladd-ease);
}

.ladd-field textarea {
	height: auto;
	min-height: 166px;
	padding: 14px 16px;
	line-height: var(--ladd-lh-body);
	resize: vertical;
}

/* Focus is an accent border — no glow, no shadow. */
.ladd-input:focus,
.ladd-field input:focus,
.ladd-field textarea:focus,
.ladd-field select:focus {
	border-color: var(--ladd-accent);
	outline: 3px solid var(--ladd-accent-text);
	outline-offset: 2px;
}

/* Error state is never colour-only — the message below the field is required. */
.ladd-field--error input,
.ladd-field--error textarea {
	background-color: var(--ladd-error-bg);
	border-width: 1.5px;
	border-color: var(--ladd-error-border);
}

.ladd-field__error {
	display: block;
	margin-top: var(--ladd-space-2);
	font-size: var(--ladd-fs-small);
	font-weight: 700;
	color: var(--ladd-error-text);
}

/* Native controls, brand accent. */
.ladd-field input[type="checkbox"],
.ladd-field input[type="radio"] {
	width: auto;
	height: auto;
	accent-color: var(--ladd-accent);
}

/* ------------------------------------------------------------- badges ---- */

.ladd-badge {
	display: inline-block;
	padding: 4px 14px;
	border-radius: var(--ladd-radius-pill);
	background-color: var(--ladd-bg-section-alt);
	border: 1px solid var(--ladd-hair);
	font-family: var(--ladd-font-body);
	font-size: var(--ladd-fs-small);
	font-weight: 700;
	color: var(--ladd-body);
}

.ladd-badge--accent {
	background-color: var(--ladd-accent);
	border-color: var(--ladd-accent);
	color: #FFFFFF;
}

/**
 * [4] The slider arrows fill on HOVER only, never as a stuck state after a click.
 *
 * A mouse click leaves the button focused, and the focus style was inheriting the filled
 * hover treatment — so the arrow stayed solid orange after you clicked it and the mouse
 * moved away. This clears the fill for a mouse-induced focus while keeping a visible ring
 * for keyboard users, who still need to see where they are.
 */
.ladd-slider-btn:focus:not(:focus-visible) {
	background-color: #FFFFFF;
	color: var(--ladd-accent-text);
	outline: none;
}

.ladd-slider-btn:focus-visible {
	outline: 2px solid var(--ladd-accent);
	outline-offset: 3px;
}

/**
 * Anchored sections clear the sticky header.
 *
 * #contact and the other section anchors scroll the target to y=0, which puts it behind
 * the sticky header (162px desktop / 98 tablet / 101 mobile). --ladd-header-h is measured
 * and published by megamenu.js; the fallback covers the no-JS case.
 */
.ladd-sec {
	scroll-margin-top: calc(var(--ladd-header-h, 110px) + 16px);
}

html {
	scroll-behavior: smooth;
}

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