/*
 * EnviroTotal — component styles (layered on top of theme.json tokens).
 * Header / mega-menu / mobile drawer, buttons, cards, checklists, contact form,
 * cookie banner, footer, FAQ marker, utilities. Values map to theme.json presets.
 */

/* ---------------------------------------------------------------- Utilities */
.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 !important;
	word-wrap: normal !important;
}

.et-eyebrow {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.et-eyebrow.is-soft { color: var(--wp--preset--color--accent-soft); }

.et-lead { max-width: 54ch; }
.et-measure { max-width: 64ch; }
.et-note { color: var(--wp--preset--color--muted); }
.et-link-underline { font-weight: 600; color: var(--wp--preset--color--brand); text-decoration: none; border-bottom: 1.5px solid var(--wp--preset--color--brand); padding-bottom: 3px; }
.et-link-underline:hover { color: var(--wp--preset--color--brand-dark); }

/* WordPress' constrained layout auto-centers any direct child that has a
   max-width. Left-align hero titles and lead paragraphs to the content column
   (matches the design) — works in both content-width and full-bleed sections. */
.is-layout-constrained > .et-lead,
.is-layout-constrained > .et-measure,
.is-layout-constrained > :where(h1, h2, h3)[style*="max-width"] {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size, 1240px)) / 2)) !important;
	margin-right: auto !important;
}

.et-diamond {
	width: 11px;
	height: 11px;
	display: inline-block;
	background: var(--wp--preset--color--accent);
	transform: rotate(45deg);
}
.et-diamond--soft { background: var(--wp--preset--color--accent-soft); }
/* Diamond + heading on one line (service cards) */
.et-card__head { align-items: center; }
.et-card__head .et-diamond { flex: 0 0 auto; }

/* --------------------------------------------------------------- Buttons */
.et-btn {
	box-sizing: border-box; /* so width:100% (mobile CTA, form submit) includes padding */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.97rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 1.5px solid transparent;
	border-radius: var(--wp--custom--radius--button);
	padding: 0.92rem 1.6rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.et-btn--solid { background: var(--wp--preset--color--brand); color: var(--wp--preset--color--base); }
.et-btn--solid:hover, .et-btn--solid:focus-visible { background: var(--wp--preset--color--brand-dark); color: var(--wp--preset--color--base); }
.et-btn--ghost {
	background: transparent;
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
}
.et-btn--ghost:hover, .et-btn--ghost:focus-visible { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--base); }
.et-btn--block { width: 100%; }

/* ---------------------------------------------------------------- Header */
.et-header { position: relative; }

/* Sticky header — the template-part <header> is a direct child of .wp-site-blocks
   (the full-page container), so the whole header (contact bar + nav) stays put
   for the entire scroll. Sticking .et-nav alone failed because its parent
   (.et-header) is too short to stick within. */
.wp-site-blocks > header {
	position: sticky;
	top: 0;
	z-index: 50;
}

.et-topbar {
	background: var(--wp--preset--color--brand-dark);
	color: #c4d6c4;
	font-size: 0.8125rem;
}
.et-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 28px;
	justify-content: space-between;
	align-items: center;
	padding: 9px var(--wp--preset--spacing--gutter);
}
.et-topbar a { color: var(--wp--preset--color--base); text-decoration: none; }
.et-topbar a:hover { text-decoration: underline; }
.et-topbar__phone { font-weight: 600; }
.et-topbar__links { display: flex; flex-wrap: wrap; gap: 6px 24px; }

.et-nav {
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: rgba(246, 244, 238, 0.92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.et-nav__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px 32px;
	padding: 15px var(--wp--preset--spacing--gutter);
}

.et-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--wp--preset--color--ink); }
.et-brand__mark { width: 11px; height: 11px; background: var(--wp--preset--color--accent); transform: rotate(45deg); display: block; }
.et-brand__name { font-family: var(--wp--preset--font-family--serif); font-weight: 700; font-size: 1.5625rem; letter-spacing: -0.02em; }

.et-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 2px 4px;
}
.et-menu__item { position: relative; }
.et-menu__item > a:not(.et-btn),
.et-menu__parent {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	border-radius: 6px;
}
.et-menu__item > a:not(.et-btn):hover,
.et-menu__parent:hover {
	color: var(--wp--preset--color--brand);
	text-decoration: underline;
	text-underline-offset: 6px;
}
.et-menu__item > a:not(.et-btn)[aria-current],
.et-menu__parent[aria-current] {
	color: var(--wp--preset--color--brand);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 2px;
}
.et-menu__cta { margin-left: 8px; }
.et-menu__cta .et-btn { padding: 0.7rem 1.4rem; font-size: 0.9rem; }

