/*
 * Church Live Pro — Frontend CSS  v19.2.0
 * Adds: countdown timer, status badge, slider transitions (fade/slide/zoom),
 *       gradient button support, Google Font pass-through, campus styles.
 */

/* ── [church_live_button] ── */
.clp-header-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 20px; border-radius: 50px; color: #fff !important;
	text-decoration: none !important; font-weight: 800; font-size: 13px;
	text-transform: uppercase; letter-spacing: 0.5px;
	box-shadow: 0 0 10px var(--clp-btn-pulse);
	animation: clp-btn-pulse-anim 2s infinite ease-in-out;
	transition: transform 0.2s;
}
.clp-header-btn:hover { transform: scale(1.05); color: #fff !important; }
.clp-dot-pulse {
	width: 8px; height: 8px; background: #fff; border-radius: 50%;
	animation: clp-dot-anim 1s infinite; flex-shrink: 0;
}

/* ── [church_live_hero] ── */
.clp-live-hero-container {
	width: 100%; border-radius: 16px; overflow: hidden;
	background: #000; position: relative;
	border: 3px solid var(--clp-video-pulse);
}
.clp-glow-active { animation: clp-video-glow-anim 2s infinite ease-in-out; }
.clp-aspect-ratio { position: relative; padding-top: 56.25%; }
.clp-aspect-ratio iframe,
.clp-aspect-ratio video {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
/* Fallback/slide videos may not be 16:9 — crop to fill rather than stretch */
.clp-aspect-ratio video { object-fit: cover; }
/* Offline fallback image (shortcode-rendered) */
.clp-offline-img { width: 100%; height: auto; display: block; }

/* Badge */
.clp-hero-overlay-badge { position: absolute; z-index: 10; pointer-events: none; }
.clp-badge-pos-top-left    { top: 24px; left: 24px; }
.clp-badge-pos-top-right   { top: 24px; right: 24px; }
.clp-badge-pos-bottom-left { bottom: 24px; left: 24px; }
.clp-badge-pos-bottom-right{ bottom: 24px; right: 24px; }
.clp-hero-badge {
	background: var(--clp-badge-bg, #ef4444); color: #fff; padding: 6px 16px; border-radius: 50px;
	font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3); animation: clp-badge-blink 2s infinite;
}

/* CTA overlay */
.clp-hero-overlay-btn {
	position: absolute; z-index: 10; width: 100%; padding: 28px;
	box-sizing: border-box; display: flex; pointer-events: none;
}
.clp-btn-pos-bottom-left   { bottom: 0; left: 0; justify-content: flex-start;  align-items: flex-end; }
.clp-btn-pos-bottom-center { bottom: 0; left: 0; justify-content: center;       align-items: flex-end; }
.clp-btn-pos-bottom-right  { bottom: 0; left: 0; justify-content: flex-end;     align-items: flex-end; }
.clp-btn-pos-top-right     { top: 0; left: 0; justify-content: flex-end;        align-items: flex-start; }
.clp-btn-pos-center        { top: 0; left: 0; height: 100%; align-items: center; justify-content: center; }
.clp-hero-btn {
	pointer-events: auto; display: inline-block; padding: 14px 30px;
	border-radius: 10px; color: #fff !important; text-decoration: none !important;
	font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px;
	box-shadow: 0 6px 20px rgba(0,0,0,0.4); transition: transform 0.2s, box-shadow 0.2s;
}
.clp-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.5); color:#fff!important; }

/* YouTube live chat sidebar (show_chat) */
.clp-live-hero-container.clp-has-chat { display: flex; align-items: stretch; }
.clp-has-chat .clp-hero-video { position: relative; flex: 1 1 auto; min-width: 0; }
.clp-has-chat .clp-hero-chat { flex: 0 0 340px; max-width: 40%; background: #fff; overflow: hidden; }
.clp-has-chat .clp-hero-chat iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 782px) {
	.clp-live-hero-container.clp-has-chat { flex-direction: column; }
	.clp-has-chat .clp-hero-chat { flex: 0 0 auto; max-width: none; height: 380px; }
}

/* Fallback */
.clp-live-hero-fallback {
	width: 100%; border-radius: 16px; overflow: hidden; background: #f1f5f9;
	display: flex; justify-content: center; align-items: center;
	min-height: 380px; border: 1px solid #e2e8f0;
}
.clp-live-hero-fallback img { width: 100%; height: auto; display: block; }
.clp-fallback-placeholder {
	display: flex; flex-direction: column; align-items: center; gap: 12px;
	/* #475569 (not #94a3b8) so this clears AA on the light #f1f5f9 fallback bg. The later
	   dark-gradient .clp-fallback-placeholder rule overrides this in the default case. */
	color: #475569; font-size: 16px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 1px;
}
.clp-fallback-placeholder .dashicons { font-size: 48px; width: 48px; height: 48px; }

/* ══════════════════════════════════════
   STEP 5: [church_live_status] badge
══════════════════════════════════════ */
.clp-status-badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 14px; border-radius: 50px;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.clp-status-badge--live {
	background: rgba(239,68,68,0.12); color: #dc2626;
	border: 1px solid rgba(239,68,68,0.3);
}
.clp-status-badge--offline {
	background: rgba(100,116,139,0.1); color: #64748b;
	border: 1px solid rgba(100,116,139,0.2);
}
.clp-status-dot {
	width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.clp-status-badge--live .clp-status-dot { animation: clp-dot-anim 1s infinite; }

/* ══════════════════════════════════════
   STEP 5: [church_live_countdown]
══════════════════════════════════════ */
.clp-countdown {
	display: flex; flex-direction: column; align-items: center; gap: 16px;
	padding: 32px 24px; text-align: center;
}
.clp-countdown--empty {
	background: #f8fafc; border: 2px dashed #e2e8f0;
	border-radius: 12px; color: #94a3b8;
	padding: 24px; font-size: 14px;
}
.clp-countdown__label {
	font-size: 14px; color: #64748b; line-height: 1.5;
}
.clp-countdown__label strong { color: #0f172a; }
.clp-countdown__day {
	display: block; font-size: 12px; margin-top: 2px;
	color: #94a3b8; font-style: italic;
}
.clp-countdown__units {
	display: flex; align-items: center; gap: 8px;
}
.clp-cd-unit {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	background: #0f172a; border-radius: 12px; padding: 16px 20px; min-width: 72px;
}
.clp-cd-num {
	font-size: 36px; font-weight: 900; color: #fff; line-height: 1;
	font-variant-numeric: tabular-nums; letter-spacing: -1px;
}
.clp-cd-lbl {
	font-size: 10px; font-weight: 700; color: #64748b;
	text-transform: uppercase; letter-spacing: 1px;
}
.clp-cd-sep {
	font-size: 28px; font-weight: 900; color: #334155;
	margin-bottom: 16px; /* align with numbers */
}

/* Compact format */
.clp-countdown[data-format="compact"] .clp-cd-unit {
	padding: 10px 14px; min-width: 54px; border-radius: 8px;
}
.clp-countdown[data-format="compact"] .clp-cd-num { font-size: 24px; }
.clp-countdown[data-format="compact"] .clp-cd-lbl { font-size: 9px; }
.clp-countdown[data-format="compact"] .clp-cd-sep { font-size: 20px; margin-bottom: 10px; }

/* When live — replace countdown with live indicator */
.clp-countdown.clp-countdown--live .clp-countdown__units { display: none; }
.clp-countdown.clp-countdown--live::after {
	content: '🔴 Service is Live Now!';
	display: block; font-size: 16px; font-weight: 800;
	color: #dc2626; animation: clp-badge-blink 2s infinite;
}
/* hide_when_live="1" (default): remove the whole block once live, no live indicator */
.clp-countdown.clp-countdown--hide-when-live.clp-countdown--live { display: none; }
.clp-countdown.clp-countdown--hide-when-live.clp-countdown--live::after { content: none; }

/* ══════════════════════════════════════
   [church_live_slider] — base
══════════════════════════════════════ */
.clp-slider {
	position: relative; width: 100%; overflow: hidden;
	border-radius: 16px; background: #000;
	box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.clp-slider-track { position: relative; }
.clp-slide {
	position: absolute; top: 0; left: 0; width: 100%;
	opacity: 0; pointer-events: none;
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.clp-slide.clp-slide-active {
	position: relative; opacity: 1; pointer-events: auto;
}
.clp-slide img { width: 100%; height: auto; display: block; object-fit: cover; }
.clp-slide .clp-aspect-ratio { background: #111; }
.clp-slide__label {
	position: absolute; bottom: 56px; left: 20px; z-index: 5;
	background: rgba(0,0,0,0.6); color: #fff; padding: 6px 14px;
	border-radius: 6px; font-size: 13px; font-weight: 600;
	backdrop-filter: blur(4px);
}

/* ── Fade transition (default) ── */
.clp-slider--fade .clp-slide { transform: none; }
.clp-slider--fade .clp-slide-active { transform: none; }

/* Crossfade — same as fade but uses a slightly longer opacity transition */
.clp-slider--crossfade .clp-slide { transform: none; transition: opacity 0.8s ease, transform 0s; }
.clp-slider--crossfade .clp-slide-active { transform: none; opacity: 1; }

/* None — instant cut, no animation */
.clp-slider--none .clp-slide { transition: none; opacity: 0; }
.clp-slider--none .clp-slide-active { opacity: 1; }

/* ── Slide transition ── */
.clp-slider--slide .clp-slide { transform: translateX(60px); }
.clp-slider--slide .clp-slide-active { transform: translateX(0); }
.clp-slider--slide .clp-slide-out { transform: translateX(-60px); opacity: 0; }

/* ── Zoom transition ── */
.clp-slider--zoom .clp-slide { transform: scale(1.06); }
.clp-slider--zoom .clp-slide-active { transform: scale(1); }

/* Arrows */
.clp-slider-arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
	width: 44px; height: 44px; border-radius: 50%; border: none;
	background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
	color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background 0.2s, transform 0.2s; -webkit-appearance: none;
}
.clp-slider-arrow:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.1); }
.clp-arrow-prev { left: 16px; }
.clp-arrow-next { right: 16px; }

/* Dots */
.clp-slider-dots {
	position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
	display: flex; gap: 8px; z-index: 20;
}
.clp-dot-nav {
	width: 8px; height: 8px; border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.6); background: transparent;
	cursor: pointer; padding: 0; transition: background 0.2s, transform 0.2s;
	position: relative; /* anchor the expanded hit target below */
}
/* A-M3: 44px invisible touch target (WCAG 2.5.8) without changing the 8px visual dot. */
.clp-dot-nav::before { content: ''; position: absolute; inset: -18px; }
.clp-dot-nav.active { background: #fff; transform: scale(1.3); border-color: #fff; }
.clp-slider-counter {
	position: absolute; bottom: 14px; right: 16px;
	background: rgba(0,0,0,0.45); color: #fff;
	font-size: 12px; font-family: ui-monospace, monospace;
	padding: 2px 8px; border-radius: 20px; z-index: 20;
	pointer-events: none; letter-spacing: 0.05em;
}

/* Empty state */
.clp-slider-empty {
	background: #f8fafc; border: 2px dashed #cbd5e1;
	border-radius: 12px; padding: 40px 24px; text-align: center;
	color: #94a3b8; font-size: 14px;
}

/* ── Animations ── */
@keyframes clp-video-glow-anim {
	0%,100% { box-shadow: 0 0 10px var(--clp-video-pulse); border-color: var(--clp-video-pulse); }
	50%      { box-shadow: 0 0 35px var(--clp-video-pulse); }
}
@keyframes clp-btn-pulse-anim {
	0%,100% { box-shadow: 0 0 5px var(--clp-btn-pulse); }
	50%      { box-shadow: 0 0 20px var(--clp-btn-pulse); }
}
@keyframes clp-dot-anim {
	0%,100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.4; transform: scale(1.3); }
}
@keyframes clp-badge-blink {
	0%,90%,100% { opacity: 1; }
	95%          { opacity: 0.6; }
}

/* ══════════════════════════════════════
   v19.2.0 ADDITIONS
══════════════════════════════════════ */

/* Feature 1: Add-to-Calendar buttons */
.clp-cal-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 4px;
}
.clp-cal-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #64748b;
}
.clp-cal-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 14px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform 0.15s, box-shadow 0.15s;
	border: 1px solid transparent;
}
.clp-cal-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.clp-cal-google  { background: #fff; color: #374151 !important; border-color: #e5e7eb; }
.clp-cal-outlook { background: #0078d4; color: #fff !important; }
.clp-cal-apple   { background: #1c1c1e; color: #fff !important; }
.clp-cal-btn svg { flex-shrink: 0; }

/* Feature 2: Premiere + Replay badges */
.clp-hero-badge--premiere {
	background: linear-gradient(135deg, #f59e0b, #d97706);
	animation: none;
}
.clp-hero-badge--replay {
	background: linear-gradient(135deg, #64748b, #475569);
	animation: none;
}

/* Feature 3: Playlist fallback */
.clp-playlist-fallback { position: relative; }
.clp-playlist-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 10;
	background: rgba(0,0,0,0.7);
	color: #fff;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	backdrop-filter: blur(4px);
}
.clp-playlist-title {
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
}

/* Feature 7: [church_live_offline] section */
.clp-offline-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 48px 24px;
	gap: 20px;
}
.clp-offline-section__icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
}
.clp-offline-section__icon .dashicons {
	font-size: 36px;
	width: 36px;
	height: 36px;
	color: #94a3b8;
}
.clp-offline-section__title {
	font-size: 26px;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
	letter-spacing: -0.5px;
}
.clp-offline-section__subtitle {
	font-size: 16px;
	color: #64748b;
	margin: 0;
	max-width: 480px;
}
.clp-offline-section__image {
	width: 100%;
	max-width: 600px;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.clp-offline-section__image img { width: 100%; height: auto; display: block; }

/* ── BROADCAST LOCK SHIELD (v20.3.1) ──
   Transparent layer over the live iframe when "Hide player bar" is on —
   blocks click-to-pause and scrubbing. Sits above the iframe but below the
   hero badge/button (z-index 10) and the mute toggle (z-index 20), so the
   plugin's own overlays keep working. */
.clp-player-shield {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	background: transparent;
}

/* ── CLICK-TO-MUTE / UNMUTE OVERLAY ── */
.clp-mute-overlay {
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 20;
	cursor: pointer;
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}
.clp-mute-overlay.clp-mute-visible {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}
/* outline:none only for mouse focus; keyboard (:focus-visible) gets a clear ring on the icon. */
.clp-mute-overlay:focus { outline: none; }
.clp-mute-overlay:focus-visible { outline: none; }
.clp-mute-overlay:focus-visible .clp-mute-icon {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(0,0,0,0.45);
}

/* A-M2: keyboard focus ring on every interactive control (many themes reset the browser
   default to nothing — a keyboard-visible "Watch Live" button is not optional). */
.clp-header-btn:focus-visible,
.clp-hero-btn:focus-visible,
.clp-slider-arrow:focus-visible,
.clp-dot-nav:focus-visible,
.clp-campus-btn:focus-visible,
.clp-cal-btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}
.clp-mute-icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0,0,0,0.65);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 2px solid rgba(255,255,255,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.15s;
}
.clp-mute-overlay:hover .clp-mute-icon,
.clp-mute-overlay:focus .clp-mute-icon {
	background: rgba(0,0,0,0.85);
	transform: scale(1.08);
}
/* Muted state — speaker with X */
.clp-mute-icon--muted::before {
	content: '';
	display: block;
	width: 20px;
	height: 20px;
	background-color: #fff;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3.63 3.63a1 1 0 0 0 0 1.41L7.29 8.7 7 9H4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h3l3.57 3.57A1 1 0 0 0 12 18v-2.59l6.96 6.95a1 1 0 1 0 1.41-1.41L5.05 3.63a1 1 0 0 0-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53A8.93 8.93 0 0 0 21 12a9 9 0 0 0-9-9 8.96 8.96 0 0 0-3.88.88l1.52 1.52A7 7 0 0 1 12 5a7 7 0 0 1 7 7zm-7-5a5 5 0 0 1 5 5c0 .65-.13 1.26-.33 1.84l1.52 1.52A7 7 0 0 0 12 5v2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3.63 3.63a1 1 0 0 0 0 1.41L7.29 8.7 7 9H4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h3l3.57 3.57A1 1 0 0 0 12 18v-2.59l6.96 6.95a1 1 0 1 0 1.41-1.41L5.05 3.63a1 1 0 0 0-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53A8.93 8.93 0 0 0 21 12a9 9 0 0 0-9-9 8.96 8.96 0 0 0-3.88.88l1.52 1.52A7 7 0 0 1 12 5a7 7 0 0 1 7 7zm-7-5a5 5 0 0 1 5 5c0 .65-.13 1.26-.33 1.84l1.52 1.52A7 7 0 0 0 12 5v2z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}
/* Unmuted state — speaker with waves */
.clp-mute-icon--live::before {
	content: '';
	display: block;
	width: 20px;
	height: 20px;
	background-color: #fff;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}
/* Live pulse ring when unmuted */
.clp-mute-icon--live {
	animation: clp-mute-pulse 2s ease-in-out infinite;
	border-color: rgba(239,68,68,0.6);
}
@keyframes clp-mute-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
	50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ══════════════════════════════════════
   v19.2.0 — CINEMATIC MOTION SYSTEM
   Layered pulses, ambient glow drift,
   dynamic live states, reduced-motion
   support.
══════════════════════════════════════ */

/* ── Dynamic State Classes ── */
/* Applied to .clp-live-hero-container via JS */

/* UPCOMING — soft ambient glow */
.clp-state--upcoming .clp-live-hero-container {
	border-color: #64748b !important;
	animation: clp-glow-upcoming 4s ease-in-out infinite;
}
.clp-state--upcoming .clp-hero-badge {
	background: #475569;
	animation: none;
}

/* STARTING SOON — building excitement */
.clp-state--soon .clp-live-hero-container {
	animation: clp-glow-soon 1.8s ease-in-out infinite;
}
.clp-state--soon .clp-hero-badge {
	background: linear-gradient(135deg, #f59e0b, #ef4444);
	animation: clp-badge-pulse-soon 1.5s ease-in-out infinite;
}

/* LIVE — full broadcast pulse (layered) */
.clp-state--live .clp-live-hero-container {
	animation: clp-glow-live-outer 2s ease-in-out infinite, clp-hue-drift 8s linear infinite;
}
.clp-state--live .clp-hero-badge {
	animation: clp-badge-live-throb 1.2s ease-in-out infinite;
	box-shadow: 0 0 16px rgba(239,68,68,0.6);
	/* Follow the badge color (badge_color 'none' → transparent → no halo).
	   Falls back to the red halo above where color-mix is unsupported. */
	box-shadow: 0 0 16px color-mix(in srgb, var(--clp-badge-bg, #ef4444) 60%, transparent);
}
.clp-state--live .clp-header-btn {
	animation: clp-btn-pulse-live 1.5s ease-in-out infinite;
}

/* REPLAY — muted cinematic */
.clp-state--replay .clp-live-hero-container {
	border-color: #475569 !important;
	animation: clp-glow-replay 5s ease-in-out infinite;
	filter: saturate(0.85);
}

/* OFFLINE — calm static */
.clp-state--offline .clp-live-hero-fallback {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ── Layered Pulse — Button has independent freq from badge ── */
.clp-dot-pulse {
	animation: clp-dot-anim-fast 0.9s infinite !important;
}
.clp-hero-badge .clp-dot-pulse {
	animation: clp-dot-anim 1.4s infinite !important;
}

/* ── Ambient Glow Drift (very subtle hue shift on live) ── */
@keyframes clp-hue-drift {
	0%   { filter: hue-rotate(0deg); }
	50%  { filter: hue-rotate(8deg); }
	100% { filter: hue-rotate(0deg); }
}

/* ── State-specific glow keyframes ── */
@keyframes clp-glow-upcoming {
	0%,100% { box-shadow: 0 0 8px rgba(100,116,139,0.3); border-color: #475569; }
	50%     { box-shadow: 0 0 20px rgba(100,116,139,0.5); border-color: #64748b; }
}
@keyframes clp-glow-soon {
	0%,100% { box-shadow: 0 0 10px rgba(245,158,11,0.4); border-color: #f59e0b; }
	50%     { box-shadow: 0 0 30px rgba(245,158,11,0.7); border-color: #fbbf24; }
}
@keyframes clp-glow-live-outer {
	0%,100% {
		box-shadow: 0 0 12px var(--clp-video-pulse), 0 0 32px rgba(239,68,68,0.2);
		border-color: var(--clp-video-pulse);
	}
	50% {
		box-shadow: 0 0 40px var(--clp-video-pulse), 0 0 70px rgba(239,68,68,0.15), 0 0 100px rgba(239,68,68,0.08);
		border-color: var(--clp-video-pulse);
	}
}
@keyframes clp-glow-replay {
	0%,100% { box-shadow: 0 0 6px rgba(71,85,105,0.3); }
	50%     { box-shadow: 0 0 18px rgba(71,85,105,0.5); }
}

/* ── Badge keyframes ── */
@keyframes clp-badge-pulse-soon {
	0%,100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
	50%     { transform: scale(1.05); box-shadow: 0 6px 20px rgba(245,158,11,0.5); }
}
@keyframes clp-badge-live-throb {
	0%,100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
	50%     { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ── Button live pulse (different frequency) ── */
@keyframes clp-btn-pulse-live {
	0%,100% { box-shadow: 0 0 5px var(--clp-btn-pulse), 0 0 14px rgba(239,68,68,0.2); }
	50%     { box-shadow: 0 0 22px var(--clp-btn-pulse), 0 0 38px rgba(239,68,68,0.15); }
}

/* ── Fast dot pulse for button ── */
@keyframes clp-dot-anim-fast {
	0%,100% { opacity: 1; transform: scale(1); }
	50%     { opacity: 0.35; transform: scale(1.4); }
}

/* ══════════════════════════════════════
   v19.2.0 — ANALYTICS EVENT TRACKING
   Micro-interaction on click for
   tracked elements
══════════════════════════════════════ */
.clp-tracked-click {
	position: relative;
}
.clp-tracked-click::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: inherit;
	pointer-events: none;
	border: 2px solid transparent;
	transition: border-color 0.15s, opacity 0.3s;
	opacity: 0;
}
.clp-tracked-click:active::after {
	border-color: rgba(255,255,255,0.5);
	opacity: 1;
}

/* ══════════════════════════════════════
   v19.2.0 — STREAM HEALTH INDICATOR
   Small badge in hero corner
══════════════════════════════════════ */
.clp-health-indicator {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 5px;
	background: rgba(0,0,0,0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 20px;
	padding: 4px 10px 4px 8px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.4s, transform 0.4s;
}
.clp-health-indicator.clp-health-visible {
	opacity: 1;
	transform: translateY(0);
}
.clp-health-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	flex-shrink: 0;
}
.clp-health-indicator--warning .clp-health-dot { background: #f59e0b; animation: clp-dot-anim 1.2s infinite; }
.clp-health-indicator--error   .clp-health-dot { background: #ef4444; animation: clp-dot-anim 0.8s infinite; }
.clp-health-indicator--good    .clp-health-dot { background: #22c55e; animation: clp-glow-dot 2s ease-in-out infinite; }
/* Corner variants (Design → Live elements → Status chip). Default stays top-right. */
.clp-health-indicator.clp-health-pos-top-left     { top: 12px; left: 12px; right: auto; }
.clp-health-indicator.clp-health-pos-bottom-left  { top: auto; bottom: 12px; left: 12px; right: auto; }
.clp-health-indicator.clp-health-pos-bottom-right { top: auto; bottom: 12px; right: 12px; }

@keyframes clp-glow-dot {
	0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
	50%     { box-shadow: 0 0 0 3px rgba(34,197,94,0.3); }
}

/* ══════════════════════════════════════
   v19.2.0 — COUNTDOWN UPGRADE
   "Starting Soon" visual state
══════════════════════════════════════ */
.clp-countdown--soon .clp-cd-unit {
	background: linear-gradient(135deg, #1e293b, #0f172a);
	border: 1px solid rgba(245,158,11,0.3);
	box-shadow: 0 0 12px rgba(245,158,11,0.15);
	animation: clp-cd-unit-pulse 2s ease-in-out infinite;
}
.clp-countdown--soon .clp-cd-num {
	color: #fbbf24;
}
.clp-countdown--soon .clp-cd-sep { color: #f59e0b; }
@keyframes clp-cd-unit-pulse {
	0%,100% { border-color: rgba(245,158,11,0.3); }
	50%     { border-color: rgba(245,158,11,0.6); box-shadow: 0 0 20px rgba(245,158,11,0.2); }
}

/* ══════════════════════════════════════
   v19.2.0 — REDUCED MOTION SUPPORT
   All animations respect prefers-reduced-motion
══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
	.clp-live-hero-container,
	.clp-header-btn,
	.clp-hero-badge,
	.clp-dot-pulse,
	.clp-status-dot,
	.clp-mute-icon--live,
	.clp-countdown--soon .clp-cd-unit,
	.clp-health-dot {
		animation: none !important;
	}
	.clp-live-hero-container {
		box-shadow: 0 0 12px var(--clp-video-pulse);
	}
	.clp-mute-overlay,
	.clp-health-indicator {
		transition: none;
	}
}

/* ══════════════════════════════════════
   v19.2.0 — COUNTDOWN VISUAL THEMES
   Applied via .clp-countdown--theme-{name}
   on the countdown wrapper element.
══════════════════════════════════════ */

/* ── Minimal (light card on white) ── */
.clp-countdown--theme-minimal .clp-cd-unit {
	background: #fff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	border-radius: 10px;
}
.clp-countdown--theme-minimal .clp-cd-num { color: #0f172a; }
.clp-countdown--theme-minimal .clp-cd-lbl { color: #94a3b8; }
.clp-countdown--theme-minimal .clp-cd-sep { color: #cbd5e1; }
.clp-countdown--theme-minimal { background: transparent; }

/* ── LED (green on black, monospace) ── */
.clp-countdown--theme-led .clp-cd-unit {
	background: #000;
	border: 1px solid #003300;
	border-radius: 6px;
	box-shadow: 0 0 12px rgba(0,255,65,0.15), inset 0 0 8px rgba(0,255,65,0.05);
}
.clp-countdown--theme-led .clp-cd-num {
	color: #00ff41;
	font-family: 'Courier New', monospace;
	text-shadow: 0 0 10px #00ff41, 0 0 20px rgba(0,255,65,0.5);
	letter-spacing: 2px;
}
.clp-countdown--theme-led .clp-cd-lbl {
	color: #005500;
	font-family: 'Courier New', monospace;
}
.clp-countdown--theme-led .clp-cd-sep {
	color: #00aa28;
	text-shadow: 0 0 8px #00ff41;
}
.clp-countdown--theme-led { background: transparent; }

/* ── Cinematic (gold on very dark warm) ── */
.clp-countdown--theme-cinematic .clp-cd-unit {
	background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
	border: 1px solid rgba(251,191,36,0.2);
	border-radius: 14px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(251,191,36,0.1);
	min-width: 80px;
	padding: 18px 22px;
}
.clp-countdown--theme-cinematic .clp-cd-num {
	color: #fbbf24;
	font-size: 42px;
	text-shadow: 0 0 20px rgba(251,191,36,0.3);
}
.clp-countdown--theme-cinematic .clp-cd-lbl {
	color: #78716c;
	letter-spacing: 2px;
}
.clp-countdown--theme-cinematic .clp-cd-sep {
	color: rgba(251,191,36,0.4);
	font-size: 32px;
}
.clp-countdown--theme-cinematic .clp-countdown__label,
.clp-countdown--theme-cinematic .clp-countdown__label strong { color: #a8a29e; }

/* ── Modern Worship (violet / purple) ── */
.clp-countdown--theme-worship .clp-cd-unit {
	background: linear-gradient(135deg, #2e1065 0%, #3b0764 100%);
	border: 1px solid rgba(196,181,253,0.25);
	border-radius: 16px;
	box-shadow: 0 0 24px rgba(124,58,237,0.2), 0 4px 16px rgba(0,0,0,0.3);
	padding: 18px 22px;
	min-width: 78px;
}
.clp-countdown--theme-worship .clp-cd-num {
	color: #c4b5fd;
	font-size: 40px;
	text-shadow: 0 0 16px rgba(167,139,250,0.5);
}
.clp-countdown--theme-worship .clp-cd-lbl { color: #6d28d9; }
.clp-countdown--theme-worship .clp-cd-sep { color: rgba(196,181,253,0.4); font-size: 30px; }
.clp-countdown--theme-worship .clp-countdown__label         { color: #7c3aed; }
.clp-countdown--theme-worship .clp-countdown__label strong  { color: #a78bfa; }
.clp-countdown--theme-worship .clp-cal-btn {
	border-color: rgba(167,139,250,0.3);
	color: #a78bfa;
}
.clp-countdown--theme-worship .clp-cal-btn:hover {
	background: rgba(124,58,237,0.15);
	border-color: #a78bfa;
}

/* ── Conference (forest green, professional) ── */
.clp-countdown--theme-conference .clp-cd-unit {
	background: linear-gradient(135deg, #052e16 0%, #064e3b 100%);
	border: 1px solid rgba(134,239,172,0.2);
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.clp-countdown--theme-conference .clp-cd-num {
	color: #86efac;
	text-shadow: 0 0 12px rgba(134,239,172,0.3);
}
.clp-countdown--theme-conference .clp-cd-lbl { color: #166534; }
.clp-countdown--theme-conference .clp-cd-sep { color: rgba(134,239,172,0.3); }
.clp-countdown--theme-conference .clp-countdown__label { color: #15803d; }
.clp-countdown--theme-conference .clp-countdown__label strong { color: #4ade80; }

/* ── Custom (user colors from Design → Countdown, via CSS vars) ── */
.clp-countdown--theme-custom .clp-cd-unit {
	background: var(--clp-cd-bg, #1e1b4b);
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.clp-countdown--theme-custom .clp-cd-num { color: var(--clp-cd-fg, #ffffff); }
.clp-countdown--theme-custom .clp-cd-lbl { color: var(--clp-cd-fg, #ffffff); opacity: 0.65; }
.clp-countdown--theme-custom .clp-cd-sep { color: var(--clp-cd-fg, #ffffff); opacity: 0.4; }
.clp-countdown--theme-custom .clp-countdown__label        { color: var(--clp-cd-fg, #ffffff); opacity: 0.8; }
.clp-countdown--theme-custom .clp-countdown__label strong { color: var(--clp-cd-fg, #ffffff); }

/* All themes — inherit transition for soon state */
[class*="clp-countdown--theme-"].clp-countdown--soon .clp-cd-unit {
	animation: clp-cd-unit-pulse 2s ease-in-out infinite;
}

/* ── Multi-campus selector ── */
.clp-campus-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.clp-campus-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.clp-campus-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}
.clp-campus-btn.clp-campus-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

/* ── Offline placeholder ── */
.clp-fallback-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: rgba(255,255,255,0.7);
  border-radius: 12px;
  text-align: center;
  padding: 40px 24px;
}
.clp-fallback-icon { font-size: 48px; line-height: 1; }
.clp-fallback-title { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.clp-fallback-next  { font-size: 14px; color: rgba(255,255,255,0.6); }

/* ────────────────────────────────────────────────────────
   HERO BANNER MODE  (.clp-hero-banner wrapper)

   Turns [church_live_hero] into a cinematic full-viewport
   header: full browser width, 100vh tall, video scaled to
   cover (same technique as CSS background-video). Works in
   any theme — the negative-margin breakout handles the width.

   Usage (Gutenberg Custom HTML block):
     <div class="clp-hero-banner">[church_live_hero]</div>

   Usage (page builder):
     Wrap [church_live_hero] inside a full-width section
     and set the section min-height to 100vh. The CSS below
     handles the cover-fill automatically.
──────────────────────────────────────────────────────── */
.clp-hero-banner {
  position: relative;
  /* 100svh = viewport minus mobile browser chrome (Safari 15.4+).
     Fall back to 100vh for older browsers. */
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #000;
  /* Full-width breakout from the theme's content column */
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  line-height: 0;
}

/* Shortcode wrapper fills the banner area */
.clp-hero-banner #clp-hero-wrapper {
  position: absolute;
  inset: 0;
}

/* ── LIVE / REPLAY / UPCOMING: iframe-based hero ──
   Size the container to cover the viewport while keeping 16:9.
   Logic: width  = max(vw, vh × 16/9)   → always ≥ viewport width
          height = max(vw × 9/16, vh)    → always ≥ viewport height
   Center it so equal amounts overflow on each side. */
.clp-hero-banner .clp-live-hero-container {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, calc(100vh * 16 / 9));
  height: max(calc(100vw * 9 / 16), 100vh);
  border-radius: 0 !important;
  border: none !important;
  animation: none !important; /* no glow pulse on a full-bleed video */
}

/* Kill the padding-top aspect-ratio trick — parent size drives layout now */
.clp-hero-banner .clp-aspect-ratio {
  padding-top: 0 !important;
  height: 100%;
}

/* ── OFFLINE / FALLBACK state ── */
.clp-hero-banner .clp-live-hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: unset;
  border-radius: 0;
  border: none;
  background: #111;
}
.clp-hero-banner .clp-live-hero-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clp-hero-banner .clp-fallback-placeholder {
  height: 100%;
  min-height: unset;
  border-radius: 0;
}

/* Dark gradient scrim — keeps badge and CTA text readable */
.clp-hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.50) 100%);
  pointer-events: none;
  z-index: 5;
}

/* Badge and CTA button sit above the scrim */
.clp-hero-banner .clp-hero-overlay-badge,
.clp-hero-banner .clp-hero-overlay-btn {
  z-index: 10;
}

/* Reset line-height for any content that follows the banner */
.clp-hero-banner + * { line-height: normal; }

/* ══════════════════════════════════════
   UI/UX audit A-M5 + A-M6
══════════════════════════════════════ */

/* A-M6: T=0 "Starting now…" interim state. The label is in the DOM (hidden); JS adds
   .clp-countdown--starting at countdown zero and removes it once the stream is live. */
.clp-countdown__starting { display: none; margin-top: 14px; font-weight: 800; letter-spacing: .5px; }
.clp-countdown--starting .clp-countdown__starting { display: block; }
.clp-countdown--starting .clp-countdown__units { opacity: .45; transition: opacity .2s; }

/* A-M5: reserve a 16:9 box on the hero wrapper so the offline placeholder and the live
   embed occupy the SAME height — no layout shift (CLS) at the offline→live moment. Scoped
   to the default (non-banner) shortcode mode; the full-bleed .clp-hero-banner mode sizes the
   wrapper via position:absolute;inset:0 (which ignores aspect-ratio), so it's unaffected.

   NEW-M1: the side-by-side chat layout (.clp-has-chat) is taller than 16:9 — clamping it
   to the reserved box clipped the chat (almost entirely, on the mobile column variant). So
   the reservation is opted OUT whenever chat is rendered, via the .clp-chat-active flag the
   server sets on first paint and the poller keeps in sync (frontend.js syncChatMode). Chat
   off → the CLS win is fully preserved (video-only + offline placeholder paths). */
#clp-hero-wrapper:not(.clp-chat-active) { aspect-ratio: 16 / 9; }
#clp-hero-wrapper:not(.clp-chat-active) > .clp-live-hero-container { height: 100%; }
#clp-hero-wrapper:not(.clp-chat-active) > .clp-live-hero-container > .clp-aspect-ratio { padding-top: 0; height: 100%; }
#clp-hero-wrapper:not(.clp-chat-active) > .clp-live-hero-fallback { height: 100%; min-height: 0; }
#clp-hero-wrapper:not(.clp-chat-active) > .clp-live-hero-fallback .clp-fallback-placeholder { min-height: 0; height: 100%; }

/* A-L4: brief loading affordance while a multi-campus switch loads the new stream. */
.clp-campus-loading { position: relative; }
.clp-campus-loading::after {
	content: ''; position: absolute; top: 50%; left: 50%;
	width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%;
	animation: clp-campus-spin 0.8s linear infinite; z-index: 5;
}
@keyframes clp-campus-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.clp-campus-loading::after { animation: none; }
}

/* ── Accessibility helpers (audit 2026-07) ─────────────────────────────── */

/* Visually-hidden text for screen readers (e.g. "(opens in a new tab)"). Defined
   here so it works even when the active theme doesn't provide .screen-reader-text. */
.clp-live-hero-container .screen-reader-text,
.clp-header-btn .screen-reader-text,
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

/* Windows High Contrast / forced-colors: keep badges, buttons and the selected
   campus perceivable when the cinematic colors are overridden by the OS. */
@media (forced-colors: active) {
	.clp-status-badge,
	.clp-hero-btn,
	.clp-header-btn,
	.clp-campus-btn {
		border: 1px solid currentColor;
	}
	.clp-campus-btn[aria-checked="true"] {
		outline: 2px solid Highlight;
		outline-offset: 1px;
	}
}
