/* ==========================================================================
   RBM - YOUTUBE FEED — KAFELKI I OBRAMOWANIA IDENTYCZNE Z RBM - POSTY
   ========================================================================== */
:root {
	--rbm-accent: #E5007E;
	--rbm-accent-hover: #C2006A;
	--rbm-blue: #009FE3;
	--rbm-date-bg: #009FE3;
	--rbm-navy: #0b2545;
	--rbm-text: #1e293b;
	--rbm-muted: #64748b;
	--rbm-bg: #ffffff;
	--rbm-surface: #ffffff;
	--rbm-surface-soft: #f8fafc;
	--rbm-border: rgba(11, 37, 69, 0.1);
	--rbm-shadow: 0 12px 32px rgba(11, 37, 69, 0.12);
	--rbm-shadow-sm: 0 4px 16px rgba(11, 37, 69, 0.08);
	--rbm-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--rbm-font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

html.rbm-dark-mode {
	--rbm-navy: #f1f5f9;
	--rbm-text: #e2e8f0;
	--rbm-muted: #94a3b8;
	--rbm-bg: #0b1324;
	--rbm-surface: #132038;
	--rbm-surface-soft: #1a2944;
	--rbm-border: rgba(255, 255, 255, 0.12);
	--rbm-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
	--rbm-shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.rbm-yt-wrap,
.rbm-yt-wrap *,
.rbm-yt-modal-overlay,
.rbm-yt-modal-overlay * {
	box-sizing: border-box;
}

.rbm-yt-wrap {
	--rbm-card-radius: 16px;
	--rbm-side-thumb-w: 160px;
	--rbm-side-gap: 12px;
	width: 100%;
	font-family: var(--rbm-font-sans);
	color: var(--rbm-navy);
}

/* ==========================================================================
   NAGŁÓWEK SEKCJI ("| Filmy z Bucza" + "Wszystkie filmy na YouTube →")
   ========================================================================== */
.rbm-yt-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.rbm-yt-header-left {
	display: flex;
	align-items: stretch;
	gap: 14px;
	min-width: 0;
}

.rbm-yt-accent-bar {
	width: 5px;
	align-self: stretch;
	min-height: 28px;
	border-radius: 999px;
	background: linear-gradient(180deg, #f3168e 0%, var(--rbm-accent) 100%);
	flex-shrink: 0;
}

.rbm-yt-sec-title {
	margin: 0 !important;
	padding: 1px 0;
	font-family: var(--rbm-font-serif);
	font-style: italic;
	font-weight: 600;
	font-size: clamp(24px, 2.8vw, 34px);
	line-height: 1.15;
	color: var(--rbm-navy);
}

.rbm-yt-all-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--rbm-navy);
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.rbm-yt-all-link:hover {
	color: var(--rbm-accent);
}

.rbm-yt-arrow {
	display: inline-block;
	transition: transform 0.2s ease;
}

.rbm-yt-all-link:hover .rbm-yt-arrow,
.rbm-yt-readmore:hover .rbm-yt-arrow {
	transform: translateX(4px);
}

.rbm-yt-notice {
	padding: 18px 22px;
	border-radius: var(--rbm-card-radius);
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-left: 4px solid var(--rbm-date-bg);
	font-size: 14px;
	color: var(--rbm-navy);
	box-shadow: var(--rbm-shadow-sm);
}

/* ==========================================================================
   KAFELKI FILMÓW — IDENTYCZNE OBRAMOWANIE, CIEŃ I UKŁAD JAK .rbm-post-card
   ========================================================================== */
.rbm-yt-grid {
	display: grid;
	grid-template-columns: repeat(var(--rbm-yt-cols, 3), minmax(0, 1fr));
	gap: 24px;
}

.rbm-yt-card {
	display: flex;
	flex-direction: column;
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-radius: var(--rbm-card-radius);
	box-shadow: var(--rbm-shadow-sm);
	overflow: hidden;
	margin: 0 !important;
	padding: 0;
	min-height: 0 !important;
	height: 100%;
	transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.rbm-yt-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--rbm-shadow);
	border-color: rgba(229, 0, 126, 0.26);
}

.rbm-yt-thumb-link {
	display: block;
	text-decoration: none;
	flex-shrink: 0;
}

.rbm-yt-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--rbm-surface-soft);
}

