/* ==========================================================================
   RBM - MINI GALERIA (KARUZELA ZDJĘĆ JAK NA GRAFICE + LIGHTBOX + DARK MODE)
   ========================================================================== */
.rbm-mgal,
.rbm-mgal *,
.rbm-mgal-lightbox,
.rbm-mgal-lightbox * {
	box-sizing: border-box;
}

.rbm-mgal {
	--rbm-accent: #E5007E;
	--rbm-mgal-photo-radius: 14px;
	--rbm-mgal-gap: 14px;
	--rbm-navy: #0b2545;
	--rbm-muted: #64748b;
	--rbm-surface: #ffffff;
	--rbm-surface-soft: #f8fafc;
	--rbm-border: rgba(11, 37, 69, 0.09);
	--rbm-shadow-sm: 0 6px 24px rgba(11, 37, 69, 0.08);
	--rbm-shadow: 0 12px 30px rgba(11, 37, 69, 0.14);
	--rbm-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--rbm-font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

	width: 100%;
	font-family: var(--rbm-font-sans);
	color: var(--rbm-navy);
}

html.rbm-dark-mode .rbm-mgal {
	--rbm-navy: #f1f5f9;
	--rbm-muted: #94a3b8;
	--rbm-surface: #132038;
	--rbm-surface-soft: #1a2944;
	--rbm-border: rgba(255, 255, 255, 0.12);
	--rbm-shadow-sm: 0 8px 26px rgba(0, 0, 0, 0.36);
	--rbm-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

/* Zewnętrzna biała karta jak na grafice mala galeria.png */
.rbm-mgal.is-card {
	background: var(--rbm-surface);
	border: 1px solid var(--rbm-border);
	border-radius: 18px;
	box-shadow: var(--rbm-shadow-sm);
	padding: 20px 22px 22px;
}

/* Nagłówek ("| Galeria zdjęć" + "Zobacz więcej zdjęć →" + strzałki) */
.rbm-mgal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

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

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

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

.rbm-mgal-header-right {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.rbm-mgal-more-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--rbm-navy);
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.rbm-mgal-more-link:hover {
	color: var(--rbm-accent);
}

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

.rbm-mgal-more-link:hover .rbm-mgal-arrow {
	transform: translateX(4px);
}

/* Przyciski strzałek przewijania */
.rbm-mgal-nav {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.rbm-mgal button.rbm-mgal-nav-btn {
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 34px !important;
	height: 34px !important;
	min-width: 34px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	border: 1px solid var(--rbm-border) !important;
	background: var(--rbm-surface-soft) !important;
	color: var(--rbm-navy) !important;
	font-size: 20px !important;
	line-height: 1 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

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

.rbm-mgal button.rbm-mgal-nav-btn:disabled {
	opacity: 0.32;
	cursor: default;
}

/* Przewijany pasek fotografii */
.rbm-mgal-viewport {
	position: relative;
	width: 100%;
}

.rbm-mgal-track {
	display: flex;
	gap: var(--rbm-mgal-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding: 2px 1px 6px;
	scrollbar-width: none;
}

.rbm-mgal-track::-webkit-scrollbar {
	display: none;
}

.rbm-mgal-slide {
	position: relative;
	flex: 0 0 calc((100% - (var(--rbm-mgal-cols, 4) - 1) * var(--rbm-mgal-gap)) / var(--rbm-mgal-cols, 4));
	aspect-ratio: 5 / 4;
	border-radius: var(--rbm-mgal-photo-radius);
	overflow: hidden;
	scroll-snap-align: start;
	background: var(--rbm-surface-soft);
	border: 1px solid var(--rbm-border);
	box-shadow: 0 4px 14px rgba(11, 37, 69, 0.08);
	text-decoration: none;
	display: block;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.rbm-mgal-slide:hover {
	transform: translateY(-3px);
	box-shadow: var(--rbm-shadow);
	border-color: color-mix(in srgb, var(--rbm-accent) 36%, transparent);
}

.rbm-mgal-slide 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-mgal-slide:hover img {
	transform: scale(1.06);
	filter: brightness(0.88);
}

.rbm-mgal-zoom {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.82);
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(11, 37, 69, 0.72);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border: 1.5px solid rgba(255, 255, 255, 0.85);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.22s ease;
}

.rbm-mgal-zoom svg {
	width: 19px;
	height: 19px;
}

.rbm-mgal-slide:hover .rbm-mgal-zoom {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
	background: var(--rbm-accent);
}

.rbm-mgal-empty {
	padding: 20px;
	text-align: center;
	color: var(--rbm-muted);
	font-size: 14px;
	border: 1px dashed var(--rbm-border);
	border-radius: 12px;
}

/* ==========================================================================
   WBUDOWANY LIGHTBOX RBM (ZERO ZEWNĘTRZNYCH ZALEŻNOŚCI)
   ========================================================================== */
.rbm-mgal-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(8, 15, 32, 0.88);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.rbm-mgal-lightbox.is-open {
	display: flex;
}

.rbm-mgal-lb-stage {
	position: relative;
	max-width: min(1100px, 92vw);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.rbm-mgal-lb-stage img {
	max-width: 100%;
	max-height: 76vh;
	border-radius: 14px;
	border: 3px solid rgba(255, 255, 255, 0.92);
	box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
	display: block;
	object-fit: contain;
}

.rbm-mgal-lb-meta {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	color: #f1f5f9;
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
}

.rbm-mgal-lb-counter {
	padding: 3px 10px;
	border-radius: 999px;
	background: #E5007E;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

button.rbm-mgal-lb-close,
button.rbm-mgal-lb-arrow {
	appearance: none !important;
	-webkit-appearance: none !important;
	position: fixed;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	background: rgba(11, 19, 36, 0.72) !important;
	color: #ffffff !important;
	font-size: 24px !important;
	line-height: 1 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

button.rbm-mgal-lb-close:hover,
button.rbm-mgal-lb-arrow:hover {
	background: #E5007E !important;
	border-color: #E5007E !important;
}

button.rbm-mgal-lb-close { top: 20px; right: 20px; }
button.rbm-mgal-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
button.rbm-mgal-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Responsywność */
@media (max-width: 1024px) {
	.rbm-mgal-slide {
		flex: 0 0 calc((100% - 2 * var(--rbm-mgal-gap)) / 3);
	}
}

@media (max-width: 767px) {
	.rbm-mgal.is-card {
		padding: 15px 14px 16px;
		border-radius: 15px;
	}

	.rbm-mgal-header {
		flex-wrap: wrap;
		gap: 10px;
		margin-bottom: 14px;
	}

	.rbm-mgal-header-right {
		width: 100%;
		justify-content: space-between;
	}

	.rbm-mgal-more-link {
		font-size: 13px;
	}

	/* Na telefonach ~2.15 zdjęcia w rzędzie — naturalnie widać, że można przesuwać palcem */
	.rbm-mgal-slide {
		flex: 0 0 46%;
	}

	button.rbm-mgal-lb-prev { left: 10px; }
	button.rbm-mgal-lb-next { right: 10px; }
}