/* =====================================================
   Future Minds Consulting — Testimonials Carousel + Grid
   wfm.tonalli.ro

   Palette lifted from the site's own Divi global colors:
     --fmc-primary   #E25F70  coral   (--gcid-primary-color / link color)
     --fmc-secondary #FBB79E  peach   (--gcid-secondary-color)
     --fmc-tan       #FAD5A6  warm tan (gradient partner)
     --fmc-heading   #4C384A  plum    (--gcid-heading-color)
     --fmc-muted     #866768  mauve   (derived: secondary text, hairlines)
     --fmc-body      #000     (--gcid-body-color, used at 78% for copy)

   Typography, matching --et_global_*:
     Headings — Montserrat 700
     Body     — Nunito Sans 400/600
   ===================================================== */

.fmc-tc-wrapper {
	--fmc-primary: #e25f70;
	--fmc-secondary: #fbb79e;
	--fmc-tan: #fad5a6;
	--fmc-heading: #4c384a;
	--fmc-muted: #866768;
	--fmc-body: rgba(0, 0, 0, 0.78);
	--fmc-white: #ffffff;
	--fmc-surface: #ffffff;
	--fmc-hairline: rgba(134, 103, 104, 0.18);

	--fmc-font-heading: 'Montserrat', 'Segoe UI', Arial, sans-serif;
	--fmc-font-body: 'Nunito Sans', 'Segoe UI', Arial, sans-serif;

	--fmc-line-height: 1.7;
	--fmc-clamp-lines: 7;
	--fmc-radius: 18px;

	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 0 8px;
	box-sizing: border-box;
	font-family: var(--fmc-font-body);
}

.fmc-tc-wrapper *,
.fmc-tc-wrapper *::before,
.fmc-tc-wrapper *::after {
	box-sizing: border-box;
}

/* Divi ships no .screen-reader-text in some child themes — define it locally. */
.fmc-tc-wrapper .screen-reader-text,
.fmc-tc-modal .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =====================================================
   CARD
   ===================================================== */

.fmc-tc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 46px 30px 28px;
	background: var(--fmc-surface);
	border: 1px solid var(--fmc-hairline);
	border-radius: var(--fmc-radius);
	box-shadow: 0 6px 20px rgba(76, 56, 74, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.fmc-tc-card:hover,
.fmc-tc-card:focus-within {
	transform: translateY(-4px);
	border-color: rgba(226, 95, 112, 0.35);
	box-shadow: 0 16px 34px rgba(226, 95, 112, 0.18);
}

/* Quote badge */
.fmc-tc-quote-icon {
	position: absolute;
	top: -20px;
	left: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--fmc-secondary), var(--fmc-tan));
	box-shadow: 0 6px 14px rgba(226, 95, 112, 0.3);
}

.fmc-tc-quote-icon svg {
	width: 21px;
	height: 21px;
	fill: var(--fmc-primary);
}

/* Quote block: grows to fill, pushing the person block to the bottom so every
   card lines up regardless of how much text it holds. */
.fmc-tc-quote {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.fmc-tc-content {
	position: relative;
	margin: 0;
	color: var(--fmc-body);
	font-family: var(--fmc-font-body);
	font-size: 15px;
	line-height: var(--fmc-line-height);
}

.fmc-tc-content p {
	margin: 0 0 12px;
}

.fmc-tc-content p:last-child {
	margin-bottom: 0;
}

/* The visual clamp. Height is derived from the line count so all cards agree,
   and the gradient hides the cut mid-line instead of chopping it flat.
   Applied via max-height rather than -webkit-line-clamp because wpautop wraps
   the quote in <p> elements, which line-clamp handles inconsistently. */
.fmc-tc-wrapper:not(.fmc-tc--no-clamp) .fmc-tc-content.is-clamped {
	max-height: calc(var(--fmc-clamp-lines) * var(--fmc-line-height) * 1em);
	overflow: hidden;
}

.fmc-tc-wrapper:not(.fmc-tc--no-clamp) .fmc-tc-content.is-clamped::after {
	content: '';
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	height: 3.4em;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--fmc-surface) 82%);
	pointer-events: none;
}

