/**
 * Site-wide Theme Builder header / footer chrome.
 *
 * Colours and fonts come from Styles tokens (--cm-*).
 *
 * @package CalumetMedia\ThemeBuilder
 */

/* -------------------------------------------------------------------------
   Header — gradient accent + surface bar
   ------------------------------------------------------------------------- */

.tb-site-header {
	position: relative;
	background: var(--cm-color-header-bg, var(--cm-color-background, #ffffff));
	border-bottom: 1px solid var(--cm-color-border, color-mix(in srgb, var(--cm-color-text, #0f172a) 10%, transparent));
	box-shadow: 0 1px 0 color-mix(in srgb, var(--cm-color-primary, #1e70ea) 8%, transparent),
		0 8px 24px color-mix(in srgb, var(--cm-color-text, #0f172a) 6%, transparent);
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
	color: var(--cm-color-header-text, var(--cm-color-text, #0f172a));
}

.tb-site-header::before {
	content: "";
	display: block;
	height: 4px;
	background: linear-gradient(
		90deg,
		var(--cm-color-primary, #1e70ea),
		var(--cm-color-accent, #6366f1)
	);
}

.tb-site-header__inner {
	max-width: var(--cm-content-width, 1140px);
	margin: 0 auto;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.tb-site-header__brand {
	display: flex;
	align-items: center;
	min-width: 0;
}

.tb-site-header__logo a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.tb-site-header__logo img,
.tb-site-header .cm-theme-brand-logo {
	display: block;
	max-height: 64px;
	max-width: 220px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.tb-site-header__site-title {
	font-family: var(--cm-font-heading, var(--cm-font-body, "DM Sans", sans-serif));
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--cm-color-text, #0f172a);
	text-decoration: none;
	line-height: 1.2;
	transition: color 0.15s ease;
}

.tb-site-header__site-title:hover,
.tb-site-header__site-title:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-header__nav {
	margin-left: auto;
}

.tb-site-header .tb-social-links {
	flex-shrink: 0;
}

.tb-site-header__menu {
	display: flex;
	align-items: center;
	gap: 0.35rem 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}

.tb-site-header__menu > li {
	margin: 0;
	padding: 0;
}

.tb-site-header__menu a {
	position: relative;
	display: inline-block;
	color: var(--cm-color-secondary, #475569);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	padding: 0.35rem 0;
	transition: color 0.15s ease;
}

.tb-site-header__menu a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--cm-color-primary, #1e70ea);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.2s ease;
}

.tb-site-header__menu a:hover,
.tb-site-header__menu a:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-header__menu a:hover::after,
.tb-site-header__menu a:focus::after,
.tb-site-header__menu .current-menu-item > a::after,
.tb-site-header__menu .current_page_item > a::after {
	transform: scaleX(1);
}

.tb-site-header__menu .current-menu-item > a,
.tb-site-header__menu .current_page_item > a {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-header__menu .sub-menu {
	list-style: none;
	margin: 0.35rem 0 0;
	padding: 0;
}

/* -------------------------------------------------------------------------
   Footer — dark modern band
   ------------------------------------------------------------------------- */

.tb-site-footer {
	position: relative;
	background: var(--cm-color-footer-bg, color-mix(in srgb, var(--cm-color-text, #0f172a) 92%, black));
	color: var(--cm-color-footer-text, color-mix(in srgb, var(--cm-color-background, #ffffff) 88%, transparent));
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
	margin-top: auto;
}

.tb-site-footer::before {
	content: "";
	display: block;
	height: 4px;
	background: linear-gradient(
		90deg,
		var(--cm-color-primary, #1e70ea),
		var(--cm-color-accent, #6366f1)
	);
}

.tb-site-footer__inner {
	max-width: var(--cm-content-width, 1140px);
	margin: 0 auto;
	padding: 2.75rem 1.5rem 1.5rem;
}

.tb-site-footer__grid {
	display: grid;
	gap: 2.25rem;
	grid-template-columns: 1fr;
	padding-bottom: 2rem;
	border-bottom: 1px solid color-mix(in srgb, var(--cm-color-background, #ffffff) 14%, transparent);
}

.tb-site-footer__brand {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
	align-items: flex-start;
}

.tb-site-footer__logo {
	line-height: 0;
}

.tb-site-footer__logo a {
	display: inline-block;
	line-height: 0;
}

.tb-site-footer__logo img,
.tb-site-footer__logo .cm-theme-brand-logo {
	display: block;
	max-width: 300px;
	max-height: 96px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.tb-site-footer__brand-name {
	margin: 0;
	font-family: var(--cm-font-heading, var(--cm-font-body, "DM Sans", sans-serif));
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--cm-color-background, #ffffff);
	line-height: 1.3;
}

.tb-site-footer__brand-name a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.tb-site-footer__brand-name a:hover,
.tb-site-footer__brand-name a:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-footer__contact {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	max-width: 22rem;
}

.tb-site-footer__contact-line {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: color-mix(in srgb, var(--cm-color-background, #ffffff) 72%, transparent);
}

.tb-site-footer__contact-line a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.tb-site-footer__contact-line a:hover,
.tb-site-footer__contact-line a:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-footer__heading {
	margin: 0 0 0.9rem;
	font-family: var(--cm-font-heading, var(--cm-font-body, "DM Sans", sans-serif));
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cm-color-background, #ffffff);
}

.tb-site-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.tb-site-footer__menu li {
	margin: 0;
	padding: 0;
}

.tb-site-footer__menu a {
	color: color-mix(in srgb, var(--cm-color-background, #ffffff) 72%, transparent);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.4;
	transition: color 0.15s ease;
}

.tb-site-footer__menu a:hover,
.tb-site-footer__menu a:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-site-footer__sub {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: center;
	padding-top: 1.25rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: color-mix(in srgb, var(--cm-color-background, #ffffff) 55%, transparent);
	text-align: center;
}

.tb-site-footer__privacy,
.tb-site-footer__credit {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.tb-site-footer__privacy:hover,
.tb-site-footer__privacy:focus,
.tb-site-footer__credit:hover,
.tb-site-footer__credit:focus {
	color: var(--cm-color-primary, #1e70ea);
}

/* -------------------------------------------------------------------------
   Elementor Pro location chrome (when source = elementor)
   ------------------------------------------------------------------------- */

.elementor-location-header {
	background: var(--cm-color-header-bg, var(--cm-color-background, #ffffff));
	border-bottom: 1px solid var(--cm-color-border, #e2e8f0);
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
}

.elementor-location-header .elementor-widget-theme-site-title .elementor-heading-title,
.elementor-location-header .elementor-widget-heading .elementor-heading-title {
	font-family: var(--cm-font-heading, var(--cm-font-body, "DM Sans", sans-serif));
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--cm-color-header-text, var(--cm-color-text, #0f172a));
}

.elementor-location-header .elementor-nav-menu--main .elementor-item {
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--cm-color-header-text, var(--cm-color-text, #0f172a));
}

.elementor-location-header .elementor-nav-menu--main .elementor-item:hover,
.elementor-location-header .elementor-nav-menu--main .elementor-item:focus,
.elementor-location-header .elementor-nav-menu--main .elementor-item.elementor-item-active {
	color: var(--cm-color-primary, #1e70ea);
}

.elementor-location-header .elementor-widget-image img,
.elementor-location-header .elementor-widget-theme-site-logo img,
.elementor-element-hdrlogo img {
	max-height: 64px;
	max-width: 220px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.elementor-location-footer {
	background: var(--cm-color-footer-bg, #0f172a);
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
	color: var(--cm-color-footer-text, #ffffff);
}

.elementor-location-footer .elementor-widget-image img,
.elementor-location-footer .elementor-widget-theme-site-logo img,
.elementor-element-ftrlogo img {
	max-width: 300px;
	max-height: 96px;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* Brand + Quick links: content-sized columns so space-between spans full width. */
.elementor-location-footer .elementor-element-ftrgrid > .e-con,
.elementor-element-ftrgrid > .e-con {
	flex-grow: 0 !important;
	width: auto !important;
	max-width: 100%;
}

.elementor-location-footer .elementor-nav-menu,
.elementor-location-footer .elementor-widget-nav-menu ul,
.elementor-element-ftrnav .elementor-nav-menu,
.elementor-element-ftrnav .elementor-widget-nav-menu ul,
.elementor-element-ftrnav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.elementor-location-footer .elementor-widget-heading .elementor-heading-title,
.elementor-location-footer .elementor-widget-theme-site-title .elementor-heading-title {
	font-family: var(--cm-font-heading, var(--cm-font-body, "DM Sans", sans-serif));
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--cm-color-footer-text, #ffffff);
}

.elementor-location-footer .elementor-widget-text-editor,
.elementor-location-footer .elementor-nav-menu--main .elementor-item,
.elementor-location-footer .elementor-widget-text-editor a {
	font-family: var(--cm-font-body, "DM Sans", system-ui, sans-serif);
	color: var(--cm-color-footer-text, #ffffff);
	opacity: 0.85;
}

.elementor-location-footer .elementor-widget-text-editor a:hover,
.elementor-location-footer .elementor-nav-menu--main .elementor-item:hover {
	color: var(--cm-color-primary, #1e70ea);
	opacity: 1;
}

@media (min-width: 768px) {
	.tb-site-footer__grid {
		grid-template-columns: 1fr auto;
		justify-content: space-between;
		align-items: start;
	}

	.tb-site-footer__sub {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		text-align: left;
	}
}

/* -------------------------------------------------------------------------
   Front page tall hero — transparent overlay header (home only)
   ------------------------------------------------------------------------- */

body.tb-home-tall-hero .tb-site-header,
body.tb-home-tall-hero .elementor-location-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	width: 100%;
	background: transparent !important;
	border-bottom: none !important;
	box-shadow: none !important;
}

/* Extra top breathing room over full-bleed hero (image stays edge-to-edge). */
body.tb-home-tall-hero .tb-site-header__inner {
	padding-top: calc(2rem + env(safe-area-inset-top, 0px));
}

body.tb-home-tall-hero .elementor-location-header {
	padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

body.tb-home-tall-hero .tb-site-header::before {
	display: none;
}

body.tb-home-tall-hero .elementor-location-header > .elementor-element,
body.tb-home-tall-hero .elementor-location-header .e-con {
	background-color: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
}

body.tb-home-tall-hero .tb-site-header,
body.tb-home-tall-hero .tb-site-header a,
body.tb-home-tall-hero .tb-site-header__site-title,
body.tb-home-tall-hero .tb-site-header__menu a {
	color: #ffffff;
}

body.tb-home-tall-hero .elementor-location-header .elementor-nav-menu--main .elementor-item,
body.tb-home-tall-hero .elementor-location-header .elementor-widget-theme-site-title .elementor-heading-title,
body.tb-home-tall-hero .elementor-location-header .elementor-widget-heading .elementor-heading-title {
	color: #ffffff !important;
}

body.tb-home-tall-hero .elementor-location-header .elementor-nav-menu--main .elementor-item:hover,
body.tb-home-tall-hero .elementor-location-header .elementor-nav-menu--main .elementor-item:focus,
body.tb-home-tall-hero .elementor-location-header .elementor-nav-menu--main .elementor-item.elementor-item-active,
body.tb-home-tall-hero .tb-site-header a:hover,
body.tb-home-tall-hero .tb-site-header a:focus {
	color: var(--cm-color-primary, #f5a623) !important;
}

body.tb-home-tall-hero .elementor-location-header .elementor-button,
body.tb-home-tall-hero .elementor-location-header .elementor-button-link {
	background-color: transparent !important;
	border: 1px solid rgba(255, 255, 255, 0.85) !important;
	color: #ffffff !important;
}

body.tb-home-tall-hero .tb-site-header__cta,
body.tb-home-tall-hero .tb-site-header .button {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.85);
	color: #ffffff;
}

/* -------------------------------------------------------------------------
   Social links — header & footer
   ------------------------------------------------------------------------- */

.tb-social-links {
	margin: 0;
	padding: 0;
}

.tb-social-links__list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tb-social-links__item {
	margin: 0;
	padding: 0;
}

.tb-social-links__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	color: inherit;
	text-decoration: none;
	border-radius: 0.25rem;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.tb-social-links__link:hover,
.tb-social-links__link:focus {
	color: var(--cm-color-primary, #1e70ea);
}

.tb-social-links__icon {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
}

.tb-social-links .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.tb-site-header .tb-social-links {
	color: var(--cm-color-header-text, var(--cm-color-text, #0f172a));
}

.tb-site-footer .tb-social-links {
	color: var(--cm-color-footer-text, color-mix(in srgb, var(--cm-color-background, #ffffff) 88%, transparent));
	margin-top: 0.25rem;
}

body.tb-home-tall-hero .tb-site-header .tb-social-links,
body.tb-home-tall-hero .tb-site-header .tb-social-links__link {
	color: #ffffff;
}

body.tb-home-tall-hero .tb-site-header .tb-social-links__link:hover,
body.tb-home-tall-hero .tb-site-header .tb-social-links__link:focus {
	color: var(--cm-color-primary, #f5a623);
}
