/* Thrive-O components used by patterns and templates. Colours only through semantic tokens. */

/* Section rhythm */
.thriveo-section {
	padding-bottom: var(--thriveo-section-padding);
	padding-left: var(--thriveo-gutter);
	padding-right: var(--thriveo-gutter);
	padding-top: var(--thriveo-section-padding);
}

.thriveo-section--alt {
	background: var(--thriveo-color-bg-alt);
}

.thriveo-section__header {
	margin-bottom: var(--thriveo-space-10);
	max-width: 640px;
}

.thriveo-section__header > * {
	margin-bottom: 0;
	margin-top: 0;
}

.thriveo-section__header > * + * {
	margin-top: var(--thriveo-space-4);
}

/* Page header (templates) */
.thriveo-page-header {
	padding: clamp(1.5rem, 3vw, 2.5rem) var(--thriveo-gutter) clamp(1.25rem, 2.5vw, 2rem);
}

.thriveo-page-header:has(.wp-block-post-featured-image),
.thriveo-page-header.has-featured-image {
	border-bottom: 1px solid var(--thriveo-color-hairline);
	isolation: isolate;
	overflow: hidden;
	position: relative;
}

.thriveo-page-header > :not(.thriveo-page-header__image) {
	position: relative;
	z-index: 1;
}

.thriveo-page-header__image {
	bottom: 0;
	margin: 0;
	position: absolute;
	right: 0;
	top: 0;
	width: min(60%, 720px);
	z-index: 0;
	-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 70%);
	mask-image: linear-gradient(to right, transparent 0%, #000 70%);
}

.thriveo-page-header .thriveo-page-header__image img {
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.thriveo-page-header:has(.wp-block-post-featured-image) :is(.wp-block-post-title, .wp-block-query-title, h1),
.thriveo-page-header.has-featured-image :is(.wp-block-post-title, .wp-block-query-title, h1) {
	text-shadow:
		-1px -1px 0 var(--thriveo-color-bg),
		0 -1px 0 var(--thriveo-color-bg),
		1px -1px 0 var(--thriveo-color-bg),
		-1px 0 0 var(--thriveo-color-bg),
		1px 0 0 var(--thriveo-color-bg),
		-1px 1px 0 var(--thriveo-color-bg),
		0 1px 0 var(--thriveo-color-bg),
		1px 1px 0 var(--thriveo-color-bg);
}

.thriveo-page-header .wp-block-post-title,
.thriveo-page-header .wp-block-query-title,
.thriveo-page-header h1 {
	font-size: var(--wp--preset--font-size--3-xl);
	margin: 0;
}

.thriveo-page-header .wp-block-post-excerpt,
.thriveo-page-header .wp-block-term-description {
	color: var(--thriveo-color-text-secondary);
	font-size: 1.125rem;
	margin-top: var(--thriveo-space-4);
}

.thriveo-page-header .wp-block-post-excerpt__more-text {
	display: none;
}

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

.thriveo-meta .wp-block-post-terms a {
	color: var(--thriveo-color-link);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow, 0.16em);
	text-decoration: none;
	text-transform: uppercase;
}

.thriveo-main {
	padding: clamp(1.5rem, 4vw, 2.5rem) var(--thriveo-gutter) var(--thriveo-section-padding);
}

.thriveo-main--flush {
	padding: 0;
}

/* Hero */
.hero-section {
	background-color: var(--thriveo-color-bg);
	background-image: url("../images/home/hero.webp");
	background-position: left center;
	background-repeat: no-repeat;
	background-size: cover;
	overflow: hidden;
	padding: clamp(2.5rem, 6vw, 4.5rem) var(--thriveo-gutter);
	position: relative;
}

.hero-box {
	background: var(--thriveo-color-bg);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-lg);
	box-shadow: var(--thriveo-shadow-lg);
	max-width: 32rem;
	padding: var(--thriveo-space-6);
	width: 100%;
}

.hero-box > * {
	margin-bottom: 0;
	margin-top: 0;
}

.hero-section::after {
	background: var(--thriveo-glow-line);
	bottom: 0;
	content: "";
	height: 1px;
	left: 0;
	position: absolute;
	right: 0;
}

.hero-section .hero-title {
	font-size: clamp(1.75rem, 3.2vw, 2.5rem);
	line-height: 1.1;
	margin-bottom: var(--thriveo-space-4);
	margin-top: 0;
}

.hero-box .thriveo-lede {
	font-size: 1rem;
}

.hero-section .hero-title em {
	color: var(--thriveo-color-link);
	font-style: normal;
}

.hero-section .wp-block-buttons {
	gap: var(--thriveo-space-3);
	margin-top: var(--thriveo-space-6);
}

