/* Alles unter .wbk-cal gescoped. Defensive Resets, damit Theme- und Builder-Styles nicht durchschlagen. */
.wbk-cal,
.wbk-cal *,
.wbk-cal *::before,
.wbk-cal *::after {
	box-sizing: border-box;
}

.wbk-cal {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	font-family: inherit;
	line-height: 1.45;
	text-align: left;
}

.wbk-cal .wbk-headline {
	margin: 0 0 .5em;
	padding: 0;
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	line-height: 1.15;
	color: inherit;
}

.wbk-cal .wbk-intro,
.wbk-cal .wbk-footer {
	margin: 0 0 1.25em;
	color: inherit;
}

.wbk-cal .wbk-footer {
	margin: 1.25em 0 0;
	font-size: .85em;
	opacity: .85;
}

.wbk-cal .wbk-intro p,
.wbk-cal .wbk-footer p {
	margin: 0 0 .75em;
	padding: 0;
	color: inherit;
}

.wbk-cal .wbk-preview {
	margin: 0 0 12px;
	padding: 8px 12px;
	background: #fff3cd;
	color: #3b2f00;
	border: 1px solid #e0c36b;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
}

/* Grid */
.wbk-cal .wbk-gridwrap {
	position: relative;
	padding: var(--wbk-p);
	--wbk-p: var(--wbk-pad, 24px);
	background-color: var(--wbk-bg, #7a0d12);
	background-image: var(--wbk-bg-img, none);
	background-size: cover;
	background-position: center;
}

.wbk-cal .wbk-gridbox {
	container-type: inline-size;
}

.wbk-cal .wbk-grid {
	--wbk-c: var(--wbk-cols);
	--wbk-g: var(--wbk-gap);
	--wbk-cell: calc((100cqw - (var(--wbk-c) - 1) * var(--wbk-g)) / var(--wbk-c));
	display: grid;
	gap: var(--wbk-g);
	grid-template-columns: repeat(var(--wbk-c), minmax(0, 1fr));
	grid-template-rows: repeat(var(--wbk-rows), var(--wbk-cell));
	margin: 0;
	padding: 0;
}

.wbk-cal .wbk-tile {
	position: relative;
	min-width: 0;
	min-height: 0;
	grid-column: var(--wbk-x) / span var(--wbk-w);
	grid-row: var(--wbk-y) / span var(--wbk-h);
	perspective: 900px;
}

.wbk-cal .wbk-tile__inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform .6s ease;
}

.wbk-cal .wbk-tile.is-flipped .wbk-tile__inner {
	transform: rotateY(180deg);
}

