/*
 * Mobile navigation drawer.
 *
 * Kept out of the Tailwind build for the same reason as the chat widget: the
 * theme ships without node_modules, so a stylesheet that needs `npm run
 * build:css` before it renders is a stylesheet that renders broken. Everything
 * here is plain CSS keyed to the tia-nav__* classes emitted by
 * Theitaid_Walker_Mobile_Nav.
 */

:root {
	--tia-nav-width: min(86vw, 360px);
	--tia-nav-ease: cubic-bezier(0.32, 0.72, 0, 1);
	--tia-nav-primary: #4f46e5;
	--tia-nav-ink: #0f172a;
	--tia-nav-muted: #64748b;
	--tia-nav-line: #e9edf3;
}

/* ---------------------------------------------------------------------------
 * Backdrop
 * ------------------------------------------------------------------------ */

.tia-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: 90;
	background-color: rgba(15, 23, 42, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.32s var(--tia-nav-ease), visibility 0s linear 0.32s;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

body.tia-nav-open .tia-nav-backdrop {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.32s var(--tia-nav-ease), visibility 0s;
}

/* ---------------------------------------------------------------------------
 * Panel
 * ------------------------------------------------------------------------ */

.tia-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
	display: flex;
	width: var(--tia-nav-width);
	flex-direction: column;
	background-color: #fff;
	/*
	 * visibility, not just the transform: an off-screen panel that is merely
	 * translated still takes keyboard focus, so tabbing on a phone used to walk
	 * the visitor through sixteen invisible links.
	 */
	visibility: hidden;
	transform: translateX(100%);
	box-shadow: -24px 0 60px -20px rgba(15, 23, 42, 0.45);
	transition: transform 0.34s var(--tia-nav-ease), visibility 0s linear 0.34s;
	font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body.tia-nav-open .tia-nav {
	visibility: visible;
	transform: translateX(0);
	transition: transform 0.34s var(--tia-nav-ease), visibility 0s;
}

/* While the drawer is dragged the transform is set inline, frame by frame. */
.tia-nav.is-dragging {
	transition: none;
}

/* The chat launcher and the floating review card both outrank the drawer on
 * z-index, so park them while it is open. */
body.tia-nav-open .titaid-chat,
body.tia-nav-open #floating-review-left {
	opacity: 0;
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

.tia-nav__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--tia-nav-line);
}

.tia-nav__brand {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 8px;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--tia-nav-ink);
	text-decoration: none;
}

.tia-nav__brand img,
.tia-nav__brand .custom-logo {
	max-height: 40px;
	width: auto;
}

.tia-nav__brand-mark {
	padding: 2px 6px;
	border-radius: 6px;
	background-color: var(--tia-nav-primary);
	color: #fff;
}

.tia-nav__close {
	display: grid;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	place-items: center;
	margin-right: -6px;
	border: 0;
	border-radius: 50%;
	background-color: #f1f5f9;
	color: var(--tia-nav-ink);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tia-nav__close:hover,
.tia-nav__close:focus-visible {
	background-color: #e2e8f0;
}

.tia-nav__close .material-symbols-outlined {
	font-size: 24px;
}

/* ---------------------------------------------------------------------------
 * Menu
 * ------------------------------------------------------------------------ */

.tia-nav__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 6px 0 12px;
}

.tia-nav__list,
.tia-nav__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tia-nav__item {
	border-bottom: 1px solid var(--tia-nav-line);
}

.tia-nav__item:last-child {
	border-bottom: 0;
}

.tia-nav__row {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 4px;
}