/* Story navigation (bridge) */
.bridge-inner {
	display: flex;
	flex-direction: column;
	gap: var(--thriveo-space-10);
}

.bridge-text {
	flex: 1;
}

.story-nav-wrap {
	min-width: 0;
	width: 100%;
}

.story-nav-label {
	color: var(--thriveo-color-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow, 0.16em);
	margin: 0 0 var(--thriveo-space-2);
	text-transform: uppercase;
}

.story-nav-wrap .wp-block-buttons {
	flex-direction: column;
	gap: var(--thriveo-space-2);
}

.story-nav-wrap .wp-block-button {
	width: 100%;
}

.wp-block-button.is-style-story-nav .wp-block-button__link {
	align-items: center;
	background: transparent;
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
	display: flex;
	font-weight: 500;
	gap: var(--thriveo-space-3);
	justify-content: flex-start;
	padding: var(--thriveo-space-3) var(--thriveo-space-4);
	text-align: left;
	width: 100%;
}

.wp-block-button.is-style-story-nav .wp-block-button__link:hover,
.wp-block-button.is-style-story-nav .wp-block-button__link:focus-visible {
	background: var(--thriveo-color-surface-tint);
	border-color: var(--thriveo-color-link);
	color: var(--thriveo-color-text);
}

.story-nav-num {
	color: var(--thriveo-color-link);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	min-width: 1.75rem;
}

.story-nav-arrow {
	margin-left: auto;
	transition: transform var(--thriveo-duration-base) var(--thriveo-ease-out);
}

.wp-block-button.is-style-story-nav .wp-block-button__link:hover .story-nav-arrow {
	transform: translateX(3px);
}

/* Story sections */
.story-section {
	padding: var(--thriveo-section-padding) var(--thriveo-gutter);
}

.story-section-alt {
	background: var(--thriveo-color-bg-alt);
}

.story-section .story-inner > * {
	margin-bottom: 0;
	margin-top: 0;
}

.story-section .story-inner.alignwide {
	max-width: var(--wp--style--global--wide-size, 1280px);
}

.story-section .story-inner > :not(.story-header):not(.back-to-list) {
	max-width: none;
}

