/**
 * Testimonials block — see init.php's top comment for the Figma source
 * (node 2001:7100 @1920) and the sticky-column / hand-rolled-JS
 * reasoning.
 *
 * @package intobi
 */

.testimonials {
	background: var(--io-bg);
	margin-bottom: var(--io-section-py);
}

.team-photo + .testimonials {
	margin-top: 32px;
}

.testimonials__row {
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding-top: var(--io-section-py);
	padding-bottom: var(--io-section-py);
	padding-top: 64px;
	padding-bottom: 64px;
}

@media (min-width: 768px) {
	.testimonials__row {
		gap: 64px;
	}
}
@media (min-width: 1440px) {
	.testimonials__row {
		flex-direction: row;
		align-items: flex-start;
		gap: 64px;
	}
}

.testimonials__aside {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	width: 100%;
	max-width: 480px;
}

@media (min-width: 1440px) {
	.testimonials__aside {
		position: sticky;
		top: var(--io-header-clearance);
		flex: 1 1 0%;
		z-index: 2;
	}
}

/* .testimonials__heading — font-size now comes from the base h2 cascade (css/base.css) */

/* ---------------------------------------------------------------
   Person — the "photo" style's author card (Figma node 2001:20915,
   "Person" frame — same 64px photo / H5 name / 16px-muted role
   pattern as case_testimonial_block's own .case-testimonial__person,
   same Figma node). Lives in .testimonials__aside, right after the
   heading, at every width — node 2001:21163 (everything below 1240)
   shows the exact same stacked order, no separate rules needed there.

   Only rendered when at least one testimonial has both a photo and an
   author name (block.php's $any_person_photo) — blocks where nobody
   ever set a photo never get this markup at all. --visible is toggled
   by block.js's updatePerson() on slideChange, off each slide's own
   data-person-* attributes, so it stays in sync with the active quote
   without touching how the no-photo .testimonials__author figcaption
   below renders.
------------------------------------------------------------------ */

.testimonials__person {
	display: none;
	align-items: center;
	gap: var(--io-space-4);
	width: 100%;
	margin-top: var(--io-space-4);
}

.testimonials__person--visible {
	display: flex;
}

.testimonials__person-photo {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 9999px;
	object-fit: cover;
	background: var(--io-surface);
}

.testimonials__person-body {
	display: flex;
	flex-direction: column;
	gap: var(--io-space-1);
	min-width: 0;
}

.testimonials__person-name {
	margin: 0;
}

.testimonials__person-role {
	font-family: var(--io-font-body);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	color: var(--io-additional);
	margin: 0;
}

.testimonials__slider {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 48px;
	width: 100%;
	padding-top: 24px;
}

@media (min-width: 1440px) {
	.testimonials__slider {
		flex: 1 1 0%;
		/* Without this, the flex item's automatic minimum width is its
		   content's min-content size — and since the Swiper conversion
		   (block.js), that content is .testimonials__swiper's
		   .swiper-wrapper, a flex row holding EVERY slide side by side
		   (only clipped visually via overflow: hidden, which doesn't
		   shrink min-content sizing). With several testimonials that
		   summed width is easily wider than the viewport, pushing this
		   whole column — and the page — past its right edge. Same fix as
		   every other flexed content column beside a sticky aside in this
		   theme (cases_block/.cases__list-wrap,
		   video_testimonials_block/.video-testimonials__video-col,
		   steps_block/.steps__row, technology_stack_block). */
		min-width: 0;
		gap: 48px;
	}
}

/* ---------------------------------------------------------------
   Segmented progress bar — one segment per testimonial. 14.09, per
   Oleksandr ("testimonials__progress should work as a filling bar;
   the line should be full at the end"): every segment up to and
   including the current slide stays filled/blue, not just the current
   one — see block.js's updateProgressFill() for the class it drives.
   Purely visual/decorative (aria-hidden via role="tablist" on the
   wrapper with plain spans, not real tabs, since there's no
   per-segment keyboard interaction beyond the prev/next buttons
   below).
------------------------------------------------------------------ */

.testimonials__progress {
	display: flex;
	width: 100%;
	height: 4px;
	background: var(--io-border);
}

.testimonials__progress-seg {
	flex: 1 1 0%;
	height: 100%;
	background: transparent;
	transition: background-color 0.3s ease;
}

.testimonials__progress-seg--active {
	background: var(--io-brand);
}

