/* ==========================================================================
   SITE CHROME — HEADER + FOOTER
   ==========================================================================
   Elementor free has no Theme Builder, so header and footer are rendered by
   template-parts/header.php and template-parts/footer.php in this child theme.
   The nav itself is a normal WordPress menu (Appearance → Menus → "Primary"),
   so dropdown items are editable without touching code.
   ========================================================================== */

/* ---------- header shell ---------- */
.ab-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: color-mix(in srgb, var(--ab-bg) 85%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}
.ab-header.is-stuck { border-bottom-color: var(--ab-line); }

/* The WP admin bar is itself fixed at the top; offset so they don't overlap. */
.admin-bar .ab-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ab-header { top: 46px; } }

.ab-nav {
	display: flex;
	align-items: center;
	gap: 28px;
	height: var(--ab-header-h);
}

/* ---------- logo ---------- */
.ab-logo {
	font-weight: 700;
	font-size: 1.08rem;
	letter-spacing: -0.02em;
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--ab-ink);
	text-decoration: none;
	flex: 0 0 auto;
}
.ab-logo:hover { color: var(--ab-ink); }
.ab-logo mark {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--ab-ink);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 0.78rem;
	letter-spacing: 0;
	font-weight: 700;
}
.ab-logo img { max-height: 38px; width: auto; }

/* ---------- menu ---------- */
.ab-menu {
	display: flex;
	align-items: center;
	gap: 26px;
	margin: 0 0 0 auto;
	padding: 0;
	list-style: none;
}
.ab-menu > li { position: relative; }

.ab-menu a {
	font-size: 0.93rem;
	font-weight: 500;
	color: var(--ab-ink-soft);
	display: flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
	transition: color 0.15s ease;
}
.ab-menu a:hover,
.ab-menu .current-menu-item > a,
.ab-menu .current-menu-ancestor > a { color: var(--ab-ink); }

/* caret on parent items — driven by WP's own menu-item-has-children class */
.ab-menu .menu-item-has-children > a::after {
	content: "";
	width: 9px;
	height: 9px;
	flex: 0 0 9px;
	background: currentColor;
	transition: transform 0.2s ease;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ab-menu .menu-item-has-children:hover > a::after { transform: rotate(180deg); }

/* dropdown */
.ab-menu .sub-menu {
	position: absolute;
	top: calc(100% + 14px);
	left: -18px;
	min-width: 238px;
	background: #fff;
	border: 1px solid var(--ab-line);
	border-radius: 14px;
	padding: 8px;
	margin: 0;
	list-style: none;
	box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.ab-menu > li:hover > .sub-menu,
.ab-menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
/* invisible bridge so the pointer can travel from item to dropdown */
.ab-menu .sub-menu::before {
	content: "";
	position: absolute;
	top: -14px;
	left: 0;
	right: 0;
	height: 14px;
}
.ab-menu .sub-menu a {
	padding: 9px 12px;
	border-radius: 9px;
	font-size: 0.9rem;
}
.ab-menu .sub-menu a:hover { background: var(--ab-bg-alt); color: var(--ab-ink); }

/* ---------- header CTA + burger ---------- */
.ab-nav-cta { margin-left: 6px; flex: 0 0 auto; }

.ab-burger {
	display: none;
	margin-left: auto;
	padding: 9px;
	background: none;
	border: 0;
	cursor: pointer;
	border-radius: 8px;
}
.ab-burger span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--ab-ink);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.ab-burger span + span { margin-top: 5px; }
.ab-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ab-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ab-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- mobile ---------- */
@media (max-width: 980px) {
	.ab-menu {
		position: fixed;
		inset: var(--ab-header-h) 0 auto 0;
		background: #fff;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 12px var(--ab-pad) 26px;
		border-bottom: 1px solid var(--ab-line);
		max-height: calc(100vh - var(--ab-header-h));
		overflow: auto;
		display: none;
	}
	.admin-bar .ab-menu { inset-block-start: calc(var(--ab-header-h) + 46px); }

	.ab-menu.is-open { display: flex; }
	.ab-menu > li { border-bottom: 1px solid var(--ab-line); }
	.ab-menu > li > a { padding: 15px 0; font-size: 1rem; width: 100%; justify-content: space-between; }

	.ab-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		border: 0;
		box-shadow: none;
		padding: 0 0 12px 12px;
		min-width: 0;
		display: none;
	}
	.ab-menu > li.is-open > .sub-menu { display: block; }
	.ab-menu .menu-item-has-children.is-open > a::after { transform: rotate(180deg); }

	.ab-nav-cta { margin-left: auto; margin-right: 8px; }
	.ab-nav-cta .ab-btn { padding: 10px 18px; font-size: 0.85rem; }
	.ab-burger { display: block; margin-left: 0; }
}

@media (max-width: 520px) {
	.ab-nav-cta { display: none; }
	.ab-burger { margin-left: auto; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.ab-footer {
	background: var(--ab-dark);
	color: var(--ab-dark-ink);
	padding-block: clamp(52px, 7vw, 84px) 32px;
}
.ab-footer-grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, 1fr);
	gap: 40px;
}
@media (max-width: 860px) { .ab-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .ab-footer-grid { grid-template-columns: 1fr; } }

.ab-footer .ab-logo { color: #fff; }
.ab-footer .ab-logo mark { background: #fff; color: var(--ab-dark); }
.ab-footer p {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.93rem;
	margin-top: 16px;
	max-width: 34ch;
}
.ab-footer h2 {
	font-size: 0.76rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
	font-weight: 600;
	margin: 0 0 16px;
}
.ab-footer ul { list-style: none; margin: 0; padding: 0; }
.ab-footer li + li { margin-top: 11px; }
.ab-footer li a {
	font-size: 0.93rem;
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	transition: color 0.15s ease;
}
.ab-footer li a:hover { color: #fff; }

.ab-social { display: flex; gap: 10px; margin-top: 24px; }
.ab-social a {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.18);
	display: grid;
	place-items: center;
	color: #fff;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.ab-social a:hover { background: #fff; color: var(--ab-dark); border-color: #fff; }
.ab-social svg { width: 16px; height: 16px; fill: currentColor; }

.ab-footer-bottom {
	margin-top: 52px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.5);
}
