/*
 * CaryTamura Testimonials page (/testimonials/, Page 5481).
 *
 * SCOPE. Loaded on the testimonials page only (functions.php, is_page()),
 * after page-hero.css and sections.css. It tunes that page's CT Page Hero
 * band to the live testimonials hero, and styles the paginated list: the
 * `.ct-testimonial-archive` section, its Loop Grid of CT Loop – Testimonial
 * Entry items (`.ct-testimonial-entry`), the READ MORE fold
 * (`.ct-testimonial-text`, [ct_testimonial_text]) and the grid's pagination.
 * Work With Cary is the global template in the shared section frame; this
 * file only restores its desktop height in Elementor's tablet range. The
 * Home/About/Team testimonial carousel (`.ct-testimonials`, `.ct-testimonial`)
 * is a different component and nothing here reaches it.
 *
 * VALUES. Measured from carytamura.com/testimonials at 1440, 1024, 768 and
 * 375 wide (FACT) unless marked. Live breakpoints: the list's side padding is
 * 120px, 40px from 992 and 24px from 768; the section padding, the monogram
 * and the name step down at 768; sections leave the 12px frame from 767.
 *
 * MOTION. Live has no entrance animation here. What moves is reproduced with
 * the live timings: READ MORE's height and cross-fade (0.5s, testimonials.js),
 * its underline turning red on hover (0.3s), the page links filling red on
 * hover (0.3s), and the smooth scroll back to the list on a page change.
 */

/* ------------------------------------------------------------------ hero --
 * The same intro band as the About, Team and Marketing pages: 600px at
 * every width, framed 12px on desktop, one flat 45% black scrim, title
 * centred and lifted by its 24px bottom margin. */
.ct-page-hero.e-con {
	--width: calc(100% - 2 * var(--ct-body-padding));
	margin: var(--ct-body-padding) var(--ct-body-padding) 0;
	min-height: 0;
	height: 600px;
	padding: 0 var(--ct-body-padding);
}

.ct-page-hero::before {
	background-color: var(--ct-overlay-strong);
}

.ct-page-hero::after {
	content: none;
}

.ct-page-hero .ct-page-hero__title {
	max-width: 900px;
}

.ct-page-hero .ct-page-hero__title .elementor-heading-title {
	margin: 0 0 24px;
	font-size: var(--ct-size-h1);
	line-height: 1.25;
}

/* The page body's own padding is dropped: every section carries its own. */
.ct-page-body:has(.ct-testimonial-archive) {
	padding-block: 0;
}

/* --------------------------------------------------------------- section --
 * White, framed 12px, 96px above and below; a 1080px content box with 120px
 * sides, so the text column is 840px at 1440. */
.ct-testimonial-archive.e-con {
	--ct-testimonial-side: 120px;
	--width: calc(100% - 2 * var(--ct-body-padding));
	--padding-top: var(--ct-section-padding);
	--padding-bottom: var(--ct-section-padding);
	/* Padding percentages resolve against the page, not this framed section,
	 * hence the frame taken off before centring the 1080px box. */
	--padding-left: max(var(--ct-testimonial-side), calc((100% - 2 * var(--ct-body-padding) - 1080px) / 2 + var(--ct-testimonial-side)));
	--padding-right: max(var(--ct-testimonial-side), calc((100% - 2 * var(--ct-body-padding) - 1080px) / 2 + var(--ct-testimonial-side)));
	margin-inline: var(--ct-body-padding);
	background-color: var(--ct-canvas);
}

.ct-testimonial-archive .ct-testimonial-archive__list.elementor-widget {
	--kit-widget-spacing: 0px;
	width: 100%;
	margin: 0;
	letter-spacing: 1px;
	/* Page changes scroll the list back into view (Elementor's auto scroll,
	 * scrollIntoView); live scrolls to the section's top, 96px above. */
	scroll-margin-top: var(--ct-section-padding);
}

.ct-testimonial-archive .ct-testimonial-archive__list .elementor-loop-container {
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
}