/* ---------------------------------------------------------------
   Quotes — a real Swiper instance (see block.js). .swiper /
   .swiper-wrapper / .swiper-slide base layout comes from the vendored
   Swiper bundle CSS, same as cases_block/video_testimonials_block.
------------------------------------------------------------------ */

.testimonials__swiper {
	width: 100%;
}

.testimonials__quote {
	width: 100%;
	margin: 0;
}

.testimonials__quote-text {
	margin: 0;
	font-family: var(--io-font-body);
	font-weight: 400;
	font-size: 20px;
	line-height: 1.5;
	color: var(--io-body);
}

@media (min-width: 1024px) {
	.testimonials__quote-text {
		font-size: 32px;
	}
	.site-main__toc-content .testimonials__quote-text {
		font-size: 20px;
	}
}

.testimonials__quote-text p {
	margin: 0 0 8px;
}

.testimonials__quote-text p:last-child {
	margin-bottom: 0;
}

.testimonials__author {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 24px;
}

.testimonials__author-name {
	font-family: var(--io-font-heading);
	font-weight: 400;
	font-size: 16px;
	color: var(--io-ink);
}

.testimonials__author-role {
	font-family: var(--io-font-body);
	font-size: 14px;
	color: var(--io-muted);
}

/* ---------------------------------------------------------------
   Nav — two circular OUTLINE buttons, same family as
   cases_featured_block's.
------------------------------------------------------------------ */

.testimonials__nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* .testimonials__nav-btn — visuals now come from the shared .io-icon-btn
   / .io-icon-btn--outline classes (css/base.css) added alongside it in
   block.php; kept here only as the JS hook for the --prev/--next/
   --disabled modifiers (Swiper's navigation module adds --disabled at
   either end of the slide list — see block.js). */

/* Figma "Outline/Inactive" (node 2001:2346): border + icon both use
   Text/muted (#81858c), not Border/additional. */
.testimonials__nav-btn--disabled {
	border-color: var(--io-muted);
	color: var(--io-muted);
	cursor: not-allowed;
	pointer-events: none;
}
.testimonials__nav-btn--disabled svg path {
	stroke: var(--io-muted);
}

/* ---------------------------------------------------------------
   Card layout — the single Service page's own self-contained
   bordered-card treatment (Figma node 2001:9752 @1920): heading
   stacked directly above the slider inside one white bordered card,
   no sticky aside / no side-by-side row at any width (unlike the
   default "aside" layout above). See init.php's "layout" field.

   .testimonials__row already carries the .container class, so its
   own padding-inline (css/base.css, 16/32/64px) supplies the card's
   left/right inset for free — only padding-block (the card's
   top/bottom interior) is added here. The page-rhythm vertical
   spacing that normally lives on .testimonials__row moves up to the
   section (.testimonials--card) instead, so it sits OUTSIDE the
   card rather than doubling up with the card's own interior padding.
------------------------------------------------------------------ */

/* 10.09, per Oleksandr's correction: the white background belongs on
   the bordered row itself (the actual visible card), not the full-width
   section — the section stays transparent so the page shows around it. */
.testimonials--card {
	background: transparent;
	padding-top: var(--io-section-py);
	padding-bottom: var(--io-section-py);
}

.testimonials--card .testimonials__row {
	background: var(--io-bg);
	flex-direction: column;
	gap: 24px;
	padding: 32px;
	border: 1px solid var(--io-border);
	border-radius: var(--io-radius-card);
}

/* Figma (node 2001:9752 @1920): the card's own interior padding AND the
   heading-to-slider gap are both a flat 64px at desktop — the same
   number, not a coincidence, matches .container's own padding-inline
   at ≥1024px (css/base.css) so the top/bottom padding lines up with the
   left/right padding the .container class already supplies. */
@media (min-width: 1024px) {
	.testimonials--card .testimonials__row {
		gap: 64px;
		padding: 64px;
	}
	.testimonials--card .testimonials__heading {
		max-width: 480px;
	}
	.site-main__toc-content .testimonials--card .testimonials__row {
		gap: 32px;
		padding: 32px;
	}
}

.testimonials--card .testimonials__aside {
	max-width: none;
	width: 100%;
}

@media (min-width: 1024px) {
	.testimonials--card .testimonials__aside {
		position: static;
		flex: initial;
	}
}

@media (min-width: 1024px) {
	.testimonials--card .testimonials__slider {
		flex: initial;
		min-width: 0;
		gap: 48px;
	}
}