/* "Read full testimonial" */
.fmc-tc-more {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 14px 0 0;
	padding: 0;
	background: none;
	border: 0;
	border-bottom: 1px solid rgba(226, 95, 112, 0.4);
	border-radius: 0;
	color: var(--fmc-primary);
	font-family: var(--fmc-font-body);
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.4;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}

.fmc-tc-more:hover,
.fmc-tc-more:focus-visible {
	color: var(--fmc-heading);
	border-color: var(--fmc-heading);
	gap: 10px;
	outline: none;
}

.fmc-tc-more:focus-visible {
	outline: 2px solid var(--fmc-primary);
	outline-offset: 3px;
}

.fmc-tc-more__icon {
	width: 13px;
	height: 13px;
	flex: 0 0 auto;
}

/* Set by PHP for short quotes, and by JS for any quote that turns out to fit. */
.fmc-tc-more.is-hidden {
	display: none;
}

/* =====================================================
   PERSON BLOCK
   ===================================================== */

.fmc-tc-person {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--fmc-hairline);
}

.fmc-tc-image {
	flex: 0 0 auto;
	width: 66px;
	height: 66px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--fmc-tan);
	border: 3px solid var(--fmc-tan);
	box-shadow: 0 4px 10px rgba(76, 56, 74, 0.14);
}

.fmc-tc-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fmc-tc-image--placeholder {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: var(--fmc-secondary);
	border-color: var(--fmc-secondary);
}

.fmc-tc-image--placeholder svg {
	display: block;
	width: 92%;
	height: 92%;
	fill: var(--fmc-white);
	opacity: 0.7;
	transform: translateY(6%);
}

.fmc-tc-meta {
	flex: 1 1 auto;
	min-width: 0;
}

.fmc-tc-name {
	margin: 0;
	font-family: var(--fmc-font-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--fmc-heading);
}

.fmc-tc-title {
	margin: 5px 0 0;
	font-family: var(--fmc-font-body);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--fmc-muted);
}

.fmc-tc-company {
	margin: 2px 0 0;
	font-family: var(--fmc-font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--fmc-muted);
}

.fmc-tc-company a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(134, 103, 104, 0.4);
	transition: color 0.25s ease, border-color 0.25s ease;
}

.fmc-tc-company a:hover,
.fmc-tc-company a:focus-visible {
	color: var(--fmc-primary);
	border-color: var(--fmc-primary);
	outline: none;
}

/* Star rating */
.fmc-tc-rating {
	display: flex;
	gap: 2px;
	margin: 6px 0 0;
}

.fmc-tc-star {
	width: 14px;
	height: 14px;
	color: rgba(134, 103, 104, 0.28);
}

.fmc-tc-star.is-filled {
	color: var(--fmc-primary);
}

.fmc-tc-star svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* =====================================================
   CAROUSEL
   ===================================================== */

.fmc-tc-swiper {
	/* Vertical room for the quote badge and the card's hover lift. */
	padding: 26px 4px 10px;
	overflow: hidden;
}

.fmc-tc-swiper .swiper-slide {
	height: auto;
	display: flex;
}

.fmc-tc-swiper .swiper-slide > .fmc-tc-card {
	width: 100%;
}

/* Controls sit below the track rather than overlapping the cards — the
   overlay arrows were colliding with the text on narrow columns. */
.fmc-tc-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 26px;
}

.fmc-tc-prev,
.fmc-tc-next {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--fmc-hairline);
	border-radius: 50%;
	background: var(--fmc-white);
	color: var(--fmc-heading);
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.fmc-tc-prev svg,
.fmc-tc-next svg {
	width: 18px;
	height: 18px;
}

.fmc-tc-prev:hover,
.fmc-tc-next:hover,
.fmc-tc-prev:focus-visible,
.fmc-tc-next:focus-visible {
	background: var(--fmc-primary);
	border-color: var(--fmc-primary);
	color: var(--fmc-white);
	transform: scale(1.06);
	outline: none;
}

