/*
 * SWD Site Kit: base stylesheet.
 *
 * Uses only named tokens. A client package sets their values (see
 * docs/site-kit-1.0-plan.md, Design tokens); the defaults below are plain
 * and readable so a site with no package still works.
 *
 * Sections: 1 tokens, 2 reset, 3 layout, 4 type, 5 buttons and links,
 * 6 header and menu, 7 footer, 8 page parts, 9 photos, 10 forms,
 * 11 editing, 12 motion, 13 helpers.
 */

/* 1. Tokens ------------------------------------------------------------ */
:root {
	--color-bg: #f6f7f9;
	--color-surface: #ffffff;
	--color-text: #1f2a37;
	--color-accent: #2f5bd3;
	--color-accent-2: #9db6ff;
	--color-divider: #dfe3ea;
	--color-dark: #17202c;

	--font-heading: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-heading-weight: 800;

	--radius-control: 10px;
	--radius-card: 16px;
	--radius-panel: 24px;
	--radius-pill: 999px;

	--shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
	--shadow-md: 0 10px 30px rgba(16, 24, 40, .08);
	--shadow-lg: 0 24px 60px rgba(16, 24, 40, .12);

	--motion-duration: .5s;
	--motion-ease: cubic-bezier(.2, .7, .2, 1);

	--content-max: 1200px;
	--content-narrow: 760px;
	--gutter: clamp(16px, 4vw, 40px);
	--section-gap: clamp(56px, 8vw, 110px);
	--logo-height: 44px;

	--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
	--space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

	--step--1: clamp(.83rem, .8rem + .1vw, .9rem);
	--step-0: clamp(1rem, .96rem + .2vw, 1.09rem);
	--step-1: clamp(1.2rem, 1.1rem + .4vw, 1.4rem);
	--step-2: clamp(1.44rem, 1.25rem + .8vw, 1.9rem);
	--step-3: clamp(1.73rem, 1.4rem + 1.5vw, 2.6rem);
	--step-4: clamp(2.07rem, 1.5rem + 2.6vw, 3.5rem);
	--step-5: clamp(2.49rem, 1.6rem + 4vw, 4.6rem);

	/* Worked out from the colours above; never set by hand. */
	--color-text-muted: #556275;
	--color-accent-hover: #2349ad;
	--color-tint: #eef2fb;
	--color-on-dark: #ffffff;
	--color-on-dark-muted: #c8d0dc;
	--color-line-on-dark: rgba(255, 255, 255, .16);
	--color-field-border: #c3cad6;
	--color-danger: #b42318;
	--color-success: #067647;
}
@supports (color: color-mix(in srgb, red, blue)) {
	:root {
		--color-text-muted: color-mix(in srgb, var(--color-text) 72%, var(--color-bg));
		--color-accent-hover: color-mix(in srgb, var(--color-accent) 82%, #000);
		--color-tint: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
		--color-on-dark-muted: color-mix(in srgb, var(--color-on-dark) 78%, var(--color-dark));
		--color-field-border: color-mix(in srgb, var(--color-text) 25%, var(--color-surface));
	}
}

/* 2. Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.swd-site { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6; }
.swd-site img, .swd-site svg, .swd-site video { max-width: 100%; height: auto; display: block; }
.swd-site a { color: var(--color-accent); text-underline-offset: .18em; }
.swd-site a:hover { color: var(--color-accent-hover); }
.swd-site :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; border-radius: 4px; }
.swd-site ::selection { background: var(--color-accent); color: #fff; }

/* 3. Layout ------------------------------------------------------------ */
.swd-wrap { width: min(100% - 2 * var(--gutter), var(--content-max)); margin-inline: auto; }
.swd-narrow { width: min(100% - 2 * var(--gutter), var(--content-narrow)); }
.swd-section { padding-block: var(--section-gap); }
/* Two plain sections in a row share one gap rather than two. */
.swd-section:not(.swd-dark):not(.swd-tint) + .swd-section:not(.swd-dark):not(.swd-tint) { padding-top: 0; }
.swd-tint { background: var(--color-tint); }
.swd-surface { background: var(--color-surface); }
.swd-dark { background: var(--color-dark); color: var(--color-on-dark); }
.swd-dark a:not(.swd-btn) { color: var(--color-on-dark); }
.swd-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.swd-split { display: grid; gap: var(--space-7); align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.swd-main { display: block; outline: none; }

/* 4. Type -------------------------------------------------------------- */
.swd-h1, .swd-h2, .swd-h3, .swd-h4, .swd-site h1, .swd-site h2, .swd-site h3 {
	font-family: var(--font-heading);
	font-weight: var(--font-heading-weight);
	line-height: 1.08;
	letter-spacing: -.02em;
	margin: 0 0 .5em;
	text-wrap: balance;
}
.swd-h1 { font-size: var(--step-5); }
.swd-h2 { font-size: var(--step-4); }
.swd-h3 { font-size: var(--step-2); letter-spacing: -.01em; }
.swd-h4 { font-size: var(--step-1); }
.swd-lead { font-size: var(--step-1); line-height: 1.5; color: var(--color-text-muted); max-width: 62ch; }
.swd-dark .swd-lead { color: var(--color-on-dark-muted); }
.swd-muted { color: var(--color-text-muted); }
.swd-eyebrow {
	display: inline-flex; align-items: center; gap: .6em; margin: 0 0 var(--space-3);
	font-size: var(--step--1); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted);
}
.swd-dark .swd-eyebrow { color: var(--color-on-dark-muted); }
.swd-eyebrow-dot { width: .7em; height: .7em; border-radius: 50%; background: var(--color-accent); flex: none; }
.swd-prose { max-width: 70ch; }
.swd-prose > * + * { margin-top: 1em; }
.swd-prose h2 { font-size: var(--step-3); margin-top: 1.6em; }
.swd-prose h3 { font-size: var(--step-2); margin-top: 1.4em; }
.swd-heading { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: end; margin-bottom: var(--space-6); }
.swd-heading .swd-h2 { margin-bottom: 0; }

/* 5. Buttons and links ------------------------------------------------- */
.swd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .55em;
	min-height: 48px; padding: .7em 1.4em; border-radius: var(--radius-pill); border: 2px solid transparent;
	font: inherit; font-weight: 800; line-height: 1.1; text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.swd-site .swd-btn-primary { background: var(--color-accent); color: #fff; }
.swd-site .swd-btn-primary:hover { background: var(--color-accent-hover); color: #fff; transform: translateY(-1px); }
.swd-site .swd-btn-secondary { background: transparent; color: var(--color-text); border-color: currentColor; }
.swd-site .swd-btn-ghost { background: transparent; color: var(--color-text); padding-inline: .6em; }
.swd-site .swd-btn-on-dark { background: transparent; color: var(--color-on-dark); border-color: var(--color-line-on-dark); }
.swd-site .swd-btn-on-dark:hover { border-color: var(--color-on-dark); color: var(--color-on-dark); }
.swd-btn .swd-icon { width: 1.1em; height: 1.1em; }
.swd-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.swd-link-arrow { font-weight: 800; text-decoration: none; }
.swd-link-arrow:hover { text-decoration: underline; }

/* 6. Header and menu ---------------------------------------------------- */
.swd-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; padding: .6em 1em; background: var(--color-surface); border-radius: var(--radius-control); }
.swd-skip:focus { left: 8px; }
.swd-header { position: sticky; top: 0; z-index: 50; background: var(--color-surface); border-bottom: 1px solid var(--color-divider); }
/* Below the WordPress toolbar for people signed in. */
.admin-bar .swd-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .swd-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .swd-header { top: 0; } }
.swd-header-inner { display: flex; align-items: center; gap: var(--space-5); min-height: 76px; }
.swd-logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--color-text); margin-right: auto; }
.swd-logo-img { height: var(--logo-height); width: auto; }
.swd-logo-text { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: var(--step-1); }
.swd-nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-5); }
.swd-nav-list a { color: var(--color-text); text-decoration: none; font-weight: 700; }
.swd-nav-list a[aria-current="page"], .swd-nav-list a:hover { color: var(--color-accent); }
.swd-nav-list ul { display: none; }
.swd-header-cta { display: flex; gap: var(--space-2); align-items: center; }
.swd-menu-toggle { display: none; align-items: center; gap: .4em; min-height: 44px; padding: .4em .8em; border: 2px solid var(--color-divider); border-radius: var(--radius-pill); background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
@media (max-width: 960px) {
	.swd-menu-toggle { display: inline-flex; order: 3; }
	.swd-header-cta { display: none; }
	.swd-nav { position: fixed; inset: 76px 0 0; background: var(--color-surface); padding: var(--space-6) var(--gutter); overflow: auto; display: none; }
	.swd-nav.is-open { display: block; }
	.swd-nav-list { flex-direction: column; gap: 0; }
	.swd-nav-list a { display: block; padding: var(--space-4) 0; border-bottom: 1px solid var(--color-divider); font-size: var(--step-1); }
	.swd-nav-list ul { display: block; padding-left: var(--space-4); list-style: none; }
}

/* 7. Footer ------------------------------------------------------------ */
.swd-footer { padding-block: var(--space-8) var(--space-6); font-size: var(--step--1); }
.swd-footer-top { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.swd-footer-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: var(--step-2); margin: 0; }
.swd-footer-line { color: var(--color-on-dark-muted); }
.swd-footer .swd-nav-list, .swd-footer-list { flex-direction: column; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.swd-footer .swd-nav-list a, .swd-footer-list a { color: var(--color-on-dark); font-weight: 600; }
.swd-nap { font-style: normal; display: flex; flex-direction: column; gap: 2px; }
.swd-social { list-style: none; display: flex; gap: var(--space-3); padding: 0; margin: 0; }
.swd-social a { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-line-on-dark); }
.swd-footer-legal { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--color-line-on-dark); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; color: var(--color-on-dark-muted); }
.swd-footer-legal p { margin: 0; }
.swd-footer-legal ul { list-style: none; display: flex; gap: var(--space-4); margin: 0; padding: 0; }

