/* =====================================================================
   River of Life Sermons — front-end styles
   Uses the church-theme brand tokens (--rl-*) with safe fallbacks so the
   plugin still looks right if activated on another theme.
   ===================================================================== */

.rl-sermons {
	--_navy:  var(--rl-navy, #0C3B5E);
	--_teal:  var(--rl-teal, #2F9BE0);
	--_ink:   var(--rl-ink, #1A2A36);
	--_muted: var(--rl-muted, #5A6B77);
	--_line:  var(--rl-line, #E3E9ED);
	--_white: var(--rl-white, #fff);
	--_radius: var(--rl-radius, 16px);
	--_radius-sm: var(--rl-radius-sm, 10px);
	--_shadow: var(--rl-shadow, 0 18px 40px -18px rgba(12, 59, 94, 0.28));
	--_shadow-sm: var(--rl-shadow-sm, 0 8px 24px -12px rgba(12, 59, 94, 0.22));
	--_font-head: var(--rl-font-head, "Poppins", system-ui, sans-serif);

	width: 100%;
	max-width: var(--rl-maxw, 1180px);
	margin-inline: auto;
}

/* ---- Featured video ------------------------------------------------ */
.rl-sermon-eyebrow {
	text-align: center;
}

.rl-sermon-scripture {
	display: block;
	width: fit-content;
	margin: 0 auto 1.25rem;
	padding: 0.3rem 0.95rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--_teal) 12%, transparent);
	color: var(--_navy);
	font-family: var(--_font-head);
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.01em;
	text-align: center;
}

.rl-sermon-scripture[hidden] {
	display: none;
}

.rl-sermon-player {
	max-width: 960px;
	margin: 0 auto;
}

.rl-sermon-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--_radius);
	overflow: hidden;
	box-shadow: var(--_shadow);
}

.rl-sermon-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Single caption line under the video:
   This week's sermon "Title" June 22, 2026 */
.rl-sermon-caption {
	max-width: 960px;
	margin: 1.15rem auto 0;
	text-align: center;
	font-family: var(--_font-head);
	font-size: 1.1rem;
	line-height: 1.5;
}

.rl-sermon-caption-label {
	color: var(--_muted);
	font-weight: 500;
}

.rl-sermon-caption-title {
	color: var(--_navy);
	font-weight: 600;
}

.rl-sermon-caption-date {
	color: var(--_muted);
	font-weight: 500;
	white-space: nowrap;
}

/* ---- Archive grid -------------------------------------------------- */
.rl-sermon-archive {
	margin-top: 3.5rem;
}

.rl-sermon-archive-heading {
	text-align: center;
	color: var(--_navy);
	font-family: var(--_font-head);
	margin: 0 0 1.75rem;
}

.rl-sermon-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
}

.rl-sermon-card {
	margin: 0;
}

/* Lazy reveal: JS hides cards past the first rows and shows more on scroll. */
.rl-sermon-card.is-collapsed {
	display: none;
}

.rl-sermon-card.is-revealed {
	animation: rl-sermon-in 0.35s ease-out both;
}

@keyframes rl-sermon-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

.rl-sermon-more {
	display: flex;
	justify-content: center;
	margin-top: 2rem;
}

.rl-sermon-more[hidden] {
	display: none;
}

.rl-sermon-more-btn {
	font: 600 1rem/1 var(--_font-head);
	color: var(--_navy);
	background: var(--_white);
	border: 2px solid var(--_navy);
	border-radius: 999px;
	padding: 0.85rem 1.75rem;
	min-height: 44px;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.rl-sermon-more-btn:hover,
.rl-sermon-more-btn:focus-visible {
	background: var(--_navy);
	color: var(--_white);
}

.rl-sermon-more-btn:focus-visible {
	outline: 3px solid var(--_teal);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.rl-sermon-card.is-revealed {
		animation: none;
	}
}

.rl-sermon-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--_white);
	border: 1px solid var(--_line);
	border-radius: var(--_radius-sm);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: var(--_shadow-sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.rl-sermon-card-link:hover,
.rl-sermon-card-link:focus-visible {
	transform: translateY(-4px);
	box-shadow: var(--_shadow);
	color: inherit;
}

.rl-sermon-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.rl-sermon-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.rl-sermon-card-link:hover .rl-sermon-thumb img {
	transform: scale(1.05);
}

/* Play button overlay */
.rl-sermon-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(12, 59, 94, 0.82);
	transition: background 0.18s ease, transform 0.18s ease;
}

.rl-sermon-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #fff;
}

.rl-sermon-card-link:hover .rl-sermon-play {
	background: var(--_teal);
	transform: translate(-50%, -50%) scale(1.08);
}

.rl-sermon-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem 1.1rem 1.15rem;
}

.rl-sermon-card-title {
	font-family: var(--_font-head);
	font-weight: 600;
	color: var(--_navy);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rl-sermon-card-date {
	color: var(--_muted);
	font-size: 0.85rem;
}

/* ---- YouTube CTA + empty state ------------------------------------- */
.rl-sermon-yt-link {
	text-align: center;
	margin-top: 2.5rem;
}

.rl-sermons--empty {
	text-align: center;
	color: var(--rl-muted, #5A6B77);
	padding: 2rem 0;
}

/* Active card (currently playing in the big player) */
.rl-sermon-card-link.is-playing {
	outline: 3px solid var(--_teal);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.rl-sermon-grid {
		grid-template-columns: 1fr;
	}
	.rl-sermon-archive {
		margin-top: 2.5rem;
	}
}
