/* ==========================================================================
   Yakulaas — base.css
   Foundation layer: tokens, reset, typography, layout, buttons, forms, a11y.
   Mobile-first. Breakpoints (use min-width only):
     sm 480px · md 768px · lg 1024px · xl 1280px
   Colours/fonts/sizes come from theme.json (--wp--preset--*); this file only
   gives them short aliases. Keep component styles OUT of this file.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
	/* Brand — names match the old header.css so existing modules keep working */
	--yk-brand:       var(--wp--preset--color--brand, #055B49);
	--yk-brand-dark:  var(--wp--preset--color--brand-dark, #033d31);
	--yk-brand-hover: var(--wp--preset--color--brand-hover, #034a3b);
	--yk-brand-tint:  var(--wp--preset--color--brand-tint, #edf7f5);
	--yk-cream:       var(--wp--preset--color--cream, #f5f3e5);   /* also the footer artwork's own background */

	/* Neutrals */
	--yk-ink:         var(--wp--preset--color--ink, #111827);
	--yk-body:        var(--wp--preset--color--body, #374151);
	--yk-muted:       var(--wp--preset--color--muted, #6b7280);
	--yk-subtle:      var(--wp--preset--color--subtle, #9ca3af);
	--yk-line:        var(--wp--preset--color--line, #e5e7eb);
	--yk-surface:     var(--wp--preset--color--surface, #f9fafb);
	--yk-paper:       var(--wp--preset--color--paper, #fff);
	--yk-danger:      var(--wp--preset--color--danger, #dc2626);
	--yk-danger-tint: var(--wp--preset--color--danger-tint, #fef2f2);

	/* Shape + depth */
	--yk-radius-sm:   var(--wp--custom--radius--sm, 6px);
	--yk-radius-md:   var(--wp--custom--radius--md, 10px);
	--yk-radius-lg:   var(--wp--custom--radius--lg, 16px);
	--yk-radius-pill: var(--wp--custom--radius--pill, 999px);
	--yk-shadow-sm:   var(--wp--preset--shadow--sm, 0 1px 2px rgba(17, 24, 39, .06));
	--yk-shadow-md:   var(--wp--preset--shadow--md, 0 6px 20px rgba(17, 24, 39, .08));
	--yk-shadow-lg:   var(--wp--preset--shadow--lg, 0 18px 48px rgba(17, 24, 39, .14));

	/* Spacing scale */
	--yk-space-2xs: var(--wp--preset--spacing--2xs, .25rem);
	--yk-space-xs:  var(--wp--preset--spacing--xs, .5rem);
	--yk-space-sm:  var(--wp--preset--spacing--sm, .75rem);
	--yk-space-md:  var(--wp--preset--spacing--md, 1rem);
	--yk-space-lg:  var(--wp--preset--spacing--lg, 1.5rem);
	--yk-space-xl:  var(--wp--preset--spacing--xl, 2rem);
	--yk-space-2xl: var(--wp--preset--spacing--2xl, 3rem);
	--yk-space-3xl: var(--wp--preset--spacing--3xl, 5rem);

	/* Layout */
	--yk-container: var(--wp--style--global--wide-size, 1280px);
	--yk-measure:   var(--wp--style--global--content-size, 720px);
	--yk-gutter:    clamp(1rem, 4vw, 2rem);
	--yk-header-h:  var(--wp--custom--header--height, 64px);
	--yk-focus:     var(--wp--custom--focus, #055B49);
	--yk-star:      #f59e0b;

}

@media (min-width: 1024px) {
	:root { --yk-header-h: var(--wp--custom--header--height-lg, 76px); }
}

/* ---------- 2. Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--yk-header-h) + var(--wp-admin--admin-bar--height, 0px) + .5rem);
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
	overflow-x: clip; /* a full-width block can never add a sideways scrollbar */
}

:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol) { margin-block: 0; }
:where(p, ul, ol, dl, blockquote, figure) + :where(p, ul, ol, dl, blockquote, figure, h2, h3, h4) { margin-block-start: var(--yk-space-md); }
:where(h2, h3, h4) { margin-block-start: var(--yk-space-xl); margin-block-end: var(--yk-space-sm); }
:where(h1, h2, h3) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }

:where(img, svg, video, canvas) { display: block; max-width: 100%; height: auto; }
:where(img) { font-style: italic; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(button, [role="button"], summary, label[for]) { cursor: pointer; }
:where(table) { border-collapse: collapse; width: 100%; }
:where(hr) { border: 0; border-top: 1px solid var(--yk-line); margin-block: var(--yk-space-xl); }
:where(a) { text-underline-offset: .18em; }

/* ---------- 3. Accessibility -------------------------------------------- */
:focus-visible {
	outline: 2px solid var(--yk-focus);
	outline-offset: 2px;
}

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

.skip-link.screen-reader-text:focus {
	position: fixed !important;
	top: .75rem; left: .75rem;
	width: auto; height: auto;
	margin: 0; padding: .75rem 1.25rem;
	clip: auto; clip-path: none;
	z-index: 100000;
	background: var(--yk-ink);
	color: #fff;
	border-radius: var(--yk-radius-md);
	text-decoration: none;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- 4. Layout primitives ---------------------------------------- */
.yk-container {
	width: min(100% - (2 * var(--yk-gutter)), var(--yk-container));
	margin-inline: auto;
}

.yk-container--narrow { width: min(100% - (2 * var(--yk-gutter)), var(--yk-measure)); }

.yk-main { flex: 1 0 auto; padding-block: var(--yk-space-xl) var(--yk-space-3xl); }

.yk-section { padding-block: var(--yk-space-2xl); }
@media (min-width: 768px) { .yk-section { padding-block: var(--yk-space-3xl); } }

/* ---------- FAQ dropdown (blog posts, and old plugin FAQ blocks converted by faq.js) ---------- */
.yk-faq { border-top: 1px solid var(--yk-line); }
.yk-faq__item, .yk-prose .wp-block-details { border-bottom: 1px solid var(--yk-line); }
.yk-faq__item summary, .yk-prose .wp-block-details summary {
	display: flex; align-items: center; justify-content: space-between; gap: var(--yk-space-md);
	padding: var(--yk-space-md) 0; color: var(--yk-ink); font-size: 1.0625rem; font-weight: 600; list-style: none; cursor: pointer;
}
.yk-faq__item summary::-webkit-details-marker, .yk-prose .wp-block-details summary::-webkit-details-marker { display: none; }
.yk-faq__item summary:hover, .yk-prose .wp-block-details summary:hover { color: var(--yk-brand); }
.yk-faq__item summary .yk-icon { flex: none; width: 1.25rem; height: 1.25rem; color: var(--yk-muted); transition: transform .2s ease; }
.yk-faq__item[open] summary .yk-icon { transform: rotate(180deg); }
.yk-faq__answer { padding: 0 0 var(--yk-space-md); color: var(--yk-body); line-height: 1.65; }
.yk-faq__answer > * + * { margin-top: var(--yk-space-sm); }
.yk-faq__answer p { margin: 0; }
.yk-faq__answer a { color: var(--yk-brand); font-weight: 600; }

.yk-page-title { margin-block-end: var(--yk-space-lg); }

/* Block-editor alignment inside content (classic theme + theme.json) */
.alignwide { width: min(100%, var(--yk-container)); margin-inline: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }

/* ---------- 5. Buttons --------------------------------------------------- */
.yk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 2.75rem;
	padding: .65rem 1.4rem;
	border: 1.5px solid transparent;
	border-radius: var(--yk-radius-md);
	background: var(--yk-brand);
	color: #fff;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.yk-btn:hover { background: var(--yk-brand-hover); color: #fff; }
.yk-btn:active { background: var(--yk-brand-dark); }

.yk-btn--outline { background: transparent; border-color: var(--yk-brand); color: var(--yk-brand); }
.yk-btn--outline:hover { background: var(--yk-brand); border-color: var(--yk-brand); color: #fff; }
.yk-btn--outline:active { background: var(--yk-brand-dark); border-color: var(--yk-brand-dark); }

.yk-btn--ghost { background: transparent; color: var(--yk-brand); }
.yk-btn--ghost:hover { background: var(--yk-brand-tint); color: var(--yk-brand-hover); }

.yk-btn--lg { min-height: 3.25rem; padding-inline: 2rem; font-size: 1.0625rem; }
.yk-btn--block { display: flex; width: 100%; }

.yk-btn[disabled], .yk-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- 6. Forms ----------------------------------------------------- */
:where(input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
       input[type="password"], input[type="number"], input[type="search"], select, textarea) {
	width: 100%;
	min-height: 2.75rem;
	padding: .6rem .85rem;
	background: var(--yk-paper);
	border: 1.5px solid var(--yk-line);
	border-radius: var(--yk-radius-md);
	font-size: 1rem; /* 16px minimum stops iOS zooming on focus */
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
}
:where(textarea) { min-height: 7rem; resize: vertical; }
:where(input, select, textarea):hover { border-color: var(--yk-subtle); }
:where(input, select, textarea):focus { border-color: var(--yk-brand); outline: none; box-shadow: 0 0 0 3px var(--yk-brand-tint); }
:where(input, select, textarea)[aria-invalid="true"] { border-color: var(--yk-danger); }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--yk-brand); width: 1.1rem; height: 1.1rem; }
::placeholder { color: var(--yk-muted); opacity: 1; }