.back-to-list {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.story-section .story-inner > .back-to-list {
	margin-bottom: var(--thriveo-space-8);
}

.story-section .story-inner > .story-header {
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.back-to-list a {
	color: var(--thriveo-color-link);
	text-decoration: none;
}

.back-to-list a:hover {
	text-decoration: underline;
}

.story-header {
	gap: var(--thriveo-space-2);
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
	max-width: 720px;
}

.story-header > * {
	margin: 0;
}

.story-headline {
	font-size: clamp(1.75rem, 3.5vw, 2.75rem);
	line-height: 1.15;
	margin-bottom: var(--thriveo-space-3);
}

.story-intro {
	color: var(--thriveo-color-text-secondary);
	max-width: 600px;
}

.story-header-with-media {
	align-items: stretch;
	display: flex;
	flex-direction: column;
	gap: var(--thriveo-space-6);
	max-width: none;
}

.story-header-with-media .story-header-text {
	flex: 1;
	min-width: 0;
}

.story-header-image {
	margin: 0;
	min-height: 12rem;
	overflow: hidden;
	position: relative;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
	mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
}

.story-header-image img {
	display: block;
	height: 100%;
	inset: 0;
	object-fit: cover;
	object-position: center;
	position: absolute;
	width: 100%;
}

.story-header-image:has(img[src=""]),
.story-header-image:not(:has(img)) {
	display: none;
}

/* Services grid */
.thriveo-services .wp-block-columns {
	gap: var(--thriveo-space-6);
}

.service-card__link a {
	color: var(--thriveo-color-link);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.service-card__link a:hover {
	text-decoration: underline;
}

.card-clickable {
	cursor: pointer;
}

/* Manifesto */
.thriveo-manifesto .wp-block-columns {
	gap: var(--thriveo-space-10);
}

.thriveo-manifesto__statement {
	font-size: clamp(1.75rem, 4vw, 3rem);
	line-height: 1.12;
}

.thriveo-manifesto__pillars {
	gap: var(--thriveo-space-6);
}

.pillar-num {
	color: var(--thriveo-color-link);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	margin: 0;
}

.pillar-title {
	font-family: var(--thriveo-font-body);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: 0;
	margin: 0;
}

.pillar-text {
	color: var(--thriveo-color-text-secondary);
	font-size: 1rem;
	margin: 0;
}

/* Call to action */
.cta-section {
	background: var(--thriveo-color-bg-alt);
	border-bottom: 1px solid var(--thriveo-color-hairline);
	border-top: 1px solid var(--thriveo-color-hairline);
	padding: var(--thriveo-section-padding) var(--thriveo-gutter);
	text-align: center;
}

.cta-section .wp-block-heading {
	font-size: clamp(1.75rem, 4vw, 3rem);
}

.cta-section .thriveo-lede {
	margin-left: auto;
	margin-right: auto;
}

.cta-section .wp-block-buttons {
	gap: var(--thriveo-space-3);
	justify-content: center;
}

/* Certifications (ISO) */
.thriveo-certifications {
	display: grid;
	gap: var(--thriveo-space-8);
	grid-template-columns: 1fr;
	list-style: none;
	margin: 0;
	padding: 0;
}

.thriveo-certifications__item {
	display: flex;
	flex-direction: column;
	gap: var(--thriveo-space-2);
}

.thriveo-certifications__logo {
	background: var(--brand-white);
	border-radius: var(--thriveo-radius-sm);
	display: block;
	height: auto;
	padding: var(--thriveo-space-2);
	width: 200px;
}

.thriveo-certifications__name {
	color: var(--thriveo-color-link);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow, 0.16em);
	margin: var(--thriveo-space-2) 0 0;
	text-transform: uppercase;
}

.thriveo-certifications__text {
	color: var(--thriveo-color-text-secondary);
	font-size: 0.875rem;
	margin: 0;
}

/* Reviews (Trustpilot) */
.thriveo-reviews {
	background: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-xl);
	box-shadow: var(--thriveo-shadow-sm);
	margin-left: auto;
	margin-right: auto;
	max-width: 760px;
	padding: var(--thriveo-space-4) var(--thriveo-space-5);
}

.thriveo-reviews__header {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: var(--thriveo-space-3);
	margin-bottom: var(--thriveo-space-4);
}

.thriveo-reviews__score {
	color: var(--thriveo-color-link);
	font-family: var(--thriveo-font-heading);
	font-size: clamp(2.25rem, 5vw, 2.75rem);
	font-weight: 600;
	line-height: 1;
	margin: 0;
}

.thriveo-reviews__meta > * {
	margin: 0;
}

.thriveo-reviews__verdict {
	font-weight: 600;
}

.thriveo-reviews__count,
.thriveo-reviews__date {
	color: var(--thriveo-color-muted);
	font-size: 0.875rem;
}

.thriveo-reviews__stars {
	color: var(--thriveo-color-link);
	display: flex;
	gap: 3px;
	margin: 0 0 var(--thriveo-space-2);
}

.thriveo-reviews__stars svg {
	height: 20px;
	width: 20px;
}

.thriveo-reviews__viewport {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}

.thriveo-reviews__track {
	display: flex;
	gap: var(--thriveo-space-4);
	list-style: none;
	margin: 0;
	padding: 0;
}

.thriveo-reviews__card {
	background: var(--thriveo-color-bg);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-md);
	flex: 0 0 100%;
	padding: var(--thriveo-space-4);
	scroll-snap-align: start;
}

.thriveo-reviews__text {
	border: 0;
	font-size: 0.9375rem;
	font-style: italic;
	line-height: 1.55;
	margin: 0 0 var(--thriveo-space-3);
	padding: 0;
}

.thriveo-reviews__text p {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 6;
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
}

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

.thriveo-reviews__avatar {
	align-items: center;
	background: var(--thriveo-color-cta);
	border-radius: 50%;
	color: var(--thriveo-color-cta-text);
	display: inline-flex;
	flex-shrink: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	height: 38px;
	justify-content: center;
	width: 38px;
}

.thriveo-reviews__name {
	display: block;
	font-weight: 600;
}

.thriveo-reviews.is-enhanced .thriveo-reviews__viewport {
	overflow: hidden;
}

.thriveo-reviews.is-enhanced .thriveo-reviews__track {
	gap: 0;
	transition: transform 450ms var(--thriveo-ease-out);
}

.thriveo-reviews__dots {
	display: flex;
	flex-wrap: wrap;
	gap: var(--thriveo-space-2);
	justify-content: center;
	margin-top: var(--thriveo-space-3);
}

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

.thriveo-reviews__dot {
	background: transparent;
	border: 1px solid var(--thriveo-color-border);
	border-radius: 50%;
	cursor: pointer;
	height: 12px;
	padding: 0;
	width: 12px;
}

.thriveo-reviews__dot[aria-current="true"] {
	background: var(--thriveo-color-link);
	border-color: var(--thriveo-color-link);
}

