/* ============================================================
   Bilderkarussel — Frontend
   ============================================================ */

.tk-carousel {
	max-width: 100%;
	padding: 8px;
	user-select: none;
	-webkit-user-select: none;
	outline: none;
}

.tk-carousel:focus-visible {
	outline: 2px solid #007cba;
	outline-offset: 2px;
}

/* Stage — wraps image track + arrows + dots */
.tk-carousel__stage {
	position: relative;
	overflow: hidden;
}

/* Track — grid stacking so all images load */
.tk-carousel__track-container { overflow: hidden; }

.tk-carousel__track {
	display: grid;
}

/* Slides — all stacked, fade via opacity */
.tk-carousel__slide {
	grid-column: 1;
	grid-row: 1;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.45s ease;
}

.tk-carousel__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

/* Figure */
.tk-carousel__figure {
	margin: 0;
	padding: 0;
	line-height: 0;
}

.tk-carousel__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 80vh;
	object-fit: cover;
	cursor: zoom-in;
}

/* ── Arrows ─────────────────────────────────────────────── */
.tk-carousel__prev,
.tk-carousel__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.18);
	color: rgba(255, 255, 255, 0.75);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
}

.tk-carousel__prev { left:  10px; }
.tk-carousel__next { right: 10px; }

.tk-carousel__prev:hover,
.tk-carousel__next:hover {
	background: rgba(0, 0, 0, 0.38);
	color: #fff;
}

.tk-carousel__prev:focus-visible,
.tk-carousel__next:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
}

/* ── Dots — im Bild, grau ────────────────────────────────── */
.tk-carousel__dots {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	z-index: 10;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 7px;
	padding: 0;
	pointer-events: none;
}

.tk-carousel__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 2px solid rgba(180, 180, 180, 0.75);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	pointer-events: all;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
	-webkit-appearance: none;
}

.tk-carousel__dot.is-active {
	background: rgba(180, 180, 180, 0.85);
	border-color: rgba(180, 180, 180, 0.85);
	transform: scale(1.3);
}

.tk-carousel__dot:hover:not(.is-active) {
	background: rgba(180, 180, 180, 0.35);
}

.tk-carousel__dot:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 3px;
}

/* ── Captions — unterhalb des Bildes ────────────────────── */
.tk-carousel__captions {
	min-height: 1.5em;
	padding: 0 2px;
}

.tk-carousel__caption {
	display: none;
	margin: 0;
	padding: 0.5em 0.25em;
	font-size: 0.875rem;
	line-height: 1.5;
	color: inherit;
	user-select: text;
	-webkit-user-select: text;
}

.tk-carousel__caption.is-active {
	display: block;
}

/* ── Lightbox ────────────────────────────────────────────── */
.tk-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tk-lb[hidden] { display: none; }

.tk-lb__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: zoom-out;
}

.tk-lb__inner {
	position: relative;
	z-index: 1;
	max-width: min(92vw, 1200px);
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.tk-lb__img {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 3px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.tk-lb__caption {
	margin: 0.6em 0 0;
	font-size: 0.875rem;
	color: rgba(220, 220, 220, 0.85);
	text-align: center;
	max-width: 60ch;
	user-select: text;
}

.tk-lb__close {
	position: fixed;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.75);
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	padding: 4px 8px;
	transition: color 0.15s ease;
	-webkit-appearance: none;
}

.tk-lb__close:hover { color: #fff; }

.tk-lb__prev,
.tk-lb__next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.3);
	border: none;
	color: rgba(255, 255, 255, 0.8);
	font-size: 2.5rem;
	line-height: 1;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	transition: background 0.2s ease;
	-webkit-appearance: none;
}

.tk-lb__prev { left:  16px; }
.tk-lb__next { right: 16px; }

.tk-lb__prev:hover,
.tk-lb__next:hover { background: rgba(0, 0, 0, 0.55); color: #fff; }

@media (max-width: 600px) {
	.tk-lb__prev { left:  6px; }
	.tk-lb__next { right: 6px; }
}

/* ── Block alignment ─────────────────────────────────────── */
.alignwide  > .tk-carousel,
.tk-carousel.alignwide {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

.alignfull > .tk-carousel,
.tk-carousel.alignfull {
	max-width: 100vw;
}
