/* ==========================================================================
   YouTube Videos page (page-templates/template-youtube.php,
   inc/youtube-videos.php). Loaded on this page only.
   Each box carries its category colour (--yt-accent: sage = yoga,
   mauve = healing, dusk blue = talks, ochre = kirtan, terracotta = stories).
   Hover: the box lifts, its border and title take the category colour, the
   picture zooms and the play button turns YouTube red.
   ========================================================================== */
.yt-page { --yt-ease: cubic-bezier(.2, .7, .2, 1); --yt-red: #ff0000; }

/* ---- Filter chips ---- */
.yt-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 34px; }
.yt-filters[hidden] { display: none; }
.yt-chip {
	--yt-accent: var(--color-primary);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
	color: var(--color-primary-dark);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 250ms ease, color 250ms ease, border-color 250ms ease, transform 250ms ease;
}
.yt-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--yt-accent); }
.yt-chip span { padding: 1px 8px; border-radius: 999px; background: var(--color-bg-alt); font-size: 0.75rem; }
.yt-chip:hover { border-color: var(--yt-accent); transform: translateY(-2px); }
.yt-chip.is-active { background: var(--yt-accent); border-color: var(--yt-accent); color: #fff; }
.yt-chip.is-active i { background: #fff; }
.yt-chip.is-active span { background: rgba(255, 255, 255, 0.22); }

/* ---- Grids ---- */
.yt-grid, .yt-shorts { display: grid; gap: 26px; margin: 0; padding: 0; list-style: none; }
.yt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yt-shorts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.yt-item[hidden] { display: none; }
.yt-grid.is-filtered .yt-item { animation: yt-in 400ms var(--yt-ease); }
@keyframes yt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- Video box ---- */
.yt-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	color: var(--color-text);
	text-decoration: none;
	transition: transform 400ms var(--yt-ease), box-shadow 400ms ease, border-color 400ms ease;
}
.yt-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	z-index: 2;
	background: var(--yt-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 450ms var(--yt-ease);
}
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #1e2a25; }
.yt-card--short .yt-thumb { aspect-ratio: 9 / 16; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--yt-ease), filter 400ms ease; }
.yt-thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.45));
	pointer-events: none;
}
.yt-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 44px;
	margin: -22px 0 0 -31px;
	border-radius: 14px;
	background: rgba(20, 20, 20, 0.72);
	color: #fff;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
	transition: background 300ms ease, transform 400ms var(--yt-ease);
}
.yt-play svg { width: 26px; height: 26px; }
.yt-duration, .yt-short-badge {
	position: absolute;
	bottom: 10px;
	z-index: 1;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.yt-duration { right: 10px; }
.yt-short-badge { left: 10px; background: var(--yt-red); }
.yt-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.yt-card--short .yt-body { padding: 12px 14px 14px; }
.yt-cat {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-primary-dark);
	color: color-mix(in srgb, var(--yt-accent) 72%, #1b1b1b);
}
.yt-cat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--yt-accent); }
.yt-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; line-height: 1.35; color: var(--color-primary-dark); transition: color 300ms ease; }
.yt-card--short .yt-title { font-size: 0.95rem; }