/* ------------------------------------------------------------------ item --
 * Each testimonial: 24px under the text, 12px padding and 12px margin below,
 * so 48px from one testimonial's last line to the next monogram. */
.ct-testimonial-archive .ct-testimonial-entry.e-con {
	--padding-top: 0px;
	--padding-bottom: 36px;
	--padding-left: 0px;
	--padding-right: 0px;
	--gap: 0px;
	margin-bottom: 12px;
}

/* Monogram and name: a 96px row, name centred on it. */
.ct-testimonial-archive .ct-testimonial-entry__head.e-con {
	--padding-top: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--padding-right: 0px;
	--gap: 0px;
	--flex-wrap: nowrap;
	align-items: center;
	margin-bottom: 24px;
}

/* The monogram: 96px circle on white, drawn 14px left of the text column
 * (its own box still starts on the column, so the name sits 14px clear). */
.ct-testimonial-archive .ct-testimonial-entry__mark.elementor-widget {
	--kit-widget-spacing: 0px;
	position: relative;
	right: 14px;
	flex: 0 0 96px;
	width: 96px;
	height: 96px;
	margin: 0;
	border-radius: 50%;
	overflow: hidden;
	background-color: var(--ct-canvas);
}

.ct-testimonial-archive .ct-testimonial-entry__mark img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.ct-testimonial-archive .ct-testimonial-entry__name.elementor-widget {
	--kit-widget-spacing: 0px;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.ct-testimonial-archive .ct-testimonial-entry__name .elementor-heading-title {
	margin: 0;
	font-family: var(--ct-font-display);
	font-size: 43px;
	font-weight: 400;
	line-height: 56px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ct-ink);
}

.ct-testimonial-archive .ct-testimonial-entry__text.elementor-widget {
	--kit-widget-spacing: 0px;
	width: 100%;
	margin: 0;
}

/* ------------------------------------------------------------------ text --
 * Lato 16/1.6, 1px tracking, pure black (live draws these in #000, not the
 * body 80%). Line breaks in the testimonial are kept, as live keeps them. */
