/* ==========================================================================
   Header — Figma 26:5 (Top Strip) + 26:10 (Nav)
   ========================================================================== */

.site-header {
	position: relative;
	z-index: 50;
	background: var(--color-burgundy-600);
	color: var(--color-white);
}

/* Front page: sits on top of the hero image. */
.site-header--overlay {
	position: absolute;
	inset: 0 0 auto;
	background: transparent;
}

/* Top strip ---------------------------------------------------------------- */
.topbar {
	border-bottom: 1px solid var(--line-on-dark-soft);
	font-size: 13px;
	line-height: normal;
}

.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 12px;
}

.topbar__contacts {
	display: flex;
	gap: 28px;
	color: var(--color-blush-100);
	white-space: nowrap;
}

.topbar__links {
	display: flex;
	align-items: center;
	gap: 22px;
	white-space: nowrap;
}

.topbar__link {
	color: var(--color-blush-100);
	transition: color var(--dur-fast);
}

.topbar__emergency {
	padding-left: 22px;
	border-left: 1px solid var(--line-on-dark);
	font-weight: 600;
	color: var(--color-white);
	white-space: nowrap;
}

.topbar a:hover {
	color: var(--color-white);
}

/* Nav bar ------------------------------------------------------------------ */
.navbar {
	height: 96px; /* reserves space when the bar becomes fixed */
}

.navbar__bar {
	height: 96px;
	transition: background-color var(--dur-base), box-shadow var(--dur-base), height var(--dur-base) var(--ease-out);
}

.navbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 100%;
}

.navbar__logo img {
	width: 198px;
	height: 60px;
	object-fit: contain;
	transition: width var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out);
}

.nav-menu {
	display: flex;
	align-items: center;
	gap: 28px;
	font-size: 14.5px;
	font-weight: 500;
	line-height: normal;
	white-space: nowrap;
}

.nav-menu > li {
	position: relative;
}

.nav-menu > li > a {
	position: relative;
	display: inline-block;
	padding-block: 6px;
	color: var(--color-white);
	/* Underline grows in on hover (background, so ::after stays free for the caret) */
	background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
	transition: color var(--dur-fast), background-size var(--dur-base) var(--ease-out);
}

/* Current page keeps its underline; others show it on hover or while open. */
.nav-menu > li > a:hover,
.nav-menu > li.is-open > a,
.nav-menu > .current-menu-item > a,
.nav-menu > .current-menu-ancestor > a {
	background-size: 100% 2px;
}

.nav-menu > li > a:hover,
.nav-menu > li.is-open > a,
.nav-menu .current-menu-item > a,
.nav-menu .current-menu-ancestor > a {
	color: var(--accent);
}

.nav-menu .current-menu-item > a {
	font-weight: 600;
}

/* Parent items get the ▾ from the design; it flips while the dropdown is open. */
.nav-menu .menu-item-has-children > a::after {
	content: "▾";
	display: inline-block;
	margin-left: 0.45em;
	font-family: system-ui, sans-serif; /* Poppins has no ▾ glyph */
	font-size: 0.8em;
	transition: transform var(--dur-base) var(--ease-out);
}

.nav-menu .menu-item-has-children.is-open > a::after {
	transform: rotate(180deg);
}

.submenu-toggle,
.drawer-foot,
.navbar__toggle {
	display: none;
}

/* Service icon tile beside each dropdown link (inc/menu.php) */
.sub-menu__icon {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--color-paper);
	color: var(--color-burgundy-600);
	transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-base) var(--ease-out);
}

.sub-menu__icon svg {
	width: 19px;
	height: 19px;
}

@keyframes live-dot {
	from { box-shadow: 0 0 0 0 rgba(31, 164, 106, 0.6); }
	to   { box-shadow: 0 0 0 8px rgba(31, 164, 106, 0); }
}

/* Mega dropdown (desktop) ------------------------------------------------------
   Without JS each panel opens under its own item on hover/focus. header.js adds
   .has-morph to the bar: panels then share one white backdrop (.nav-morph) that
   glides and resizes between them while their content cross-slides — the
   Stripe-style dropdown. */
