/* ==========================================================================
   Layout: container, grids, header, navigation, footer shell
   ========================================================================== */

.c-container {
	width: 100%;
	max-width: var(--tbe-container);
	margin-inline: auto;
	padding-inline: var(--tbe-gutter);
}

.site {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
}

.c-main {
	flex: 1 0 auto;
}

.c-section {
	padding-block: var(--tbe-section);
}

.c-section--muted {
	background: var(--tbe-mist);
}

.c-section--tight {
	padding-block: calc(var(--tbe-section) * 0.6);
}

.c-layout {
	display: grid;
	gap: var(--tbe-space-6);
	padding-block: var(--tbe-space-7) var(--tbe-section);
}

@media (min-width: 62rem) {
	.c-layout--with-sidebar {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: var(--tbe-space-7);
	}
}

.c-prose {
	max-width: var(--tbe-container-narrow);
	font-size: var(--tbe-text-lg);
	line-height: 1.75;
}

.c-prose h2 {
	margin-top: var(--tbe-space-7);
	font-size: var(--tbe-text-2xl);
}

.c-prose h3 {
	margin-top: var(--tbe-space-6);
	font-size: var(--tbe-text-xl);
}

.c-prose a {
	text-decoration: underline;
}

.c-prose ul,
.c-prose ol {
	padding-left: 1.4rem;
}

.c-prose li + li {
	margin-top: var(--tbe-space-2);
}

.c-prose > *:first-child {
	margin-top: 0;
}

/* Grids ----------------------------------------------------------------- */
.c-grid {
	display: grid;
	gap: var(--tbe-space-5);
	grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
	.c-grid--3,
	.c-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 62rem) {
	.c-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.c-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* ==========================================================================
   Top utility bar
   ========================================================================== */

.c-topbar {
	background: var(--tbe-ink);
	color: #cdd4de;
	font-size: var(--tbe-text-sm);
}

.c-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-4);
	min-height: 40px;
	padding-block: var(--tbe-space-1);
}

.c-topbar__claim {
	display: none;
	align-items: center;
	gap: var(--tbe-space-2);
	margin: 0;
	color: #e7ecf3;
}

.c-topbar__claim svg {
	color: var(--tbe-accent);
	flex: none;
}

.c-topbar__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--tbe-space-2) var(--tbe-space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-topbar__list li {
	margin: 0;
}

.c-topbar__list a,
.c-topbar__hours {
	display: inline-flex;
	align-items: center;
	gap: var(--tbe-space-2);
	color: #cdd4de;
	text-decoration: none;
	white-space: nowrap;
}

.c-topbar__list a:hover,
.c-topbar__list a:focus-visible {
	color: var(--tbe-accent);
}

.c-topbar__list svg {
	flex: none;
	opacity: 0.8;
}

.c-topbar__hours {
	display: none;
}

@media (min-width: 48rem) {
	.c-topbar__claim {
		display: flex;
	}

	.c-topbar__hours {
		display: inline-flex;
	}
}

/* ==========================================================================
   Header — two rows: brand (scrolls) + dark navigation bar (sticky)
   ========================================================================== */

.c-header {
	position: relative;
	z-index: var(--tbe-z-header);
	background: var(--tbe-white);
}

.c-header__top {
	border-bottom: 1px solid var(--tbe-line);
}

.c-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-4);
	min-height: 82px;
	padding-block: var(--tbe-space-2);
}

/* Right-hand cluster of the brand row */
.c-header__meta {
	display: none;
	align-items: center;
	gap: var(--tbe-space-5);
	margin-left: auto;
}

.c-header__phone {
	display: inline-flex;
	align-items: center;
	gap: var(--tbe-space-3);
	color: var(--tbe-ink);
	text-decoration: none;
}

.c-header__phone:hover {
	color: var(--tbe-accent-strong);
}

.c-header__phone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--tbe-accent-soft);
	color: var(--tbe-accent-strong);
	flex: none;
}

.c-header__phone-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.c-header__phone-label {
	color: var(--tbe-slate);
	font-size: var(--tbe-text-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.c-header__phone-number {
	color: var(--tbe-ink);
	font-size: 1.05rem;
	font-weight: 750;
	letter-spacing: -0.01em;
}

.c-header__actions {
	display: flex;
	align-items: center;
	gap: var(--tbe-space-2);
}

/* Navigation bar ------------------------------------------------------- */
.c-header__bar {
	background: var(--tbe-ink);
	color: #d7dee7;
}

.c-header__bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-3);
	min-height: 56px;
}

.c-header__bar-actions {
	display: none;
}

@media (min-width: 64rem) {
	.c-header__meta {
		display: flex;
	}
}