.yt-card:hover,
.yt-card:focus-visible {
	transform: translateY(-8px);
	border-color: var(--yt-accent);
	box-shadow: 0 22px 44px rgba(43, 38, 32, 0.14), 0 10px 24px color-mix(in srgb, var(--yt-accent) 22%, transparent);
	color: var(--color-text);
	text-decoration: none;
}
.yt-card:hover::before,
.yt-card:focus-visible::before { transform: scaleX(1); }
.yt-card:hover .yt-thumb img,
.yt-card:focus-visible .yt-thumb img { transform: scale(1.07); filter: brightness(0.92); }
.yt-card:hover .yt-play,
.yt-card:focus-visible .yt-play { background: var(--yt-red); transform: scale(1.14); }
.yt-card:hover .yt-title,
.yt-card:focus-visible .yt-title { color: color-mix(in srgb, var(--yt-accent) 72%, #1b1b1b); }
.yt-card:focus-visible { outline: 3px solid var(--yt-accent); outline-offset: 3px; }

/* ---- Hero / subscribe buttons: YouTube red ---- */
.yt-hero .hero-actions .yt-subscribe-btn:hover,
.yt-hero .hero-actions .yt-subscribe-btn:focus-visible { background-color: var(--yt-red, #ff0000) !important; border-color: var(--yt-red, #ff0000) !important; }
.yt-hero .hero-actions .yt-subscribe-btn svg { width: 18px; height: 18px; }

.yt-subscribe {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	gap: 24px 32px;
	flex-wrap: wrap;
	padding: 34px 38px;
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, #1e1e1e, #3a1414);
	color: #fff;
	box-shadow: var(--shadow-md);
}
.yt-subscribe::after {
	content: '';
	position: absolute;
	right: -60px;
	top: -60px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: #ff0000;
	opacity: 0.16;
	pointer-events: none;
}
.yt-subscribe-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 20px;
	background: #ff0000;
	color: #fff;
	box-shadow: 0 12px 26px rgba(255, 0, 0, 0.35);
}
.yt-subscribe-icon svg { width: 38px; height: 38px; }
.yt-subscribe-text { flex: 1 1 280px; position: relative; z-index: 1; }
.yt-subscribe-text h2 { margin: 0 0 6px; color: #fff; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.yt-subscribe-text p { margin: 0; color: rgba(255, 255, 255, 0.78); }
.yt-subscribe-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; }
.yt-subscribe .btn svg { width: 18px; height: 18px; }
.yt-btn-red { background: #ff0000; border: 2px solid #ff0000; color: #fff; }
.yt-btn-red:hover, .yt-btn-red:focus-visible { background: #cc0000; border-color: #cc0000; color: #fff; transform: translateY(-2px); }
.yt-subscribe .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.6); background: transparent; }
.yt-subscribe .btn-outline:hover,
.yt-subscribe .btn-outline:focus-visible { background: #fff; border-color: #fff; color: #1e1e1e; }

/* ---- Player pop-up ---- */
.yt-lightbox-open, .yt-lightbox-open body { overflow: hidden; }
.yt-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 12, 11, 0.92);
}
.yt-lightbox[hidden] { display: none; }
.yt-lightbox-inner { width: min(1100px, 100%); }
.yt-lightbox.is-short .yt-lightbox-inner { width: min(420px, 100%); }
.yt-lightbox-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.yt-lightbox-title { flex: 1; min-width: 0; overflow: hidden; color: #fff; font-family: var(--font-heading); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.yt-lightbox-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 250ms ease, border-color 250ms ease;
}
.yt-lightbox-btn svg { width: 18px; height: 18px; }
.yt-lightbox-btn:hover { background: #ff0000; border-color: #ff0000; color: #fff; }
.yt-lightbox-close:hover { background: rgba(255, 255, 255, 0.25); border-color: #fff; }
.yt-lightbox-btn:focus-visible { outline: 2px solid #f4d9a8; outline-offset: 3px; }
.yt-player { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-md); background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.yt-lightbox.is-short .yt-player { aspect-ratio: 9 / 16; max-height: calc(100vh - 120px); margin: 0 auto; }
.yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Responsive & reduced motion ---- */
@media (max-width: 1024px) {
	.yt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.yt-grid { grid-template-columns: 1fr; gap: 20px; }
	.yt-shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.yt-subscribe { padding: 28px 22px; text-align: center; justify-content: center; }
	.yt-subscribe-actions { justify-content: center; width: 100%; }
	.yt-subscribe-actions .btn { flex: 1 1 auto; justify-content: center; }
	.yt-lightbox { padding: 12px; }
	.yt-lightbox-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.yt-card, .yt-card::before, .yt-thumb img, .yt-play, .yt-chip { transition: none; }
	.yt-card:hover, .yt-card:focus-visible, .yt-card:hover .yt-thumb img, .yt-card:hover .yt-play, .yt-chip:hover { transform: none; }
	.yt-grid.is-filtered .yt-item { animation: none; }
}