.et-caret {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

/* Mega-menu */
.et-mega__toggle { display: none; background: none; border: 0; }
.et-mega {
	position: absolute;
	top: 100%;
	left: 0;
	padding-top: 8px;
	z-index: 60;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	pointer-events: none;
}
.et-has-mega:hover .et-mega,
.et-has-mega:focus-within .et-mega,
.et-has-mega.is-open .et-mega {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}
.et-has-mega:hover .et-caret,
.et-has-mega.is-open .et-caret { transform: rotate(180deg); }
.et-mega__panel {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
	box-shadow: var(--wp--custom--shadow--menu);
	padding: 8px;
	min-width: 320px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.et-mega__item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border-radius: 8px;
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.et-mega__item:hover { background: #edf1e8; }
.et-mega__title { font-size: 0.9rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.et-mega__item[aria-current] .et-mega__title { color: var(--wp--preset--color--brand); }
.et-mega__desc { font-size: 0.78rem; color: var(--wp--preset--color--muted); }
.et-mega__sep { height: 1px; background: var(--wp--preset--color--line); margin: 6px 10px; display: block; }
.et-mega__all {
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--brand);
	text-decoration: none;
}
.et-mega__all:hover { background: #edf1e8; }

/* Hamburger */
.et-burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: none;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	cursor: pointer;
	position: relative;
	z-index: 80; /* stay above the open drawer (z-index 70) so the ✕ can close it */
}
.et-burger__box { position: relative; width: 20px; height: 14px; }
.et-burger__line,
.et-burger__line::before,
.et-burger__line::after {
	position: absolute;
	left: 0;
	width: 20px;
	height: 2px;
	background: var(--wp--preset--color--ink);
	border-radius: 2px;
	transition: transform 0.24s ease, opacity 0.24s ease, top 0.24s ease;
}
.et-burger__line { top: 6px; }
.et-burger__line::before { content: ""; top: -6px; }
.et-burger__line::after { content: ""; top: 6px; }
.et-header.is-menu-open .et-burger__line { background: transparent; }
.et-header.is-menu-open .et-burger__line::before { top: 0; transform: rotate(45deg); }
.et-header.is-menu-open .et-burger__line::after { top: 0; transform: rotate(-45deg); }

/* Header responsive: mobile drawer */
@media (max-width: 900px) {
	.et-burger { display: inline-flex; }
	/* On mobile, collapse the contact bar to a thin colored accent strip
	   (its text wraps and wastes vertical space). */
	.et-topbar { height: 6px; }
	.et-topbar__inner { display: none; }
	.et-menu {
		position: fixed;
		top: 0;
		right: 0;
		height: 100dvh;
		width: min(360px, 86vw);
		background: var(--wp--preset--color--base);
		border-left: 1px solid var(--wp--preset--color--line);
		box-shadow: -20px 0 60px -30px rgba(15, 51, 43, 0.55);
		padding: 84px 22px 28px;
		/* Anchored within the viewport (right:0) and hidden with a fade — never
		   translated off-screen, so it can't create horizontal scroll. */
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.26s ease, visibility 0.26s ease;
		overflow-y: auto;
		z-index: 70;
	}
	.et-header.is-menu-open .et-menu { opacity: 1; visibility: visible; pointer-events: auto; }
	.et-menu__list { flex-direction: column; align-items: stretch; gap: 2px; }
	.et-menu__item > a:not(.et-btn),
	.et-menu__parent { font-size: 1.0625rem; padding: 13px 10px; }
	.et-menu__cta { margin: 12px 0 0; }
	.et-menu__cta .et-btn { width: 100%; }
	.et-caret { display: none; }

	.et-mega__toggle {
		display: block;
		position: absolute;
		top: 4px;
		right: 4px;
		width: 44px;
		height: 44px;
		cursor: pointer;
	}
	.et-mega__toggle::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 0;
		height: 0;
		margin: -3px 0 0 -5px;
		border-left: 5px solid transparent;
		border-right: 5px solid transparent;
		border-top: 6px solid var(--wp--preset--color--ink);
		transition: transform 0.2s ease;
	}
	.et-has-mega.is-open .et-mega__toggle::after { transform: rotate(180deg); }
	.et-mega {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		pointer-events: auto;
		padding-top: 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.28s ease;
	}
	.et-has-mega.is-open .et-mega { max-height: 420px; }
	.et-mega__panel { background: transparent; border: 0; box-shadow: none; min-width: 0; padding: 2px 0 8px 10px; }
	.et-mega__item { padding: 9px 8px; }
	.et-mega__sep { display: none; }

	/* On mobile only [data-open]/is-open drives the mega; hover must not force it open. */
	.et-has-mega:hover .et-mega,
	.et-has-mega:focus-within .et-mega { max-height: 0; }
	.et-has-mega.is-open .et-mega { max-height: 420px; }
}

body.et-no-scroll { overflow: hidden; }

/* -------------------------------------------------------- Cards & content */
.et-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--card);
}
.et-card.is-hover { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.et-card.is-hover:hover {
	transform: translateY(-4px);
	border-color: var(--wp--preset--color--brand);
	box-shadow: var(--wp--custom--shadow--card);
}

/* Checklist ("Ce include" — ✓ rows with dividers) */
ul.et-check { list-style: none; margin: 0; padding: 0; }
ul.et-check li {
	position: relative;
	padding: 16px 0 16px 30px;
	border-bottom: 1px solid var(--wp--preset--color--line-2);
	font-size: 0.97rem;
	line-height: 1.55;
}
ul.et-check li:last-child { border-bottom: 0; }
ul.et-check li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 15px;
	color: var(--wp--preset--color--accent);
	font-weight: 700;
}