@media (min-width: 1081px) {
	.navbar__inner {
		position: relative;
	}

	.mega {
		position: absolute;
		top: 100%;
		left: -24px;
		z-index: 2;
		padding-top: 14px; /* hover bridge between the link and the panel */
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity var(--dur-fast), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
	}

	.navbar__inner:not(.has-morph) .nav-menu li:hover > .mega,
	.navbar__inner:not(.has-morph) .nav-menu li:focus-within > .mega {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out), visibility 0s;
	}

	.mega__inner {
		display: flex;
		gap: 12px;
		padding: 12px;
		border-radius: 20px;
		background: var(--color-white);
		box-shadow: 0 30px 60px -12px rgba(42, 10, 16, 0.32), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
		color: var(--color-ink);
	}

	.mega .sub-menu {
		--cols: 1;
		display: grid;
		grid-template-columns: repeat(var(--cols), 244px);
		align-content: start;
		gap: 2px 4px;
		padding: 4px;
	}

	.mega .sub-menu:has(> li:nth-child(6)) {
		--cols: 2;
	}

	/* Our Services: the areas of care side by side, four to a row. */
	.mega--services {
		left: -140px;
	}

	.mega-groups {
		display: grid;
		grid-template-columns: repeat(4, 204px);
		gap: 18px 8px;
		padding: 10px 6px 6px;
	}

	.mega-group__title {
		display: block;
		margin: 0 10px 6px;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.08em;
		line-height: 1.3;
		text-transform: uppercase;
		white-space: normal;
		color: var(--color-slate);
		transition: color var(--dur-fast);
	}

	.mega-group__title:hover {
		color: var(--color-burgundy-600);
	}

	.mega-groups .sub-menu {
		grid-template-columns: 1fr;
		padding: 0;
	}

	.mega-groups .sub-menu a {
		padding: 6px 10px;
		font-size: 14px;
	}

	.mega-groups .sub-menu__icon {
		width: 32px;
		height: 32px;
		border-radius: 9px;
	}

	.mega-groups .sub-menu__icon svg {
		width: 17px;
		height: 17px;
	}

	.mega .sub-menu a {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 8px 10px;
		border-radius: 12px;
		font-size: 14.5px;
		font-weight: 500;
		line-height: 1.3;
		white-space: normal;
		color: var(--color-ink);
		transition: background-color var(--dur-fast), color var(--dur-fast);
	}

	.mega .sub-menu a:hover,
	.mega .sub-menu a:focus-visible,
	.mega .sub-menu .current-menu-item > a {
		background: #fbf3f4;
		color: var(--color-burgundy-600);
	}

	.mega .sub-menu a:hover .sub-menu__icon,
	.mega .sub-menu a:focus-visible .sub-menu__icon {
		background: var(--color-burgundy-600);
		color: var(--color-white);
		transform: scale(1.06) rotate(-4deg);
	}

	/* Side card: emergency line, booking, "View all" */
	.mega-feature {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		width: 236px;
		padding: 22px;
		border-radius: 14px;
		background:
			radial-gradient(120% 80% at 100% 0%, rgba(232, 201, 205, 0.22), transparent 60%),
			linear-gradient(150deg, var(--color-burgundy-600), var(--color-burgundy-700));
		color: var(--color-white);
		white-space: normal;
	}

	.mega-feature__label {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		font-size: 11.5px;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--color-blush-100);
	}

	.mega-feature__label::before {
		content: "";
		width: 8px;
		height: 8px;
		border-radius: var(--radius-pill);
		background: #1fa46a;
		animation: live-dot 2s var(--ease-out) infinite;
	}

	.mega-feature__number {
		margin-top: 12px;
		font-family: var(--font-display);
		font-size: 25px;
		font-weight: 700;
		line-height: 1.1;
		color: var(--color-white);
	}

	.mega-feature__text {
		margin-top: 10px;
		font-family: var(--font-body);
		font-size: 16px;
		line-height: 1.45;
		color: var(--color-blush-100);
	}

	.mega-feature__all {
		display: inline-flex;
		gap: 6px;
		margin-top: 22px;
		font-size: 13.5px;
		font-weight: 600;
		color: var(--color-white);
	}

	.mega-feature__all--sub {
		margin-top: 10px;
		color: var(--color-blush-100);
	}

	.mega-feature__all span {
		transition: transform var(--dur-base) var(--ease-out);
	}

	.mega-feature__all:hover span {
		transform: translateX(4px);
	}

	/* Morph mode -------------------------------------------------------------- */
	.has-morph .nav-menu > .menu-item-has-children {
		position: static; /* panels position against .navbar__inner */
	}

	.has-morph .mega {
		top: calc(50% + 10px);
		left: var(--mega-x, 0px);
		transform: translateX(var(--mega-from, 0px));
		transition: opacity 0.2s, transform 0.45s var(--ease-out), visibility 0s linear 0.45s;
	}

	.has-morph .mega.is-active {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 0.3s 0.06s, transform 0.45s var(--ease-out), visibility 0s;
	}

	.has-morph .mega.is-instant {
		transition: none;
	}

	.has-morph .mega__inner {
		background: none;
		box-shadow: none;
	}

	.nav-morph {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: var(--morph-w, 0px);
		height: var(--morph-h, 0px);
		border-radius: 20px;
		background: var(--color-white);
		box-shadow: 0 30px 60px -12px rgba(42, 10, 16, 0.32), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
		opacity: 0;
		transform: translate(var(--morph-x, 0px), var(--morph-y, 0px));
		scale: 0.96;
		transform-origin: var(--arrow-x, 50%) 0;
		pointer-events: none;
		transition:
			opacity 0.25s,
			scale 0.4s var(--ease-out),
			width 0.45s var(--ease-out),
			height 0.45s var(--ease-out),
			transform 0.45s var(--ease-out);
	}

	.nav-morph.is-visible {
		opacity: 1;
		scale: 1;
	}

	/* Opening from closed: jump to the panel's size, only fade + grow in. */
	.nav-morph.is-instant {
		transition: opacity 0.25s, scale 0.4s var(--ease-out);
	}

	.nav-morph__arrow {
		position: absolute;
		top: -6px;
		left: calc(var(--arrow-x, 50%) - 7px);
		width: 14px;
		height: 14px;
		border-radius: 3px 0 0;
		background: var(--color-white);
		transform: rotate(45deg);
		transition: left 0.45s var(--ease-out);
	}

	.nav-morph.is-instant .nav-morph__arrow {
		transition: none;
	}
}

