/* =========================================================================
   Home: تالار افتخارات (client logo wall)
   Markup: modules/main-parts/brand.tpl   Behaviour: js/brands.js (jQuery 4)
   Rule: logos grey at rest, full colour on hover / focus (touch: colour).
   ========================================================================= */
.rp-br {
	--br-red: #fb4848;
	--br-ink: #29292B;
	--br-line: #e8e8ec;
	--br-ease: cubic-bezier(.22, 1, .36, 1);
	position: relative; /* keeps the .sr-only list inside the clipped box */
	padding: 84px 0 90px;
	background: #fff;
	direction: rtl;
	font-family: 'IranSans', sans-serif;
	overflow: hidden;
}
.rp-br button { font-family: inherit; }

.rp-br-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.rp-br-head .sec-title { margin-bottom: 0; padding-bottom: 0; }
.rp-br-head .rp-h1 { text-wrap: balance; }
.rp-br-toggle {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 11px 20px;
	border: 1px solid var(--br-line);
	border-radius: 999px;
	background: #fff;
	color: var(--br-ink);
	font-family: 'IranSansMedium', 'IranSans', sans-serif;
	font-size: 14px;
	transition: background-color .25s, border-color .25s, color .25s;
}
.rp-br-toggle:hover { background: var(--br-ink); border-color: var(--br-ink); color: #fff; }
.rp-br-toggle:focus-visible { outline: 2px solid var(--br-red); outline-offset: 3px; }

/* ---- marquee rows */
.rp-br-wall { display: flex; flex-direction: column; gap: 14px; }
.rp-br-row {
	direction: ltr; /* the loop math assumes the track starts at the left edge */
	position: relative;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.rp-br-track {
	display: flex;
	gap: 14px;
	width: max-content;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	direction: ltr;
}
.rp-br-track li { flex: 0 0 auto; margin: 0; }
.rp-br.is-running .rp-br-track { animation: rp-br-move var(--br-dur, 60s) linear infinite; }
.rp-br.is-running .rp-br-row[data-dir="ltr"] .rp-br-track { animation-direction: reverse; }
.rp-br-row:hover .rp-br-track, .rp-br-row:focus-within .rp-br-track { animation-play-state: paused; }
@keyframes rp-br-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- logo card */
.rp-br-logo {
	position: relative;
	display: grid;
	place-items: center;
	width: 178px;
	height: 96px;
	padding: 10px 16px;
	border: 1px solid var(--br-line);
	border-radius: 18px;
	background: #fff;
	text-decoration: none !important;
	transition: border-color .3s, box-shadow .4s var(--br-ease), transform .4s var(--br-ease);
}
.rp-br-logo img {
	max-width: 100%;
	max-height: 64px;
	width: auto;
	height: auto;
	filter: grayscale(1);
	opacity: .55;
	transition: filter .35s, opacity .35s, transform .4s var(--br-ease);
}
.rp-br-logo:hover, .rp-br-logo:focus-visible {
	border-color: transparent;
	box-shadow: 0 18px 34px -18px rgba(25, 25, 30, .35), 0 0 0 1px rgba(25, 25, 30, .04);
	transform: translateY(-3px);
}
.rp-br-logo:hover img, .rp-br-logo:focus-visible img { filter: none; opacity: 1; transform: scale(1.04); }
.rp-br-logo:focus-visible { outline: 2px solid var(--br-red); outline-offset: 2px; }
/* clients with a portfolio post: small red corner + label on hover */
a.rp-br-logo::before { content: ""; position: absolute; top: 10px; left: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--br-red); box-shadow: 0 0 0 3px rgba(251, 72, 72, .18); }
.rp-br-tip {
	position: absolute;
	bottom: 6px;
	left: 50%;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--br-ink);
	color: #fff;
	font-family: 'IranSansMedium', 'IranSans', sans-serif;
	font-size: 10.5px;
	white-space: nowrap;
	direction: rtl;
	opacity: 0;
	transform: translate(-50%, 4px);
	transition: opacity .25s, transform .35s var(--br-ease);
	pointer-events: none;
}
a.rp-br-logo:hover .rp-br-tip, a.rp-br-logo:focus-visible .rp-br-tip { opacity: 1; transform: translate(-50%, 0); }
a.rp-br-logo:hover img, a.rp-br-logo:focus-visible img { transform: translateY(-6px) scale(1.02); }

/* ---- grid view ("همه برندها") */
.rp-br.is-grid .rp-br-wall { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 0 15px; direction: rtl; }
.rp-br.is-grid .rp-br-row, .rp-br.is-grid .rp-br-track { display: contents; } /* both rows flow as one grid */
.rp-br.is-grid .rp-br-clone { display: none; }
.rp-br.is-grid .rp-br-logo { width: 160px; height: 88px; }

@media (hover: none) {
	.rp-br-logo img { filter: none; opacity: 1; }
}
@media (max-width: 767px) {
	.rp-br { padding: 56px 0 60px; }
	.rp-br-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
	.rp-br-toggle { padding: 9px 16px; font-size: 13px; }
	.rp-br-wall, .rp-br-track { gap: 10px; }
	.rp-br-logo { width: 132px; height: 74px; padding: 8px 12px; border-radius: 14px; }
	.rp-br-logo img { max-height: 50px; }
	.rp-br.is-grid .rp-br-wall { gap: 8px; }
	.rp-br.is-grid .rp-br-logo { width: calc((100vw - 46px) / 3); height: 64px; padding: 6px 8px; }
	.rp-br-tip { display: none; }
}