/* 8. Page parts -------------------------------------------------------- */
.swd-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4em; padding: 0; margin: 0 0 var(--space-5); font-size: var(--step--1); color: var(--color-text-muted); }
.swd-crumbs li + li::before { content: "/"; margin-right: .4em; opacity: .6; }
.swd-faqs { display: grid; gap: var(--space-3); }
.swd-faq { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-card); }
.swd-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); cursor: pointer; }
.swd-faq summary::-webkit-details-marker { display: none; }
.swd-faq-q { font-size: var(--step-1); margin: 0; }
.swd-faq-icon { width: 14px; height: 14px; flex: none; position: relative; }
.swd-faq-icon::before, .swd-faq-icon::after { content: ""; position: absolute; inset: 6px 0 auto; height: 2px; background: currentColor; transition: transform .2s; }
.swd-faq-icon::after { transform: rotate(90deg); }
.swd-faq[open] .swd-faq-icon::after { transform: rotate(0); }
.swd-faq-a { padding: 0 var(--space-5) var(--space-4); color: var(--color-text-muted); }
.swd-cta-inner { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: space-between; align-items: end; }
.swd-cta-band .swd-h2 { color: var(--color-on-dark); }
.swd-card { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-card); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.swd-pagination ul { list-style: none; display: flex; gap: var(--space-2); padding: 0; }
.swd-pagination a, .swd-pagination span { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .6em; border-radius: var(--radius-pill); border: 1px solid var(--color-divider); text-decoration: none; }
.swd-pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.swd-results { padding: 0; list-style: none; }
.swd-results li { padding-block: var(--space-4); border-bottom: 1px solid var(--color-divider); }
.swd-results a { text-decoration: none; }