/* Stuck state (added by header.js after scrolling) ------------------------- */
.site-header.is-stuck .navbar__bar {
	position: fixed;
	inset: 0 0 auto;
	height: 76px;
	background: rgba(140, 16, 27, 0.95);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
	animation: navbar-drop var(--dur-base) var(--ease-out);
}

.site-header.is-stuck .navbar__logo img {
	width: 165px;
	height: 50px;
}

.admin-bar .site-header.is-stuck .navbar__bar {
	top: 32px;
}

@keyframes navbar-drop {
	from { transform: translateY(-100%); }
	to   { transform: none; }
}

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1280px) {
	.nav-menu { gap: 20px; font-size: 14px; }
	.navbar__inner { gap: 18px; }
	.navbar__logo img { width: 170px; height: 52px; }
	.navbar__cta { padding-inline: 18px; font-size: 14px; }
}

/* Just above the drawer breakpoint: six items and the button still fit on one line. */
@media (min-width: 1081px) and (max-width: 1240px) {
	.nav-menu { gap: 14px; font-size: 13px; }
	.nav-menu > li { flex-shrink: 0; }
	.navbar__inner { gap: 14px; }
	.navbar__logo img { width: 148px; height: 45px; }
	.navbar__cta { padding: 12px 15px; font-size: 13px; }
}

/* Mobile drawer ------------------------------------------------------------------
   Full-screen panel revealed by a circle from the toggle. Items are rows with
   hairlines, dropdowns become accordions, and booking + contact shortcuts sit
   at the bottom. */
