/* ==========================================================================
   RBM - KALENDARZ WYDARZEŃ (PALETA MAŁOPOLSKI + OBSŁUGA TRYBU CIEMNEGO)
   ========================================================================== */
.rbm-kal-wrapper,
.rbm-kal-wrapper *,
.rbm-kal-modal-overlay,
.rbm-kal-modal-overlay * {
	box-sizing: border-box;
}

.rbm-kal-wrapper {
	--rbm-kal-accent: #E5007E;
	--rbm-kal-badge-1: #009FE3;
	--rbm-kal-badge-2: #007AB8;
	--rbm-kal-header-title: #0b2545;
	--rbm-kal-header-icon: #009FE3;
	--rbm-kal-title: #0b2545;
	--rbm-kal-sub: #64748b;
	--rbm-kal-surface: #ffffff;
	--rbm-kal-surface-soft: #f8fafc;
	--rbm-kal-border: rgba(11, 37, 69, 0.1);
	--rbm-kal-shadow-sm: 0 4px 16px rgba(11, 37, 69, 0.08);
	--rbm-kal-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--rbm-kal-font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

	background: transparent;
	border: none;
	box-shadow: none;
	padding: 0;
	width: 100%;
	font-family: var(--rbm-kal-font-sans);
	color: var(--rbm-kal-title);
}

/* Opcjonalny tryb karty (spójny z kafelkami RBM - Posty) */
.rbm-kal-wrapper.rbm-kal-is-card {
	background: var(--rbm-kal-surface);
	border: 1px solid var(--rbm-kal-border);
	border-radius: 16px;
	box-shadow: var(--rbm-kal-shadow-sm);
	padding: 20px 22px;
}

/* ==========================================================================
   STAŁA WYSOKOŚĆ / DOPASOWANIE DO RAMKI OBOK (100% KONTENERA ELEMENTORA)
   ========================================================================== */
