/*
 * Lavanco theme styles that theme.json cannot express.
 * Loaded on the front end and in the block editor.
 * Breakpoint: 900px (matches the Heritage prototype).
 */

body { -webkit-font-smoothing: antialiased; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 20;
}
.lavanco-header {
	background: var(--wp--preset--color--base);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.lavanco-logo img { height: clamp(26px, 3.15vw, 39px); width: auto; display: block; }
.lavanco-footer-logo img { height: 26px; width: auto; display: block; }
/* Accreditation band (top of the footer). ComplyWorks must stay at least 165px wide
   (its brand rules): 68px tall = about 174px wide. */
.lavanco-accred { border-top: 1px solid var(--wp--preset--color--line); }
.lavanco-accred + .lavanco-footer { margin-block-start: 0; }
.lavanco-accred .lavanco-accred-row { gap: 56px; }
.lavanco-accred .wp-block-image { margin: 0; }
.lavanco-accred-label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--sub);
}
.lavanco-accred-complyworks img { height: 68px; width: auto; display: block; }
.lavanco-accred-contractorcheck { border-left: 1px solid var(--wp--preset--color--line); padding-left: 56px; }
.lavanco-accred-contractorcheck img { height: 96px; width: auto; display: block; }
@media (max-width: 599px) {
	.lavanco-accred .lavanco-accred-row { gap: 20px 28px; }
	.lavanco-accred-label { flex-basis: 100%; text-align: center; font-size: 12px; }
	.lavanco-accred-contractorcheck { border-left: 0; padding-left: 0; }
	.lavanco-accred-contractorcheck img { height: 84px; }
}
.lavanco-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.lavanco-header .wp-block-navigation .current-menu-item > a,
.lavanco-header .wp-block-navigation a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.lavanco-phone a { font-weight: 600; color: var(--wp--preset--color--primary); white-space: nowrap; }
.lavanco-header .wp-block-button__link { padding: 12px 20px; font-size: 15px; }

/* ---------- Block styles ---------- */
.is-style-eyebrow {
	font-size: 13px;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
}
.is-style-eyebrow:not(.has-text-color) { color: var(--wp--preset--color--primary); }

.is-style-number {
	font-family: var(--wp--preset--font-family--display);
	font-size: 18px;
	line-height: 1.2;
}
.is-style-number:not(.has-text-color) { color: var(--wp--preset--color--primary); }

.wp-block-group.is-style-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	overflow: hidden;
	background: var(--wp--preset--color--base);
	transition: box-shadow .2s ease;
}
.wp-block-group.is-style-card:hover { box-shadow: 0 12px 30px rgba(14, 35, 64, .12); }
.wp-block-group.is-style-card > .wp-block-image { margin: 0; }
.wp-block-group.is-style-card > .wp-block-image img { width: 100%; height: 180px; object-fit: cover; display: block; }

.wp-block-group.is-style-tile {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	border-radius: 10px;
	padding: 28px;
	min-height: 190px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	transition: transform .2s ease;
}
.wp-block-group.is-style-tile:hover { transform: translateY(-2px); }
.wp-block-group.is-style-tile a { color: inherit; }

.wp-block-group.is-style-soft {
	background: var(--wp--preset--color--base);
	border-radius: 12px;
	padding: 28px;
}

ul.is-style-chips,
ul.is-style-inline,
ul.is-style-squares { list-style: none; padding-left: 0; margin: 0; }
ul.is-style-chips { display: flex; flex-wrap: wrap; gap: 8px; }
ul.is-style-chips li {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	padding: 9px 14px;
	border-radius: 40px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
}
ul.is-style-inline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
ul.is-style-squares { display: flex; flex-direction: column; gap: 10px; }
ul.is-style-squares li { display: flex; gap: 12px; align-items: center; color: var(--wp--preset--color--ink); }
ul.is-style-squares li::before {
	content: "";
	width: 8px;
	height: 8px;
	flex: none;
	background: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-light .wp-block-button__link {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
	border: 1.5px solid var(--wp--preset--color--base);
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 1.5px solid currentColor;
	padding: 16px 26px;
}
.wp-block-button__link:hover { filter: brightness(1.08); text-decoration: none; }

/* ---------- Home hero ---------- */
.lavanco-hero { overflow: hidden; }
.lavanco-hero .wp-block-columns { gap: 0; }
.lavanco-hero-text { padding: clamp(31px, 5.2vw, 62px) 0; }
.lavanco-hero-text .wp-block-heading { text-wrap: pretty; }
.lavanco-hero-photo { align-self: stretch; }
.lavanco-hero-photo .wp-block-image,
.lavanco-hero-photo .wp-block-image img { height: 100%; width: 100%; object-fit: cover; margin: 0; }
.lavanco-hero-photo .wp-block-image img { min-height: clamp(260px, 40vw, 560px); }
.lavanco-badge {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-family: var(--wp--preset--font-family--display);
	font-size: 14px;
	line-height: 1.1;
	flex: none;
	margin: 0;
}
.lavanco-text-link a,
a.lavanco-text-link {
	font-weight: 600;
}
.lavanco-hero .lavanco-text-link a {
	font-weight: 500;
	color: inherit;
	border-bottom: 1px solid var(--wp--preset--color--accent);
	padding: 16px 4px;
}
.lavanco-hero .lavanco-text-link a:hover { text-decoration: none; }

/* Stat ("1991") block */
.lavanco-stat { line-height: .85; letter-spacing: -.04em; margin: 0; }
.lavanco-mini-stat strong {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 40px;
	line-height: 1.2;
	color: var(--wp--preset--color--primary);
}

/* ---------- FAQ (core Details block) ---------- */
.wp-block-details { margin: 0; }
.wp-block-details > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 26px;
	font-size: 18px;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
}
.wp-block-details > summary::-webkit-details-marker { display: none; }
.wp-block-details > summary::after { content: "+"; color: var(--wp--preset--color--primary); font-weight: 600; }
.wp-block-details[open] > summary::after { content: "\2212"; }
.wp-block-details > :not(summary) {
	padding: 0 26px 22px;
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
	color: var(--wp--preset--color--sub);
}
.wp-block-details > summary:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 2px; border-radius: 16px; }

