/**
 * RT tutorial horizontal pill — BuddyBoss Activity feed inner preview.
 * Scoped to .ahr-rt-activity-feed-card (mirrors Reference Pack related pill).
 */

/* BuddyBoss .activity-inner borders/padding — strip for manual RT pill embeds (posts + groups) */
.activity-list .activity-item .activity-content .activity-inner:has(.ahr-rt-activity-feed-card),
.bb-template-v2 .activity-list .activity-item .activity-content .activity-inner:has(.ahr-rt-activity-feed-card) {
	border: none;
	padding: 0;
	background: transparent;
	max-width: none;
	overflow: visible;
	box-shadow: none;
}

.activity-list .activity-item .activity-content:has(.ahr-rt-activity-feed-card) {
	overflow: visible;
}

/* Collapse empty wpautop paragraphs left after marker removal */
.activity-inner:has(.ahr-rt-activity-feed-card) > p:empty {
	display: none;
	min-height: 0;
	margin: 0;
	padding: 0;
}

.ahr-rt-activity-feed-card {
	max-width: 100%;
	margin: 8px 0 0;
	padding: 0;
	box-sizing: border-box;
	overflow: visible;
}

.activity-inner .ahr-rt-activity-feed-card {
	width: 100%;
}

/* wpautop must never add breaks inside our card (safety net for legacy cached rows) */
.ahr-rt-activity-feed-card br {
	display: none;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	background: #fff;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transform: translateY(0);
	transition: all 0.2s ease;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill:hover {
	border-color: #e5e7eb;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
	text-decoration: none;
	color: inherit;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-thumb {
	position: relative;
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
	align-self: center;
	min-height: 0;
	overflow: hidden;
	background: #f1f5f9;
	border-radius: 12px 0 0 12px;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-thumb img {
	width: 100%;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-lock-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.4);
	pointer-events: none;
	z-index: 3;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-lock-icon {
	display: block;
	width: 22px;
	height: 22px;
	background-color: #fff;
	-webkit-mask-image: var(--ahr-refpack-related-lock-icon);
	mask-image: var(--ahr-refpack-related-lock-icon);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	transition: transform 0.2s ease;
}

@media (hover: hover) {
	.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="locked"]:hover .ahr-refpack-single-related-lock-icon {
		transform: scale(1.15);
	}
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"] .ahr-refpack-single-related-thumb::before,
.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"] .ahr-refpack-single-related-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"] .ahr-refpack-single-related-thumb::before {
	background: rgba(0, 0, 0, 0.35);
	z-index: 1;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"] .ahr-refpack-single-related-thumb::after {
	inset: auto;
	top: 50%;
	left: 50%;
	width: 26px;
	height: 26px;
	transform: translate(-50%, -50%);
	background-color: #fff;
	-webkit-mask-image: var(--ahr-refpack-related-play-icon);
	mask-image: var(--ahr-refpack-related-play-icon);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	z-index: 2;
}

@media (hover: hover) {
	.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"]:hover .ahr-refpack-single-related-thumb::before {
		opacity: 1;
	}

	.ahr-rt-activity-feed-card .ahr-refpack-single-related-pill[data-lock-status="unlocked"]:hover .ahr-refpack-single-related-thumb::after {
		opacity: 0.9;
	}
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	min-width: 0;
	flex: 1;
	padding: 10px 14px;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
	margin: 0;
}

.ahr-rt-activity-feed-card .ahr-refpack-single-related-desc {
	font-size: 14px;
	color: #64748b;
	line-height: 1.45;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Invalid / missing Tutorial ID marker fallback */
.ahr-rt-activity-marker-missing {
	margin: 8px 0 0;
	font-size: 13px;
	color: #6b7280;
	font-style: italic;
}

/* Posts and comments — same compact card spacing */
.activity-inner .ahr-rt-activity-feed-card,
.acomment-content .ahr-rt-activity-feed-card {
	max-width: 100%;
	margin: 8px 0 0;
	padding: 0;
}

.acomment-content .ahr-rt-activity-feed-card + .ahr-rt-activity-feed-card {
	margin-top: 10px;
}

@media (max-width: 480px) {
	.ahr-rt-activity-feed-card .ahr-refpack-single-related-thumb {
		flex: 0 0 72px;
		width: 72px;
		height: 72px;
		min-height: 0;
	}

	.ahr-rt-activity-feed-card .ahr-refpack-single-related-body {
		padding: 8px 10px;
	}

	.ahr-rt-activity-feed-card .ahr-refpack-single-related-title {
		font-size: 15px;
	}

	.ahr-rt-activity-feed-card .ahr-refpack-single-related-desc {
		font-size: 13px;
		-webkit-line-clamp: 2;
	}
}