.rbm-yt-thumb img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.rbm-yt-card:hover .rbm-yt-thumb img,
.rbm-yt-list-item:hover .rbm-yt-list-thumb img {
	transform: scale(1.05);
	filter: brightness(0.88);
}

/* Niebieska pigułka z datą — dokładnie jak w RBM - Posty */
.rbm-yt-date-pill {
	position: absolute;
	top: 13px;
	left: 13px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	padding: 5px 13px;
	border-radius: 999px;
	background: var(--rbm-date-bg);
	color: #ffffff;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.2;
	box-shadow: 0 4px 12px color-mix(in srgb, var(--rbm-date-bg) 38%, transparent);
}

/* Przycisk Play (glassmorphism -> Magenta po najechaniu) */
.rbm-yt-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: rgba(11, 37, 69, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 2px solid rgba(255, 255, 255, 0.85);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	transition: background-color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.rbm-yt-play-btn svg {
	width: 22px;
	height: 22px;
	margin-left: 2px;
	display: block;
}

.rbm-yt-play-btn.is-small {
	width: 34px;
	height: 34px;
	border-width: 1.5px;
}

.rbm-yt-play-btn.is-small svg {
	width: 14px;
	height: 14px;
}

.rbm-yt-card:hover .rbm-yt-play-btn,
.rbm-yt-list-item:hover .rbm-yt-play-btn {
	background: var(--rbm-accent);
	transform: translate(-50%, -50%) scale(1.08);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--rbm-accent) 48%, transparent);
}

/* Treść kafelka — 1:1 z .rbm-post-body */
.rbm-yt-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 20px 20px;
}

.rbm-yt-mobile-date {
	display: none;
}

.rbm-yt-title {
	margin: 0 0 10px !important;
	font-family: var(--rbm-font-sans);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.32;
	color: var(--rbm-navy);
}

.rbm-yt-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rbm-yt-title a:hover {
	color: var(--rbm-accent);
}

.rbm-yt-excerpt {
	margin: 0 0 16px !important;
	font-size: 13.8px;
	line-height: 1.55;
	color: var(--rbm-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rbm-yt-readmore {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--rbm-accent);
	text-decoration: none;
	font-size: 14px;
	font-weight: 700;
	align-self: flex-start;
	transition: color 0.2s ease;
}

.rbm-yt-readmore:hover {
	color: var(--rbm-accent-hover);
}

/* ==========================================================================
   UKŁAD STRONY GŁÓWNEJ (1 DUŻY PO LEWEJ + POZIOME PO PRAWEJ — JAK RBM POSTY)
   ========================================================================== */
.rbm-yt-mag-top {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 22px;
	align-items: stretch;
}

.rbm-yt-mag-top.is-single-only {
	grid-template-columns: 1fr;
}

.rbm-yt-mag-featured {
	display: flex;
	flex-direction: column;
}

.rbm-yt-mag-featured .rbm-yt-card--featured {
	flex: 1 1 auto;
}

.rbm-yt-mag-featured .rbm-yt-card--featured .rbm-yt-body {
	padding: 22px 24px 24px;
}

.rbm-yt-mag-featured .rbm-yt-card--featured .rbm-yt-title {
	font-size: clamp(20px, 2vw, 25px);
}

.rbm-yt-mag-featured .rbm-yt-card--featured .rbm-yt-excerpt {
	font-size: 14.5px;
	-webkit-line-clamp: 4;
}

.rbm-yt-mag-side-list {
	display: flex;
	flex-direction: column;
	gap: var(--rbm-side-gap, 12px);
	min-height: 0;
}

.rbm-yt-list-item {
	flex: 1 1 0;
	min-height: 92px;
	display: flex;
	margin: 0 !important;
	padding: 0 !important;
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-radius: 14px;
	box-shadow: var(--rbm-shadow-sm);
	overflow: hidden;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.rbm-yt-list-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--rbm-shadow);
	border-color: color-mix(in srgb, var(--rbm-date-bg) 42%, transparent);
}