.ct-testimonial-text p {
	margin: 0;
	font-family: var(--ct-font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 1px;
	white-space: pre-line;
	color: var(--ct-ink);
}

/* The fold. Collapsed: the first 900 characters and "…". Opening, the box
 * animates from one height to the other while the two versions cross-fade
 * (both are lifted out of flow for the duration); open, the full text. */
.ct-testimonial-text__content {
	position: relative;
	width: 100%;
	overflow: hidden;
	transition: all 0.5s ease;
}

.ct-testimonial-text__short,
.ct-testimonial-text__full,
.ct-testimonial-text__more {
	transition: all 0.5s ease;
}

.ct-testimonial-text--fold .ct-testimonial-text__full {
	display: none;
}

.ct-testimonial-text.is-collapsing .ct-testimonial-text__full,
.ct-testimonial-text.is-expanding .ct-testimonial-text__full {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
}

.ct-testimonial-text.is-collapsing .ct-testimonial-text__short,
.ct-testimonial-text.is-expanding .ct-testimonial-text__short {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
}

.ct-testimonial-text.is-collapsing .ct-testimonial-text__full { opacity: 0; }
.ct-testimonial-text.is-collapsing .ct-testimonial-text__short { opacity: 1; }
.ct-testimonial-text.is-expanding .ct-testimonial-text__full { opacity: 1; }
.ct-testimonial-text.is-expanding .ct-testimonial-text__short { opacity: 0; }

.ct-testimonial-text.is-expanded .ct-testimonial-text__full {
	display: block;
	opacity: 1;
}

.ct-testimonial-text.is-expanded .ct-testimonial-text__short {
	display: none;
	opacity: 0;
}

/* READ MORE / READ LESS: one 39px row, the two controls stacked in it and
 * swapped by opacity. Lato 700 14px, 1.5px tracking, a 1px #CCC underline
 * that turns red on hover, and a ⌄ stretched 1.5× (turned over for LESS). */
.ct-testimonial-text__toggle {
	position: relative;
	width: 100%;
	height: 39px;
}

.ct-testimonial-text__more {
	position: absolute;
	bottom: 0;
	left: 0;
	display: inline-block;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-family: var(--ct-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 24px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ct-ink);
	cursor: pointer;
	opacity: 0;
}

.ct-testimonial-text__more:hover,
.ct-testimonial-text__more:focus {
	background: none;
	color: var(--ct-ink);
}

.ct-testimonial-text__more::before {
	content: "";
	display: block;
	position: absolute;
	left: 0;
	bottom: 2px;
	width: 100%;
	height: 1px;
	background: #ccc; /* FACT: live underline, not a palette colour */
	transition: all 0.3s ease;
}

.ct-testimonial-text__more:hover::before {
	background: var(--ct-accent);
}

.ct-testimonial-text__more::after {
	content: "\2304";
	display: inline-block;
	position: relative;
	bottom: 3px;
	left: 4px;
	padding-right: 3px;
	transform: scaleX(1.5);
}

.ct-testimonial-text__more--collapse::after {
	bottom: -3px;
	left: -1px;
	transform: scaleX(1.5) rotate(180deg);
}

.ct-testimonial-text:not(.is-expanded) .ct-testimonial-text__more--expand {
	opacity: 1;
	z-index: 1;
}

.ct-testimonial-text.is-expanding .ct-testimonial-text__more--expand {
	opacity: 0;
}

.ct-testimonial-text.is-expanding .ct-testimonial-text__more--collapse,
.ct-testimonial-text.is-expanded .ct-testimonial-text__more--collapse {
	opacity: 1;
	z-index: 1;
}

.ct-testimonial-text.is-collapsing .ct-testimonial-text__more--collapse {
	opacity: 0;
}

/* ------------------------------------------------------------ pagination --
 * Centred, 12px under the last testimonial. 48px squares in the accent;
 * the current page and a hovered link fill red with white figures; "…" and
 * an unavailable arrow sit at half strength. Previous/Next are chevrons drawn
 * from two borders, 16px clear of the numbers (12px from 768). */
.ct-testimonial-archive .elementor-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	font-family: var(--ct-font-body);
	line-height: 1;
}

.ct-testimonial-archive .elementor-pagination .page-numbers {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 48px;
	height: 48px;
	margin: 0 5px;
	padding: 0 14px;
	border: 2px solid transparent;
	background: transparent;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 1px;
	text-align: center;
	text-decoration: none;
	color: var(--ct-accent);
	transition: all 0.3s;
}

.ct-testimonial-archive .elementor-pagination a.page-numbers:hover,
.ct-testimonial-archive .elementor-pagination a.page-numbers:focus-visible,
.ct-testimonial-archive .elementor-pagination .page-numbers.current {
	border-color: var(--ct-accent);
	background-color: var(--ct-accent);
	color: var(--ct-on-dark);
}

.ct-testimonial-archive .elementor-pagination .page-numbers.dots {
	opacity: 0.5;
}

.ct-testimonial-archive .elementor-pagination .page-numbers.prev,
.ct-testimonial-archive .elementor-pagination .page-numbers.next {
	width: 48px;
	font-size: 0;
}

/* The numbers' 5px sides are the grid's own Pagination › Spacing (10px);
 * the arrows and "…" take live's spacing instead. Written to outrank the
 * rule Elementor generates for that control. */
body:not(.rtl) .ct-testimonial-archive .elementor-element.ct-testimonial-archive__list .elementor-pagination .page-numbers.dots {
	margin-left: 0;
	margin-right: 0;
}

body:not(.rtl) .ct-testimonial-archive .elementor-element.ct-testimonial-archive__list .elementor-pagination .page-numbers.prev {
	margin-left: 0;
	margin-right: var(--ct-testimonial-arrow-gap, 16px);
}