@media (min-width: 68.75rem) {

	.c-header__actions {
		display: none;
	}

	.c-header__bar-actions {
		display: flex;
	}

	/* Desktop only: the header sticks, but is pulled up by the height of the
	   brand row, so after scrolling just the dark navigation bar stays
	   visible. (Sticky is applied to the header, not the bar, because a sticky
	   element cannot escape its parent's box.) */
	.c-header {
		position: sticky;
		top: calc(-1 * var(--tbe-header-top));
		box-shadow: 0 6px 18px rgba(20, 24, 29, 0.10);
	}

	/* The dark bar must never be the off-canvas drawer on desktop. */
	.c-header__bar .c-nav {
		position: static;
		z-index: auto;
		display: flex;
		flex-direction: row;
		width: auto;
		padding: 0;
		background: none;
		box-shadow: none;
		overflow: visible;
		transform: none;
		visibility: visible;
	}

	/* Auto margins centre the menu; the search icon keeps its width. */
	.c-header__bar .c-nav {
		margin-inline: auto;
	}
}

/* Brand lockup ---------------------------------------------------------- */
.c-brand {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: var(--tbe-space-3);
	max-width: 70%;
	color: var(--tbe-ink);
	text-decoration: none;
	min-width: 0;
}

.c-brand:hover,
.c-brand:focus-visible {
	color: var(--tbe-ink);
}

.c-brand__logo {
	display: block;
	flex: none;
	width: 54px;
	height: 54px;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: var(--tbe-shadow-sm);
	transition: transform var(--tbe-base) var(--tbe-ease);
}

.c-brand:hover .c-brand__logo {
	transform: translateY(-1px) scale(1.02);
}

.c-brand__logo img,
.custom-logo-link img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.c-brand__text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	line-height: 1.2;
}

.c-brand__name {
	color: var(--tbe-ink);
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.c-brand__tagline {
	display: none;
	color: var(--tbe-slate);
	font-size: var(--tbe-text-xs);
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (min-width: 26rem) {
	.c-brand__tagline {
		display: block;
	}
}

@media (min-width: 68.75rem) {
	.c-brand__name {
		font-size: 1.2rem;
	}

	.c-brand__logo {
		width: 62px;
		height: 62px;
	}
}

/* Footer variant of the brand lockup needs light type and full width. */
.c-footer .c-brand {
	max-width: 100%;
}

.c-footer .c-brand__name {
	color: var(--tbe-white);
	white-space: normal;
	font-size: 1.1rem;
}

.c-footer .c-brand__tagline {
	color: #97a2b0;
}

/* ==========================================================================
   Primary navigation
   ========================================================================== */

.c-nav {
	position: fixed;
	inset: 0 0 0 auto;
	z-index: var(--tbe-z-drawer);
	display: flex;
	flex-direction: column;
	width: min(88vw, 360px);
	padding: calc(var(--tbe-space-8) + env(safe-area-inset-top)) var(--tbe-space-5) var(--tbe-space-6);
	background: var(--tbe-white);
	box-shadow: var(--tbe-shadow-lg);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(102%);
	visibility: hidden;
	transition: transform var(--tbe-base) var(--tbe-ease), visibility var(--tbe-base) var(--tbe-ease);
}

.c-nav.is-open {
	transform: translateX(0);
	visibility: visible;
}

.c-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-nav__list > li {
	position: relative;
	margin: 0;
	border-bottom: 1px solid var(--tbe-line);
}

.c-nav__list > li > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-3);
	padding: var(--tbe-space-4) var(--tbe-space-1);
	color: var(--tbe-ink);
	font-size: var(--tbe-text-lg);
	font-weight: 600;
	text-decoration: none;
}

/* Inside the dark bar (desktop) the drawer colours are overridden below. */

.c-nav__list > li > a:hover,
.c-nav__list > li > a:focus-visible,
.c-nav__list > .current-menu-item > a,
.c-nav__list > .current_page_item > a,
.c-nav__list > .current-menu-ancestor > a {
	color: var(--tbe-accent-strong);
}

.c-nav__list > li > a::after {
	content: "";
	position: absolute;
	left: var(--tbe-space-1);
	bottom: -1px;
	width: 0;
	height: 2px;
	background: var(--tbe-accent);
	transition: width var(--tbe-base) var(--tbe-ease);
}

.c-nav__list > .current-menu-item > a::after,
.c-nav__list > .current_page_item > a::after {
	width: 3rem;
}

/* Submenus (mobile: inline accordion panel) ----------------------------- */
.c-nav .sub-menu {
	margin: 0 0 var(--tbe-space-3);
	padding: 0 0 0 var(--tbe-space-3);
	border-left: 2px solid var(--tbe-mist);
	list-style: none;
}

.c-nav .sub-menu a {
	display: block;
	padding: var(--tbe-space-2) 0;
	color: var(--tbe-ink-600);
	font-size: var(--tbe-text-md);
	text-decoration: none;
}

