/* ==========================================================================
   EW Galerie – Frontend
   ========================================================================== */

:root {
	--ewgal-accent: #e07b00;
	--ewgal-accent-dark: #b56300;
	--ewgal-bg: #fff8e7;
	--ewgal-btn: #f0a500;
	--ewgal-lb-bg: rgba(20, 16, 10, 0.94);
	--ewgal-radius: 10px;
}

.ewgal {
	--ewgal-cols: 3;
	--ewgal-cols-tab: 2;
	--ewgal-cols-mob: 1;
	--ewgal-gap: 14px;
	--ewgal-item-radius: 10px;
	--ewgal-slides: 3;
	--ewgal-slides-tab: 2;
	--ewgal-slides-mob: 1;
	position: relative;
	box-sizing: border-box;
	margin: 0 0 28px;
}

.ewgal *,
.ewgal *::before,
.ewgal *::after {
	box-sizing: border-box;
}

.ewgal img {
	max-width: 100%;
	height: auto;
	display: block;
}

.ewgal-heading {
	margin: 0 0 6px;
	color: var(--ewgal-accent);
	font-weight: 700;
	line-height: 1.25;
}

.ewgal-subheading {
	margin: 0 0 18px;
	color: #5d5346;
	font-size: 16px;
	line-height: 1.5;
}

.ewgal-notice {
	padding: 14px 18px;
	border-left: 4px solid var(--ewgal-accent);
	background: var(--ewgal-bg);
	border-radius: 8px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	color: #6b5a3e;
}

/* --------------------------------------------------------------------------
   Rahmen / Karton
   -------------------------------------------------------------------------- */

.ewgal-frame-soft,
.ewgal-frame-outline,
.ewgal-frame-gradient,
.ewgal-frame-dark {
	padding: clamp(14px, 2.4vw, 30px);
	border-radius: 16px;
}

.ewgal-frame-soft {
	background: var(--ewgal-bg);
}

.ewgal-frame-outline {
	background: var(--ewgal-bg);
	border: 2px solid var(--ewgal-accent);
}

.ewgal-frame-gradient {
	background: linear-gradient(135deg, var(--ewgal-bg) 0%, #ffeecd 55%, #ffe3ae 100%);
}

.ewgal-frame-dark {
	background: #241d15;
}

.ewgal-frame-dark .ewgal-heading {
	color: var(--ewgal-btn);
}

.ewgal-frame-dark .ewgal-subheading,
.ewgal-frame-dark .ewgal-caption {
	color: #e5d9c6;
}

/* --------------------------------------------------------------------------
   Item-Grundgerüst
   -------------------------------------------------------------------------- */

.ewgal-item {
	margin: 0;
	padding: 0;
	position: relative;
	min-width: 0;
}

.ewgal-link {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
	outline: none;
}

.ewgal-media {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--ewgal-item-radius);
	background: rgba(0, 0, 0, 0.06);
	aspect-ratio: var(--ewgal-ar, var(--ewgal-item-ar, 1.5));
}

.ewgal-media > .ewgal-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform: scale(var(--ewgal-scale, 1));
	transform-origin: var(--ewgal-zoom-origin, 50% 50%);
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.35s ease;
	will-change: transform;
}

/* Groesse im Ausschnitt gesetzt: Das Bild wird zunaechst vollstaendig
   eingepasst und dann skaliert. Bei 100 Prozent ist das rechnerisch
   identisch mit dem formatfuellenden Zuschnitt, darunter wird mehr vom
   Bild sichtbar, darueber weniger. */
.ewgal-item.ewgal-zoomed .ewgal-media > .ewgal-img {
	object-fit: contain;
}

.ewgal-has-shadow .ewgal-media {
	box-shadow: 0 6px 18px rgba(60, 42, 12, 0.14);
}

/* Zuschnitt aus: Bild wird vollstaendig eingepasst statt beschnitten */
.ewgal-nocrop .ewgal-media > .ewgal-img {
	object-fit: contain;
}