/* Bulleted list (small green square markers) */
ul.et-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ul.et-bullets li {
	position: relative;
	padding-left: 18px;
	font-size: 0.9rem;
	line-height: 1.5;
}
ul.et-bullets li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 8px;
	width: 5px;
	height: 5px;
	background: var(--wp--preset--color--accent);
}
.is-on-dark ul.et-bullets li::before { background: var(--wp--preset--color--accent-soft); }

/* Pills (anchor-nav chips) */
.et-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.et-pill {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--brand);
	text-decoration: none;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	padding: 10px 18px;
	background: var(--wp--preset--color--surface);
	transition: border-color 0.2s ease, background-color 0.2s ease;
}
.et-pill:hover { border-color: var(--wp--preset--color--brand); background: #edf1e8; }

/* Breadcrumb */
.et-breadcrumb { margin: 0; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.et-breadcrumb a { color: var(--wp--preset--color--muted); text-decoration: none; }
.et-breadcrumb a:hover { color: var(--wp--preset--color--brand); text-decoration: underline; }
.et-breadcrumb .is-current { color: var(--wp--preset--color--brand); font-weight: 600; }

/* Big serif numbers / stats */
.et-serif-num { font-family: var(--wp--preset--font-family--serif); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.et-stat-num { font-family: var(--wp--preset--font-family--serif); font-weight: 700; letter-spacing: -0.02em; color: var(--wp--preset--color--brand); }

/* --------------------------------------------------------- Contact form */
.et-formcard {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--panel);
	padding: clamp(1.75rem, 3.4vw, 2.75rem);
}
.et-formcard__title { font-family: var(--wp--preset--font-family--serif); font-weight: 600; font-size: 1.625rem; letter-spacing: -0.015em; margin: 0 0 6px; }
.et-formcard__intro { font-size: 0.9rem; color: var(--wp--preset--color--muted); margin: 0 0 1.6rem; line-height: 1.55; }
.et-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.et-field { display: flex; flex-direction: column; gap: 7px; font-size: 0.84rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.et-field--full { margin-top: 16px; }
.et-field__label { display: block; }
.et-field input,
.et-field textarea {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.95rem;
	font-weight: 400;
	padding: 13px 15px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--input);
	background: #fff;
	color: var(--wp--preset--color--ink);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.et-field textarea { resize: vertical; min-height: 128px; }
.et-field input:focus,
.et-field textarea:focus { border-color: var(--wp--preset--color--brand); box-shadow: 0 0 0 3px rgba(23, 70, 58, 0.12); }
.et-field input::placeholder,
.et-field textarea::placeholder { color: #9aa29b; }
.et-form .et-btn--block { margin-top: 1.4rem; }
.et-form__note { margin: 0.9rem 0 0; font-size: 0.78rem; color: var(--wp--preset--color--muted); line-height: 1.5; text-align: center; }
.et-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.et-notice { border-radius: var(--wp--custom--radius--input); padding: 14px 18px; margin-bottom: 18px; font-size: 0.9rem; line-height: 1.5; }
.et-notice--ok { background: #e7f0e8; border: 1px solid #b6d3bd; color: #12492f; }
.et-notice--warn { background: #f7ede2; border: 1px solid #e3c6a5; color: #7a4a17; }

/* ------------------------------------------------------------- FAQ (Details) */
.wp-block-details.et-faq { padding: 0 1.625rem; }
.et-faq summary {
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	cursor: pointer;
	padding: 20px 0;
	font-size: 1.03rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}
.et-faq summary::-webkit-details-marker { display: none; }
.et-faq summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--accent);
	transition: transform 0.2s ease;
}
.et-faq[open] summary::after { content: "−"; }
.et-faq > *:not(summary) { margin: 0 0 22px; font-size: 0.97rem; line-height: 1.65; color: var(--wp--preset--color--body); }

/* --------------------------------------------------------------- Footer */
.et-footer a { color: rgba(234, 240, 231, 0.8); text-decoration: none; }
.et-footer a:hover { color: var(--wp--preset--color--base); text-decoration: underline; }
.et-foot-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.et-foot-brand__name { font-family: var(--wp--preset--font-family--serif); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; color: var(--wp--preset--color--base); }
.et-foot-blurb { max-width: 34ch; }
.et-foot-title { margin: 0 0 16px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wp--preset--color--accent-soft); }
.et-foot-links { gap: 10px; }
.et-foot-links p { margin: 0; font-size: 0.9rem; }
.et-foot-strong a { color: var(--wp--preset--color--base); font-weight: 600; }
.et-foot-bottom { font-size: 0.8125rem; color: rgba(234, 240, 231, 0.6); gap: 8px 24px; }
.et-foot-copy { margin: 0; }
.et-foot-legal { gap: 6px 20px; }
.et-foot-legal p { margin: 0; }
.et-foot-legal a { color: rgba(234, 240, 231, 0.6); }

/* --------------------------------------------------------- Cookie banner */
.et-cookie {
	position: fixed;
	left: 50%;
	bottom: clamp(12px, 3vw, 28px);
	transform: translateX(-50%);
	z-index: 80;
	width: min(720px, calc(100vw - 32px));
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--panel);
	box-shadow: 0 30px 60px -24px rgba(15, 51, 43, 0.5);
}
.et-cookie[hidden] { display: none; }
.et-cookie__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	padding: 18px 22px;
}
.et-cookie__text { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--wp--preset--color--body); flex: 1 1 320px; }
.et-cookie__text a { color: var(--wp--preset--color--brand); font-weight: 600; }
.et-cookie__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.et-cookie .et-btn { padding: 0.7rem 1.25rem; font-size: 0.88rem; }