.rbm-yt-list-link {
	display: flex;
	align-items: stretch;
	gap: 14px;
	width: 100%;
	height: 100%;
	padding: 8px 14px 8px 8px;
	text-decoration: none;
	color: inherit;
}

.rbm-yt-list-thumb {
	position: relative;
	width: var(--rbm-side-thumb-w, 160px);
	min-width: var(--rbm-side-thumb-w, 160px);
	min-height: 76px;
	align-self: stretch;
	border-radius: 10px;
	overflow: hidden;
	background: var(--rbm-surface-soft);
	flex-shrink: 0;
}

.rbm-yt-list-thumb img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease, filter 0.3s ease;
}

.rbm-yt-list-meta {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 2px 0;
}

.rbm-yt-list-date {
	display: inline-flex;
	align-self: flex-start;
	padding: 3px 10px;
	margin-bottom: 6px;
	border-radius: 999px;
	background: var(--rbm-date-bg);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.25;
}

.rbm-yt-list-title {
	margin: 0 !important;
	font-family: var(--rbm-font-sans);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--rbm-navy);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.rbm-yt-list-item:hover .rbm-yt-list-title {
	color: var(--rbm-accent);
}

/* ==========================================================================
   PAGINACJA (IDENTYCZNA Z RBM - POSTY)
   ========================================================================== */
.rbm-yt-pagination {
	margin-top: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}

.rbm-yt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 42px;
	padding: 0 20px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.rbm-yt-btn--secondary {
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	color: var(--rbm-navy);
	box-shadow: var(--rbm-shadow-sm);
}

.rbm-yt-btn--secondary:hover {
	border-color: var(--rbm-accent);
	color: var(--rbm-accent);
	transform: translateY(-1px);
}

.rbm-yt-btn--primary {
	background: linear-gradient(135deg, #f3168e 0%, var(--rbm-accent) 100%);
	border: 1px solid transparent;
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(229, 0, 126, 0.34);
}

.rbm-yt-btn--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(229, 0, 126, 0.42);
	color: #ffffff;
}

/* ==========================================================================
   WŁASNY LIGHTBOX (POPUP WIDEO 16:9)
   ========================================================================== */
.rbm-yt-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(8, 17, 36, 0.78);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 999999;
	font-family: var(--rbm-font-sans);
}

.rbm-yt-modal-overlay.is-open {
	display: flex;
	animation: rbmYtFadeIn 0.2s ease;
}

@keyframes rbmYtFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.rbm-yt-modal-box {
	width: 100%;
	max-width: 920px;
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-radius: 18px;
	box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}

.rbm-yt-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 15px 20px;
	background: var(--rbm-surface-soft);
	border-bottom: 1px solid var(--rbm-border);
}

.rbm-yt-modal-title-wrap {
	display: flex;
	align-items: stretch;
	gap: 11px;
	min-width: 0;
}

.rbm-yt-modal-title {
	margin: 0 !important;
	font-size: 16px;
	font-weight: 700;
	color: var(--rbm-navy);
	line-height: 1.3;
}

button.rbm-yt-modal-close {
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 10px !important;
	border: 1px solid var(--rbm-border) !important;
	background: var(--rbm-surface) !important;
	color: var(--rbm-navy) !important;
	font-size: 22px !important;
	line-height: 1 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

button.rbm-yt-modal-close:hover {
	background: var(--rbm-accent) !important;
	border-color: var(--rbm-accent) !important;
	color: #ffffff !important;
}

.rbm-yt-modal-player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000000;
}

.rbm-yt-modal-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ==========================================================================
   RESPONSYWNOŚĆ (TABLET & MOBILE — IDENTYCZNA Z RBM - POSTY)
   ========================================================================== */
@media (max-width: 1024px) {
	.rbm-yt-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	.rbm-yt-mag-top {
		grid-template-columns: 1fr;
		gap: 18px;
		align-items: start;
	}

	.rbm-yt-mag-side-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.rbm-yt-list-item {
		flex: none;
		min-height: 0 !important;
		height: auto !important;
		display: block;
	}

	.rbm-yt-list-link {
		height: auto;
		align-items: center;
	}

	.rbm-yt-list-thumb {
		width: 118px;
		min-width: 118px;
		height: 76px;
		min-height: 76px;
		align-self: center;
	}
}