/* 9. Photos ------------------------------------------------------------ */
.swd-photo { position: relative; overflow: hidden; border-radius: var(--radius-card); background: var(--color-tint); aspect-ratio: 4 / 3; }
.swd-photo-hero { aspect-ratio: 16 / 7; border-radius: 0; }
.swd-photo-wide { aspect-ratio: 16 / 8; }
.swd-photo-portrait { aspect-ratio: 4 / 5; }
.swd-photo-thumb { aspect-ratio: 1; }
.swd-photo-img { width: 100%; height: 100%; object-fit: cover; }
.swd-photo.is-empty { background: repeating-linear-gradient(135deg, var(--color-tint) 0 12px, var(--color-surface) 12px 24px); }
.swd-photo-hint { position: absolute; left: 12px; bottom: 12px; right: 12px; font-size: var(--step--1); font-weight: 700; color: var(--color-text-muted); }

/* 10. Forms ------------------------------------------------------------ */
.swd-site input[type="text"], .swd-site input[type="email"], .swd-site input[type="tel"], .swd-site input[type="search"], .swd-site input[type="url"], .swd-site textarea, .swd-site select {
	width: 100%; min-height: 48px; padding: .7em .9em; border: 1px solid var(--color-field-border); border-radius: var(--radius-control);
	background: var(--color-surface); color: var(--color-text); font: inherit;
}
.swd-site textarea { min-height: 140px; }
.swd-site .search-form { display: flex; gap: var(--space-2); margin-block: var(--space-5); }
.swd-site .search-form label { flex: 1; }
.swd-site .search-submit { min-height: 48px; padding: 0 1.2em; border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }

