/*
 * Site chrome around the header (header.php, template-parts/mobile-action-bar.php):
 * the dark top bar, the header's counseling button, and the Call / WhatsApp
 * bar pinned to the bottom of the screen on phones and tablets.
 *
 * Plain CSS outside the frozen Tailwind build, like mobile-nav.css; enqueued
 * after main.css so a display rule here outranks the markup's `hidden`.
 */

/* ---------------------------------------------------------------------------
 * Top bar
 * One line at every width. Below md: the announcement (cut short with an
 * ellipsis if it is long) and the quick links; the location and the phone
 * number (.tia-topbar__md) join from md up.
 * ------------------------------------------------------------------------ */

.tia-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.tia-topbar__start,
.tia-topbar__end {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.tia-topbar__start {
	min-width: 0;
}

.tia-topbar__end {
	flex-shrink: 0;
}

.tia-topbar__announce {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tia-topbar__item {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: rgb(255 255 255 / 0.9);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease;
}

a.tia-topbar__item:hover,
a.tia-topbar__item:focus-visible {
	color: #06B6D4;
}

.tia-topbar__item .material-symbols-outlined {
	font-size: 13px;
}

.tia-topbar__sep {
	color: rgb(255 255 255 / 0.3);
}

.tia-topbar__md,
.tia-topbar--md {
	display: none;
}

@media (min-width: 768px) {
	.tia-topbar__start,
	.tia-topbar__end {
		gap: 1.5rem;
	}

	.tia-topbar__md {
		display: inline-flex;
	}

	.tia-topbar--md {
		display: block;
	}

	.tia-topbar__item .material-symbols-outlined {
		font-size: 14px;
	}
}

/* ---------------------------------------------------------------------------
 * Header CTA ("Book Free Counseling")
 * In the nav row from sm up: a compact size beside the hamburger until lg,
 * where mobile-nav.css hands over to the full desktop size in the markup.
 * A light sweeps across it every few seconds to draw the eye.
 * ------------------------------------------------------------------------ */

.tia-header-cta {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	white-space: nowrap;
}

.tia-header-cta .material-symbols-outlined {
	font-size: 1.25rem;
}

.tia-header-cta::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%);
	transform: translateX(-110%);
	animation: tia-cta-sheen 6s ease-in-out 2s infinite;
	pointer-events: none;
}

@keyframes tia-cta-sheen {
	0% {
		transform: translateX(-110%);
	}

	15%,
	100% {
		transform: translateX(110%);
	}
}

@media (min-width: 640px) {
	.tia-header-cta {
		display: inline-flex;
	}
}

@media (min-width: 640px) and (max-width: 1023px) {
	.tia-header-cta {
		min-height: 44px;
		padding: 0 1.125rem;
		font-size: 0.8125rem;
	}
}

/* ---------------------------------------------------------------------------
 * Bottom action bar (template-parts/mobile-action-bar.php), below lg only.
 * 4.25rem tall plus the phone's home-indicator inset; the spacer after the
 * footer is the same height, so the footer's last line scrolls clear of it.
 * ------------------------------------------------------------------------ */

.tia-action-bar,
.tia-action-spacer {
	display: none;
}

@media (max-width: 1023px) {
	.tia-action-spacer {
		display: block;
		height: calc(4.25rem + env(safe-area-inset-bottom, 0px));
		/* The footer's navy, so the strip under it reads as more footer. */
		background-color: #0F172A;
	}

	/* Under the menu drawer's backdrop (90) and the video lightbox (100). */
	.tia-action-bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 80;
		display: flex;
		justify-content: center;
		gap: 0.625rem;
		padding: 0.625rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid #E2E8F0;
		background-color: rgb(255 255 255 / 0.96);
		box-shadow: 0 -12px 30px -14px rgb(15 23 42 / 0.3);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
		transition: transform 0.25s ease;
	}

	/* A form field has focus: the keyboard is up, the bar steps aside. */
	body.tia-typing .tia-action-bar {
		transform: translateY(110%);
	}

	.tia-action-bar__btn {
		display: flex;
		min-width: 0;
		max-width: 20rem;
		min-height: 3rem;
		flex: 1 1 0;
		align-items: center;
		justify-content: center;
		gap: 0.5rem;
		padding: 0 0.75rem;
		border-radius: 0.75rem;
		color: #FFFFFF;
		font-size: 0.9rem;
		font-weight: 800;
		text-decoration: none;
		white-space: nowrap;
	}

	.tia-action-bar__btn:hover,
	.tia-action-bar__btn:focus-visible {
		color: #FFFFFF;
	}

	.tia-action-bar__btn:focus-visible {
		outline: 2px solid #4F46E5;
		outline-offset: 2px;
	}

	.tia-action-bar__btn .material-symbols-outlined,
	.tia-action-bar__btn i {
		flex-shrink: 0;
		font-size: 1.25rem;
	}

	/* The live chat button (printed after the bar by wp_footer) rides above it. */
	.tia-action-bar ~ .titaid-chat {
		bottom: calc(var(--tc-bottom) + 4.25rem + env(safe-area-inset-bottom, 0px));
	}
}

/* On a phone the chat panel is pinned to the viewport (live-chat.css), not to
   its button, so it needs the same lift on its own. */
@media (max-width: 480px) {
	.tia-action-bar ~ .titaid-chat[data-position] .titaid-chat__panel {
		bottom: calc(var(--tc-bottom) + 68px + 4.25rem + env(safe-area-inset-bottom, 0px));
		max-height: calc(100vh - var(--tc-bottom) - 100px - 4.25rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tia-header-cta::after {
		animation: none;
	}

	.tia-action-bar {
		transition: none;
	}
}

@media print {
	.tia-action-bar,
	.tia-action-spacer {
		display: none;
	}
}
