/* =========================================================================
   Home: نظرات مشتریان + نامه‌های حسن انجام کار
   Markup: modules/main-parts/testimonial.tpl   Behaviour: js/testimonials.js
   Brand: red #fb4848, dark #29292B. Logos grey at rest, colour on hover / active.
   ========================================================================= */
.rp-tm {
	--tm-red: #fb4848;
	--tm-ink: #29292B;
	--tm-muted: #6b6b72;
	--tm-line: #e8e8ec;
	--tm-ease: cubic-bezier(.22, 1, .36, 1);
	position: relative;
	padding: 64px 0 70px;
	background: #fff;
	direction: rtl;
	font-family: 'IranSans', sans-serif;
	overflow: hidden;
}
.rp-tm button { font-family: inherit; }

/* ---- head: title + arrows on one row */
.rp-tm-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 26px;
}
.rp-tm-head .sec-title { margin-bottom: 0; padding-bottom: 0; }

/* ---- stage: all slides share one grid cell, so the box keeps the tallest height (no jumping) */
.rp-tm-stage {
	position: relative;
	border: 1px solid var(--tm-line);
	border-radius: 30px;
	background: #f6f6f7;
	overflow: hidden;
}
.rp-tm-slides { display: grid; }
.rp-tm-slide {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	min-width: 0;
	visibility: hidden;
	transition: visibility 0s linear .6s;
}
.rp-tm-slide:not(.is-active) { pointer-events: none; }
.rp-tm-slide.is-active { visibility: visible; transition: none; } /* no z-index here: it would isolate the logos' multiply blend */

/* quote side */
.rp-tm-quote {
	position: relative;
	padding: 40px 48px 34px 44px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	align-content: center;
	column-gap: 24px;
}
.rp-tm-quote > blockquote { flex: 0 0 100%; }
.rp-tm-quote::before { /* big decorative quote mark */
	content: "”";
	position: absolute;
	top: 6px;
	left: 40px;
	font-family: Georgia, serif;
	font-size: 180px;
	line-height: 1;
	color: var(--tm-red);
	opacity: .09;
	pointer-events: none;
}
.rp-tm-logo { flex: 0 0 auto; width: 96px; height: auto; mix-blend-mode: multiply; margin: -6px -6px -6px 0; }
.rp-tm-quote blockquote { margin: 0; padding: 0; border: 0; font-size: inherit; font-style: normal; }
.rp-tm-pull {
	margin: 0 0 12px;
	font-family: 'IranSansBold', 'IranSans', sans-serif;
	font-weight: normal;
	font-size: clamp(18px, 1.6vw, 22px);
	line-height: 1.8;
	color: var(--tm-ink);
	text-wrap: pretty;
}
.rp-tm-full p { margin: 0; font-size: 14.5px; line-height: 1.95; color: var(--tm-muted); text-wrap: pretty; }
.rp-tm-author {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 22px;
}
.rp-tm-who { position: relative; display: flex; flex-direction: column; gap: 1px; padding-right: 16px; }
.rp-tm-who::before { content: ""; position: absolute; top: 4px; bottom: 4px; right: 0; width: 3px; border-radius: 3px; background: var(--tm-red); }
.rp-tm-who strong { font-family: 'IranSansBold', 'IranSans', sans-serif; font-weight: normal; font-size: 17px; color: var(--tm-ink); }
.rp-tm-who span { font-family: 'IranSansMedium', 'IranSans', sans-serif; font-size: 13px; color: var(--tm-muted); }
.rp-tm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px auto 0 0; padding: 0; list-style: none; justify-content: flex-end; }
.rp-tm-tags li {
	padding: 5px 12px;
	border: 1px solid var(--tm-line);
	border-radius: 999px;
	background: #fff;
	font-family: 'IranSansMedium', 'IranSans', sans-serif;
	font-size: 12px;
	color: var(--tm-ink);
}