.c-nav .sub-menu a:hover {
	color: var(--tbe-accent-strong);
}

/* Desktop navigation ---------------------------------------------------- */
@media (min-width: 68.75rem) {
	.c-nav {
		position: static;
		z-index: auto;
		flex-direction: row;
		width: auto;
		padding: 0;
		background: none;
		box-shadow: none;
		overflow: visible;
		transform: none;
		visibility: visible;
	}

	.c-nav__list {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0;
	}

	.c-nav__list > li {
		border: 0;
	}

	.c-nav__list > li > a {
		padding: 0.95rem 0.68rem;
		border-radius: 0;
		color: #d7dee7;
		font-size: 0.92rem;
		font-weight: 600;
		white-space: nowrap;
	}

	.c-nav__list > li > a::after {
		display: none;
	}

	.c-nav__list > li > a:hover,
	.c-nav__list > li > a:focus-visible {
		background: rgba(255, 255, 255, 0.08);
		color: var(--tbe-white);
	}

	.c-nav__list > .current-menu-item > a,
	.c-nav__list > .current_page_item > a,
	.c-nav__list > .current-menu-ancestor > a {
		color: var(--tbe-accent);
		box-shadow: inset 0 -3px 0 var(--tbe-accent);
	}

	/* Dropdowns */
	.c-nav__list > li > .sub-menu {
		position: absolute;
		/* Was calc(100% + 10px): that 10px gap was a dead zone — moving the
		   pointer down from the parent closed the menu before reaching it.
		   The visual gap now comes from an invisible ::before bridge instead. */
		top: 100%;
		left: 0;
		z-index: 10;
		min-width: 248px;
		margin: 0;
		padding: var(--tbe-space-2);
		border: 1px solid var(--tbe-line);
		border-radius: var(--tbe-radius);
		background: var(--tbe-white);
		box-shadow: var(--tbe-shadow-md);
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity var(--tbe-fast) var(--tbe-ease), transform var(--tbe-fast) var(--tbe-ease),
			visibility var(--tbe-fast) var(--tbe-ease);
	}

	.c-nav__list > li:hover > .sub-menu,
	.c-nav__list > li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.c-nav__list > li > .sub-menu a {
		padding: var(--tbe-space-2) var(--tbe-space-3);
		border-radius: var(--tbe-radius-sm);
		font-size: 0.94rem;
	}

	.c-nav__list > li > .sub-menu a:hover {
		background: var(--tbe-mist);
	}
}

	/*
	 * Invisible hover bridge across the gap between the parent item and the
	 * panel, so the pointer can travel down without the dropdown closing.
	 */
	.c-nav__list > li > .sub-menu::before {
		content: "";
		position: absolute;
		top: calc(-1 * var(--tbe-space-3));
		left: 0;
		right: 0;
		height: var(--tbe-space-3);
	}

	/* Third level and deeper: fly out to the side of the parent item. */
	.c-nav .sub-menu .sub-menu {
		position: absolute;
		top: calc(-1 * var(--tbe-space-2));
		left: 100%;
		z-index: 11;
		min-width: 232px;
		margin: 0;
		padding: var(--tbe-space-2);
		border: 1px solid var(--tbe-line);
		border-radius: var(--tbe-radius);
		background: var(--tbe-white);
		box-shadow: var(--tbe-shadow-md);
		opacity: 0;
		visibility: hidden;
		transform: translateX(8px);
		transition: opacity var(--tbe-fast) var(--tbe-ease), transform var(--tbe-fast) var(--tbe-ease),
			visibility var(--tbe-fast) var(--tbe-ease);
	}

	.c-nav .sub-menu li {
		position: relative;
	}

	.c-nav .sub-menu li:hover > .sub-menu,
	.c-nav .sub-menu li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateX(0);
	}

	/* Same bridge, horizontally, so the flyout does not close on the way out. */
	.c-nav .sub-menu .sub-menu::before {
		content: "";
		position: absolute;
		top: 0;
		left: calc(-1 * var(--tbe-space-2));
		width: var(--tbe-space-2);
		height: 100%;
	}

	/* Chevron on items that have children, so the third level is discoverable. */
	.c-nav .sub-menu li.menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 7px;
		height: 7px;
		margin-left: var(--tbe-space-2);
		border-top: 2px solid currentColor;
		border-right: 2px solid currentColor;
		transform: rotate(45deg);
		vertical-align: middle;
	}

/* Toggle button --------------------------------------------------------- */
.c-nav-toggle,
.c-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--tbe-line);
	border-radius: var(--tbe-radius-sm);
	background: var(--tbe-white);
	color: var(--tbe-ink);
	cursor: pointer;
	transition: background var(--tbe-fast) var(--tbe-ease), border-color var(--tbe-fast) var(--tbe-ease),
		color var(--tbe-fast) var(--tbe-ease);
}

