/* ==========================================================================
   WSPÓLNE ZMIENNE SERII RBM (Spójne z RBM - Nagłówek + Tryb ciemny)
   ========================================================================== */
: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);
}

/* ==========================================================================
   BAZA WIDŻETU RBM - POSTY
   ========================================================================== */
.rbm-posts,
.rbm-posts * {
	box-sizing: border-box;
}

.rbm-posts {
	--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);
}

.rbm-posts .rbm-hide-on-desktop {
	display: none !important;
}

/* ==========================================================================
   NAGŁÓWEK SEKCJI ("| Co słychać w Buczu?" + "Wszystkie wiadomości →")
   ========================================================================== */
.rbm-posts-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

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

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

.rbm-posts-sec-title {
	margin: 0 !important;
	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-posts-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-posts-all-link:hover {
	color: var(--rbm-accent);
}

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

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

/* Informacja o frazie wyszukiwania */
.rbm-posts-search-bar {
	margin-bottom: 20px;
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-left: 4px solid var(--rbm-blue);
	font-size: 14px;
	color: var(--rbm-text);
	box-shadow: var(--rbm-shadow-sm);
}

.rbm-posts-editor-note {
	margin-bottom: 18px;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(0, 159, 227, 0.1);
	border: 1px dashed var(--rbm-blue);
	font-size: 12.5px;
	color: var(--rbm-navy);
}

/* ==========================================================================
   WSPÓLNE STYLE KAFELKÓW (ZDJĘCIE, NIEBIESKA DATA, KOMENTARZE, TREŚĆ)
   ========================================================================== */
.rbm-post-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;
	transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
	height: 100%;
}

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

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

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

.rbm-post-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);
}

.rbm-post-card:hover .rbm-post-thumb img,
.rbm-post-list-item:hover .rbm-post-list-thumb img {
	transform: scale(1.05);
}

.rbm-post-thumb-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(229, 0, 126, 0.14) 0%, rgba(0, 159, 227, 0.18) 100%);
	color: var(--rbm-accent);
}

.rbm-post-thumb-placeholder svg {
	width: 40px;
	height: 40px;
	opacity: 0.72;
}

/* Pigułka daty na zdjęciu — domyślnie niebieska (#009FE3) */
.rbm-post-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);
}

/* Plakietka komentarzy na zdjęciu (prawy górny róg) */
.rbm-post-comments-badge {
	position: absolute;
	top: 13px;
	right: 13px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(11, 37, 69, 0.74);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.24);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.rbm-post-comments-badge svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

.rbm-post-comments-badge.has-comments {
	background: color-mix(in srgb, var(--rbm-accent) 90%, transparent);
	border-color: rgba(255, 255, 255, 0.32);
}

.rbm-post-card:hover .rbm-post-comments-badge,
.rbm-post-list-item:hover .rbm-post-comments-badge {
	transform: scale(1.05);
}

.rbm-post-comments-badge.is-compact {
	top: 6px;
	right: 6px;
	padding: 3px 7px;
	font-size: 10.5px;
	gap: 3px;
}

.rbm-post-comments-badge.is-compact svg {
	width: 10px;
	height: 10px;
}

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

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

.rbm-post-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-post-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

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

.rbm-post-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-post-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-post-readmore:hover {
	color: var(--rbm-accent-hover);
}

/* ==========================================================================
   TRYB 1: STRONA GŁÓWNA — PRAWA LISTA IDEALNIE RÓWNO Z LEWĄ KARTĄ
   ========================================================================== */
.rbm-posts-mag-top {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 22px;
	align-items: stretch;
}

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

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

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

.rbm-posts-mag-featured .rbm-post-card--featured .rbm-post-thumb {
	aspect-ratio: 16 / 10;
}

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

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

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

/* Prawa kolumna: równe kafelki wypełniające dokładnie wysokość lewej wiadomości */
.rbm-posts-mag-side-list {
	display: flex;
	flex-direction: column;
	gap: var(--rbm-side-gap, 12px);
	min-height: 0;
}

.rbm-post-list-item {
	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-posts-mag-side-list .rbm-post-list-item {
	flex: 1 1 0;
	min-height: 92px;
	display: flex;
}

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

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

/* Obrazek wypełnia 100% wysokości poziomego kafelka (zero pustych pasów) */
.rbm-post-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-post-list-thumb img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

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

.rbm-post-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-post-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-post-list-item:hover .rbm-post-list-title {
	color: var(--rbm-accent);
}

/* ==========================================================================
   TRYB 2: AKTUALNOŚCI I WYSZUKIWANIE (PEŁNE KAFELKI + PAGINACJA)
   ========================================================================== */
.rbm-posts-archive-grid {
	display: grid;
	grid-template-columns: repeat(var(--rbm-archive-cols, 3), minmax(0, 1fr));
	gap: 24px;
}

.rbm-posts-pagination {
	margin-top: 34px;
	display: flex;
	justify-content: center;
}

.rbm-posts-pagination ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.rbm-posts-pagination li {
	margin: 0 !important;
	padding: 0 !important;
}

.rbm-posts-pagination a.page-numbers,
.rbm-posts-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 42px;
	height: 42px;
	padding: 0 15px;
	border-radius: 999px;
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	color: var(--rbm-navy);
	text-decoration: none;
	font-size: 14px;
	font-weight: 700;
	box-shadow: var(--rbm-shadow-sm);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.rbm-posts-pagination a.page-numbers:hover {
	border-color: var(--rbm-accent);
	color: var(--rbm-accent);
	transform: translateY(-1px);
}

.rbm-posts-pagination span.page-numbers.current {
	background: linear-gradient(135deg, #f3168e 0%, var(--rbm-accent) 100%);
	border-color: transparent;
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(229, 0, 126, 0.34);
}

.rbm-posts-pagination span.page-numbers.dots {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	min-width: 28px;
	padding: 0 4px;
	color: var(--rbm-muted);
}

/* ==========================================================================
   KOMUNIKAT „NIC TUTAJ NIE ZNALEZIONO”
   ========================================================================== */
.rbm-posts-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 46px 28px;
	border-radius: var(--rbm-card-radius);
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	box-shadow: var(--rbm-shadow-sm);
}

.rbm-posts-empty-icon {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, rgba(229, 0, 126, 0.12) 0%, rgba(0, 159, 227, 0.16) 100%);
	color: var(--rbm-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}

.rbm-posts-empty-icon svg {
	width: 28px;
	height: 28px;
}

.rbm-posts-empty-title {
	margin: 0 0 8px !important;
	font-family: var(--rbm-font-serif);
	font-style: italic;
	font-size: 26px;
	font-weight: 600;
	color: var(--rbm-navy);
}

.rbm-posts-empty-phrase {
	margin: 0 0 10px !important;
	font-size: 14px;
	font-weight: 700;
	color: var(--rbm-blue);
}

.rbm-posts-empty-desc {
	margin: 0 0 22px !important;
	max-width: 520px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--rbm-muted);
}