.ewgal-link:focus-visible .ewgal-media {
	outline: 3px solid var(--ewgal-accent);
	outline-offset: 3px;
}

.ewgal-link-url,
.ewgal-lb,
.ewgal-link-file {
	cursor: pointer;
}

.ewgal-caption {
	margin: 8px 2px 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: #6b5a3e;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Hover-Effekte
   -------------------------------------------------------------------------- */

.ewgal-hover-zoom .ewgal-link:hover .ewgal-img,
.ewgal-hover-zoom-dark .ewgal-link:hover .ewgal-img,
.ewgal-hover-overlay .ewgal-link:hover .ewgal-img,
.ewgal-hover-overlay-always .ewgal-link:hover .ewgal-img,
.ewgal-hover-veil .ewgal-link:hover .ewgal-img,
.ewgal-hover-veil-always .ewgal-link:hover .ewgal-img {
	transform: scale(calc(var(--ewgal-scale, 1) * 1.08));
}

.ewgal-hover-zoom-dark .ewgal-link:hover .ewgal-img {
	filter: brightness(0.72);
}

.ewgal-hover-bright .ewgal-link:hover .ewgal-img {
	filter: brightness(1.18) saturate(1.08);
}

.ewgal-hover-lift .ewgal-item {
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.ewgal-hover-lift .ewgal-item:hover {
	transform: translateY(-6px);
}

.ewgal-hover-lift .ewgal-item:hover .ewgal-media {
	box-shadow: 0 16px 34px rgba(60, 42, 12, 0.26);
}

.ewgal-hover-shine .ewgal-media::after {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 55%;
	height: 100%;
	background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0) 100%);
	transform: skewX(-18deg);
	transition: left 0.7s ease;
	pointer-events: none;
}

.ewgal-hover-shine .ewgal-link:hover .ewgal-media::after {
	left: 130%;
}

/* Overlay */
.ewgal-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 18px;
	background: linear-gradient(180deg, rgba(20, 14, 5, 0) 35%, rgba(20, 14, 5, 0.82) 100%);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.ewgal-overlay-inner {
	display: block;
	transform: translateY(14px);
	transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
	width: 100%;
}

.ewgal-hover-overlay .ewgal-link:hover .ewgal-overlay,
.ewgal-hover-overlay .ewgal-link:focus-visible .ewgal-overlay,
.ewgal-hover-overlay-always .ewgal-overlay,
.ewgal-hover-veil .ewgal-link:hover .ewgal-overlay,
.ewgal-hover-veil .ewgal-link:focus-visible .ewgal-overlay,
.ewgal-hover-veil-always .ewgal-overlay {
	opacity: 1;
}

/* Veil: gleichmaessiger Filter ueber dem ganzen Bild, Text und Button mittig */
.ewgal-hover-veil .ewgal-overlay,
.ewgal-hover-veil-always .ewgal-overlay {
	background: rgba(20, 14, 5, 0.58);
	align-items: center;
	justify-content: center;
	text-align: center;
}

.ewgal-hover-veil .ewgal-overlay-inner,
.ewgal-hover-veil-always .ewgal-overlay-inner {
	width: auto;
	max-width: 88%;
	transform: translateY(10px) scale(0.96);
}

.ewgal-hover-overlay .ewgal-link:hover .ewgal-overlay-inner,
.ewgal-hover-overlay .ewgal-link:focus-visible .ewgal-overlay-inner,
.ewgal-hover-overlay-always .ewgal-overlay-inner {
	transform: translateY(0);
}

.ewgal-hover-veil .ewgal-link:hover .ewgal-overlay-inner,
.ewgal-hover-veil .ewgal-link:focus-visible .ewgal-overlay-inner,
.ewgal-hover-veil-always .ewgal-overlay-inner {
	transform: translateY(0) scale(1);
}

.ewgal-overlay-sub {
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #ffd894;
	margin-bottom: 4px;
}

