.csp-ads {
	display: grid;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	gap: 16px;
	margin: 16px 0;
}

.csp-ads,
.csp-ads *,
.csp-ads *::before,
.csp-ads *::after {
	box-sizing: border-box;
}

.csp-ads-mount-source {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.csp-ads-mount-source[hidden] {
	display: none !important;
}

.bb-rl-widget-sidebar .csp-ads-mount-source,
.bb-rl-widget-sidebar .csp-ads {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0 0 16px;
}

.csp-ad {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #dce3eb;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 28px rgba(22, 36, 58, 0.08);
	color: #172033;
}

.csp-ad__label {
	position: absolute;
	z-index: 1;
	top: 12px;
	left: 12px;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(17, 24, 39, 0.82);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.csp-ad__image {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.csp-ad__body {
	min-width: 0;
	padding: 18px;
}

.csp-ad__title {
	margin: 0 0 8px;
	font-size: clamp(18px, 2vw, 24px);
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.csp-ad__content {
	min-width: 0;
	color: #4b5563;
	font-size: 15px;
	line-height: 1.55;
	overflow-wrap: anywhere;
	word-break: normal;
}

.csp-ad__content img,
.csp-ad__content iframe,
.csp-ad__content video {
	max-width: 100%;
	height: auto;
}

.csp-ad__content > :first-child {
	margin-top: 0;
}

.csp-ad__content > :last-child {
	margin-bottom: 0;
}

.csp-ad__cta {
	display: inline-flex;
	max-width: 100%;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-top: 16px;
	padding: 10px 18px;
	border-radius: 12px;
	background: #3157d5;
	color: #fff;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: background-color 160ms ease, transform 160ms ease;
}

.csp-ad__cta:hover {
	background: #2344b4;
	color: #fff;
	transform: translateY(-1px);
}

.csp-ad__cta:focus-visible {
	outline: 3px solid #f4b942;
	outline-offset: 3px;
}

.bb-rl-widget-sidebar .csp-ad__body,
.csp-ads-search-sidebar .csp-ad__body {
	padding: 16px;
}

.bb-rl-widget-sidebar .csp-ad__title,
.csp-ads-search-sidebar .csp-ad__title {
	font-size: 20px;
	line-height: 1.3;
}

.bb-rl-widget-sidebar .csp-ad__content,
.csp-ads-search-sidebar .csp-ad__content {
	font-size: 14px;
	line-height: 1.5;
}

.bb-rl-widget-sidebar .csp-ad__cta,
.csp-ads-search-sidebar .csp-ad__cta {
	display: flex;
	width: 100%;
}

.csp-ads-search-sidebar {
	width: 100%;
	max-width: 320px;
	min-width: 0;
}

.csp-ads-search-sidebar .csp-ads {
	margin: 0;
}

.bb-rl-dark-mode .csp-ad {
	border-color: var(--bb-rl-border-secondary-color, #3d3d3d);
	background: var(--bb-rl-background-color, #242425);
	color: var(--bb-rl-text-color, #fff);
}

.bb-rl-dark-mode .csp-ad__content {
	color: var(--bb-rl-text-secondary-color, #cececf);
}

@media (min-width: 1024px) {
	.csp-ads-search-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
		gap: 24px;
		align-items: start;
	}

	.csp-ads-search-layout > .entry-header,
	.csp-ads-search-layout > #buddypress {
		grid-column: 1;
	}

	.csp-ads-search-layout > .entry-header {
		grid-row: 1;
	}

	.csp-ads-search-layout > #buddypress {
		grid-row: 2;
	}

	.csp-ads-search-layout > .csp-ads-search-sidebar {
		grid-column: 2;
		grid-row: 1 / span 2;
	}
}

@media (max-width: 1023px) {
	.csp-ads-search-sidebar {
		max-width: none;
		margin-top: 20px;
	}
}

@media (max-width: 480px) {
	.csp-ad {
		border-radius: 14px;
	}

	.csp-ad__body {
		padding: 14px;
	}

	.csp-ad__title {
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.csp-ad__cta {
		transition: none;
	}
}