.tia-nav__link {
	display: flex;
	flex: 1 1 auto;
	min-height: 52px;
	align-items: center;
	padding: 10px 18px;
	color: var(--tia-nav-ink);
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.tia-nav__link:hover,
.tia-nav__link:focus-visible {
	background-color: #f8fafc;
	color: var(--tia-nav-primary);
}

/* Current page gets an accent rail rather than colour alone. */
.tia-nav__item.is-current > .tia-nav__row > .tia-nav__link {
	position: relative;
	color: var(--tia-nav-primary);
}

.tia-nav__item.is-current > .tia-nav__row > .tia-nav__link::before {
	content: '';
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 0;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background-color: var(--tia-nav-primary);
}

/* Toggle: its own 48px target so tapping the parent still follows the link. */
.tia-nav__toggle {
	display: grid;
	flex: 0 0 auto;
	width: 48px;
	place-items: center;
	border: 0;
	border-left: 1px solid var(--tia-nav-line);
	background: none;
	color: var(--tia-nav-muted);
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.tia-nav__toggle:hover,
.tia-nav__toggle:focus-visible {
	background-color: #f8fafc;
	color: var(--tia-nav-primary);
}

.tia-nav__chevron {
	display: block;
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.28s var(--tia-nav-ease);
}

.tia-nav__item.is-open > .tia-nav__row > .tia-nav__toggle .tia-nav__chevron {
	transform: translateY(2px) rotate(-135deg);
}

/*
 * Accordion without measuring heights in JS: the wrapper animates between
 * grid-template-rows 0fr and 1fr, and visibility keeps collapsed links out of
 * the tab order.
 */
.tia-nav__subwrap {
	display: grid;
	grid-template-rows: 0fr;
	background-color: #f8fafc;
	transition: grid-template-rows 0.3s var(--tia-nav-ease);
}

.tia-nav__item.is-open > .tia-nav__subwrap {
	grid-template-rows: 1fr;
}

.tia-nav__sub {
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s linear 0.3s;
}

.tia-nav__item.is-open > .tia-nav__subwrap > .tia-nav__sub {
	visibility: visible;
	transition-delay: 0s;
}

.tia-nav__sublink {
	display: flex;
	min-height: 46px;
	align-items: center;
	padding: 8px 18px 8px 34px;
	color: #475569;
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.tia-nav__sublink::before {
	content: '';
	width: 5px;
	height: 5px;
	margin-right: 11px;
	border-radius: 50%;
	background-color: #cbd5e1;
	transition: background-color 0.15s ease;
}

.tia-nav__sublink:hover,
.tia-nav__sublink:focus-visible {
	background-color: #eef2ff;
	color: var(--tia-nav-primary);
}

.tia-nav__sublink:hover::before,
.tia-nav__sublink:focus-visible::before {
	background-color: var(--tia-nav-primary);
}

.tia-nav__item.is-current > .tia-nav__row > .tia-nav__sublink,
.tia-nav__sub .is-current > .tia-nav__row > .tia-nav__sublink {
	color: var(--tia-nav-primary);
}

.tia-nav__sub .is-current > .tia-nav__row > .tia-nav__sublink::before {
	background-color: var(--tia-nav-primary);
}

.tia-nav__sub .tia-nav__item {
	border-bottom: 0;
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

.tia-nav__foot {
	flex: 0 0 auto;
	padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--tia-nav-line);
	background-color: #fff;
}

.tia-nav__cta {
	display: flex;
	min-height: 50px;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background-color: var(--tia-nav-primary);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
	box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.9);
	transition: background-color 0.15s ease;
}

.tia-nav__cta:hover,
.tia-nav__cta:focus-visible {
	background-color: #4338ca;
	color: #fff;
}

.tia-nav__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.tia-nav__contact-item {
	display: flex;
	flex: 1 1 0;
	min-height: 44px;
	min-width: 0;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 0 10px;
	border: 1px solid var(--tia-nav-line);
	border-radius: 10px;
	color: #334155;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.tia-nav__contact-item:hover,
.tia-nav__contact-item:focus-visible {
	border-color: var(--tia-nav-primary);
	color: var(--tia-nav-primary);
}

.tia-nav__contact-item .material-symbols-outlined {
	font-size: 18px;
}

.tia-nav__social {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 12px;
}

.tia-nav__social a {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border-radius: 50%;
	background-color: #f1f5f9;
	color: #475569;
	font-size: 15px;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.tia-nav__social a:hover,
.tia-nav__social a:focus-visible {
	background-color: var(--tia-nav-primary);
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Scroll lock and breakpoint
 * ------------------------------------------------------------------------ */

/*
 * The body is pinned rather than merely overflow:hidden, which iOS Safari
 * ignores. JS stores the scroll offset in --tia-scroll-y and restores it on
 * close.
 */
body.tia-nav-locked {
	position: fixed;
	top: calc(var(--tia-scroll-y, 0px) * -1);
	left: 0;
	width: 100%;
	overflow: hidden;
}

/* Matches the lg: breakpoint the hamburger already uses. */
@media (min-width: 1024px) {

	.tia-nav,
	.tia-nav-backdrop {
		display: none;
	}

	/*
	 * The desktop menu and its CTA carry `hidden` and are switched back on here
	 * rather than with lg:flex / lg:inline-flex, because the compiled main.css
	 * has neither — it only ever needed lg:flex-row. Both selectors are one
	 * class, same as .hidden, and this file loads after main.css, so source
	 * order settles it.
	 */
	.tia-desktop-nav {
		display: flex;
	}

	.tia-header-cta {
		display: inline-flex;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tia-nav,
	.tia-nav-backdrop,
	.tia-nav__subwrap,
	.tia-nav__chevron {
		transition-duration: 0.01ms;
	}
}