@media (max-width: 1080px) {
	.navbar {
		--toggle-y: 48px; /* centre of the toggle, where the circle grows from */
	}

	.navbar__toggle {
		position: relative;
		z-index: 2;
		display: grid;
		place-items: center;
		width: 46px;
		height: 46px;
		border-radius: var(--radius-button);
		background: rgba(255, 255, 255, 0.12);
	}

	.navbar__toggle-lines,
	.navbar__toggle-lines::before,
	.navbar__toggle-lines::after {
		display: block;
		width: 20px;
		height: 2px;
		background: var(--color-white);
		border-radius: 2px;
		transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast);
	}

	.navbar__toggle-lines {
		position: relative;
	}

	.navbar__toggle-lines::before,
	.navbar__toggle-lines::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.navbar__toggle-lines::before { transform: translateY(-6px); }
	.navbar__toggle-lines::after  { transform: translateY(6px); }

	.nav-open .navbar__toggle-lines { background: transparent; }
	.nav-open .navbar__toggle-lines::before { transform: rotate(45deg); }
	.nav-open .navbar__toggle-lines::after  { transform: rotate(-45deg); }

	.navbar__inner > .navbar__cta {
		display: none;
	}

	.navbar__logo {
		position: relative;
		z-index: 2;
	}

	.navbar__nav {
		position: fixed;
		inset: 0;
		z-index: 1;
		display: flex;
		flex-direction: column;
		gap: 32px;
		padding: 0 var(--gutter) max(28px, env(safe-area-inset-bottom));
		background:
			radial-gradient(90% 50% at 100% 0%, rgba(232, 201, 205, 0.16), transparent 70%),
			linear-gradient(170deg, var(--color-burgundy-600), var(--color-burgundy-700));
		overflow-y: auto;
		overscroll-behavior: contain;
		clip-path: circle(0 at calc(100% - var(--gutter) - 23px) var(--toggle-y));
		visibility: hidden;
		transition: clip-path 0.6s var(--ease-out), visibility 0s linear 0.6s;
	}

	/* Solid band behind the logo and close button: links scroll underneath it
	   instead of showing through the logo. */
	.navbar__nav::before {
		content: "";
		position: sticky;
		top: 0;
		z-index: 1;
		flex-shrink: 0;
		height: var(--drawer-top, 96px);
		margin: 0 calc(-1 * var(--gutter)) -24px;
		background: var(--color-burgundy-600);
		box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
	}

	/* The chat bubble would cover the drawer's contact shortcuts. */
	.nav-open #frictionless-widget {
		display: none;
	}

	.nav-open .navbar__nav {
		clip-path: circle(150% at calc(100% - var(--gutter) - 23px) var(--toggle-y));
		visibility: visible;
		transition: clip-path 0.6s var(--ease-out), visibility 0s;
	}

	.nav-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		font-family: var(--font-display);
		font-size: 22px;
		font-weight: 700;
		white-space: normal;
	}

	.nav-menu > li,
	.drawer-foot {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
	}

	.nav-menu > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border-bottom: 1px solid rgba(255, 255, 255, 0.14);
	}

	.nav-open .nav-menu > li,
	.nav-open .drawer-foot {
		opacity: 1;
		transform: none;
	}

	.nav-open .nav-menu > li:nth-child(1) { transition-delay: 0.15s; }
	.nav-open .nav-menu > li:nth-child(2) { transition-delay: 0.19s; }
	.nav-open .nav-menu > li:nth-child(3) { transition-delay: 0.23s; }
	.nav-open .nav-menu > li:nth-child(4) { transition-delay: 0.27s; }
	.nav-open .nav-menu > li:nth-child(5) { transition-delay: 0.31s; }
	.nav-open .nav-menu > li:nth-child(6) { transition-delay: 0.35s; }
	.nav-open .nav-menu > li:nth-child(7) { transition-delay: 0.39s; }
	.nav-open .nav-menu > li:nth-child(8) { transition-delay: 0.43s; }
	.nav-open .drawer-foot                { transition-delay: 0.47s; }

	.nav-menu > li > a {
		flex: 1;
		padding-block: 14px;
		background: none;
		color: rgba(255, 255, 255, 0.78);
	}

	.nav-menu > li > a:hover,
	.nav-menu > .current-menu-item > a,
	.nav-menu > .current-menu-ancestor > a { color: var(--color-white); }

	.nav-menu .current-menu-item > a { font-weight: 700; }

	.nav-menu .menu-item-has-children > a::after { content: none; }

	/* Accordion button with a chevron */
	.submenu-toggle {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		border-radius: var(--radius-button);
		background: rgba(255, 255, 255, 0.1);
		color: var(--color-white);
		transition: background-color var(--dur-fast);
	}

	.submenu-toggle::before {
		content: "";
		width: 8px;
		height: 8px;
		margin-top: -4px;
		border: solid currentColor;
		border-width: 0 2px 2px 0;
		transform: rotate(45deg);
		transition: transform var(--dur-base) var(--ease-out), margin var(--dur-base) var(--ease-out);
	}

	.is-expanded > .submenu-toggle {
		background: rgba(255, 255, 255, 0.2);
	}

	.is-expanded > .submenu-toggle::before {
		margin-top: 4px;
		transform: rotate(-135deg);
	}

	.mega {
		display: grid;
		flex-basis: 100%;
		grid-template-rows: 0fr;
		visibility: hidden;
		transition: grid-template-rows 0.45s var(--ease-out), visibility 0s linear 0.45s;
	}

	.is-expanded > .mega {
		grid-template-rows: 1fr;
		visibility: visible;
		transition: grid-template-rows 0.45s var(--ease-out), visibility 0s;
	}

	.mega__inner {
		min-height: 0;
		overflow: hidden;
	}

	.mega .sub-menu {
		display: grid;
		gap: 2px;
		padding-bottom: 14px;
		font-family: var(--font-ui);
		font-size: 15px;
		font-weight: 500;
	}

	.mega .sub-menu a {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 7px 4px;
		border-radius: var(--radius-button);
		color: var(--color-blush-100);
		transition: background-color var(--dur-fast), color var(--dur-fast);
	}

	.mega .sub-menu a:hover,
	.mega .sub-menu .current-menu-item > a {
		background: rgba(255, 255, 255, 0.08);
		color: var(--color-white);
	}

	.mega .sub-menu__icon {
		width: 32px;
		height: 32px;
		border-radius: 9px;
		background: rgba(255, 255, 255, 0.1);
		color: var(--color-white);
	}

	.mega .sub-menu__icon svg {
		width: 17px;
		height: 17px;
	}

	.mega-feature { display: none; }

	.mega-groups {
		display: grid;
		gap: 14px;
		padding-bottom: 16px;
	}

	.mega-group__title {
		display: block;
		padding: 2px 4px 4px;
		font-family: var(--font-ui);
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--color-blush-200);
	}

	.mega-groups .sub-menu {
		padding-bottom: 0;
	}

	/* Bottom: booking + contact shortcuts */
	.drawer-foot {
		display: flex;
		flex-direction: column;
		gap: 12px;
		margin-top: auto;
	}

	.navbar__cta--mobile {
		display: inline-flex;
		width: 100%;
	}

	.drawer-foot__contacts {
		display: grid;
		gap: 10px;
	}

	.drawer-foot__contacts a {
		display: flex;
		flex-direction: column;
		gap: 2px;
		padding: 11px 14px;
		border: 1px solid rgba(255, 255, 255, 0.14);
		border-radius: var(--radius-button);
		background: rgba(255, 255, 255, 0.06);
		line-height: 1.3;
	}

	.drawer-foot__contacts span {
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--color-blush-200);
	}

	.drawer-foot__contacts strong {
		font-size: 15px;
		font-weight: 600;
		color: var(--color-white);
	}

	body.nav-open {
		overflow: hidden;
	}

	/* Keep the bar itself transparent while the drawer is open. */
	.nav-open .site-header.is-stuck .navbar__bar {
		background: transparent;
		box-shadow: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

/* Below 783px WordPress's admin bar is absolute (it scrolls away), so the stuck
   bar must sit flush at the top rather than leaving room for it. */
@media (max-width: 782px) {
	.admin-bar .site-header.is-stuck .navbar__bar { top: 0; }
}

@media (max-width: 900px) {
	.topbar__link { display: none; }
	.topbar__emergency { padding-left: 0; border-left: 0; }
}

@media (max-width: 640px) {
	/* Only the emergency line fits: hide the email and centre the number. */
	.topbar__contacts { display: none; }
	.topbar__inner { justify-content: center; }
	.navbar { --toggle-y: 40px; --drawer-top: 80px; }
	.navbar,
	.navbar__bar { height: 80px; }
	.navbar__logo img { width: 158px; height: 48px; }
}

@media (max-width: 380px) {
	.navbar__nav { gap: 28px; }
	.nav-menu { font-size: 20px; }
	.nav-menu > li > a { padding-block: 12px; }
	.mega .sub-menu { font-size: 14px; }
	.drawer-foot__contacts a { padding: 10px 12px; }
	.drawer-foot__contacts strong { font-size: 14px; }
}