.thriveo-reviews__cta {
	display: block;
	font-size: 0.875rem;
	margin-top: var(--thriveo-space-3);
	text-align: center;
}

/* Blog cards (query loop) */
.post-card {
	background: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-lg);
	height: 100%;
	overflow: hidden;
	transition: box-shadow var(--thriveo-duration-base) var(--thriveo-ease-out),
		border-color var(--thriveo-duration-base) var(--thriveo-ease-out);
}

.post-card:hover {
	border-color: var(--thriveo-color-accent-line);
	box-shadow: var(--thriveo-shadow-md);
}

.post-card .wp-block-post-featured-image {
	margin: 0;
}

.post-card__body {
	gap: var(--thriveo-space-2);
	padding: var(--thriveo-space-5);
}

.post-card__body > * {
	margin: 0;
}

.post-card .wp-block-post-title {
	font-family: var(--thriveo-font-body);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.35;
}

.post-card .wp-block-post-title a {
	color: var(--thriveo-color-text);
	text-decoration: none;
}

.post-card .wp-block-post-title a:hover {
	color: var(--thriveo-color-link);
}

.post-card .wp-block-post-date {
	color: var(--thriveo-color-link);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.post-card .wp-block-post-excerpt {
	color: var(--thriveo-color-text-secondary);
	font-size: 0.9375rem;
}

.post-card .wp-block-post-terms {
	color: var(--thriveo-color-muted);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.wp-block-query-pagination {
	gap: var(--thriveo-space-2);
	margin-top: var(--thriveo-space-12);
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
	border: 1px solid var(--thriveo-color-hairline);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
	padding: var(--thriveo-space-1) var(--thriveo-space-3);
	text-decoration: none;
}

.wp-block-query-pagination .current {
	border-color: var(--thriveo-color-link);
	color: var(--thriveo-color-link);
}

.thriveo-related {
	background: var(--thriveo-color-bg-alt);
	padding: var(--thriveo-section-padding) var(--thriveo-gutter);
}

/* 404 */
.thriveo-not-found__code {
	color: var(--thriveo-color-link);
	font-family: var(--thriveo-font-heading);
	font-size: clamp(5rem, 15vw, 10rem);
	font-weight: 300;
	letter-spacing: -0.05em;
	line-height: 1;
	margin: 0;
}

.thriveo-not-found .wp-block-buttons {
	gap: var(--thriveo-space-3);
}

/* Search block */
.wp-block-search__input {
	background: var(--thriveo-color-surface);
	border: 1px solid var(--thriveo-color-border);
	border-radius: var(--thriveo-radius-sm);
	color: var(--thriveo-color-text);
}

@media (min-width: 640px) {
	.thriveo-reviews {
		padding: var(--thriveo-space-5) var(--thriveo-space-6);
	}

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

@media (min-width: 900px) {
	.bridge-inner {
		align-items: flex-start;
		flex-direction: row;
	}

	.story-nav-wrap {
		width: 280px;
	}

	.story-header-with-media {
		align-items: stretch;
		flex-direction: row;
	}

	.story-header-with-media .story-header-image {
		flex: 0 0 42%;
		min-height: 0;
		-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
		mask-image: linear-gradient(to right, transparent 0%, #000 45%);
	}

	.thriveo-certifications {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Compact reviews box: same content as .thriveo-reviews, about half as tall, for a column */
.thriveo-reviews--compact {
	border-radius: var(--thriveo-radius-lg);
	max-width: none;
	padding: var(--thriveo-space-4);
}

.thriveo-reviews--compact .thriveo-reviews__header {
	gap: var(--thriveo-space-3);
	margin-bottom: var(--thriveo-space-3);
}

.thriveo-reviews--compact .thriveo-reviews__score {
	font-size: 2rem;
}

.thriveo-reviews--compact .thriveo-reviews__stars svg {
	height: 16px;
	width: 16px;
}

.thriveo-reviews--compact .thriveo-reviews__card {
	padding: var(--thriveo-space-3) var(--thriveo-space-4);
}

.thriveo-reviews--compact .thriveo-reviews__text {
	font-size: 0.875rem;
	line-height: 1.5;
	margin-bottom: var(--thriveo-space-3);
}

.thriveo-reviews--compact .thriveo-reviews__text p {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	display: -webkit-box;
	overflow: hidden;
}

.thriveo-reviews--compact .thriveo-reviews__avatar {
	height: 30px;
	width: 30px;
}

.thriveo-reviews--compact .thriveo-reviews__dots,
.thriveo-reviews--compact .thriveo-reviews__cta {
	margin-top: var(--thriveo-space-3);
}

.thriveo-contact-newsletter {
	margin-top: var(--thriveo-space-8);
}
