/* Kestra — base: reset, skip-link, focus, motion */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
}

/* Sections manage their own vertical rhythm via .kk-section padding, so the
   root blockGap margin WP inserts between header/main/footer is redundant —
   it only shows up as unwanted whitespace against full-bleed sections. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
	display: block;
}

:where(ul, ol) {
	padding-inline-start: 1.2em;
}

table {
	border-collapse: collapse;
	width: 100%;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	position: fixed;
	top: var(--wp--preset--spacing--20);
	left: var(--wp--preset--spacing--20);
	z-index: 100;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	padding: 0.6em 1em;
	border-radius: var(--wp--custom--radius--sm);
	text-decoration: none;
}

/* Focus indicator.
 *
 * Two-tone by construction: a dark ring with a light halo between it and the
 * element. The two tones contrast with each other, so the indicator carries its
 * own contrast and stays visible on ANY background. A single accent-coloured
 * ring did not: on an accent-filled button, or anywhere in the accent hero, it
 * was drawn in the colour it sat on and vanished. That is what the September
 * 2026 accessibility-ready review failed the theme for, on .wp-block-button__link
 * among others. WCAG 2.4.11 is satisfied by the indicator's internal contrast,
 * so no per-section overrides are needed and none can be forgotten.
 *
 * Both tones come from the palette, so every style variation gets a ring built
 * from its own two most-contrasting colours. */

:root {
	--kk-focus-ring: var(--wp--preset--color--contrast);
	--kk-focus-halo: 0 0 0 2px var(--wp--preset--color--base);
}

:focus-visible {
	outline: 2px solid var(--kk-focus-ring);
	outline-offset: 2px;
	box-shadow: var(--kk-focus-halo);
}

/* Outline buttons carry their border as an inset shadow. Re-declare it, or the
 * halo above replaces the border and the button loses its edge while focused. */
.is-style-outline.wp-block-button .wp-block-button__link:focus-visible {
	box-shadow: var(--kk-focus-halo), inset 0 0 0 2px var(--wp--preset--color--accent);
}

/* Containers that clip their children — for the hover zoom, or for the site
 * title's ellipsis under 480px — also clip the focus ring of the link inside
 * them, which is why the featured image and the site title appeared to have no
 * indicator at all. Stop clipping while that link holds focus; the zoom runs on
 * hover only, so nothing escapes the frame. */
.wp-block-post-featured-image:has( a:focus-visible ),
.kk-portfolio-grid figure:has( a:focus-visible ),
.kk-team-member figure:has( a:focus-visible ),
.kk-image-pair figure:has( a:focus-visible ),
.is-style-framed:has( a:focus-visible ),
.kk-header .wp-block-site-title:has( a:focus-visible ) {
	overflow: visible;
}

main#main {
	display: block;
}

.wp-block-table__scrollable-wrapper,
.wp-block-embed__wrapper {
	overflow-x: auto;
}

@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;
	}
}
