/* EB Anmeldung · Blockstil „Slider“ für den Galerie-Block.
 * Ohne JavaScript: waagerecht wischbare Reihe mit Einrasten. Mit Skript: Pfeile, Zähler, Tastatur.
 * Im Editor bleibt die Galerie ein Raster (:not(.block-editor-block-list__block)). */
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	position: relative; /* Bilder messen ihren Abstand zum Slider (offsetLeft). */
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	margin: 0;
	padding: 0;
	border-radius: var(--eb-radius-lg, 14px);
}
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) figure.wp-block-image:not(#individual-image) {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: block;
}
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) figure.wp-block-image::before { display: none; }
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) figure.wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--eb-radius-lg, 14px);
	background: var(--eb-paper-2, #f6f4ef);
}
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) figure.wp-block-image figcaption {
	position: static;
	max-height: none;
	overflow: visible;
	background: none;
	color: var(--eb-ink-2, #55524c);
	font-size: .875rem;
	line-height: 1.45;
	text-align: left;
	text-shadow: none;
	padding: 10px 2px 0;
	margin: 0;
}
.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) > .blocks-gallery-caption {
	flex: 0 0 100%;
	scroll-snap-align: start;
}

/* Mit Skript: Leiste mit Zähler und Pfeilen, Bildlaufleiste weg. */
.eb-slider { margin: 2rem 0; }
.eb-slider .wp-block-gallery.is-style-eb-slider { scrollbar-width: none; }
.eb-slider .wp-block-gallery.is-style-eb-slider::-webkit-scrollbar { display: none; }
.eb-slider .wp-block-gallery.is-style-eb-slider:focus-visible { outline: 3px solid var(--eb-focus, #fbba00); outline-offset: 3px; }
.eb-slider__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.eb-slider__count { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--eb-ink-2, #55524c); font-size: .95rem; }
.eb-slider__nav { display: flex; gap: 8px; }
.eb-slider__btn {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1.5px solid var(--eb-ink, #1a1a1a);
	border-radius: 50%;
	background: var(--eb-paper, #fffdf9);
	color: var(--eb-ink, #1a1a1a);
	cursor: pointer;
	padding: 0;
	transition: background .14s var(--eb-ease, ease-out), transform .14s var(--eb-ease, ease-out), opacity .14s;
}
.eb-slider__btn:hover:not(:disabled) { background: var(--eb-focus, #fbba00); }
.eb-slider__btn:active:not(:disabled) { transform: scale(.94); }
.eb-slider__btn:focus-visible { outline: 3px solid var(--eb-focus, #fbba00); outline-offset: 2px; }
.eb-slider__btn:disabled { opacity: .3; cursor: default; }
.eb-slider__btn svg { width: 20px; height: 20px; }
.eb-slider > .blocks-gallery-caption { color: var(--eb-ink-3, #6e6a63); font-size: 1rem; line-height: 1.4; margin: 0 0 16px; padding-top: 24px; border-top: 1px solid var(--eb-line, #e2ded6); text-align: left; }
.eb-slider.is-single .eb-slider__bar { display: none; }

@media (max-width: 600px) {
	/* Nächstes Bild schaut rechts herein, damit klar ist: hier kann man wischen. */
	.wp-block-gallery.has-nested-images.is-style-eb-slider:not(.block-editor-block-list__block) figure.wp-block-image:not(#individual-image) { flex-basis: 86%; width: 86%; }
	.eb-slider.is-single .wp-block-gallery.is-style-eb-slider figure.wp-block-image:not(#individual-image) { flex-basis: 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-eb-slider { scroll-behavior: auto !important; }
	.eb-slider__btn { transition: none; }
}

/* Im Editor: Hinweis, dass die Galerie auf der Seite als Slider erscheint. */
.block-editor-block-list__block.wp-block-gallery.is-style-eb-slider::before {
	content: "Auf der Seite: Slider (wischen, Pfeile, Zähler)";
	flex: 0 0 100%;
	order: -1;
	font: 500 12px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #2271b1;
}