.ewgal-overlay-title {
	display: block;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.ewgal-overlay-btn {
	display: inline-block;
	margin-top: 12px;
	background-color: var(--ewgal-btn);
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	padding: 10px 22px;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(240, 165, 0, 0.35);
	letter-spacing: 0.02em;
}

.ewgal-hover-overlay-always .ewgal-link:hover .ewgal-overlay-btn,
.ewgal-hover-veil-always .ewgal-link:hover .ewgal-overlay-btn,
.ewgal-hover-veil .ewgal-link:hover .ewgal-overlay-btn {
	background-color: var(--ewgal-accent);
}

/* --------------------------------------------------------------------------
   Overlay je Bild
   Diese Regeln stehen bewusst hinter den Galerie-Regeln und haben eine
   hoehere Gewichtung. Damit schlaegt die Einstellung am Bild immer den
   Hover-Effekt der Galerie.
   -------------------------------------------------------------------------- */

/* Position: Text unten mit Verlauf */
.ewgal-item.ewgal-ov-bottom .ewgal-overlay {
	align-items: flex-end;
	justify-content: flex-start;
	text-align: left;
	background: linear-gradient(180deg, rgba(20, 14, 5, 0) 35%, rgba(20, 14, 5, 0.82) 100%);
}

.ewgal-item.ewgal-ov-bottom .ewgal-overlay-inner {
	width: 100%;
	max-width: none;
	transform: translateY(14px);
}

/* Position: Filter ueber dem ganzen Bild, Text mittig */
.ewgal-item.ewgal-ov-center .ewgal-overlay {
	align-items: center;
	justify-content: center;
	text-align: center;
	background: rgba(20, 14, 5, 0.58);
}

.ewgal-item.ewgal-ov-center .ewgal-overlay-inner {
	width: auto;
	max-width: 88%;
	transform: translateY(10px) scale(0.96);
}

/* Sichtbarkeit: nur bei Mouseover */
.ewgal-item.ewgal-ov-hover .ewgal-overlay {
	opacity: 0;
}

.ewgal-item.ewgal-ov-hover:hover .ewgal-overlay,
.ewgal-item.ewgal-ov-hover:focus-within .ewgal-overlay {
	opacity: 1;
}

.ewgal-item.ewgal-ov-hover:hover .ewgal-overlay-inner,
.ewgal-item.ewgal-ov-hover:focus-within .ewgal-overlay-inner {
	transform: translateY(0) scale(1);
}

/* Sichtbarkeit: dauerhaft */
.ewgal-item.ewgal-ov-always .ewgal-overlay {
	opacity: 1;
}

.ewgal-item.ewgal-ov-always .ewgal-overlay-inner {
	transform: translateY(0) scale(1);
}

/* Abdunkeln des Bildes */
.ewgal-item.ewgal-ov-dark:hover .ewgal-img,
.ewgal-item.ewgal-ov-dark:focus-within .ewgal-img {
	filter: brightness(0.62);
}

.ewgal-item.ewgal-ov-dark.ewgal-ov-always .ewgal-img {
	filter: brightness(0.68);
}

/* Button als echter Link: nur anklickbar, wenn das Overlay sichtbar ist */
.ewgal-overlay a.ewgal-overlay-btn {
	pointer-events: auto;
	text-decoration: none;
	cursor: pointer;
}

.ewgal-item.ewgal-ov-hover .ewgal-overlay a.ewgal-overlay-btn {
	pointer-events: none;
}

.ewgal-item.ewgal-ov-hover:hover .ewgal-overlay a.ewgal-overlay-btn,
.ewgal-item.ewgal-ov-hover:focus-within .ewgal-overlay a.ewgal-overlay-btn {
	pointer-events: auto;
}

.ewgal-overlay a.ewgal-overlay-btn:hover,
.ewgal-overlay a.ewgal-overlay-btn:focus-visible {
	background-color: var(--ewgal-accent);
	color: #fff;
}

.ewgal-overlay a.ewgal-overlay-btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Kachel ohne <a>, aber mit Klickfunktion */
.ewgal-link[role="button"] {
	cursor: pointer;
}

/* Touchgeraete: kein Mouseover. Das Verhalten kommt aus der Auswahl
   "Auf Mobilgeräten" – je Bild oder als Galerie-Standard. */
@media (hover: none) {

	/* Dauerhaft sichtbar */
	.ewgal-item.ewgal-ovm-always .ewgal-overlay {
		opacity: 1;
	}

	.ewgal-item.ewgal-ovm-always .ewgal-overlay-inner {
		transform: translateY(0) scale(1);
	}

	.ewgal-item.ewgal-ovm-always .ewgal-overlay a.ewgal-overlay-btn {
		pointer-events: auto;
	}

	.ewgal-item.ewgal-ov-dark.ewgal-ovm-always .ewgal-img {
		filter: brightness(0.68);
	}

	/* Aus */
	.ewgal-item.ewgal-ovm-off .ewgal-overlay {
		opacity: 0;
	}

	.ewgal-item.ewgal-ovm-off .ewgal-overlay a.ewgal-overlay-btn {
		pointer-events: none;
	}

	/* Erst beim Antippen */
	.ewgal-item.ewgal-ovm-tap .ewgal-overlay {
		opacity: 0;
	}

	.ewgal-item.ewgal-ovm-tap .ewgal-overlay a.ewgal-overlay-btn {
		pointer-events: none;
	}

	.ewgal-item.ewgal-ovm-tap.is-open .ewgal-overlay {
		opacity: 1;
	}

	.ewgal-item.ewgal-ovm-tap.is-open .ewgal-overlay-inner {
		transform: translateY(0) scale(1);
	}

	.ewgal-item.ewgal-ovm-tap.is-open .ewgal-overlay a.ewgal-overlay-btn {
		pointer-events: auto;
	}

	.ewgal-item.ewgal-ov-dark.ewgal-ovm-tap .ewgal-img {
		filter: none;
	}

	.ewgal-item.ewgal-ov-dark.ewgal-ovm-tap.is-open .ewgal-img {
		filter: brightness(0.68);
	}
}

/* --------------------------------------------------------------------------
   Layout: Raster
   -------------------------------------------------------------------------- */

.ewgal-grid {
	display: grid;
	grid-template-columns: repeat(var(--ewgal-cols), minmax(0, 1fr));
	gap: var(--ewgal-gap);
}

/* --------------------------------------------------------------------------
   Kachelgroesse
   auto  = Kacheln mindestens --ewgal-tile breit, Reihe wird gefuellt
   fixed = Kacheln exakt --ewgal-tile breit, Umbruch automatisch
   Das Seitenverhaeltnis kommt weiterhin aus --ewgal-ar, dadurch bleiben
   die Kacheln proportional und nichts wird verzerrt.
   -------------------------------------------------------------------------- */

.ewgal-size-auto .ewgal-grid,
.ewgal-size-auto .ewgal-cards {
	grid-template-columns: repeat(auto-fit, minmax(min(var(--ewgal-tile), 100%), 1fr));
}

.ewgal-size-fixed .ewgal-grid,
.ewgal-size-fixed .ewgal-cards {
	grid-template-columns: repeat(auto-fill, min(var(--ewgal-tile), 100%));
	justify-content: center;
}

.ewgal-size-auto .ewgal-masonry,
.ewgal-size-fixed .ewgal-masonry {
	column-count: auto;
	column-width: var(--ewgal-tile);
}

.ewgal-size-auto .ewgal-carousel .ewgal-slide,
.ewgal-size-fixed .ewgal-carousel .ewgal-slide {
	flex: 0 0 min(var(--ewgal-tile), 100%);
}

/* --------------------------------------------------------------------------
   Layout: Cards
   -------------------------------------------------------------------------- */

.ewgal-cards {
	display: grid;
	grid-template-columns: repeat(var(--ewgal-cols), minmax(0, 1fr));
	gap: var(--ewgal-gap);
}

.ewgal-cards .ewgal-media {
	aspect-ratio: var(--ewgal-ar, var(--ewgal-item-ar, 3 / 4));
}

/* Karten-Rahmen: jede Kachel steht fuer sich, damit die Artikel nicht als
   eine zusammenhaengende Flaeche wirken. */
.ewgal-cards .ewgal-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(190, 140, 60, 0.22);
	border-radius: calc(var(--ewgal-item-radius, 10px) + 8px);
	padding: 10px 10px 2px;
	box-shadow: 0 3px 12px rgba(90, 60, 15, 0.08);
	transition: transform 0.32s cubic-bezier(0.2, 0.75, 0.2, 1), box-shadow 0.32s ease, border-color 0.32s ease;
}