.c-nav-toggle:hover,
.c-icon-btn:hover {
	border-color: var(--tbe-accent);
	background: var(--tbe-accent-soft);
	color: var(--tbe-ink);
}

.c-nav-toggle__bars {
	display: flex;
	width: 20px;
	height: 14px;
	flex-direction: column;
	justify-content: space-between;
}

.c-nav-toggle__bars span {
	display: block;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform var(--tbe-base) var(--tbe-ease), opacity var(--tbe-fast) var(--tbe-ease);
	transform-origin: center;
}

.c-nav-toggle[aria-expanded="true"] .c-nav-toggle__bars span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.c-nav-toggle[aria-expanded="true"] .c-nav-toggle__bars span:nth-child(2) {
	opacity: 0;
}

.c-nav-toggle[aria-expanded="true"] .c-nav-toggle__bars span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.c-search-toggle {
	display: none;
}

/* Icon button on the dark navigation bar */
.c-icon-btn--dark {
	border-color: rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.06);
	color: var(--tbe-white);
}

.c-icon-btn--dark:hover {
	border-color: var(--tbe-accent);
	background: var(--tbe-accent);
	color: var(--tbe-ink);
}

@media (min-width: 68.75rem) {
	.c-nav-toggle {
		display: none;
	}

	.c-search-toggle {
		display: inline-flex;
	}
}

/* Drawer backdrop ------------------------------------------------------- */
.c-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--tbe-z-backdrop);
	background: rgba(20, 24, 29, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--tbe-base) var(--tbe-ease), visibility var(--tbe-base) var(--tbe-ease);
}

.c-nav-backdrop.is-visible {
	opacity: 1;
	visibility: visible;
}

/* Search panel ---------------------------------------------------------- */
.c-search-panel {
	padding-block: var(--tbe-space-4);
	border-top: 1px solid var(--tbe-line);
	background: var(--tbe-white);
	box-shadow: var(--tbe-shadow-sm);
}

.c-search-panel[hidden] {
	display: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.c-footer {
	padding-block: var(--tbe-space-9) var(--tbe-space-5);
	background: var(--tbe-ink);
	color: #b9c2ce;
	font-size: 0.95rem;
}

.c-footer a {
	color: #dfe5ec;
	text-decoration: none;
}

.c-footer a:hover,
.c-footer a:focus-visible {
	color: var(--tbe-accent);
}

.c-footer__grid {
	display: grid;
	gap: var(--tbe-space-7) var(--tbe-space-6);
	grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
	.c-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 62rem) {
	.c-footer__grid {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
	}
}

.c-footer__note {
	margin-top: var(--tbe-space-4);
	max-width: 34ch;
	color: #97a2b0;
}

.c-footer__contact {
	margin: var(--tbe-space-4) 0 0;
	padding: 0;
	list-style: none;
}

.c-footer__contact li {
	display: flex;
	align-items: flex-start;
	gap: var(--tbe-space-2);
	margin-top: var(--tbe-space-2);
}

.c-footer__contact svg {
	flex: none;
	margin-top: 3px;
	color: var(--tbe-accent);
}

.c-footer__title {
	margin: 0 0 var(--tbe-space-3);
	color: var(--tbe-white);
	font-size: var(--tbe-text-sm);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.c-footer__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-footer__menu li {
	margin-top: var(--tbe-space-2);
}

.c-footer__menu a {
	display: inline-block;
	padding-block: 2px;
}

.c-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-3);
	margin-top: var(--tbe-space-8);
	padding-top: var(--tbe-space-5);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: var(--tbe-text-sm);
}

.c-footer__bottom p {
	margin: 0;
}

.c-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tbe-space-4);
	color: #8b96a4;
}

/* Back to top ----------------------------------------------------------- */
.c-to-top {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: var(--tbe-radius-pill);
	background: rgba(255, 255, 255, 0.06);
	color: var(--tbe-white);
	cursor: pointer;
	transition: background var(--tbe-fast) var(--tbe-ease), transform var(--tbe-fast) var(--tbe-ease);
}

.c-to-top:hover {
	background: var(--tbe-accent);
	color: var(--tbe-ink);
	transform: translateY(-2px);
}

.c-to-top[hidden] {
	display: none;
}

/* CTA strip above the footer -------------------------------------------- */
.c-cta-strip {
	padding-block: var(--tbe-space-7);
	background: linear-gradient(100deg, var(--tbe-ink) 0%, var(--tbe-ink-800) 55%, #2b333d 100%);
	color: #dfe5ec;
}

.c-cta-strip__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--tbe-space-5);
}

.c-cta-strip__title {
	margin: var(--tbe-space-1) 0 0;
	max-width: 34ch;
	color: var(--tbe-white);
	font-size: var(--tbe-text-2xl);
}