.fmc-tc-prev.swiper-button-disabled,
.fmc-tc-next.swiper-button-disabled {
	opacity: 0.35;
	pointer-events: none;
}

.fmc-tc-pagination {
	position: static !important;
	display: flex;
	align-items: center;
	gap: 7px;
	width: auto !important;
}

.fmc-tc-pagination .swiper-pagination-bullet {
	width: 9px;
	height: 9px;
	margin: 0 !important;
	background: var(--fmc-muted);
	opacity: 0.3;
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.fmc-tc-pagination .swiper-pagination-bullet-active {
	background: var(--fmc-primary);
	opacity: 1;
	transform: scale(1.3);
}

.fmc-tc-empty {
	padding: 20px;
	color: var(--fmc-muted);
	font-family: var(--fmc-font-body);
	text-align: center;
}

/* =====================================================
   GRID + LOAD MORE
   ===================================================== */

.fmc-tc-grid-wrapper {
	--fmc-columns: 3;
	padding: 40px 0 8px;
}

.fmc-tc-grid {
	display: grid;
	grid-template-columns: repeat(var(--fmc-columns), minmax(0, 1fr));
	gap: 46px 28px;
}

.fmc-tc-load-more-wrap {
	margin-top: 48px;
	text-align: center;
}

.fmc-tc-load-more {
	padding: 14px 36px;
	border: none;
	border-radius: 999px;
	background: var(--fmc-primary);
	color: var(--fmc-white);
	font-family: var(--fmc-font-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 6px 14px rgba(226, 95, 112, 0.3);
	transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.fmc-tc-load-more:hover,
.fmc-tc-load-more:focus-visible {
	background: var(--fmc-heading);
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(76, 56, 74, 0.28);
	outline: none;
}

.fmc-tc-load-more.is-loading,
.fmc-tc-load-more[disabled] {
	opacity: 0.7;
	cursor: wait;
	transform: none;
}

/* =====================================================
   MODAL (full testimonial)

   A native <dialog> so it lands in the browser's top layer — that puts it
   above Divi's fixed header and section z-index stacking for free, and gives
   focus trapping, Esc-to-close and inert background without extra JS.
   ===================================================== */

.fmc-tc-modal {
	width: min(680px, calc(100vw - 32px));
	max-height: min(86vh, 760px);
	padding: 0;
	border: 0;
	border-radius: var(--fmc-radius, 18px);
	background: #ffffff;
	color: rgba(0, 0, 0, 0.78);
	box-shadow: 0 30px 70px rgba(76, 56, 74, 0.35);
	overflow: visible;

	--fmc-primary: #e25f70;
	--fmc-secondary: #fbb79e;
	--fmc-tan: #fad5a6;
	--fmc-heading: #4c384a;
	--fmc-muted: #866768;
	--fmc-body: rgba(0, 0, 0, 0.78);
	--fmc-white: #ffffff;
	--fmc-surface: #ffffff;
	--fmc-hairline: rgba(134, 103, 104, 0.18);
	--fmc-font-heading: 'Montserrat', 'Segoe UI', Arial, sans-serif;
	--fmc-font-body: 'Nunito Sans', 'Segoe UI', Arial, sans-serif;
	--fmc-line-height: 1.75;

	font-family: var(--fmc-font-body);
}

.fmc-tc-modal *,
.fmc-tc-modal *::before,
.fmc-tc-modal *::after {
	box-sizing: border-box;
}

.fmc-tc-modal::backdrop {
	background: rgba(76, 56, 74, 0.55);
	backdrop-filter: blur(3px);
}

.fmc-tc-modal__inner {
	position: relative;
	max-height: min(86vh, 760px);
	padding: 44px 40px 36px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: inherit;
}

/* Accent bar in the brand gradient across the top of the panel. */
.fmc-tc-modal__inner::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	border-radius: var(--fmc-radius) var(--fmc-radius) 0 0;
	background: linear-gradient(90deg, var(--fmc-primary), var(--fmc-secondary), var(--fmc-tan));
}

.fmc-tc-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--fmc-hairline);
	border-radius: 50%;
	background: var(--fmc-white);
	color: var(--fmc-heading);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.fmc-tc-modal__close svg {
	width: 15px;
	height: 15px;
}

.fmc-tc-modal__close:hover,
.fmc-tc-modal__close:focus-visible {
	background: var(--fmc-primary);
	border-color: var(--fmc-primary);
	color: var(--fmc-white);
	transform: rotate(90deg);
	outline: none;
}

.fmc-tc-modal__quote-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0 0 18px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--fmc-secondary), var(--fmc-tan));
	box-shadow: 0 6px 14px rgba(226, 95, 112, 0.28);
}

