/**
 * BSI PDF Slider – Frontend-Styles
 * Alle Farben/Abstände als CSS-Variablen: im Theme einfach überschreibbar.
 */

.bsips {
	--bsips-cols: 3;
	--bsips-gap: 24px;
	--bsips-radius: 16px;
	--bsips-bg: #ffffff;
	--bsips-border: rgba(15, 23, 42, 0.08);
	--bsips-text: #0f172a;
	--bsips-muted: #64748b;
	--bsips-accent: #b8860b;
	--bsips-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	--bsips-shadow-hover: 0 14px 40px rgba(15, 23, 42, 0.16);

	position: relative;
	margin: 0 0 2rem;
}

.bsips--cols-1 { --bsips-cols: 1; }
.bsips--cols-2 { --bsips-cols: 2; }
.bsips--cols-3 { --bsips-cols: 3; }
.bsips--cols-4 { --bsips-cols: 4; }
.bsips--cols-5 { --bsips-cols: 5; }

.bsips__viewport {
	overflow: hidden;
	padding: 4px;
	margin: -4px;
	cursor: grab;
}

.bsips__viewport:active {
	cursor: grabbing;
}

.bsips__track {
	display: flex;
	gap: var(--bsips-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.bsips__slide {
	flex: 0 0 calc((100% - (var(--bsips-cols) - 1) * var(--bsips-gap)) / var(--bsips-cols));
	max-width: calc((100% - (var(--bsips-cols) - 1) * var(--bsips-gap)) / var(--bsips-cols));
	margin: 0;
	padding: 0;
	list-style: none;
}

.bsips__card {
	height: 100%;
	background: var(--bsips-bg);
	border: 1px solid var(--bsips-border);
	border-radius: var(--bsips-radius);
	box-shadow: var(--bsips-shadow);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bsips__card:hover {
	transform: translateY(-4px);
	box-shadow: var(--bsips-shadow-hover);
}

.bsips__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: var(--bsips-text);
	text-decoration: none;
	box-shadow: none;
}

.bsips__link:focus-visible {
	outline: 2px solid var(--bsips-accent);
	outline-offset: 3px;
}

.bsips__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1.414;
	background: #f1f5f9;
	overflow: hidden;
}

.bsips__img,
.bsips__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	display: block;
	transition: transform 0.4s ease;
}

.bsips__canvas {
	height: auto;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bsips__canvas.is-rendered {
	opacity: 1;
}

.bsips__card:hover .bsips__img {
	transform: scale(1.03);
}

.bsips__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
}

.bsips__placeholder svg {
	width: 56px;
	height: 56px;
}

.bsips__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #fff;
	background: var(--bsips-accent);
	border-radius: 999px;
	z-index: 2;
}

.bsips__body {
	display: block;
	padding: 16px 18px 20px;
}

.bsips__title {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--bsips-text);
	overflow-wrap: anywhere;
}

.bsips__meta {
	display: block;
	margin-top: 6px;
	font-size: 0.8125rem;
	color: var(--bsips-muted);
}

/* Pfeile ---------------------------------------------------------------- */

.bsips__arrow {
	position: absolute;
	top: calc(50% - 40px);
	transform: translateY(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--bsips-text);
	background: var(--bsips-bg);
	border: 1px solid var(--bsips-border);
	border-radius: 50%;
	box-shadow: var(--bsips-shadow);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.bsips__arrow svg {
	width: 22px;
	height: 22px;
}

.bsips__arrow:hover:not(:disabled) {
	background: var(--bsips-accent);
	color: #fff;
}

.bsips__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.bsips__arrow--prev { left: -18px; }
.bsips__arrow--next { right: -18px; }

.bsips.is-static .bsips__arrow,
.bsips.is-static .bsips__dots {
	display: none;
}

/* Punkte ---------------------------------------------------------------- */

.bsips__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.bsips__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #cbd5e1;
	cursor: pointer;
	transition: width 0.25s ease, background 0.25s ease;
}

.bsips__dot.is-active {
	width: 26px;
	background: var(--bsips-accent);
}

/* Lightbox -------------------------------------------------------------- */

.bsips-noscroll {
	overflow: hidden;
}

.bsips-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 3vh 2vw;
}

.bsips-lightbox.is-open {
	display: flex;
}

.bsips-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.82);
	backdrop-filter: blur(4px);
}

.bsips-lightbox__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1100px, 96vw);
	height: min(92vh, 1400px);
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.bsips-lightbox__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
	background: #0f172a;
	color: #fff;
}

.bsips-lightbox__title {
	font-size: 0.95rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bsips-lightbox__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.bsips-lightbox__btn {
	padding: 7px 12px;
	font-size: 0.8125rem;
	color: #fff;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	transition: background 0.2s ease;
}

.bsips-lightbox__btn:hover {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}

.bsips-lightbox__close {
	width: 34px;
	height: 34px;
	font-size: 24px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.bsips-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.18);
}

.bsips-lightbox__frame {
	flex: 1;
	background: #525659;
}

.bsips-lightbox__frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Hinweis für Redakteure ------------------------------------------------ */

.bsips-notice-empty {
	padding: 14px 16px;
	color: #92400e;
	background: #fef3c7;
	border: 1px dashed #f59e0b;
	border-radius: 10px;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1024px) {
	.bsips--cols-3,
	.bsips--cols-4,
	.bsips--cols-5 { --bsips-cols: 2; }

	.bsips__arrow--prev { left: 4px; }
	.bsips__arrow--next { right: 4px; }
}

@media (max-width: 640px) {
	.bsips {
		--bsips-cols: 1;
		--bsips-gap: 16px;
	}

	.bsips--cols-2,
	.bsips--cols-3,
	.bsips--cols-4,
	.bsips--cols-5 { --bsips-cols: 1; }

	.bsips-lightbox {
		padding: 0;
	}

	.bsips-lightbox__panel {
		width: 100vw;
		height: 100vh;
		border-radius: 0;
	}

	.bsips-lightbox__title {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bsips__track,
	.bsips__card,
	.bsips__img {
		transition: none;
	}
}