.ewgal-cards .ewgal-card:hover,
.ewgal-cards .ewgal-card:focus-within {
	transform: translateY(-5px);
	border-color: rgba(224, 123, 0, 0.45);
	box-shadow: 0 14px 30px rgba(90, 60, 15, 0.16);
}

/* Der Schatten sitzt jetzt an der Karte, nicht mehr am Bild. */
.ewgal-has-shadow .ewgal-cards .ewgal-media {
	box-shadow: none;
}

.ewgal-cards .ewgal-card .ewgal-caption {
	margin: 10px 4px 8px;
	font-weight: 700;
	color: #3a2e20;
}

/* Dunkler Karton: Karten passen sich an. */
.ewgal-frame-dark .ewgal-cards .ewgal-card {
	background: #2c241b;
	border-color: rgba(255, 255, 255, 0.10);
	box-shadow: none;
}

.ewgal-frame-dark .ewgal-cards .ewgal-card:hover,
.ewgal-frame-dark .ewgal-cards .ewgal-card:focus-within {
	border-color: rgba(240, 165, 0, 0.55);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.ewgal-frame-dark .ewgal-cards .ewgal-card .ewgal-caption {
	color: #e5d9c6;
}

@media (prefers-reduced-motion: reduce) {

	.ewgal-cards .ewgal-card {
		transition: none;
	}

	.ewgal-cards .ewgal-card:hover,
	.ewgal-cards .ewgal-card:focus-within {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Layout: Masonry
   -------------------------------------------------------------------------- */

.ewgal-masonry {
	column-count: var(--ewgal-cols);
	column-gap: var(--ewgal-gap);
}

.ewgal-masonry .ewgal-item {
	break-inside: avoid;
	page-break-inside: avoid;
	margin-bottom: var(--ewgal-gap);
	display: inline-block;
	width: 100%;
}

.ewgal-masonry .ewgal-media {
	aspect-ratio: auto;
	background: none;
}

.ewgal-masonry .ewgal-media > .ewgal-img {
	height: auto;
	object-fit: contain;
}

/* --------------------------------------------------------------------------
   Layout: Justified
   -------------------------------------------------------------------------- */

.ewgal-justified {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ewgal-gap);
}

.ewgal-justified .ewgal-item {
	flex-grow: calc(var(--ewgal-item-ar, 1.5) * 100);
	flex-basis: calc(var(--ewgal-item-ar, 1.5) * 190px);
	max-width: 100%;
}

.ewgal-justified .ewgal-media {
	aspect-ratio: var(--ewgal-item-ar, 1.5);
	height: 100%;
}

.ewgal-justified-filler {
	flex-grow: 999999;
	flex-basis: 0;
	height: 0;
}

/* --------------------------------------------------------------------------
   Layout: Diamant
   -------------------------------------------------------------------------- */

.ewgal-diamond-wrap {
	position: relative;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	height: 0;
}

/* Die Flaeche bekommt ihre Hoehe ueber padding-top, die Rauten sitzen darin
   auf exakt berechneten Prozentwerten aus dem PHP-Renderer. */
.ewgal-diamond {
	position: absolute;
	inset: 0;
}

.ewgal-diamond .ewgal-item {
	position: absolute;
	margin: 0;
	padding: calc(var(--ewgal-gap) / 2);
}

.ewgal-diamond .ewgal-link {
	height: 100%;
}

.ewgal-diamond .ewgal-media {
	height: 100%;
	aspect-ratio: auto;
	border-radius: 0;
	background: none;
	clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.ewgal-diamond .ewgal-caption {
	display: none;
}

/* --------------------------------------------------------------------------
   Slider / Carousel – gemeinsame Basis
   -------------------------------------------------------------------------- */

.ewgal-slider,
.ewgal-carousel {
	position: relative;
}

.ewgal-stage {
	position: relative;
}

.ewgal-viewport {
	overflow: hidden;
	border-radius: var(--ewgal-item-radius);
}

.ewgal-track {
	display: flex;
	transition: transform 0.5s cubic-bezier(0.33, 0.9, 0.35, 1);
	will-change: transform;
}

.ewgal-track.is-dragging {
	transition: none;
}

.ewgal-slider .ewgal-slide {
	flex: 0 0 100%;
	max-width: 100%;
}

.ewgal-carousel .ewgal-slide {
	flex: 0 0 calc((100% - (var(--ewgal-slides) - 1) * var(--ewgal-gap)) / var(--ewgal-slides));
	margin-right: var(--ewgal-gap);
}

.ewgal-carousel .ewgal-slide:last-child {
	margin-right: 0;
}

.ewgal-slider .ewgal-media {
	border-radius: 0;
	aspect-ratio: var(--ewgal-ar, var(--ewgal-item-ar, 16 / 9));
	background: #2a231a;
}

.ewgal-slider .ewgal-media > .ewgal-img {
	object-fit: contain;
	position: relative;
	z-index: 1;
}

/* Bühnen-Hintergründe (Slider / Thumbs) */
.ewgal-stage-dark .ewgal-slider .ewgal-media {
	background: #2a231a;
}

.ewgal-stage-soft .ewgal-slider .ewgal-media {
	background: var(--ewgal-bg);
}

.ewgal-stage-light .ewgal-slider .ewgal-media {
	background: #fff;
}

.ewgal-stage-blur .ewgal-slider .ewgal-media {
	background: #1c1710;
}

.ewgal-stage-cover .ewgal-slider .ewgal-media > .ewgal-img {
	object-fit: cover;
}

.ewgal-blurbg {
	position: absolute;
	inset: -6%;
	z-index: 0;
	background-size: cover;
	background-position: center;
	filter: blur(26px) saturate(1.25) brightness(0.78);
	transform: scale(1.12);
	pointer-events: none;
}

.ewgal-stage-cover .ewgal-blurbg,
.ewgal-stage-dark .ewgal-blurbg,
.ewgal-stage-soft .ewgal-blurbg,
.ewgal-stage-light .ewgal-blurbg {
	display: none;
}

/* Pfeile */
.ewgal-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 8px;
	background: rgba(24, 18, 10, 0.62);
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.ewgal-arrow svg {
	width: 22px;
	height: 22px;
}

.ewgal-arrow:hover {
	background: var(--ewgal-accent);
}

.ewgal-arrow:focus-visible {
	outline: 3px solid var(--ewgal-btn);
	outline-offset: 2px;
}

.ewgal-arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

.ewgal-arrow-prev {
	left: 10px;
}

.ewgal-arrow-next {
	right: 10px;
}

.ewgal-carousel .ewgal-arrow-prev {
	left: -6px;
}

.ewgal-carousel .ewgal-arrow-next {
	right: -6px;
}

/* Zähler & Werkzeuge */
.ewgal-counter {
	position: absolute;
	top: 14px;
	left: 16px;
	z-index: 4;
	background: rgba(24, 18, 10, 0.55);
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 20px;
	letter-spacing: 0.03em;
}

.ewgal-counter-sep {
	opacity: 0.6;
	margin: 0 2px;
}

.ewgal-tools {
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 4;
	display: flex;
	gap: 8px;
}

.ewgal-tool {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 8px;
	background: rgba(24, 18, 10, 0.55);
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease;
}

.ewgal-tool svg {
	width: 19px;
	height: 19px;
}

.ewgal-tool:hover {
	background: var(--ewgal-accent);
}

/* Punkte */
.ewgal-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 9px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.ewgal-dot {
	width: 11px;
	height: 11px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(120, 100, 70, 0.32);
	cursor: pointer;
	transition: background 0.25s ease, width 0.25s ease;
}

.ewgal-dot.is-active {
	background: var(--ewgal-accent);
	width: 26px;
	border-radius: 6px;
}

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

/* Miniaturleiste */
.ewgal-thumbs {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	overflow-x: auto;
	padding: 4px 2px 8px;
	scrollbar-width: thin;
	scroll-behavior: smooth;
}

.ewgal-thumbs::-webkit-scrollbar {
	height: 6px;
}

.ewgal-thumbs::-webkit-scrollbar-thumb {
	background: rgba(224, 123, 0, 0.4);
	border-radius: 4px;
}

.ewgal-thumb {
	flex: 0 0 auto;
	width: 92px;
	height: 68px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: none;
	cursor: pointer;
	overflow: hidden;
	opacity: 0.62;
	transition: opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.ewgal-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ewgal-thumb:hover {
	opacity: 1;
	transform: translateY(-2px);
}

.ewgal-thumb.is-active {
	opacity: 1;
	border-color: var(--ewgal-accent);
}

.ewgal-slide-caption {
	margin-top: 12px;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	color: #6b5a3e;
	min-height: 1.4em;
}

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

.ewgal-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: var(--ewgal-lb-bg);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease, visibility 0.18s ease;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.ewgal-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

/* Schliessen wirkt sofort, nur das Einblenden ist weich. */
.ewgal-lightbox:not(.is-open) {
	transition: none;
	pointer-events: none;
}

.ewgal-lb-bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	color: #fff;
}

.ewgal-lb-counter {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.ewgal-lb-counter em {
	font-style: normal;
	opacity: 0.6;
	font-size: 13px;
	margin: 0 3px;
}

.ewgal-lb-actions {
	display: flex;
	gap: 8px;
}

.ewgal-lb-btn {
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease;
}

.ewgal-lb-btn svg {
	width: 20px;
	height: 20px;
}

.ewgal-lb-btn:hover {
	background: var(--ewgal-accent);
}

.ewgal-lb-btn:focus-visible {
	outline: 3px solid var(--ewgal-btn);
	outline-offset: 2px;
}

.ewgal-lb-stage {
	flex: 1 1 auto;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: 0;
	padding: 0 16px;
}

.ewgal-lb-figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.ewgal-lb-img {
	max-width: min(96vw, 1600px);
	max-height: calc(100vh - 270px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
	transition: transform 0.25s ease, opacity 0.2s ease;
	cursor: zoom-in;
	background: rgba(255, 255, 255, 0.04);
	transform-origin: center center;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.ewgal-lightbox.is-loading .ewgal-lb-img {
	opacity: 0.35;
}

.ewgal-lightbox.no-thumbs .ewgal-lb-img {
	max-height: calc(100vh - 150px);
}

/* Im vergroesserten Zustand steuert JavaScript die Verschiebung. */
.ewgal-lb-img.is-zoomed {
	cursor: grab;
}

.ewgal-lb-img.is-grabbing {
	cursor: grabbing;
}

.ewgal-lb-caption {
	margin-top: 14px;
	max-width: 900px;
	text-align: center;
	color: #f0e6d6;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	padding: 0 12px;
}

.ewgal-lb-caption strong {
	display: block;
	color: #fff;
	font-size: 17px;
	margin-bottom: 3px;
}

.ewgal-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease;
}

.ewgal-lb-nav svg {
	width: 26px;
	height: 26px;
}

.ewgal-lb-nav:hover {
	background: var(--ewgal-accent);
}

.ewgal-lb-nav:focus-visible {
	outline: 3px solid var(--ewgal-btn);
	outline-offset: 2px;
}

.ewgal-lb-prev {
	left: 14px;
}

.ewgal-lb-next {
	right: 14px;
}

.ewgal-lb-thumbs {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 14px 16px 20px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.ewgal-lb-thumbs::-webkit-scrollbar {
	height: 6px;
}

.ewgal-lb-thumbs::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.25);
	border-radius: 4px;
}

.ewgal-lb-thumb {
	flex: 0 0 auto;
	width: 78px;
	height: 58px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 5px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.25s ease, border-color 0.25s ease;
}

.ewgal-lb-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ewgal-lb-thumb:hover {
	opacity: 0.85;
}

.ewgal-lb-thumb.is-active {
	opacity: 1;
	border-color: var(--ewgal-accent);
}

body.ewgal-lb-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsiv
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.ewgal-size-cols .ewgal-grid,
	.ewgal-size-cols .ewgal-cards {
		grid-template-columns: repeat(var(--ewgal-cols-tab), minmax(0, 1fr));
	}

	.ewgal-size-cols .ewgal-masonry {
		column-count: var(--ewgal-cols-tab);
	}

	.ewgal-size-cols .ewgal-carousel .ewgal-slide {
		flex-basis: calc((100% - (var(--ewgal-slides-tab) - 1) * var(--ewgal-gap)) / var(--ewgal-slides-tab));
	}
}

@media (max-width: 640px) {
	.ewgal-size-cols .ewgal-grid,
	.ewgal-size-cols .ewgal-cards {
		grid-template-columns: repeat(var(--ewgal-cols-mob), minmax(0, 1fr));
	}

	.ewgal-size-cols .ewgal-masonry {
		column-count: var(--ewgal-cols-mob);
	}

	.ewgal-size-cols .ewgal-carousel .ewgal-slide {
		flex-basis: calc((100% - (var(--ewgal-slides-mob) - 1) * var(--ewgal-gap)) / var(--ewgal-slides-mob));
	}

	.ewgal-justified .ewgal-item {
		flex-basis: calc(var(--ewgal-item-ar, 1.5) * 130px);
	}

	.ewgal-arrow {
		width: 38px;
		height: 38px;
	}

	.ewgal-arrow svg {
		width: 18px;
		height: 18px;
	}

	.ewgal-thumb {
		width: 70px;
		height: 54px;
	}

	.ewgal-lb-nav {
		width: 44px;
		height: 44px;
	}

	.ewgal-lb-prev {
		left: 6px;
	}

	.ewgal-lb-next {
		right: 6px;
	}

	.ewgal-lb-thumbs {
		justify-content: flex-start;
	}

	.ewgal-lb-thumb {
		width: 60px;
		height: 46px;
	}

	.ewgal-overlay {
		padding: 13px;
	}

	.ewgal-overlay-title {
		font-size: 16px;
	}

	.ewgal-diamond-wrap {
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ewgal *,
	.ewgal-lightbox * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------------
   Mobile Feinschliff
   -------------------------------------------------------------------------- */

/* Mobil: Overlay-Inhalt an die Kachelgroesse anpassen */
@media (max-width: 640px) {

	.ewgal-overlay {
		padding: 10px;
	}

	.ewgal-overlay-inner {
		max-height: 100%;
		overflow: hidden;
	}

	.ewgal-overlay-sub {
		font-size: 11px;
		letter-spacing: 0.04em;
		margin-bottom: 2px;
	}

	.ewgal-overlay-title {
		font-size: 14px;
		line-height: 1.2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	/* Steht der Titel ohnehin als Bildunterschrift unter dem Bild, entfaellt
	   er im Overlay. Sonst passen Text und Button nicht gemeinsam ins Bild. */
	.ewgal-has-captions .ewgal-overlay-title {
		display: none;
	}

	.ewgal-overlay-btn,
	.ewgal-overlay a.ewgal-overlay-btn {
		margin-top: 6px;
		padding: 7px 14px;
		font-size: 12px;
		box-shadow: 0 3px 8px rgba(240, 165, 0, 0.3);
	}

	/* Karten etwas kompakter, damit zwei Spalten sauber aufgehen. */
	.ewgal-cards .ewgal-card {
		padding: 8px 8px 2px;
	}

	.ewgal-cards .ewgal-card .ewgal-caption {
		font-size: 13px;
		line-height: 1.3;
		margin: 8px 2px 6px;
	}
}