/* letter side: the real letter as a sheet of paper on a small stack */
.rp-tm-doc {
	position: relative;
	margin: 0;
	padding: 30px 40px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(circle at 50% 42%, rgba(251, 72, 72, .10), transparent 62%),
		#ececef;
}
.rp-tm-paper {
	position: relative;
	display: block;
	width: 100%;
	max-width: 232px;
	aspect-ratio: 1 / 1.414; /* A4 */
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 24px 46px -18px rgba(25, 25, 30, .38);
	transform: rotate(-2.5deg);
	transition: transform .6s var(--tm-ease), box-shadow .6s var(--tm-ease);
	cursor: zoom-in;
}
.rp-tm-paper::before, .rp-tm-paper::after { /* sheets underneath */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 10px 24px -14px rgba(25, 25, 30, .3);
	transition: transform .6s var(--tm-ease);
}
.rp-tm-paper::before { transform: rotate(5deg) translate(-6px, 4px); background: #fafafa; }
.rp-tm-paper::after { transform: rotate(9deg) translate(-12px, 10px); background: #f3f3f4; }
.rp-tm-paper img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 6px; }
.rp-tm-paper:hover, .rp-tm-paper:focus-visible {
	transform: rotate(0deg) translateY(-6px);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 34px 60px -20px rgba(25, 25, 30, .45);
}
.rp-tm-paper:hover::before { transform: rotate(3deg) translate(-4px, 4px); }
.rp-tm-paper:hover::after { transform: rotate(6deg) translate(-8px, 8px); }
.rp-tm-paper:focus-visible { outline: 2px solid var(--tm-red); outline-offset: 4px; }
.rp-tm-zoom {
	position: absolute;
	right: 50%;
	bottom: 16px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: rgba(41, 41, 43, .88);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	font-family: 'IranSansMedium', 'IranSans', sans-serif;
	font-size: 12.5px;
	white-space: nowrap;
	transform: translate(50%, 6px);
	opacity: 0;
	transition: opacity .3s, transform .4s var(--tm-ease);
}
.rp-tm-paper:hover .rp-tm-zoom, .rp-tm-paper:focus-visible .rp-tm-zoom { opacity: 1; transform: translate(50%, 0); }
.rp-tm-doc figcaption {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
	font-family: 'IranSansMedium', 'IranSans', sans-serif;
	font-size: 13px;
	color: var(--tm-ink);
}
.rp-tm-doc time { color: var(--tm-muted); }
.rp-tm-seal {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tm-red);
	color: #fff;
	font-size: 11px;
	box-shadow: 0 0 0 4px rgba(251, 72, 72, .18);
}
/* clients whose letter image is not on the site yet: logo on the sheet */
.rp-tm-doc--logo .rp-tm-paper { display: grid; place-items: center; cursor: default; }
.rp-tm-doc--logo .rp-tm-paper img { width: 72%; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.rp-tm-doc--logo .rp-tm-paper:hover { transform: rotate(-2.5deg); }

/* ---- slide entrance */
.rp-tm-quote > *, .rp-tm-doc > * { opacity: 0; transition: opacity .45s ease, transform .7s var(--tm-ease); }
.rp-tm-quote > * { transform: translateY(18px); }
.rp-tm-doc > .rp-tm-paper { transform: rotate(-9deg) translate(-30px, 24px); }
.rp-tm-doc > figcaption { transform: translateY(10px); }
.rp-tm-slide.is-active .rp-tm-quote > *, .rp-tm-slide.is-active .rp-tm-doc > * { opacity: 1; transform: none; }
.rp-tm-slide.is-active .rp-tm-doc > .rp-tm-paper { transform: rotate(-2.5deg); }
.rp-tm-slide.is-active .rp-tm-doc > .rp-tm-paper:hover,
.rp-tm-slide.is-active .rp-tm-doc > .rp-tm-paper:focus-visible { transform: rotate(0deg) translateY(-6px); }
.rp-tm-slide.is-active .rp-tm-doc--logo > .rp-tm-paper:hover { transform: rotate(-2.5deg); }
.rp-tm-quote::before { transition: none; }
.rp-tm-slide.is-active .rp-tm-quote > :nth-child(2) { transition-delay: .07s; }
.rp-tm-slide.is-active .rp-tm-quote > :nth-child(3) { transition-delay: .14s; }
.rp-tm-slide.is-active .rp-tm-quote > :nth-child(4) { transition-delay: .2s; }
.rp-tm-slide.is-active .rp-tm-doc > .rp-tm-paper { transition-delay: .1s; transition-duration: .45s, .8s; }
.rp-tm-slide.is-active .rp-tm-doc > figcaption { transition-delay: .25s; }

/* ---- navigation: client logos (grey at rest, colour on hover / active) + arrows */
.rp-tm-nav {
	display: flex;
	align-items: stretch;
	gap: 14px;
	padding: 10px;
	border-top: 1px solid var(--tm-line);
	background: #fff;
}
.rp-tm-rail { flex: 1 1 auto; display: flex; gap: 8px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.rp-tm-rail li { flex: 1 1 0; min-width: 0; margin: 0; }
.rp-tm-rail button {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 56px;
	padding: 6px 8px;
	border: 1px solid transparent;
	border-radius: 14px;
	background: transparent;
	overflow: hidden;
	cursor: pointer;
	transition: background-color .3s, border-color .3s;
}
.rp-tm-rail img {
	max-width: 100%;
	max-height: 40px;
	width: auto;
	height: auto;
	mix-blend-mode: multiply;
	filter: grayscale(1);
	opacity: .5;
	transition: filter .35s, opacity .35s, transform .35s var(--tm-ease);
}
.rp-tm-rail button:hover img, .rp-tm-rail button:focus-visible img { filter: none; opacity: 1; }
.rp-tm-rail button[aria-selected="true"] { border-color: var(--tm-line); background: #f6f6f7; }
.rp-tm-rail button[aria-selected="true"] img { filter: none; opacity: 1; transform: scale(1.04); }
.rp-tm-rail button:focus-visible { outline: 2px solid var(--tm-red); outline-offset: -2px; }
.rp-tm-bar { position: absolute; right: 12px; left: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: transparent; overflow: hidden; }
.rp-tm-bar::after { content: ""; position: absolute; inset: 0; background: var(--tm-red); transform: scaleX(0); transform-origin: right; }
[aria-selected="true"] > .rp-tm-bar { background: var(--tm-line); }
[aria-selected="true"] > .rp-tm-bar::after { transform: scaleX(1); }
.rp-tm-stage.is-auto [aria-selected="true"] > .rp-tm-bar::after { animation: rp-tm-progress var(--tm-dur, 9000ms) linear forwards; }
.rp-tm-stage.is-auto.is-paused [aria-selected="true"] > .rp-tm-bar::after { animation-play-state: paused; }
@keyframes rp-tm-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.rp-tm-arrows { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.rp-tm-arrows button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--tm-line);
	border-radius: 50%;
	background: #fff;
	color: var(--tm-ink);
	font-size: 20px;
	transition: background-color .25s, border-color .25s, color .25s;
}
.rp-tm-arrows button:hover { background: var(--tm-red); border-color: var(--tm-red); color: #fff; }
.rp-tm-arrows button:focus-visible { outline: 2px solid var(--tm-red); outline-offset: 3px; }
.rp-tm-count { font-family: 'IranSansMedium', 'IranSans', sans-serif; font-size: 13px; color: var(--tm-muted); white-space: nowrap; }
.rp-tm-count b { font-family: 'IranSansBold', 'IranSans', sans-serif; font-weight: normal; font-size: 17px; color: var(--tm-ink); }

/* ---- letter viewer */
.rp-tm-dialog {
	width: min(900px, calc(100vw - 32px));
	max-width: none;
	height: calc(100vh - 48px);
	height: calc(100dvh - 48px);
	max-height: none;
	padding: 0;
	border: 0;
	border-radius: 20px;
	background: #1d1d1f;
	color: #fff;
	overflow: hidden;
	direction: rtl;
}
.rp-tm-dialog[open] { display: flex; flex-direction: column; animation: rp-tm-pop .35s var(--tm-ease); }
.rp-tm-dialog::backdrop { background: rgba(14, 14, 16, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes rp-tm-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.rp-tm-dialog-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px 12px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.rp-tm-dialog-cap { margin: 0; font-family: 'IranSansMedium', 'IranSans', sans-serif; font-size: 14px; color: rgba(255, 255, 255, .85); }
.rp-tm-dialog-close {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 50%;
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-size: 16px;
	transition: background-color .25s, border-color .25s;
}
.rp-tm-dialog-close:hover { background: var(--tm-red); border-color: var(--tm-red); }
.rp-tm-dialog-body { flex: 1 1 auto; overflow: auto; padding: 20px; text-align: center; overscroll-behavior: contain; }
.rp-tm-dialog-body img { max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; cursor: zoom-in; }
.rp-tm-dialog.is-zoomed .rp-tm-dialog-body img { max-height: none; cursor: zoom-out; }

/* ---- laptop */
@media (max-width: 1199px) {
	.rp-tm-slide { grid-template-columns: minmax(0, 1fr) 340px; }
	.rp-tm-quote { padding: 44px 40px 40px 32px; }
	.rp-tm-doc { padding: 30px 30px 20px; }
}
/* ---- tablet */
@media (max-width: 991px) {
	.rp-tm { padding: 60px 0 64px; }
	.rp-tm-slide { grid-template-columns: minmax(0, 1fr) 280px; }
	.rp-tm-paper { max-width: 220px; }
	.rp-tm-rail { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.rp-tm-rail::-webkit-scrollbar { display: none; }
	.rp-tm-rail li { flex: 0 0 104px; scroll-snap-align: start; }
}
/* ---- phones: quote first, letter under it, logo strip scrolls sideways */
@media (max-width: 767px) {
	.rp-tm { padding: 52px 0 56px; }
	.rp-tm-head { margin-bottom: 20px; }
	.rp-tm-stage { border-radius: 22px; display: flex; flex-direction: column; }
	.rp-tm-nav { order: -1; padding: 10px; border-top: 0; border-bottom: 1px solid var(--tm-line); }
	.rp-tm-arrows { display: none; } /* phones: swipe + logo strip */
	.rp-tm-rail li { flex-basis: 92px; }
	.rp-tm-rail button { height: 56px; }
	.rp-tm-slide { grid-template-columns: minmax(0, 1fr); }
	.rp-tm-quote { padding: 30px 22px 26px; }
	.rp-tm-quote::before { font-size: 130px; left: 16px; }
	.rp-tm-logo { width: 84px; }
	.rp-tm-tags { margin-right: 0; justify-content: flex-start; }
	.rp-tm-pull { font-size: 18px; }
	.rp-tm-full p { font-size: 14px; }
	.rp-tm-doc { padding: 30px 22px 24px; }
	.rp-tm-paper { max-width: 200px; }
	.rp-tm-zoom { opacity: 1; transform: translate(50%, 0); } /* no hover on touch */
	.rp-tm-dialog { height: calc(100dvh - 24px); width: calc(100vw - 16px); border-radius: 16px; }
	.rp-tm-dialog-body { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.rp-tm-quote > *, .rp-tm-doc > *, .rp-tm-paper, .rp-tm-paper::before, .rp-tm-paper::after { transition: none !important; }
	.rp-tm-dialog[open] { animation: none; }
}

.rp-tm-head .rp-h1 { text-wrap: balance; }

/* company legal name in brackets, a step smaller than the job title */
.rp-tm-who .rp-tm-alt { font-size: .82em; opacity: .8; white-space: nowrap; }