/* 11. Editing ---------------------------------------------------------- */
.swd-note { background: #fff4c2; color: #5c4400; padding: 0 .2em; border-radius: 3px; }

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

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

/* 14. Forms ------------------------------------------------------------ */
.swd-form { display: grid; gap: var(--space-4); }
.swd-form-row label { display: block; font-weight: 700; margin-bottom: var(--space-1); }
.swd-form-row .swd-check { display: flex; gap: .6em; align-items: flex-start; font-weight: 400; }
.swd-check input { width: 22px; height: 22px; margin-top: .15em; flex: none; accent-color: var(--color-accent); }
.swd-required { color: var(--color-danger); }
.swd-optional { font-weight: 400; color: var(--color-text-muted); font-size: var(--step--1); }
.swd-form-hint { margin: 0 0 var(--space-1); font-size: var(--step--1); color: var(--color-text-muted); }
.swd-form-field-error { margin: var(--space-1) 0 0; color: var(--color-danger); font-weight: 700; font-size: var(--step--1); }
.swd-form-field-error:empty { display: none; }
.swd-form-row.has-error input, .swd-form-row.has-error textarea, .swd-form-row.has-error select { border-color: var(--color-danger); border-width: 2px; }
.swd-form-message:empty { display: none; }
.swd-form-message:focus { outline: none; }
.swd-form-ok, .swd-form-error { margin: 0; padding: var(--space-4); border-radius: var(--radius-control); font-weight: 700; }
.swd-form-ok { background: #ecfdf3; color: var(--color-success); }
.swd-form-error { background: #fef3f2; color: var(--color-danger); }
.swd-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.swd-turnstile { min-height: 65px; }
.swd-contact { display: grid; gap: var(--space-7); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }

/* 15. Cookie notice ---------------------------------------------------- */
.swd-consent {
	position: fixed; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); z-index: 9000;
	max-width: 560px; padding: var(--space-5); border-radius: var(--radius-card);
	background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); border: 1px solid var(--color-divider);
}
.swd-consent p { margin: 0 0 var(--space-4); }

/* 16. Module parts: cards, reviews, projects, articles, locations -------- */
.swd-chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-6); }
.swd-chip { display: inline-flex; align-items: center; min-height: 40px; padding: .35em 1em; border: 1px solid var(--color-divider); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); text-decoration: none; font-weight: 700; font-size: var(--step--1); }
.swd-chip:hover, .swd-chip[aria-current="page"] { border-color: var(--color-accent); color: var(--color-accent); }
.swd-chips-large .swd-chip { font-size: var(--step-0); }

a.swd-card { display: flex; flex-direction: column; gap: var(--space-2); color: var(--color-text); text-decoration: none; transition: transform .2s var(--motion-ease), box-shadow .2s; }
a.swd-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--color-text); }
a.swd-card .swd-photo { margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-2); border-radius: var(--radius-card) var(--radius-card) 0 0; }
a.swd-card .swd-h4 { margin: 0; }
a.swd-card .swd-eyebrow { margin: 0; }
.swd-article-date { margin: auto 0 0; font-size: var(--step--1); color: var(--color-text-muted); }

.swd-review { margin: 0; padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-card); display: flex; flex-direction: column; gap: var(--space-3); }
.swd-review blockquote { margin: 0; }
.swd-review blockquote p { margin: 0 0 .6em; }
.swd-stars { margin: 0; color: #c98a00; letter-spacing: .1em; font-size: var(--step-1); }

.swd-facts { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin: var(--space-6) 0 0; }
.swd-facts div { border-top: 1px solid var(--color-line-on-dark); padding-top: var(--space-3); }
.swd-facts dt { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .1em; color: var(--color-on-dark-muted); }
.swd-facts dd { margin: 0; font-weight: 800; font-size: var(--step-1); }
.swd-project-client { font-weight: 700; color: var(--color-on-dark-muted); }
.swd-story-part { margin-bottom: var(--space-7); }
.swd-story-num { color: var(--color-accent); margin-right: .4em; }
.swd-quote { margin: var(--space-7) 0; padding: var(--space-6); border-left: 4px solid var(--color-accent); background: var(--color-surface); border-radius: 0 var(--radius-card) var(--radius-card) 0; }
.swd-quote blockquote { margin: 0; font-size: var(--step-1); }
.swd-quote figcaption { margin-top: var(--space-3); font-weight: 700; }
.swd-gallery-item { margin: 0; }
.swd-gallery-item figcaption { margin-top: var(--space-2); font-size: var(--step--1); }
.swd-article-cta { margin-top: var(--space-7); }

/* 17. Movement (see motion.js) ---------------------------------------- */
.swd-js-motion .swd-will-reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--motion-duration) var(--motion-ease), transform var(--motion-duration) var(--motion-ease); }
.swd-js-motion .swd-will-reveal.is-in { opacity: 1; transform: none; }
.swd-motion-full.swd-js-motion .swd-will-reveal { transform: translateY(32px) scale(.98); }
.swd-motion-full.swd-js-motion .swd-will-reveal.is-in { transform: none; }
@media (prefers-reduced-motion: reduce) {
	.swd-js-motion .swd-will-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* 18. Small fixes ------------------------------------------------------ */
.swd-dark .swd-crumbs ol { color: var(--color-on-dark-muted); }
.swd-dark .swd-crumbs a { color: var(--color-on-dark); }