body:not(.rtl) .ct-testimonial-archive .elementor-element.ct-testimonial-archive__list .elementor-pagination .page-numbers.next {
	margin-left: var(--ct-testimonial-arrow-gap, 16px);
	margin-right: 0;
}

.ct-testimonial-archive .elementor-pagination span.page-numbers.prev,
.ct-testimonial-archive .elementor-pagination span.page-numbers.next {
	opacity: 0.5;
	pointer-events: none;
}

.ct-testimonial-archive .elementor-pagination .page-numbers.prev::before,
.ct-testimonial-archive .elementor-pagination .page-numbers.next::before {
	content: "";
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 11px;
	border-bottom: 2px solid;
	border-left: 2px solid;
	transform: translate(calc(-50% + 2px), -50%) rotate(45deg) skew(4deg, 4deg);
}

.ct-testimonial-archive .elementor-pagination .page-numbers.next::before {
	transform: translate(calc(-50% - 2px), -50%) rotate(-135deg) skew(4deg, 4deg);
}

/* Elementor pulses the grid's opacity while a page loads (.e-loading-overlay);
 * live swaps the list without a fade. */
.ct-testimonial-archive .ct-testimonial-archive__list.e-loading-overlay {
	animation: none;
}

/* ------------------------------------------------------ work with cary --
 * The global template in the shared section frame, placed as on the home
 * page. Elementor's tablet range starts at 1024, where the live section is
 * still its desktop 689px. */
@media (min-width: 901px) and (max-width: 1024px) {
	.ct-testimonials-work-with .ct-work-with.e-con {
		min-height: 689px;
	}
}

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 992px) {
	.ct-testimonial-archive.e-con {
		--ct-testimonial-side: 40px;
	}
}

@media (max-width: 768px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 32px;
	}

	.ct-testimonial-archive.e-con {
		--padding-top: var(--ct-section-padding-compact);
		--padding-bottom: var(--ct-section-padding-compact);
	}

	.ct-testimonial-archive.e-con {
		--ct-testimonial-side: 24px;
	}

	.ct-testimonial-archive .ct-testimonial-archive__list.elementor-widget {
		scroll-margin-top: var(--ct-section-padding-compact);
	}

	.ct-testimonial-archive .ct-testimonial-entry__mark.elementor-widget {
		flex-basis: 72px;
		width: 72px;
		height: 72px;
	}

	.ct-testimonial-archive .ct-testimonial-entry__name .elementor-heading-title {
		font-size: 32px;
		line-height: 44px;
		letter-spacing: 0.75px;
	}

	/* Live puts 48px between the last testimonial and the page links here,
	 * its 12px margin collapsing into that; grid items do not collapse
	 * margins, so the difference is set instead. */
	.ct-testimonial-archive .elementor-pagination {
		margin-top: 36px;
	}

	.ct-testimonial-archive .elementor-pagination {
		--ct-testimonial-arrow-gap: 12px;
	}

	.ct-testimonial-archive .elementor-pagination .page-numbers.prev::before,
	.ct-testimonial-archive .elementor-pagination .page-numbers.next::before {
		width: 9px;
		height: 9px;
	}
}

@media (max-width: 767px) {
	.ct-page-hero.e-con {
		--width: 100%;
		margin: 0;
		height: 600px;
		padding: 0 var(--ct-body-padding);
	}

	.ct-testimonial-archive.e-con {
		--width: 100%;
		margin-inline: 0;
	}
}

/* Live line height opens up on small phones (as on the About page). */
@media (max-width: 568px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		line-height: 1.6;
	}
}

@media (max-width: 360px) {
	.ct-page-hero .ct-page-hero__title .elementor-heading-title {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-testimonial-text__content,
	.ct-testimonial-text__short,
	.ct-testimonial-text__full,
	.ct-testimonial-text__more,
	.ct-testimonial-text__more::before,
	.ct-testimonial-archive .elementor-pagination .page-numbers {
		transition: none;
	}
}