/* ---------- Services page rows ---------- */
.lavanco-service-row { border-bottom: 1px solid var(--wp--preset--color--line); padding-bottom: clamp(40px, 5vw, 64px); }
.lavanco-service-row .wp-block-image img { width: 100%; min-height: 280px; object-fit: cover; border-radius: 10px; }
.lavanco-service-row:last-child { border-bottom: 0; }
[id] { scroll-margin-top: 110px; }

/* ---------- About page ---------- */
.lavanco-about-photo { margin-top: clamp(-160px, -10vw, -80px); position: relative; }
.lavanco-about-photo img { width: 100%; height: clamp(240px, 32vw, 420px); object-fit: cover; border-radius: 10px; }
.lavanco-timeline-row { border-top: 1px solid var(--wp--preset--color--line); padding: 26px 0; margin: 0 !important; }
.lavanco-timeline-row .is-style-number { font-size: clamp(26px, 3vw, 36px); }

/* ---------- Map embeds ---------- */
.lavanco-map iframe { display: block; width: 100%; height: 100%; min-height: 260px; border: 0; }
.lavanco-map-small iframe { min-height: 200px; border-radius: 10px; }

/* ---------- Contact form (Fluent Forms) ---------- */
.lavanco-form-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: clamp(24px, 4vw, 40px);
}
.lavanco-form-card .ff-el-input--label label { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--primary); }
.lavanco-form-card .ff-el-form-control {
	padding: 14px !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 6px !important;
	font-size: 16px !important;
	color: var(--wp--preset--color--ink) !important;
	font-family: inherit !important;
}
.lavanco-form-card .ff-btn-submit {
	background: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--base) !important;
	border: 0 !important;
	padding: 17px 28px !important;
	border-radius: 6px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
}
.lavanco-form-card .error,
.lavanco-form-card .ff-el-is-error .text-danger { color: #c2410c; font-size: 13px; font-weight: 500; }

/* ---------- Call band ---------- */
.lavanco-notice { color: var(--wp--preset--color--accent-pale); font-style: italic; }

/* ---------- Footer ---------- */
.lavanco-footer { font-size: 15px; line-height: 1.7; }
.lavanco-footer a { color: inherit; }
.lavanco-footer .lavanco-footer-label { color: var(--wp--preset--color--base); font-weight: 600; margin: 0; }
.lavanco-footer p { margin: 0; }
.lavanco-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }

/* ---------- Mobile call bar ---------- */
.lavanco-mobile-bar { display: none; }

@media (max-width: 899px) {
	.lavanco-header-actions { display: none !important; }
	.lavanco-mobile-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 30;
		display: grid;
		grid-template-columns: 1fr 1fr;
		box-shadow: 0 -6px 20px rgba(0, 0, 0, .12);
		margin: 0 !important;
	}
	.lavanco-mobile-bar a {
		display: block;
		padding: 17px;
		text-align: center;
		font-weight: 600;
		font-size: 15px;
		text-decoration: none;
	}
	.lavanco-mobile-bar p { margin: 0; }
	.lavanco-mobile-bar .lavanco-mobile-call a { background: var(--wp--preset--color--base); color: var(--wp--preset--color--primary); }
	.lavanco-mobile-bar .lavanco-mobile-quote a { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); }
	body { padding-bottom: 56px; }
}