.rbm-kal-hmode-match {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.rbm-kal-hmode-match > .elementor-widget-container {
	height: 100%;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.rbm-kal-hmode-match .rbm-kal-wrapper {
	height: 100%;
	flex: 1 1 auto;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout {
	display: flex;
	flex-direction: column;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-header,
.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-month-nav,
.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-footer {
	flex-shrink: 0;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-months-container {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding-right: 4px;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 159, 227, 0.35) transparent;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-months-container::-webkit-scrollbar {
	width: 5px;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-months-container::-webkit-scrollbar-thumb {
	background: rgba(0, 159, 227, 0.35);
	border-radius: 999px;
}

.rbm-kal-wrapper.rbm-kal-fixed-layout .rbm-kal-footer {
	margin-top: auto;
	padding-top: 10px;
}

/* Automatyczny tryb ciemny (zsynchronizowany z przełącznikiem w RBM - Nagłówek) */
html.rbm-dark-mode .rbm-kal-wrapper,
html.rbm-dark-mode .rbm-kal-modal-overlay {
	--rbm-kal-header-title: #f1f5f9;
	--rbm-kal-title: #f1f5f9;
	--rbm-kal-sub: #94a3b8;
	--rbm-kal-surface: #132038;
	--rbm-kal-surface-soft: #1a2944;
	--rbm-kal-border: rgba(255, 255, 255, 0.12);
	--rbm-kal-shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   NAGŁÓWEK (PASEK MAGENTA ROZCIĄGAJĄCY SIĘ DO WYSOKOŚCI TYTUŁU + DATA POD SPODEM)
   ========================================================================== */
.rbm-kal-header {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.rbm-kal-title-row {
	display: flex;
	align-items: stretch;
	gap: 11px;
}

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

.rbm-kal-header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	color: var(--rbm-kal-header-icon, #009FE3);
	flex-shrink: 0;
}

.rbm-kal-header-title {
	margin: 0 !important;
	padding: 1px 0;
	font-family: var(--rbm-kal-font-serif);
	font-style: italic;
	font-weight: 600;
	font-size: clamp(21px, 2.2vw, 26px);
	color: var(--rbm-kal-header-title, #0b2545) !important;
	line-height: 1.2;
}

/* Bieżąca data po polsku pod tytułem */
.rbm-kal-current-date {
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--rbm-kal-sub);
	line-height: 1.3;
}

/* ==========================================================================
   PASEK NAWIGACJI MIESIĘCY: < Listopad 2026 >
   ========================================================================== */
.rbm-kal-month-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
	padding: 6px 8px;
	border-radius: 12px;
	background: var(--rbm-kal-surface-soft);
	border: 1px solid var(--rbm-kal-border);
}

.rbm-kal-month-label {
	font-size: 15px;
	font-weight: 700;
	color: var(--rbm-kal-title);
	text-align: center;
	user-select: none;
}

.rbm-kal-wrapper button.rbm-kal-nav-btn {
	appearance: none !important;
	-webkit-appearance: none !important;
	background: var(--rbm-kal-surface) !important;
	border: 1px solid var(--rbm-kal-border) !important;
	outline: none !important;
	box-shadow: none !important;
	color: var(--rbm-kal-title) !important;
	width: 34px !important;
	height: 34px !important;
	min-width: 34px !important;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 999px !important;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rbm-kal-wrapper button.rbm-kal-nav-btn:hover {
	background-color: var(--rbm-kal-accent) !important;
	border-color: var(--rbm-kal-accent) !important;
	color: #ffffff !important;
}

/* ==========================================================================
   PANELE I WIERSZE WYDARZEŃ
   ========================================================================== */
.rbm-kal-month-panel {
	display: none;
	flex-direction: column;
}

.rbm-kal-month-panel.is-active {
	display: flex;
	animation: rbmKalFadeIn 0.22s ease;
}

@keyframes rbmKalFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

.rbm-kal-event-row {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 12px 4px;
	border-bottom: 1px solid var(--rbm-kal-border);
	transition: background-color 0.18s ease;
}

.rbm-kal-month-panel .rbm-kal-event-row:last-child,
.rbm-kal-modal-events-list .rbm-kal-event-row:last-child {
	border-bottom: none;
}

/* Wyróżnienie wydarzenia trwającego dzisiaj */
.rbm-kal-event-row.is-today-event .rbm-kal-date-badge {
	background: linear-gradient(145deg, #f3168e 0%, var(--rbm-kal-accent, #E5007E) 100%);
	box-shadow: 0 5px 14px color-mix(in srgb, var(--rbm-kal-accent, #E5007E) 36%, transparent);
}

.rbm-kal-today-pill {
	display: inline-flex;
	align-items: center;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--rbm-kal-accent, #E5007E);
	color: #ffffff;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
}

/* Kafelek daty po lewej — Niebieski Małopolski */
.rbm-kal-date-badge {
	width: 58px;
	height: 58px;
	flex: 0 0 58px;
	border-radius: 13px;
	background: linear-gradient(145deg, var(--rbm-kal-badge-1, #009FE3) 0%, var(--rbm-kal-badge-2, #007AB8) 100%);
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px color-mix(in srgb, var(--rbm-kal-badge-1, #009FE3) 30%, transparent);
	text-align: center;
	line-height: 1;
	user-select: none;
}

.rbm-kal-day {
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 3px;
}

.rbm-kal-date-badge.is-range .rbm-kal-day {
	font-size: 15px;
}

.rbm-kal-mon {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.94;
}

/* Tekst wydarzenia po prawej */
.rbm-kal-event-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
}

.rbm-kal-event-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--rbm-kal-title);
	line-height: 1.32;
}

.rbm-kal-event-sub {
	font-size: 13px;
	font-weight: 500;
	color: var(--rbm-kal-sub);
	line-height: 1.4;
}

.rbm-kal-empty {
	margin: 10px 0 !important;
	font-size: 14px;
	color: var(--rbm-kal-sub);
}

/* ==========================================================================
   STOPKA WIDŻETU: "Zobacz pełny kalendarz →"
   ========================================================================== */
.rbm-kal-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
	padding-top: 6px;
}

.rbm-kal-wrapper button.rbm-kal-open-popup {
	appearance: none !important;
	-webkit-appearance: none !important;
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 4px 0 !important;
	margin: 0 !important;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--rbm-kal-font-sans);
	font-size: 14px;
	font-weight: 700;
	color: var(--rbm-kal-accent, #E5007E) !important;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

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

.rbm-kal-wrapper button.rbm-kal-open-popup:hover .rbm-kal-arrow {
	transform: translateX(4px);
}

/* ==========================================================================
   OKNO POP (MODAL PEŁNEGO KALENDARZA)
   ========================================================================== */
.rbm-kal-modal-overlay {
	--rbm-kal-accent: #E5007E;
	--rbm-kal-badge-1: #009FE3;
	--rbm-kal-badge-2: #007AB8;
	--rbm-kal-title: #0b2545;
	--rbm-kal-sub: #64748b;
	--rbm-kal-surface: #ffffff;
	--rbm-kal-surface-soft: #f8fafc;
	--rbm-kal-border: rgba(11, 37, 69, 0.1);

	position: fixed;
	inset: 0;
	background-color: rgba(8, 17, 36, 0.62);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 999999;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.rbm-kal-modal-box {
	background-color: var(--rbm-kal-surface);
	color: var(--rbm-kal-title);
	border: 1px solid var(--rbm-kal-border);
	width: 100%;
	max-width: 700px;
	max-height: 86vh;
	border-radius: 18px;
	box-shadow: 0 24px 56px rgba(6, 20, 44, 0.34);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rbm-kal-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 24px;
	background-color: var(--rbm-kal-surface-soft);
	border-bottom: 1px solid var(--rbm-kal-border);
}

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

.rbm-kal-modal-title-wrap h4 {
	margin: 0 !important;
	padding: 1px 0;
	font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
	font-style: italic;
	font-size: 22px;
	font-weight: 600;
	color: var(--rbm-kal-title);
	line-height: 1.2;
}

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

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

/* Filtry w oknie POP */
.rbm-kal-modal-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 24px;
	background-color: var(--rbm-kal-surface);
	border-bottom: 1px solid var(--rbm-kal-border);
}

button.rbm-kal-filter-btn {
	appearance: none !important;
	-webkit-appearance: none !important;
	background-color: var(--rbm-kal-surface-soft) !important;
	color: var(--rbm-kal-title) !important;
	border: 1px solid var(--rbm-kal-border) !important;
	border-radius: 999px !important;
	padding: 6px 14px !important;
	margin: 0 !important;
	font-family: inherit !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

button.rbm-kal-filter-btn:hover,
button.rbm-kal-filter-btn.is-active {
	background: linear-gradient(135deg, #f3168e 0%, var(--rbm-kal-accent, #E5007E) 100%) !important;
	border-color: transparent !important;
	color: #ffffff !important;
}

/* Przewijana zawartość modala */
.rbm-kal-modal-body {
	padding: 18px 24px 24px;
	overflow-y: auto;
	flex: 1;
}

.rbm-kal-modal-month-group {
	margin-bottom: 22px;
}

.rbm-kal-modal-month-group:last-child {
	margin-bottom: 0;
}

.rbm-kal-modal-month-heading {
	margin: 0 0 8px 0 !important;
	padding: 7px 13px;
	background-color: var(--rbm-kal-surface-soft);
	border-left: 4px solid var(--rbm-kal-badge-1, #009FE3);
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--rbm-kal-title);
}

.rbm-kal-full-date {
	font-weight: 700;
	color: var(--rbm-kal-badge-1, #009FE3);
}

.rbm-kal-modal-no-match {
	text-align: center;
	padding: 28px 16px;
	font-size: 14px;
	color: var(--rbm-kal-sub);
}

/* ==========================================================================
   RESPONSYWNOŚĆ (MOBILE)
   ========================================================================== */
@media (max-width: 767px) {
	.rbm-kal-wrapper.rbm-kal-is-card {
		padding: 16px;
	}

	.rbm-kal-hmode-match,
	.rbm-kal-hmode-match > .elementor-widget-container,
	.rbm-kal-hmode-match .rbm-kal-wrapper {
		height: auto;
	}

	.rbm-kal-header {
		margin-bottom: 14px;
	}

	.rbm-kal-title-row {
		gap: 9px;
	}

	.rbm-kal-accent-bar {
		min-height: 22px;
	}

	.rbm-kal-current-date {
		font-size: 12.5px;
	}

	.rbm-kal-event-row {
		gap: 12px;
		padding: 10px 2px;
	}

	.rbm-kal-date-badge {
		width: 52px;
		height: 52px;
		flex: 0 0 52px;
		border-radius: 11px;
	}

	.rbm-kal-day {
		font-size: 18px;
	}

	.rbm-kal-date-badge.is-range .rbm-kal-day {
		font-size: 13.5px;
	}

	.rbm-kal-mon {
		font-size: 10px;
	}

	.rbm-kal-event-title {
		font-size: 14px;
	}

	.rbm-kal-event-sub {
		font-size: 12.5px;
	}

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

	.rbm-kal-modal-box {
		max-height: 90dvh;
		border-radius: 14px;
	}

	.rbm-kal-modal-header {
		padding: 14px 16px;
	}

	.rbm-kal-modal-title-wrap h4 {
		font-size: 18px;
	}

	.rbm-kal-modal-filters {
		padding: 10px 16px;
		gap: 6px;
	}

	.rbm-kal-modal-body {
		padding: 14px 16px 18px;
	}
}