.rbm-posts-empty-search {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 360px;
	margin-bottom: 18px;
	background: var(--rbm-surface-soft);
	border: 1px solid var(--rbm-border);
	border-radius: 12px;
	overflow: hidden;
}

.rbm-posts-empty-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: none !important;
	background: transparent !important;
	padding: 11px 14px !important;
	font-family: var(--rbm-font-sans);
	font-size: 14px;
	color: var(--rbm-navy);
	outline: none !important;
	box-shadow: none !important;
}

.rbm-posts .rbm-posts-empty-search button {
	appearance: none !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 10px !important;
	background: var(--rbm-accent) !important;
	color: #ffffff !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.rbm-posts .rbm-posts-empty-search button svg {
	width: 18px;
	height: 18px;
}

.rbm-posts-empty-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: 999px;
	background: linear-gradient(135deg, #f3168e 0%, var(--rbm-accent) 100%);
	color: #ffffff !important;
	text-decoration: none;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(229, 0, 126, 0.3);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rbm-posts-empty-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(229, 0, 126, 0.4);
}

/* ==========================================================================
   RESPONSYWNOŚĆ (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
	.rbm-posts-mag-top {
		grid-template-columns: 1fr;
		gap: 18px;
		align-items: start;
	}

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

	.rbm-posts-mag-side-list .rbm-post-list-item {
		flex: none;
		min-height: 0 !important;
		height: auto !important;
		display: block;
	}

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

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

	.rbm-posts-archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}
}

@media (max-width: 767px) {
	.rbm-posts .rbm-hide-on-desktop {
		display: block !important;
	}

	.rbm-posts .rbm-hide-on-mobile {
		display: none !important;
	}

	.rbm-posts-header {
		flex-wrap: wrap;
		gap: 10px;
		margin-bottom: 16px;
	}

	.rbm-posts-accent-bar {
		height: 26px;
	}

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

	/* Tryb Główny na mobile: 1 większa pierwsza wiadomość + zwarta lista poniżej */
	.rbm-posts-mag-top {
		gap: 14px;
	}

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

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

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

	.rbm-post-list-link {
		padding: 8px 10px 8px 8px;
		gap: 12px;
		align-items: center;
	}

	.rbm-post-list-thumb {
		width: 104px;
		min-width: 104px;
		height: 76px;
		min-height: 76px;
		border-radius: 10px;
	}

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

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

	/* Tryb Aktualności / Wyszukiwanie na mobile: taka sama zwarta lista */
	.rbm-posts-archive-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.rbm-posts-archive-grid .rbm-post-card {
		flex-direction: row;
		align-items: center;
		padding: 8px 10px 8px 8px;
		gap: 12px;
		border-radius: 14px;
		height: auto !important;
	}

	.rbm-posts-archive-grid .rbm-post-thumb-link {
		width: 104px;
		min-width: 104px;
	}

	.rbm-posts-archive-grid .rbm-post-thumb {
		width: 104px;
		height: 76px;
		aspect-ratio: auto;
		border-radius: 10px;
	}

	.rbm-posts-archive-grid .rbm-post-date-pill,
	.rbm-posts-archive-grid .rbm-post-excerpt,
	.rbm-posts-archive-grid .rbm-post-readmore {
		display: none !important;
	}

	.rbm-posts-archive-grid .rbm-post-comments-badge {
		top: 6px;
		right: 6px;
		padding: 3px 6px;
		font-size: 10.5px;
		gap: 3px;
	}

	.rbm-posts-archive-grid .rbm-post-comments-badge svg {
		width: 10px;
		height: 10px;
	}

	.rbm-posts-archive-grid .rbm-post-body {
		padding: 2px 0;
		justify-content: center;
		min-width: 0;
	}

	.rbm-posts-archive-grid .rbm-post-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-posts-archive-grid .rbm-post-title {
		margin: 0 !important;
		font-size: 14px;
		line-height: 1.32;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.rbm-posts-pagination a.page-numbers,
	.rbm-posts-pagination span.page-numbers {
		min-width: 38px;
		height: 38px;
		padding: 0 12px;
		font-size: 13px;
	}
}