/* ------------------------------------------------------------- Hero media */
.et-hero-media { position: relative; }
.et-hero-media img { display: block; width: 100%; height: clamp(400px, 44vw, 560px); object-fit: cover; border-radius: var(--wp--custom--radius--panel); }
.et-hero-badge {
	position: absolute;
	left: 20px;
	bottom: 20px;
	background: var(--wp--preset--color--base);
	border-radius: 10px;
	padding: 16px 22px;
	box-shadow: var(--wp--custom--shadow--card);
	display: flex;
	align-items: baseline;
	gap: 12px;
	max-width: calc(100% - 40px);
}
.et-hero-badge__num { font-family: var(--wp--preset--font-family--serif); font-weight: 700; font-size: 2.125rem; color: var(--wp--preset--color--brand); letter-spacing: -0.02em; }
.et-hero-badge__txt { font-size: 0.8125rem; color: var(--wp--preset--color--body); line-height: 1.4; }

/* Rounded media utility for any image (e.g. about photo) */
.et-media-rounded img { display: block; width: 100%; height: clamp(360px, 40vw, 480px); object-fit: cover; border-radius: var(--wp--custom--radius--panel); }

/* ---------------------------------------------------- Dark-section overrides */
.is-on-dark h1, .is-on-dark h2, .is-on-dark h3, .is-on-dark h4 { color: var(--wp--preset--color--on-brand); }
.is-on-dark a:not(.et-btn):not(.wp-block-button__link) { color: var(--wp--preset--color--base); }
.et-rule-top { border-top: 1px solid rgba(234, 240, 231, 0.3); }

/* ------------------------------------------------------- Scroll reveal */
/* JS adds .et-reveal only when motion is allowed, so no-JS/reduced-motion
   users always see content. */
.et-reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
}
.et-reveal.is-in {
	opacity: 1;
	transform: none;
}
@media print {
	.et-reveal { opacity: 1 !important; transform: none !important; }
}

/* --------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.et-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	.et-card.is-hover:hover { transform: none; }
}
