/* Thrive-O site chrome: page frame, header, navigation, colour-scheme toggle, footer. */

/* Sticky footer: on short pages the footer sits at the bottom of the window, on long pages after the content. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > * {
	flex: 0 0 auto;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Header */
.wp-block-template-part:has(> .site-header),
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.site-header {
	background: var(--thriveo-color-bg);
	border-bottom: 1px solid var(--thriveo-color-hairline);
	padding-left: var(--thriveo-gutter);
	padding-right: var(--thriveo-gutter);
}

.site-header__bar {
	gap: var(--thriveo-space-4);
	min-height: var(--thriveo-header-height);
}

.site-header__actions {
	gap: var(--thriveo-space-4);
}

.site-logo {
	display: inline-flex;
	flex-shrink: 0;
	line-height: 0;
}

.site-logo__image {
	display: block;
	height: auto;
	transition: opacity var(--thriveo-duration-base) var(--thriveo-ease-out);
	width: 140px;
}

:root[data-theme="light"] img[data-logo-light][data-logo-current="dark"] {
	opacity: 0;
}

/* Navigation */
.site-header .wp-block-navigation {
	gap: var(--thriveo-space-6);
}

.site-header .wp-block-navigation a:where(:not(.wp-element-button)) {
	color: var(--thriveo-color-text);
	text-decoration: none;
}

.site-header .wp-block-navigation a:where(:not(.wp-element-button)):hover,
.site-header .wp-block-navigation .current-menu-item > a {
	color: var(--thriveo-color-link);
	text-decoration: underline;
}

.site-header .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	background-color: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	box-shadow: var(--thriveo-shadow-md);
	color: var(--thriveo-color-text);
	padding: var(--thriveo-space-2);
}

.site-header .wp-block-navigation__submenu-container a:where(:not(.wp-element-button)) {
	color: var(--thriveo-color-text);
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	background-color: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

.site-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--thriveo-color-bg);
	color: var(--thriveo-color-text);
	padding: var(--thriveo-space-6) var(--thriveo-gutter);
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: 1.25rem;
	gap: var(--thriveo-space-4);
}

.site-header .wp-block-navigation__responsive-container-open,
.site-header .wp-block-navigation__responsive-container-close {
	color: var(--thriveo-color-text);
}

/* Header controls: colour-scheme toggle and optional language switcher */
.thriveo-header-controls {
	gap: var(--thriveo-space-2);
}

.thriveo-theme-toggle {
	align-items: center;
	background: transparent;
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
	cursor: pointer;
	display: inline-flex;
	height: 2.5rem;
	justify-content: center;
	padding: 0;
	transition: border-color var(--thriveo-duration-base) var(--thriveo-ease-out);
	width: 2.5rem;
}

.thriveo-theme-toggle[hidden] {
	display: none;
}

.thriveo-theme-toggle:hover {
	border-color: var(--thriveo-color-link);
}

.thriveo-theme-toggle svg {
	height: 18px;
	width: 18px;
}

.thriveo-theme-toggle__moon,
.thriveo-theme-toggle[data-scheme="light"] .thriveo-theme-toggle__sun {
	display: none;
}

.thriveo-theme-toggle[data-scheme="light"] .thriveo-theme-toggle__moon {
	display: block;
}

/* Footer: follows the colour scheme (dark surface in dark mode, soft light band in light mode) */
.site-footer {
	--thriveo-color-text: var(--thriveo-footer-text);
	--thriveo-color-muted: var(--thriveo-footer-muted);
	--thriveo-color-link: var(--thriveo-footer-accent);
	--thriveo-color-focus: var(--thriveo-footer-accent);
	--thriveo-color-bg: var(--thriveo-footer-bg);
	background: var(--thriveo-footer-bg);
	border-top: 1px solid var(--thriveo-footer-hairline);
	color: var(--thriveo-footer-text);
	padding: clamp(3rem, 6vw, 5rem) var(--thriveo-gutter) var(--thriveo-space-8);
}

.site-footer a {
	color: var(--thriveo-footer-text);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--thriveo-footer-accent);
	text-decoration: underline;
}

.site-footer a:focus-visible {
	outline-color: var(--thriveo-footer-accent);
}

