/*
 * Chartreuse Digital bottom dock.
 * Replaces Astra's visible header with a fixed navigation bar at the bottom.
 */

:root {
	--cd-nav-accent: #f2b84b;
	--cd-nav-bottom-gap: calc(12px + env(safe-area-inset-bottom, 0px));
	--cd-nav-height: 60px;
}

html {
	scroll-behavior: smooth;
}

body {
	padding-bottom: calc(var(--cd-nav-height) + var(--cd-nav-bottom-gap) + 18px);
}

#masthead.site-header,
.ast-transparent-header #masthead.site-header,
#ast-mobile-popup {
	display: none !important;
}

.cd-bottom-nav,
.cd-bottom-nav * {
	box-sizing: border-box;
}

.cd-bottom-nav {
	position: fixed;
	right: 0;
	bottom: var(--cd-nav-bottom-gap);
	left: 0;
	z-index: 99999;
	display: flex;
	justify-content: center;
	padding-inline: clamp(10px, 2vw, 28px);
	visibility: visible;
	opacity: 1;
	pointer-events: none;
	font-family:
		ui-sans-serif,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"Helvetica Neue",
		Arial,
		sans-serif;
	transform: translate3d(0, 0, 0);
	transition:
		opacity 260ms ease,
		transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
		visibility 0s linear;
}

.cd-bottom-nav.is-gated:not(.is-visible) {
	visibility: hidden;
	opacity: 0;
	transform: translate3d(0, calc(100% + var(--cd-nav-bottom-gap) + 8px), 0);
	transition:
		opacity 180ms ease,
		transform 220ms ease,
		visibility 0s linear 220ms;
}

.cd-bottom-nav__bar {
	display: grid;
	grid-template-columns: auto auto auto;
	align-items: center;
	gap: 7px;
	width: max-content;
	max-width: calc(100vw - 20px);
	min-height: var(--cd-nav-height);
	padding: 6px;
	color: #ecece8;
	pointer-events: auto;
	background: rgb(246 246 244 / 52%);
	border: 1px solid rgb(255 255 255 / 52%);
	border-radius: 999px;
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 62%),
		0 20px 60px rgb(24 22 17 / 14%);
	-webkit-backdrop-filter: blur(26px) saturate(118%);
	backdrop-filter: blur(26px) saturate(118%);
}

.cd-bottom-nav__brand,
.cd-bottom-nav__item,
.cd-bottom-nav__contact {
	appearance: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: 46px;
	margin: 0;
	color: #6f716d;
	text-decoration: none !important;
	border: 0;
	border-radius: 999px;
	background: transparent;
	font: inherit;
	line-height: 1;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition:
		color 180ms ease,
		background-color 180ms ease,
		box-shadow 180ms ease,
		transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cd-bottom-nav .dashicons {
	width: 24px;
	height: 24px;
	font-size: 24px;
	line-height: 1;
}

.cd-bottom-nav__brand {
	width: 46px;
	flex: 0 0 46px;
	color: #f7f7f5;
	background: #080808;
	border: 1px solid rgb(255 255 255 / 14%);
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 14%),
		0 10px 22px rgb(0 0 0 / 16%);
	font-size: 0.82rem;
	font-weight: 780;
}

.cd-bottom-nav__group {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	padding: 2px;
	background: rgb(235 235 232 / 46%);
	border: 1px solid rgb(255 255 255 / 28%);
	border-radius: 999px;
}

.cd-bottom-nav__group::before,
.cd-bottom-nav__contact::before {
	position: absolute;
	top: 9px;
	bottom: 9px;
	left: -9px;
	width: 1px;
	content: "";
	background: rgb(128 128 122 / 22%);
}

.cd-bottom-nav__item {
	width: 42px;
	padding-inline: 0;
}

