/* =========================================================================
 * Xlerate Digital — component styles.
 * Design tokens are exposed via theme.json as CSS custom properties:
 *   --wp--preset--color--xd-teal, etc.
 * ========================================================================= */

:root {
	--xd-teal:           var(--wp--preset--color--xd-teal,           #5BC4B0);
	--xd-teal-dark:      var(--wp--preset--color--xd-teal-dark,      #3FA38E);
	--xd-coral:          var(--wp--preset--color--xd-coral,          #EE8C8C);
	--xd-near-black:     var(--wp--preset--color--xd-near-black,     #0F172A);
	--xd-slate-700:      var(--wp--preset--color--xd-slate-700,      #334155);
	--xd-slate-500:      var(--wp--preset--color--xd-slate-500,      #64748B);
	--xd-slate-200:      var(--wp--preset--color--xd-slate-200,      #E2E8F0);
	--xd-slate-50:       var(--wp--preset--color--xd-slate-50,       #F8FAFC);
	--xd-impekable-gold: var(--wp--preset--color--xd-impekable-gold, #C9A961);
	--xd-success:        var(--wp--preset--color--xd-success,        #10B981);

	--xd-radius-sm: 6px;
	--xd-radius-md: 12px;
	--xd-radius-lg: 24px;
	--xd-radius-pill: 999px;

	--xd-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
	--xd-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
	--xd-shadow-lg: 0 24px 48px rgba(15, 23, 42, .14);

	--xd-header-height: 76px;
	--xd-content-max:   1240px;
	--xd-prose-max:     780px;
}

/* ---------- Base resets / typography ---------- */
html { scroll-behavior: smooth; }
body { color: var(--xd-near-black); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--xd-teal); color: var(--xd-near-black); }
img, video, svg { max-width: 100%; height: auto; }

a { color: var(--xd-teal-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--xd-near-black); }

:focus-visible { outline: 2px solid var(--xd-teal); outline-offset: 2px; border-radius: 4px; }

.xd-skip-link {
	position: absolute; left: -9999px; top: -9999px;
	background: var(--xd-near-black); color: var(--xd-white, #fff);
	padding: 8px 12px; border-radius: var(--xd-radius-sm);
	z-index: 9999;
}
.xd-skip-link:focus { left: 16px; top: 16px; }

/* ---------- Buttons ---------- */
.xd-button {
	display: inline-flex; align-items: center; justify-content: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--inter);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	padding: 0.875rem 1.625rem;
	border-radius: var(--xd-radius-pill);
	text-decoration: none;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
	will-change: transform;
}
.xd-button--solid {
	background: var(--xd-teal);
	color: var(--xd-near-black);
	box-shadow: var(--xd-shadow-sm);
}
.xd-button--solid:hover { background: var(--xd-teal-dark); color: #fff; }
.xd-button--ghost {
	background: transparent;
	color: var(--xd-near-black);
	border: 1.5px solid currentColor;
}
.xd-button--ghost:hover { background: var(--xd-near-black); color: #fff; border-color: var(--xd-near-black); }
.xd-button--on-dark { color: #fff; border-color: rgba(255, 255, 255, .35); }
.xd-button--on-dark:hover { background: #fff; color: var(--xd-near-black); border-color: #fff; }

/* ---------- Header ---------- */
.xd-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(15, 23, 42, .82);
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	transition: background 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
	border-bottom: 1px solid rgba(255, 255, 255, .06);
	box-shadow: 0 4px 20px rgba(15, 23, 42, .2);
}
.xd-header.is-scrolled {
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(160%) blur(8px);
	-webkit-backdrop-filter: saturate(160%) blur(8px);
	box-shadow: 0 1px 0 rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
	border-bottom-color: var(--xd-slate-200);
}
.xd-header__inner {
	max-width: var(--xd-content-max);
	margin: 0 auto;
	padding: 14px 24px;
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 24px;
	min-height: var(--xd-header-height);
}
.xd-header__logo { display: inline-flex; align-items: center; }
.xd-header__logo-primary {
	display: block; height: 44px; width: auto;
	filter: drop-shadow(0 1px 6px rgba(15, 23, 42, .35));
	transition: filter 220ms ease;
}
.xd-header__logo-compact {
	display: none; height: 40px; width: auto;
	filter: drop-shadow(0 1px 6px rgba(15, 23, 42, .35));
	transition: filter 220ms ease;
}
.xd-header.is-scrolled .xd-header__logo-primary,
.xd-header.is-scrolled .xd-header__logo-compact {
	filter: none;
}

.xd-nav { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; align-items: center; }
.xd-nav li { margin: 0; position: relative; }

/* ---------- Dropdown sub-menus (desktop) ---------- */
.xd-nav .menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 0; height: 0;
	margin-left: 6px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	vertical-align: middle;
	transition: transform 200ms ease;
	opacity: .7;
}
.xd-nav .menu-item-has-children:hover > a::after,
.xd-nav .menu-item-has-children:focus-within > a::after {
	transform: rotate(180deg);
	opacity: 1;
}
.xd-nav .sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: -16px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	min-width: 260px;
	background: rgba(15, 23, 42, .96);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 12px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, .4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 180ms ease, visibility 180ms, transform 180ms ease;
	z-index: 60;
}
.xd-nav .sub-menu::before {
	content: '';
	position: absolute;
	top: -10px; left: 0; right: 0; height: 12px;
}
.xd-nav .menu-item-has-children:hover > .sub-menu,
.xd-nav .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.xd-nav .sub-menu li { width: 100%; }
.xd-nav .sub-menu a {
	display: block;
	padding: 12px 20px;
	font-size: 0.92rem;
	font-weight: 500;
	color: rgba(255, 255, 255, .92);
	text-shadow: none;
	border-bottom: 0;
	white-space: nowrap;
	transition: background-color 160ms ease, color 160ms ease;
}
.xd-nav .sub-menu a:hover {
	background: rgba(91, 196, 176, .14);
	color: var(--xd-teal);
	border-bottom: 0;
}
.xd-header.is-scrolled .xd-nav .sub-menu a { color: rgba(255, 255, 255, .92); }
.xd-header.is-scrolled .xd-nav .sub-menu a:hover { color: var(--xd-teal); }
.xd-nav a {
	color: rgba(255, 255, 255, .94);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.95rem;
	padding: 6px 2px;
	border-bottom: 2px solid transparent;
	transition: color 180ms ease, border-color 180ms ease;
	text-shadow: 0 1px 8px rgba(15, 23, 42, .35);
}
.xd-nav a:hover, .xd-nav .current-menu-item a {
	color: var(--xd-teal);
	border-bottom-color: var(--xd-teal);
}
.xd-header.is-scrolled .xd-nav a {
	color: var(--xd-slate-700);
	text-shadow: none;
}
.xd-header.is-scrolled .xd-nav a:hover,
.xd-header.is-scrolled .xd-nav .current-menu-item a {
	color: var(--xd-near-black);
	border-bottom-color: var(--xd-teal);
}

.xd-header__cta {
	background: var(--xd-teal);
	color: var(--xd-near-black);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 0.7rem 1.25rem;
	border-radius: var(--xd-radius-pill);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 180ms ease, color 180ms ease;
}
.xd-header__cta:hover { background: var(--xd-teal-dark); color: #fff; }

/* ---------- Header search ---------- */
.xd-header__search-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 50%;
	color: rgba(255, 255, 255, .92);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}
.xd-header__search-toggle:hover { background: rgba(91, 196, 176, .15); color: var(--xd-teal); }
.xd-header__search {
	display: none;
	max-width: var(--xd-content-max);
	margin: 0 auto;
	padding: 0 24px 14px;
	gap: 8px;
}
.xd-header.is-search-open .xd-header__search {
	display: flex;
	animation: xd-search-fade 200ms ease;
}
@keyframes xd-search-fade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.xd-header__search input[type="search"] {
	flex: 1;
	font: inherit;
	font-size: 1rem;
	padding: 12px 18px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .18);
	color: #fff;
}
.xd-header__search input[type="search"]:focus {
	outline: 0;
	border-color: var(--xd-teal);
	background: rgba(255, 255, 255, .12);
}
.xd-header__search input::placeholder { color: rgba(255, 255, 255, .5); }
.xd-header__search button {
	background: var(--xd-teal);
	color: var(--xd-near-black);
	font-weight: 600;
	border: 0;
	padding: 12px 22px;
	border-radius: 999px;
	cursor: pointer;
}
.xd-header__search button:hover { background: var(--xd-teal-dark); color: #fff; }
@media (max-width: 1023px) {
	.xd-header__search-toggle { display: none; }
}

.xd-header__menu-toggle {
	display: none;
	background: transparent;
	border: 0;
	padding: 8px;
	cursor: pointer;
}
.xd-header__menu-toggle span {
	display: block; width: 24px; height: 2px;
	background: #fff;
	margin: 5px 0;
	transition: transform 200ms ease, opacity 200ms ease, background-color 200ms ease;
	box-shadow: 0 1px 4px rgba(15, 23, 42, .35);
}
.xd-header.is-scrolled .xd-header__menu-toggle span {
	background: var(--xd-near-black);
	box-shadow: none;
}

@media (max-width: 1023px) {
	.xd-header__inner { grid-template-columns: auto 1fr auto; padding: 12px 16px; }
	.xd-header__nav { display: none; }
	.xd-header__cta { display: none; }
	.xd-header__menu-toggle { display: inline-flex; flex-direction: column; }
	.xd-header__logo-primary { display: none; }
	.xd-header__logo-compact { display: block; }
	.xd-header.is-mobile-open .xd-header__nav { display: block; position: absolute; top: 100%; left: 0; right: 0; background: rgba(15, 23, 42, .98); backdrop-filter: blur(16px); padding: 16px 8px 24px; border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--xd-shadow-lg); max-height: calc(100vh - var(--xd-header-height)); overflow-y: auto; }
	.xd-header.is-mobile-open .xd-nav { flex-direction: column; align-items: stretch; gap: 0; }
	.xd-header.is-mobile-open .xd-nav > li { border-bottom: 1px solid rgba(255, 255, 255, .08); }
	.xd-header.is-mobile-open .xd-nav > li > a { display: block; padding: 14px 16px; font-size: 1.05rem; border: 0; color: #fff; }
	.xd-header.is-mobile-open .xd-header__cta { display: inline-flex; margin: 16px 16px 0; align-self: stretch; justify-content: center; }

	/* Mobile accordion: sub-menus stack inline below their parent. */
	.xd-header.is-mobile-open .xd-nav .menu-item-has-children > a::after { float: right; margin-top: 10px; }
	.xd-header.is-mobile-open .xd-nav .sub-menu {
		position: static;
		display: block;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: rgba(255, 255, 255, .04);
		backdrop-filter: none;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		min-width: 0;
		padding: 0 0 8px 0;
	}
	.xd-header.is-mobile-open .xd-nav .sub-menu a {
		padding: 10px 32px;
		font-size: 0.95rem;
		color: rgba(255, 255, 255, .85);
	}
}

/* ---------- Final CTA ---------- */
.xd-final-cta {
	background: linear-gradient(180deg, #1e293b 0%, var(--xd-near-black) 100%);
	color: #fff;
	padding: clamp(56px, 10vw, 120px) 24px;
	text-align: center;
}
.xd-final-cta__inner { max-width: 880px; margin: 0 auto; }
.xd-final-cta__heading {
	font-size: clamp(1.75rem, 3.6vw, 2.75rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0 0 28px;
	color: #fff;
}
.xd-final-cta__tagline {
	margin: 24px 0 0;
	color: var(--xd-slate-200);
	font-size: 0.95rem;
}
.xd-final-cta__tagline a { color: var(--xd-teal); }

/* ---------- Identity strip ---------- */
.xd-identity-strip {
	background: var(--xd-near-black);
	color: var(--xd-slate-200);
	border-top: 1px solid var(--xd-teal);
	padding: 22px 24px;
}
.xd-identity-strip__inner {
	max-width: var(--xd-content-max);
	margin: 0 auto;
	display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.xd-identity-strip__mark { height: 28px; width: auto; }
.xd-identity-strip__text {
	margin: 0;
	font-size: 0.875rem;
	color: var(--xd-slate-200);
	letter-spacing: 0.01em;
}

/* ---------- Footer ---------- */
.xd-footer {
	background: var(--xd-near-black);
	color: var(--xd-slate-200);
	padding: 56px 24px 24px;
}
.xd-footer__columns {
	max-width: var(--xd-content-max);
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1.4fr repeat(5, 1fr);
	gap: 40px;
}
.xd-footer__col { min-width: 0; }
.xd-footer__heading {
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	margin: 0 0 16px;
}
.xd-footer__menu { list-style: none; padding: 0; margin: 0; }
.xd-footer__menu li { margin: 0 0 10px; }
.xd-footer__menu a {
	color: var(--xd-slate-200);
	text-decoration: none;
	font-size: 0.9rem;
	transition: color 160ms ease;
}
.xd-footer__menu a:hover { color: var(--xd-teal); }
.xd-footer__logo { display: block; max-width: 240px; }
.xd-footer__logo img { display: block; width: 100%; height: auto; }
.xd-footer__tagline { margin: 16px 0; color: var(--xd-slate-200); font-size: 0.95rem; }
.xd-footer__social { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; }
.xd-footer__social a { color: var(--xd-slate-200); text-decoration: none; font-size: 0.85rem; }
.xd-footer__social a:hover { color: var(--xd-teal); }
.xd-footer__baseline {
	max-width: var(--xd-content-max);
	margin: 48px auto 0;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, .08);
	color: var(--xd-slate-500);
	font-size: 0.825rem;
	letter-spacing: 0.01em;
}

@media (max-width: 1023px) {
	.xd-footer__columns { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
}
@media (max-width: 559px) {
	.xd-footer__columns { grid-template-columns: 1fr; }
}

/* ---------- Hero (video background) ---------- */
.xd-hero {
	position: relative;
	display: grid;
	place-items: center;
	color: #fff;
	overflow: hidden;
	isolation: isolate;
	padding: clamp(64px, 10vw, 120px) 24px;
	min-height: min(86svh, 760px);
}
.xd-hero .xd-hero__media {
	position: absolute; inset: 0; z-index: -1;
	overflow: hidden;
}
.xd-hero__poster,
.xd-hero__video {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
}
.xd-hero__video {
	opacity: 0;
	transition: opacity 600ms ease;
}
.xd-hero__video.is-playing { opacity: 1; }
.xd-hero__overlay {
	position: absolute; inset: 0; pointer-events: none;
}

.xd-hero__inner {
	max-width: 920px;
	width: 100%;
	margin: 0 auto;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	position: relative;
}

.xd-hero__eyebrow {
	display: inline-block;
	margin: 0;
	padding: 6px 14px;
	font-size: 0.8125rem;
	color: #fff;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 600;
	background: rgba(15, 23, 42, .55);
	border: 1px solid rgba(91, 196, 176, .55);
	border-radius: 999px;
	backdrop-filter: blur(8px) saturate(140%);
	-webkit-backdrop-filter: blur(8px) saturate(140%);
	text-shadow: 0 1px 4px rgba(15, 23, 42, .5);
}

.xd-hero__title {
	margin: 0;
	font-size: clamp(2.25rem, 5vw, 4.25rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	font-weight: 700;
	color: #fff;
	max-width: 18ch;
	text-wrap: balance;
}

.xd-hero__subhead {
	margin: 0;
	font-size: clamp(1rem, 1.5vw, 1.25rem);
	line-height: 1.55;
	color: var(--xd-slate-200, #E2E8F0);
	max-width: 720px;
}

.xd-hero__ctas {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 12px;
}

.xd-hero__scroll-cue {
	position: absolute;
	bottom: -64px;
	left: 50%;
	transform: translateX(-50%);
	width: 32px; height: 48px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-radius: 999px;
	display: none;
}
.xd-hero__scroll-cue span {
	position: absolute; top: 8px; left: 50%;
	transform: translateX(-50%);
	width: 4px; height: 8px;
	background: #fff;
	border-radius: 2px;
	animation: xd-scroll-cue 1.6s ease-in-out infinite;
}
@keyframes xd-scroll-cue {
	0%   { transform: translate(-50%, 0);    opacity: .9; }
	60%  { transform: translate(-50%, 16px); opacity: 0; }
	61%  { transform: translate(-50%, 0);    opacity: 0; }
	100% { transform: translate(-50%, 0);    opacity: .9; }
}

@media (min-width: 1024px) {
	.xd-hero__scroll-cue { display: block; }
}

/* When the hero is alignfull and sits at the top, drop body bg behind it. */
body .xd-hero.alignfull { margin-top: calc(var(--xd-header-height) * -1); padding-top: calc(var(--xd-header-height) + clamp(64px, 10vw, 120px)); }

/* ---------- Suppress Kadence chrome we replace ---------- */
.entry-header.page-title { display: none !important; }
.content-area { margin: 0 !important; padding: 0 !important; }
.entry-content-wrap { padding: 0 !important; box-shadow: none !important; }
.entry.single-entry,
.entry.loop-entry { box-shadow: none !important; }
body.page .entry { background: transparent; }

/* Restore default content padding inside articles (set by xd-prose only). */
.xd-prose { max-width: var(--xd-prose-max); margin: 0 auto; padding: 24px; }

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
