/* کار استار — تبلیغات
   قاب هر جایگاه از قبل با نسبت اندازهٔ استاندارد جا رزرو می‌کند تا صفحه نپرد. */

.rdx-ad {
	position: relative; width: 100%; max-width: var(--rdx-ad-w); margin: 20px auto; box-sizing: border-box;
}
.rdx-ad__body {
	width: 100%; aspect-ratio: var(--rdx-ad-ar); overflow: hidden;
	border-radius: var(--rdx-radius-sm, 10px); background: var(--rdx-surface, #FAFAF9);
	display: flex; align-items: center; justify-content: center;
}
.rdx-ad__body > a, .rdx-ad__body picture { display: block; width: 100%; height: 100%; }
/* بنر کامل دیده شود؛ اگر اندازهٔ تصویر با جایگاه نخواند، متنش بریده نمی‌شود */
.rdx-ad__body img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* کد HTML (ادسنس و مانند آن) اندازهٔ خودش را دارد؛ فقط حداقل ارتفاع رزرو می‌شود */
.rdx-ad.is-html .rdx-ad__body { aspect-ratio: auto; min-height: var(--rdx-ad-h); background: none; }
.rdx-ad__html { width: 100%; text-align: center; }

.rdx-ad__label {
	position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; pointer-events: none;
	padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 1.8;
	background: rgba(28, 25, 23, .58); color: #FFFFFF; backdrop-filter: blur(4px);
}

/* جای خالیِ «این‌جا تبلیغ شما» */
.rdx-ad--house .rdx-ad__body { border: 1.5px dashed var(--rdx-line, #E7E5E4); background: none; }
.rdx-ad__house { padding: 8px 14px; font-size: 13px; color: var(--rdx-ink-3, #78716C); text-align: center; }
a.rdx-ad__house:hover { color: var(--rdx-primary, #FF6E00); }

.rdx-ad-wrap--header_leaderboard .rdx-ad { margin: 14px auto 6px; }
.rdx-ad-wrap--home .rdx-ad { margin: 8px auto; }

/* دستگاه: اگر برای یک اندازه تبلیغی نیست، همان‌جا (بی‌JS) پنهان */
@media (max-width: 767px) {
	.rdx-ad { max-width: var(--rdx-ad-mw); }
	.rdx-ad__body { aspect-ratio: var(--rdx-ad-mar); }
	.rdx-ad.is-html .rdx-ad__body { min-height: var(--rdx-ad-mh); }
	.rdx-ad--no-mobile { display: none !important; }
}
@media (min-width: 768px) {
	.rdx-ad--no-desktop { display: none !important; }
}
.rdx-ad.is-empty { display: none !important; }

/* کارت بومی لابه‌لای اکسپلور — هم‌شکل کارت نمونه‌کار */
.rdx-ad--native { max-width: none; margin: 0; }
.rdx-ad--native .rdx-ad__body { aspect-ratio: auto; display: block; overflow: visible; background: none; border-radius: 0; }
.rdx-ad--native .rdx-ad__label { display: none; }
.rdx-ad-native { margin: 0; height: 100%; }
.rdx-ad-native .rdx-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.rdx-ad-native .rdx-card__media img { width: 100%; height: 100%; object-fit: cover; }
.rdx-ad-native__text { margin: 4px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--rdx-ink-2, #57534E); }
.rdx-ad-native__tag {
	display: inline-flex; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
	background: var(--rdx-primary-soft, #FFF1E6); color: var(--rdx-primary, #FF6E00);
}
.rdx-explore-grid .rdx-ad--native.rdx-ad--no-mobile,
.rdx-explore-grid .rdx-ad--native.rdx-ad--no-desktop { min-width: 0; }

/* لابه‌لای فهرست آگهی‌ها */
.rdx-ad--jobs_infeed { margin: 4px auto; }

/* چسبان موبایل: بالای نوار پایین سایت؛ فقط موبایل؛ قابل بستن */
.rdx-ad--sticky {
	display: none; position: fixed; inset-inline: 0; bottom: env(safe-area-inset-bottom); z-index: 59;
	max-width: none; margin: 0; padding: 6px 8px;
	background: var(--rdx-glass, rgba(255, 255, 255, .94)); backdrop-filter: blur(10px);
	border-top: 1px solid var(--rdx-line, #E7E5E4);
}
.rdx-ad--sticky .rdx-ad__body { width: 320px; max-width: 100%; margin: 0 auto; aspect-ratio: 320 / 50; }
.rdx-ad--sticky .rdx-ad__label { top: 8px; inset-inline-start: calc(50% - 156px); }
.rdx-ad__close {
	position: absolute; top: -13px; inset-inline-end: 10px; width: 26px; height: 26px; padding: 0;
	display: grid; place-items: center; border-radius: 50%; cursor: pointer;
	border: 1px solid var(--rdx-line, #E7E5E4); background: var(--rdx-bg, #FFFFFF); color: var(--rdx-ink-2, #57534E);
	font-size: 12px; line-height: 1; box-shadow: 0 2px 8px rgba(28, 25, 23, .12);
}
@media (max-width: 767px) {
	.rdx-ad--sticky.is-ready { display: block; }
	body:has(.rdx-mobile-nav) .rdx-ad--sticky { bottom: calc(var(--rdx-mobile-nav-h, 64px) + env(safe-area-inset-bottom)); }
	body.rdx-has-sticky-ad .rdx-main { padding-bottom: 84px; }
	/* دکمهٔ شناور «نصب اپلیکیشن» بالای تبلیغ چسبان بنشیند، نه رویش */
	body.rdx-has-sticky-ad .rdx-a2hs { bottom: calc(142px + env(safe-area-inset-bottom)); }
	body.rdx-has-sticky-ad:not(.rdx-has-bnav) .rdx-a2hs { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: no-preference) {
	.rdx-ad.is-ready .rdx-ad__body > * { animation: rdx-ad-in .35s ease both; }
	@keyframes rdx-ad-in { from { opacity: 0; } to { opacity: 1; } }
}