.wbk-cal .wbk-tile__front,
.wbk-cal .wbk-tile__back {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 2px var(--wbk-border, dotted) currentColor;
	border-radius: var(--wbk-radius, 10px);
	color: var(--wbk-tile-color, #fff);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.wbk-cal .wbk-tile__front {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	background-color: var(--wbk-tile-bg, transparent);
	background-image: var(--wbk-tile-img, none);
	background-size: cover;
	background-position: center;
	font: inherit;
	font-size: min(var(--wbk-font, 28px), calc(var(--wbk-cell) * .5));
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
}

.wbk-cal .wbk-tile__front:hover {
	background-color: var(--wbk-tile-bg, transparent);
	color: var(--wbk-tile-color, #fff);
	filter: brightness(1.15);
}

.wbk-cal .wbk-tile__front:focus-visible,
.wbk-cal .wbk-close:focus-visible,
.wbk-cal .wbk-btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.wbk-cal .wbk-tile__label {
	display: block;
	color: inherit;
}

.wbk-cal .wbk-tile[data-status="today"] .wbk-tile__front {
	outline: 3px solid var(--wbk-tile-color, #fff);
	outline-offset: 2px;
}

.wbk-cal .wbk-tile[data-status="locked"] .wbk-tile__front,
.wbk-cal .wbk-tile[data-status="expired"] .wbk-tile__front {
	cursor: not-allowed;
}

.wbk-cal .wbk-tile[data-status="locked"] .wbk-tile__front:hover,
.wbk-cal .wbk-tile[data-status="expired"] .wbk-tile__front:hover {
	filter: none;
}

.wbk-cal .wbk-testmode {
	margin: 0 0 12px;
	padding: 8px 12px;
	background: #fff3cd;
	color: #3b2f00;
	border: 1px solid #e0c36b;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
}

/* Geöffnet-Markierung */
.wbk-cal[data-opened-style="dim"] .wbk-tile.is-opened .wbk-tile__label {
	opacity: .5;
}

.wbk-cal[data-opened-style="dim"] .wbk-tile.is-opened .wbk-tile__front {
	border-color: color-mix(in srgb, currentColor 45%, transparent);
}

.wbk-cal[data-opened-style="filled"] .wbk-tile.is-opened .wbk-tile__front {
	background-color: rgba(255, 255, 255, .22);
}

.wbk-cal[data-opened-style="check"] .wbk-tile.is-opened .wbk-tile__front::after {
	content: "\2713";
	position: absolute;
	right: 8px;
	bottom: 4px;
	font-size: 16px;
	line-height: 1;
}

/* Rückseite in der Kachel */
.wbk-cal .wbk-tile__back {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 32px 14px 14px;
	/* Farbe, Preset-Muster oder Bild: alles kommt als Variablen von der Kachel, ohne Angabe gilt die deckende Kachelfarbe. */
	background-color: var(--wbk-back-bg, #7a0d12);
	background-image: var(--wbk-b-img, none);
	background-size: var(--wbk-b-size, cover);
	background-repeat: var(--wbk-b-repeat, no-repeat);
	background-position: var(--wbk-b-pos, center);
	color: var(--wbk-back-color, var(--wbk-tile-color, #fff));
	transform: rotateY(180deg);
	overflow: auto;
	font-size: clamp(13px, calc(var(--wbk-cell) * .13), 18px);
	text-align: center;
}

/* auto-Margins zentrieren, ohne bei Überlauf den oberen Rand abzuschneiden */
.wbk-cal .wbk-tile__back .wbk-tile__content {
	margin: auto 0;
	max-width: 100%;
}

.wbk-cal .wbk-tile__content {
	color: inherit;
}

.wbk-cal .wbk-tile__content p {
	margin: 0 0 .6em;
	padding: 0;
	color: inherit;
	font-size: inherit;
}

.wbk-cal .wbk-tile__content ul,
.wbk-cal .wbk-tile__content ol {
	display: inline-block;
	margin: 0 0 .6em 1.2em;
	padding: 0;
	color: inherit;
	text-align: left;
}

.wbk-cal .wbk-tile__content a {
	color: inherit;
	text-decoration: underline;
}

.wbk-cal .wbk-tile__content img {
	display: block;
	/* Halbe Breite lässt auf der Rückseite Platz für den Text, ohne dass die Kachel scrollen muss. */
	max-width: 50%;
	height: auto;
	margin: 0 auto .6em;
	border-radius: 4px;
}

.wbk-cal .wbk-btn {
	display: inline-block;
	padding: .45em .9em;
	border: 2px solid currentColor;
	border-radius: 6px;
	color: inherit;
	font-weight: 700;
	text-decoration: none;
}

.wbk-cal .wbk-btn:hover {
	background: rgba(255, 255, 255, .15);
	color: inherit;
}

.wbk-cal .wbk-close {
	appearance: none;
	position: absolute;
	top: 4px;
	right: 6px;
	z-index: 2;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 22px;
	line-height: 26px;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
}

.wbk-cal .wbk-tile__back .wbk-close {
	color: var(--wbk-back-color, var(--wbk-tile-color, #fff));
}

/* Text auf einem Foto bekommt einen weichen Schatten, weil sich der Kontrast nicht voraussagen lässt. */
.wbk-cal .wbk-tile__back[data-back-type="image"] .wbk-tile__content,
.wbk-cal .wbk-overlay[data-back-type="image"] .wbk-tile__content {
	text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

/* Rückseite über dem ganzen Grid */
.wbk-cal .wbk-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	padding: 48px 24px 24px;
	overflow: auto;
	background: inherit;
	color: var(--wbk-tile-color, #fff);
	font-size: clamp(15px, 2.2vw, 20px);
	text-align: center;
}

.wbk-cal .wbk-overlay[hidden] {
	display: none;
}

.wbk-cal .wbk-overlay .wbk-close {
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	font-size: 30px;
	line-height: 34px;
	color: var(--wbk-tile-color, #fff);
}

.wbk-cal .wbk-overlay .wbk-tile__content {
	max-width: 560px;
	margin: 0 auto;
	padding: 24px;
	background: rgba(0, 0, 0, .55);
	border-radius: 14px;
	text-align: center;
}

.wbk-cal .wbk-overlay .wbk-tile__content img {
	margin-left: auto;
	margin-right: auto;
}

/* Gestaltete Rückseite: Das Panel ist deckend und trägt den gewählten Hintergrund. */
.wbk-cal .wbk-overlay[data-back-type] .wbk-tile__content {
	background-color: var(--wbk-back-bg, #7a0d12);
	background-image: var(--wbk-b-img, none);
	background-size: var(--wbk-b-size, cover);
	background-repeat: var(--wbk-b-repeat, no-repeat);
	background-position: var(--wbk-b-pos, center);
	color: var(--wbk-back-color, var(--wbk-tile-color, #fff));
}

.wbk-cal .wbk-overlay .wbk-tile__content ul,
.wbk-cal .wbk-overlay .wbk-tile__content ol {
	text-align: left;
}

.wbk-cal .wbk-notice {
	min-height: 0;
	margin: 12px 0 0;
	padding: 0;
	font-size: .95em;
}

.wbk-cal .wbk-notice:empty {
	display: none;
}

/* Mobil: Auto-Placement in Leserichtung, Spans auf die mobilen Spalten begrenzt */
/* Mit GSAP steuert JS den Flip, die CSS-Variante bleibt als Fallback */
.wbk-cal.wbk-gsap .wbk-tile__inner {
	transition: none;
}

.wbk-cal.wbk-gsap .wbk-tile.is-flipped .wbk-tile__inner {
	transform: none;
}

.wbk-cal .wbk-tile__back,
.wbk-cal .wbk-overlay {
	cursor: pointer;
}

.wbk-cal .wbk-tile__content a,
.wbk-cal .wbk-btn {
	cursor: pointer;
}

.wbk-cal .wbk-tile__glow {
	position: absolute;
	inset: -3px;
	border: 2px solid var(--wbk-tile-color, #fff);
	border-radius: var(--wbk-radius, 10px);
	opacity: 0;
	pointer-events: none;
}

.wbk-cal .wbk-tip {
	position: absolute;
	z-index: 7;
	max-width: calc(100% - 8px);
	padding: 6px 10px;
	background: #fff;
	color: #15171a;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	animation: wbk-tip-in .15s ease-out;
}

.wbk-cal .wbk-tip[hidden] {
	display: none;
}

@keyframes wbk-tip-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wbk-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(6px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(4px); }
}

.wbk-cal .wbk-tile.is-shaking .wbk-tile__front {
	animation: wbk-shake .45s ease;
}

@media (max-width: 767px) {
	.wbk-cal .wbk-gridwrap {
		--wbk-p: min(var(--wbk-pad, 24px), 16px);
	}

	.wbk-cal .wbk-grid {
		--wbk-c: var(--wbk-cols-m);
		--wbk-g: min(var(--wbk-gap), 10px);
		grid-template-rows: none;
		grid-auto-rows: var(--wbk-cell);
	}

	.wbk-cal .wbk-tile {
		grid-column: span var(--wbk-wm);
		grid-row: span var(--wbk-h);
	}

	/* Option "alle Kacheln 1x1": Spans entfallen, die Reihenfolge bleibt Leserichtung. */
	.wbk-cal[data-mobile-square="1"] .wbk-tile {
		grid-column: auto;
		grid-row: auto;
	}

	.wbk-cal .wbk-overlay {
		padding: 44px 16px 16px;
	}
}

/* ---------- Popup ---------- */
.wbk-popup,
.wbk-popup *,
.wbk-popup *::before,
.wbk-popup *::after,
.wbk-tabwrap,
.wbk-tabwrap * {
	box-sizing: border-box;
}

.wbk-popup {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	height: 100vh;
	height: 100dvh;
	z-index: 2147483000;
	color: #fff;
	font-family: inherit;
	line-height: 1.45;
	text-align: left;
}

.wbk-popup[hidden],
.wbk-tabwrap[hidden] {
	display: none;
}

.wbk-popup__bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: var(--wbk-pop-bg, #7a0d12);
	background-image: var(--wbk-pop-img, none);
	background-size: cover;
	background-position: var(--wbk-pop-pos, right center);
	background-repeat: no-repeat;
}

/* Der Container scrollt, die Seite dahinter nicht. */
.wbk-popup__scroll {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	padding: 56px clamp(16px, 4vw, 64px) 32px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* Auto-Margins zentrieren vertikal, ohne bei Überlauf den oberen Rand abzuschneiden. */
.wbk-popup__inner {
	flex: 0 0 auto;
	width: var(--wbk-popup-w, min(var(--wbk-pop-max, 760px), 100%));
	max-width: 100%;
	margin: auto auto auto 0;
}

.wbk-popup[data-align="center"] .wbk-popup__inner {
	margin: auto;
}

.wbk-popup[data-align="right"] .wbk-popup__inner {
	margin: auto 0 auto auto;
}

.wbk-popup .wbk-cal .wbk-gridwrap {
	background: none;
}

.wbk-popup .wbk-cal .wbk-headline,
.wbk-popup .wbk-cal .wbk-intro,
.wbk-popup .wbk-cal .wbk-footer {
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.wbk-popup .wbk-cal .wbk-footer {
	font-size: .8em;
}

/* Hinweise für die Redaktion nehmen im Popup möglichst wenig Höhe, damit das Raster gross bleibt. */
.wbk-popup .wbk-cal .wbk-testmode,
.wbk-popup .wbk-cal .wbk-preview {
	margin: 0 0 8px;
	padding: 4px 10px;
	font-size: 12px;
}

/* Das Raster trägt im Popup kein eigenes Bild, deshalb dunkelt das Overlay das Bild ab. */
.wbk-popup .wbk-cal .wbk-overlay {
	background: rgba(24, 2, 4, .8);
}

.wbk-popup__x {
	appearance: none;
	position: absolute;
	top: max(12px, env(safe-area-inset-top));
	right: max(12px, env(safe-area-inset-right));
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #7a0d12;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
	cursor: pointer;
}

.wbk-popup__x:hover {
	background: #f2f2f2;
	color: #c8102e;
}

.wbk-popup__x:focus-visible,
.wbk-popup__later:focus-visible,
.wbk-tab:focus-visible {
	outline: 3px solid #e6c97a;
	outline-offset: 3px;
}

.wbk-popup__x svg {
	display: block;
	width: 24px;
	height: 24px;
}

.wbk-popup__later {
	appearance: none;
	display: block;
	min-height: 44px;
	margin: 12px auto 0;
	padding: 8px 12px;
	border: 0;
	background: none;
	color: #fff;
	font: inherit;
	font-size: 15px;
	text-decoration: underline;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
	cursor: pointer;
	box-shadow: none;
}

.wbk-popup__later:hover {
	background: none;
	color: #fff;
	text-decoration-thickness: 2px;
}

/* Reiter am rechten Rand */
.wbk-tabwrap {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 2147482000;
	display: flex;
	align-items: center;
	padding-right: env(safe-area-inset-right);
	pointer-events: none;
}

.wbk-tab {
	appearance: none;
	margin: 0;
	padding: 18px 10px;
	border: 0;
	border-radius: 10px 0 0 10px;
	background: var(--wbk-tab-color, #c8102e);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1;
	text-transform: none;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: -2px 2px 10px rgba(0, 0, 0, .25);
	pointer-events: auto;
}

.wbk-tab:hover {
	background: var(--wbk-tab-color, #c8102e);
	color: #fff;
	filter: brightness(1.12);
}

@media (max-width: 767px) {
	.wbk-popup__scroll {
		padding: 72px 12px 24px;
	}

	.wbk-popup__inner,
	.wbk-popup[data-align] .wbk-popup__inner {
		width: 100%;
		margin: auto;
	}

	.wbk-popup__bg {
		background-image: var(--wbk-pop-img-m, none);
		background-position: var(--wbk-pop-pos-m, center bottom);
	}

	.wbk-tabwrap {
		transform: translateY(18vh);
	}

	.wbk-tab {
		padding: 14px 8px;
		font-size: 13px;
	}
}

@media print {
	.wbk-popup,
	.wbk-tabwrap {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wbk-cal .wbk-tile.is-shaking .wbk-tile__front,
	.wbk-cal .wbk-tip {
		animation: none;
	}

	.wbk-cal .wbk-tile__inner {
		transition: none;
	}

	.wbk-cal .wbk-tile.is-flipped .wbk-tile__inner {
		transform: none;
	}

	.wbk-cal .wbk-tile__back {
		transform: none;
		visibility: hidden;
	}

	.wbk-cal .wbk-tile.is-flipped .wbk-tile__back {
		visibility: visible;
	}

	.wbk-cal .wbk-tile.is-flipped .wbk-tile__front {
		visibility: hidden;
	}
}