.cd-bottom-nav__item::before {
	position: absolute;
	bottom: calc(100% + 9px);
	left: 50%;
	z-index: 2;
	padding: 6px 8px;
	visibility: hidden;
	color: #f7f7f5;
	background: #171918;
	border-radius: 6px;
	content: attr(aria-label);
	font-size: 0.75rem;
	font-weight: 620;
	line-height: 1;
	opacity: 0;
	pointer-events: none;
	transform: translate3d(-50%, 4px, 0);
	transition:
		opacity 150ms ease,
		transform 180ms ease,
		visibility 0s linear 180ms;
}

.cd-bottom-nav__item:focus-visible::before {
	visibility: visible;
	opacity: 1;
	transform: translate3d(-50%, 0, 0);
	transition-delay: 0s;
}

@media (hover: hover) and (pointer: fine) {
	.cd-bottom-nav__item:hover::before {
		visibility: visible;
		opacity: 1;
		transform: translate3d(-50%, 0, 0);
		transition-delay: 0s;
	}
}

.cd-bottom-nav__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cd-bottom-nav__item:hover,
.cd-bottom-nav__item:focus-visible,
.cd-bottom-nav__item.is-active {
	color: #171918;
	background: rgb(255 255 255 / 84%);
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 90%),
		0 8px 18px rgb(18 18 16 / 9%);
}

.cd-bottom-nav__item.is-active::after {
	position: absolute;
	right: 16px;
	bottom: 8px;
	left: 16px;
	height: 2px;
	content: "";
	background: var(--cd-nav-accent);
	border-radius: 999px;
}

.cd-bottom-nav__brand:hover,
.cd-bottom-nav__brand:focus-visible,
.cd-bottom-nav__contact:hover,
.cd-bottom-nav__contact:focus-visible,
.cd-bottom-nav__contact.is-active {
	color: #fff;
	background: #111;
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 18%),
		0 12px 26px rgb(0 0 0 / 18%);
}

.cd-bottom-nav__contact {
	gap: 7px;
	padding-inline: 15px;
	color: #fff;
	background: #111;
	font-size: 0.9rem;
	font-weight: 680;
}

.cd-bottom-nav__contact .dashicons {
	color: var(--cd-nav-accent);
}

.cd-bottom-nav__brand:focus-visible,
.cd-bottom-nav__item:focus-visible,
.cd-bottom-nav__contact:focus-visible {
	outline: 3px solid var(--cd-nav-accent);
	outline-offset: 4px;
}

@media (max-width: 760px) {
	:root {
		--cd-nav-height: 56px;
	}

	body {
		padding-bottom: calc(var(--cd-nav-height) + var(--cd-nav-bottom-gap) + 12px);
	}

	.cd-bottom-nav {
		padding-inline: 7px;
	}

	.cd-bottom-nav__bar {
		grid-template-columns: auto auto;
		gap: 5px;
		min-height: var(--cd-nav-height);
		padding: 5px;
	}

	.cd-bottom-nav__brand {
		display: none;
	}

	.cd-bottom-nav__group {
		justify-content: center;
		width: auto;
		gap: 0;
		padding: 2px;
	}

	.cd-bottom-nav__item {
		width: 40px;
		height: 44px;
		padding-inline: 0;
	}

	.cd-bottom-nav .dashicons {
		width: 22px;
		height: 22px;
		font-size: 22px;
	}

	.cd-bottom-nav__contact {
		width: 44px;
		height: 44px;
		padding: 0;
	}

	.cd-bottom-nav__contact span:last-child {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.cd-bottom-nav__group::before {
		display: none;
	}

	.cd-bottom-nav__contact::before {
		left: -6px;
	}
}

@media (max-width: 410px) {
	.cd-bottom-nav__contact::before {
		display: none;
	}

	.cd-bottom-nav__item {
		width: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.cd-bottom-nav__brand,
	.cd-bottom-nav__item,
	.cd-bottom-nav__contact,
	.cd-bottom-nav__label,
	.cd-bottom-nav {
		transition-duration: 0.01ms !important;
	}
}