.site-footer__grid {
	display: grid;
	gap: var(--thriveo-space-8);
	grid-template-columns: 1fr;
	margin-left: auto;
	margin-right: auto;
	max-width: var(--wp--style--global--wide-size, 1280px);
}

.site-footer__logo {
	display: block;
	height: auto;
	transition: opacity var(--thriveo-duration-base) var(--thriveo-ease-out);
	width: 150px;
}

.site-footer__tagline {
	color: var(--thriveo-footer-text);
	font-family: var(--thriveo-font-heading);
	font-size: 1.25rem;
	font-weight: 300;
	line-height: 1.3;
	margin: var(--thriveo-space-4) 0 var(--thriveo-space-3);
	max-width: 22ch;
}

.site-footer__legal,
.site-footer__address {
	color: var(--thriveo-footer-muted);
	font-size: 0.875rem;
	font-style: normal;
	line-height: 1.6;
	margin: 0;
}

.site-footer__title {
	color: var(--thriveo-footer-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow, 0.16em);
	margin: 0 0 var(--thriveo-space-4);
	text-transform: uppercase;
}

.site-footer__list {
	display: grid;
	gap: var(--thriveo-space-3);
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__address {
	margin-bottom: var(--thriveo-space-4);
}

.site-footer a.site-footer__cta {
	background: var(--thriveo-color-cta);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-cta-text);
	display: inline-block;
	font-weight: 600;
	padding: var(--thriveo-space-2) var(--thriveo-space-4);
	text-decoration: none;
}

.site-footer a.site-footer__cta:hover {
	background: var(--thriveo-color-cta-hover);
	color: var(--thriveo-color-cta-text);
}

.site-footer__certifications {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--thriveo-space-4) var(--thriveo-space-8);
	list-style: none;
	margin: var(--thriveo-space-10) auto 0;
	max-width: var(--wp--style--global--wide-size, 1280px);
	padding: 0;
}

.site-footer__certification {
	align-items: center;
	display: flex;
	gap: var(--thriveo-space-3);
}

.site-footer__certification-logo {
	background: var(--brand-white);
	border-radius: var(--thriveo-radius-xs);
	display: block;
	height: 2.5rem;
	object-fit: contain;
	padding: var(--thriveo-space-1) var(--thriveo-space-2);
	width: auto;
}

.site-footer__certification-name {
	color: var(--thriveo-footer-muted);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.site-footer__certifications + .site-footer__bottom {
	margin-top: var(--thriveo-space-6);
}

.site-footer__bottom {
	border-top: 1px solid var(--thriveo-footer-hairline);
	gap: var(--thriveo-space-4);
	margin: var(--thriveo-space-10) auto 0;
	max-width: var(--wp--style--global--wide-size, 1280px);
	padding-top: var(--thriveo-space-6);
}

.site-footer--landing {
	padding-top: var(--thriveo-space-6);
}

.site-footer--landing .site-footer__bottom {
	border-top: 0;
	margin-top: 0;
	padding-top: 0;
}

.thriveo-footer-legal {
	color: var(--thriveo-footer-muted);
	font-size: 0.875rem;
	gap: var(--thriveo-space-2);
}

.thriveo-footer-legal .thriveo-cookie-preferences {
	align-items: center;
	display: inline-flex;
	gap: var(--thriveo-space-2);
}

.thriveo-footer-legal .thriveo-cookie-preferences::before {
	content: "\00b7";
	content: "\00b7" / "";
}

.thriveo-footer-legal :where(button) {
	background: transparent;
	border: 0;
	color: var(--thriveo-footer-text);
	cursor: pointer;
	font: inherit;
	padding: 0;
	text-decoration: none;
	text-underline-offset: 3px;
}

.thriveo-footer-legal :where(button):hover,
.thriveo-footer-legal :where(button):focus-visible {
	color: var(--thriveo-footer-accent);
	text-decoration: underline;
}

.site-footer__legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--thriveo-space-2);
}

@media (min-width: 640px) {
	.site-logo__image {
		width: 160px;
	}

	.site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.site-footer__grid {
		gap: var(--thriveo-space-12);
		grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	}
}