.fmc-tc-modal__quote-icon svg {
	width: 20px;
	height: 20px;
	fill: var(--fmc-primary);
}

/* The cloned quote, unclamped: the ::after fade and max-height are undone. */
.fmc-tc-modal .fmc-tc-content,
.fmc-tc-modal .fmc-tc-content.is-clamped {
	max-height: none;
	overflow: visible;
	font-size: 16.5px;
	line-height: var(--fmc-line-height);
	color: var(--fmc-body);
}

.fmc-tc-modal .fmc-tc-content::after {
	content: none;
}

.fmc-tc-modal .fmc-tc-content p {
	margin: 0 0 16px;
}

.fmc-tc-modal .fmc-tc-person {
	margin-top: 28px;
	padding-top: 22px;
}

.fmc-tc-modal .fmc-tc-name {
	font-size: 18px;
}

/* Open/close motion. Honour reduced-motion below. */
.fmc-tc-modal[open] {
	animation: fmc-tc-modal-in 0.25s ease-out;
}

.fmc-tc-modal[open]::backdrop {
	animation: fmc-tc-backdrop-in 0.25s ease-out;
}

@keyframes fmc-tc-modal-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fmc-tc-backdrop-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Fallback for the rare browser without <dialog>: the JS adds .is-fallback
   and positions the panel itself. */
.fmc-tc-modal.is-fallback {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 999999;
	transform: translate(-50%, -50%);
	display: block;
}

.fmc-tc-modal.is-fallback[hidden] {
	display: none;
}

.fmc-tc-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba(76, 56, 74, 0.55);
}

.fmc-tc-modal-backdrop[hidden] {
	display: none;
}

/* Locks background scroll while the modal is open. */
body.fmc-tc-modal-open {
	overflow: hidden;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 980px) {
	.fmc-tc-grid-wrapper {
		--fmc-columns: 2;
	}

	.fmc-tc-grid {
		gap: 44px 24px;
	}

	.fmc-tc-modal__inner {
		padding: 40px 28px 30px;
	}
}

@media (max-width: 640px) {
	.fmc-tc-wrapper {
		padding: 30px 0 8px;
	}

	.fmc-tc-grid-wrapper {
		--fmc-columns: 1;
	}

	.fmc-tc-grid {
		gap: 40px;
	}

	.fmc-tc-card {
		padding: 42px 22px 24px;
	}

	.fmc-tc-content {
		font-size: 14.5px;
	}

	.fmc-tc-image {
		width: 58px;
		height: 58px;
	}

	.fmc-tc-modal {
		width: calc(100vw - 20px);
		max-height: 88vh;
	}

	.fmc-tc-modal__inner {
		max-height: 88vh;
		padding: 38px 20px 26px;
	}

	.fmc-tc-modal .fmc-tc-content {
		font-size: 15.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fmc-tc-card,
	.fmc-tc-more,
	.fmc-tc-prev,
	.fmc-tc-next,
	.fmc-tc-load-more,
	.fmc-tc-modal__close {
		transition: none;
	}

	.fmc-tc-card:hover,
	.fmc-tc-card:focus-within {
		transform: none;
	}

	.fmc-tc-modal[open],
	.fmc-tc-modal[open]::backdrop {
		animation: none;
	}
}