@media (max-width: 767px) {
	.rbm-yt-header {
		flex-wrap: wrap;
		gap: 10px;
		margin-bottom: 16px;
	}

	.rbm-yt-accent-bar {
		min-height: 24px;
	}

	.rbm-yt-all-link {
		font-size: 13.5px;
	}

	.rbm-yt-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	/* Tryb Główny (Magazine) na mobile */
	.rbm-yt-mag-top {
		gap: 14px;
	}

	.rbm-yt-mag-featured .rbm-yt-card--featured .rbm-yt-body {
		padding: 16px 16px 18px;
	}

	.rbm-yt-mag-featured .rbm-yt-card--featured .rbm-yt-title {
		font-size: 19px;
	}

	.rbm-yt-mag-side-list {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}

	.rbm-yt-list-link {
		padding: 8px 10px 8px 8px;
		gap: 12px;
	}

	.rbm-yt-list-thumb {
		width: 104px;
		min-width: 104px;
		height: 76px;
		min-height: 76px;
	}

	.rbm-yt-list-date {
		padding: 2px 8px;
		margin-bottom: 5px;
		font-size: 10.5px;
	}

	.rbm-yt-list-title {
		font-size: 14px;
		line-height: 1.32;
		-webkit-line-clamp: 3;
	}

	/* Tryb Siatki -> zwarta lista na mobile (1:1 z RBM - Posty) */
	.rbm-yt-mobile--list .rbm-yt-grid {
		gap: 10px;
	}

	.rbm-yt-mobile--list .rbm-yt-card {
		flex-direction: row;
		align-items: center;
		padding: 8px 10px 8px 8px;
		gap: 12px;
		border-radius: 14px;
		height: auto !important;
	}

	.rbm-yt-mobile--list .rbm-yt-thumb-link {
		width: 104px;
		min-width: 104px;
	}

	.rbm-yt-mobile--list .rbm-yt-thumb {
		width: 104px;
		height: 76px;
		aspect-ratio: auto;
		border-radius: 10px;
	}

	.rbm-yt-mobile--list .rbm-yt-date-pill,
	.rbm-yt-mobile--list .rbm-yt-excerpt,
	.rbm-yt-mobile--list .rbm-yt-readmore {
		display: none !important;
	}

	.rbm-yt-mobile--list .rbm-yt-play-btn {
		width: 30px;
		height: 30px;
		border-width: 1.5px;
	}

	.rbm-yt-mobile--list .rbm-yt-play-btn svg {
		width: 13px;
		height: 13px;
	}

	.rbm-yt-mobile--list .rbm-yt-body {
		padding: 2px 0;
		justify-content: center;
		min-width: 0;
	}

	.rbm-yt-mobile--list .rbm-yt-mobile-date {
		display: inline-flex;
		align-self: flex-start;
		padding: 2px 8px;
		margin-bottom: 5px;
		border-radius: 999px;
		background: var(--rbm-date-bg);
		color: #ffffff;
		font-size: 10.5px;
		font-weight: 700;
		line-height: 1.25;
	}

	.rbm-yt-mobile--list .rbm-yt-title {
		margin: 0 !important;
		font-size: 14px;
		line-height: 1.32;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	/* Tryb Siatki -> pełne karty na mobile */
	.rbm-yt-mobile--cards .rbm-yt-body {
		padding: 16px 16px 18px;
	}

	.rbm-yt-mobile--cards .rbm-yt-play-btn {
		width: 46px;
		height: 46px;
	}

	.rbm-yt-btn {
		min-height: 38px;
		padding: 0 14px;
		font-size: 13px;
	}

	.rbm-yt-modal-overlay {
		padding: 12px;
	}

	.rbm-yt-modal-header {
		padding: 12px 14px;
	}

	.rbm-yt-modal-title {
		font-size: 14px;
	}
}