/* Keyboard focus that is visible on navy and white. */
:where(a, button, summary, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
:where(.has-base-background-color, .lavanco-header, .lavanco-form-card) :where(a, button, summary, input, select, textarea):focus-visible {
	outline-color: var(--wp--preset--color--primary);
}

/* Make whole cards and tiles clickable via their title link (keeps one link per card for screen readers). */
.wp-block-group.is-style-card,
.wp-block-group.is-style-tile { position: relative; }
.wp-block-group.is-style-card h3 a::after,
.wp-block-group.is-style-tile > p:first-child a::after { content: ""; position: absolute; inset: 0; }
.wp-block-group.is-style-card h3 a { color: var(--wp--preset--color--primary); }
.wp-block-group.is-style-card:hover h3 a,
.wp-block-group.is-style-tile:hover a { text-decoration: none; }

/* Full-width sections sit flush against each other (no block gap between them). */
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + * { margin-block-start: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
/* About page before the team photo is added: keep normal spacing under the hero. */
.lavanco-about-story:not(:has(.lavanco-about-photo)) { padding-top: var(--wp--preset--spacing--section) !important; }

/* ---------- Light/dark mode toggle (header) ---------- */
/* Hidden until the head script has run (no JavaScript = light site, no button). */
.lavanco-theme-toggle { display: none; }
html[data-theme] .lavanco-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
html[data-theme] .lavanco-theme-toggle:hover { border-color: currentColor; }
.lavanco-theme-toggle .lavanco-icon-sun,
html[data-theme="dark"] .lavanco-theme-toggle .lavanco-icon-moon { display: none; }
html[data-theme="dark"] .lavanco-theme-toggle .lavanco-icon-sun { display: block; }

/*
 * ---------- Dark mode ----------
 * Colours from the Heritage prototype's dark palette (design/Heritage Site.dc.html, DARK).
 * The palette colours are redefined, then the few places where one colour plays two
 * roles (e.g. "base" is both the page background and white text on navy) are fixed.
 * The block editor always shows the light colours.
 */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"],
html[data-theme="dark"] body {
	--wp--preset--color--primary: #8dbbe6;      /* links and buttons */
	--wp--preset--color--primary-dark: #1f5fa8; /* credentials strip */
	--wp--preset--color--accent: #8dbbe6;
	--wp--preset--color--tint: #0f1d33;
	--wp--preset--color--base: #0b1626;         /* page and header background */
	--wp--preset--color--ink: #eaf1f9;
	--wp--preset--color--body: #b8c6d6;
	--wp--preset--color--sub: #9fb0c4;
	--wp--preset--color--line: #22324a;
	--lavanco-card: #182a45;
}

/* "White" text stays white on the coloured sections. */
html[data-theme="dark"] .has-base-color { color: #ffffff !important; }

/* Headings: light ink instead of the link blue. */
html[data-theme="dark"] :where(h1, h2, h3, h4, h5, h6):not(.has-text-color) { color: var(--wp--preset--color--ink); }

/* Navy sections become deep navy; the call band stays a brighter blue. */
html[data-theme="dark"] .has-primary-background-color,
html[data-theme="dark"] .wp-block-group.is-style-tile { background-color: #10203a !important; }
html[data-theme="dark"] .wp-block-group.is-style-tile { color: #ffffff; }
html[data-theme="dark"] .lavanco-cta-band { background-color: #1f5fa8 !important; }
html[data-theme="dark"] .lavanco-footer { background-color: #060e1a !important; color: #9fb0c4 !important; }
html[data-theme="dark"] .lavanco-footer .lavanco-footer-label { color: #ffffff; }

/* Cards, FAQ, chips and the form sit on a lifted navy. */
html[data-theme="dark"] .wp-block-group.is-style-card,
html[data-theme="dark"] .wp-block-group.is-style-soft,
html[data-theme="dark"] .wp-block-details,
html[data-theme="dark"] .lavanco-form-card,
html[data-theme="dark"] ul.is-style-chips li { background-color: var(--lavanco-card); }
html[data-theme="dark"] .wp-block-group.is-style-card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }

/* Buttons on the coloured sections. */
html[data-theme="dark"] .wp-block-button.is-style-light .wp-block-button__link {
	background: #ffffff;
	color: #10203a;
	border-color: #ffffff;
}
html[data-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link { color: #ffffff; }

/* Logos: the Lavanco logo is one colour, so it turns white exactly. The accreditation
   logos must not be recoloured, so they sit on white cards instead. */
html[data-theme="dark"] .lavanco-logo img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .lavanco-accred .wp-block-image {
	background: #ffffff;
	border-radius: 10px;
	padding: 10px 14px;
	border-left: 0;
}
html[data-theme="dark"] .lavanco-accred .lavanco-accred-contractorcheck img { height: 80px; }

/* Phone menu overlay. */
html[data-theme="dark"] .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--ink) !important;
}

/* Contact form fields and errors. */
html[data-theme="dark"] .lavanco-form-card .ff-el-form-control { background-color: var(--wp--preset--color--tint) !important; }
html[data-theme="dark"] .lavanco-form-card .error,
html[data-theme="dark"] .lavanco-form-card .ff-el-is-error .text-danger { color: #fdba74; }
