.fwg-wrap {
	font-family: var(--fwg-font-body, inherit);
}

.fwg-gallery {
	margin: 20px 0;
}

.fwg-item {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: #eee;
}

.fwg-item img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.25s ease;
	-webkit-user-drag: none;
	user-select: none;
}

.fwg-item:hover img {
	transform: scale(1.03);
}

/* --- Layout: Raster (gleich große, quadratische Kacheln) --- */
.fwg-gallery.fwg-layout-grid {
	display: grid;
	gap: 12px;
}

.fwg-gallery.fwg-layout-grid .fwg-item-wrap {
	aspect-ratio: 1 / 1;
}

.fwg-gallery.fwg-layout-grid .fwg-item,
.fwg-gallery.fwg-layout-grid .fwg-item img {
	width: 100%;
	height: 100%;
}

.fwg-gallery.fwg-layout-grid .fwg-item img {
	object-fit: cover;
}

/* --- Layout: Masonry (CSS-Spalten, volle Bildhöhe) --- */
.fwg-gallery.fwg-layout-masonry {
	display: block;
	column-gap: 12px;
}

.fwg-gallery.fwg-layout-masonry .fwg-item-wrap {
	break-inside: avoid;
	margin-bottom: 12px;
	/* verhindert abgeschnittene Elemente am Spaltenumbruch in WebKit */
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
}

.fwg-gallery.fwg-layout-masonry .fwg-item img {
	height: auto;
}

/* --- Layout: Justified (JS berechnet Breiten/Höhen) --- */
.fwg-gallery.fwg-layout-justified {
	display: block;
	font-size: 0; /* entfernt Whitespace zwischen inline-block-Items */
}

.fwg-gallery.fwg-layout-justified .fwg-item-wrap {
	display: inline-block;
	vertical-align: top;
	overflow: hidden;
}

.fwg-gallery.fwg-layout-justified .fwg-item,
.fwg-gallery.fwg-layout-justified .fwg-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* --- Lightbox --- */
.fwg-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}

/* Heller Modus: heller, leicht transparenter Hintergrund */
.fwg-lightbox-overlay.fwg-lb-light {
	background: rgba(255, 255, 255, 0.94);
}

.fwg-lightbox-overlay.is-open {
	display: flex;
}

.fwg-lightbox-figure {
	margin: 0;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.fwg-lightbox-figure img {
	max-width: 90vw;
	max-height: 84vh;
	object-fit: contain;
	-webkit-user-drag: none;
	user-select: none;
	border-radius: 2px;
}

.fwg-lightbox-caption {
	margin-top: 12px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	text-align: center;
	max-width: 80vw;
}

.fwg-lightbox-close {
	position: absolute;
	top: 18px;
	right: 26px;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.fwg-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
	z-index: 2;
}

.fwg-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.25);
}

.fwg-lightbox-prev {
	left: 20px;
}

.fwg-lightbox-next {
	right: 20px;
}

.fwg-lightbox-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.75);
	font-size: 14px;
	letter-spacing: 0.5px;
}

/* Heller Modus: dunkle Bedienelemente, damit sie auf hellem Grund sichtbar sind */
.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-close {
	color: #333;
}

.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-caption {
	color: rgba(0, 0, 0, 0.7);
}

.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-nav {
	background: rgba(0, 0, 0, 0.08);
	color: #333;
}

.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-nav:hover {
	background: rgba(0, 0, 0, 0.18);
}

.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-counter {
	color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
	.fwg-lightbox-nav {
		width: 42px;
		height: 42px;
		font-size: 26px;
	}
	.fwg-lightbox-prev {
		left: 8px;
	}
	.fwg-lightbox-next {
		right: 8px;
	}
}

/* --- Item-Wrapper (für Favoriten-Button-Positionierung) --- */
.fwg-item-wrap {
	position: relative;
}

/* --- Favoriten-Herz --- */
.fwg-fav-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.1s ease;
}

.fwg-fav-btn:hover {
	background: rgba(0, 0, 0, 0.65);
}

.fwg-fav-btn:active {
	transform: scale(0.9);
}

.fwg-fav-btn .fwg-heart {
	width: 20px;
	height: 20px;
	display: block;
}

.fwg-fav-btn .fwg-heart path {
	fill: rgba(255, 255, 255, 0.9);
	transition: fill 0.15s ease;
}

/* Aktiv: Kreis bleibt dunkel, nur das Herz wird rot gefüllt */
.fwg-fav-btn.is-active {
	background: rgba(0, 0, 0, 0.45);
}

.fwg-fav-btn.is-active:hover {
	background: rgba(0, 0, 0, 0.65);
}

.fwg-fav-btn.is-active .fwg-heart path {
	fill: #e0245e;
}

.fwg-fav-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

/* --- Proofing-Leiste --- */
.fwg-proofing-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 14px;
}

.fwg-toolbar-bottom {
	margin: 24px 0 0;
}

.fwg-proofing-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.fwg-proofing-actions .fwg-name-input {
	padding: 6px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
}

.fwg-proofing-actions .fwg-name-save,
.fwg-proofing-actions .fwg-submit-selection {
	padding: 6px 14px;
	cursor: pointer;
	font-size: 14px;
}

.fwg-proofing-actions .fwg-name-save {
	background: var(--fwg-btn-name-bg, #2271b1);
	color: var(--fwg-btn-name-fg, #fff);
	border: var(--fwg-btn-name-border, 2px solid #2271b1);
	border-radius: var(--fwg-btn-name-radius, 10px);
}

.fwg-proofing-actions .fwg-name-save:hover {
	filter: brightness(0.9);
}

.fwg-proofing-actions .fwg-submit-selection {
	background: var(--fwg-btn-submit-bg, #008a20);
	color: var(--fwg-btn-submit-fg, #fff);
	border: var(--fwg-btn-submit-border, 2px solid #008a20);
	border-radius: var(--fwg-btn-submit-radius, 10px);
	font-weight: 600;
}

.fwg-proofing-actions .fwg-submit-selection:hover {
	filter: brightness(0.9);
}

.fwg-proofing-actions .fwg-name-save:disabled,
.fwg-proofing-actions .fwg-submit-selection:disabled {
	opacity: 0.7;
	cursor: default;
}

.fwg-proofing-message {
	flex-basis: 100%;
	font-size: 14px;
	color: #008a20;
}

.fwg-proofing-message.is-error {
	color: #d63638;
}

/* --- Download-Button --- */
.fwg-download-btn {
	display: inline-block;
	padding: 10px 20px;
	background: var(--fwg-btn-download-bg, #008a20);
	color: var(--fwg-btn-download-fg, #fff);
	border: var(--fwg-btn-download-border, 2px solid #008a20);
	text-decoration: none;
	border-radius: var(--fwg-btn-download-radius, 10px);
	font-weight: 600;
	transition: filter 0.15s ease;
}

.fwg-download-btn:hover {
	filter: brightness(0.9);
	color: var(--fwg-btn-download-fg, #fff);
}

/* --- Passwort-Gate --- */
.fwg-password-gate {
	display: flex;
	justify-content: center;
	padding: 40px 20px;
}

.fwg-password-box {
	max-width: 420px;
	width: 100%;
	text-align: center;
	padding: 32px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.fwg-password-box h3 {
	margin-top: 0;
}

.fwg-password-box input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 12px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	font-size: 15px;
	box-sizing: border-box;
}

.fwg-password-box button {
	width: 100%;
	padding: 12px;
	border: none;
	border-radius: 6px;
	background: var(--fwg-accent, #2271b1);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
}

.fwg-password-box button:hover {
	filter: brightness(0.87);
}

.fwg-password-error {
	color: #d63638;
	font-size: 14px;
}

/* --- Abgelaufen-Hinweis --- */
.fwg-expired-notice {
	max-width: 480px;
	margin: 40px auto;
	text-align: center;
	padding: 32px;
	background: #fcf0f1;
	border: 1px solid #f0c0c2;
	border-radius: 10px;
}

.fwg-expired-notice h3 {
	margin-top: 0;
	color: #d63638;
}

/* =====================================================================
 * Titelbild-Banner (Cover)
 * =================================================================== */
.fwg-cover {
	position: relative;
	min-height: 260px;
	background-size: cover;
	background-position: center;
	border-radius: 8px;
	overflow: hidden;
	margin: 0 0 20px;
	display: flex;
	align-items: flex-end;
}

.fwg-cover-inner {
	width: 100%;
	padding: 28px 24px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
	color: #fff;
}

.fwg-cover-title {
	margin: 0 0 6px;
	color: #fff;
	font-size: 28px;
	line-height: 1.2;
	font-family: var(--fwg-font-heading, inherit);
	font-weight: var(--fwg-heading-weight, 700);
}

.fwg-cover-text {
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	font-size: 16px;
}

/* =====================================================================
 * Kommentar-Button & -Feld pro Bild
 * =================================================================== */
.fwg-comment-btn {
	position: absolute;
	top: 8px;
	right: 54px; /* links neben dem Herz-Button */
	width: 38px;
	height: 38px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	transition: background 0.15s ease;
}

.fwg-comment-btn:hover {
	background: rgba(0, 0, 0, 0.65);
}

.fwg-comment-btn.has-comment {
	background: var(--fwg-accent, #2271b1);
}

/* Wenn keine Favoriten aktiv sind, rückt der Kommentar-Button nach ganz rechts */
.fwg-item-wrap.fwg-no-fav .fwg-comment-btn {
	right: 8px;
}

.fwg-comment-box {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	padding: 8px;
	background: rgba(0, 0, 0, 0.8);
	border-radius: 6px;
	z-index: 3;
}

.fwg-comment-input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	padding: 6px 8px;
	font-size: 13px;
	resize: vertical;
	background: #fff;
	color: #222;
}

.fwg-comment-save {
	margin-top: 6px;
	padding: 5px 12px;
	border: none;
	border-radius: 4px;
	background: var(--fwg-accent, #2271b1);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}

.fwg-comment-save:hover {
	filter: brightness(0.87);
}

.fwg-comment-status {
	margin-left: 8px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.85);
}

/* =====================================================================
 * Dark Mode
 * =================================================================== */
.fwg-theme-dark {
	background: #16181c;
	padding: 20px;
	border-radius: 8px;
}

.fwg-theme-dark .fwg-proofing-bar {
	background: #23262b;
	border-color: #33373e;
	color: #e6e6e6;
}

.fwg-theme-dark .fwg-proofing-info,
.fwg-theme-dark .fwg-proofing-message {
	color: #e6e6e6;
}

.fwg-theme-dark .fwg-name-input {
	background: #2c2f35;
	border-color: #44484f;
	color: #f0f0f0;
}

.fwg-theme-dark .fwg-item {
	background: #23262b;
}

/* =====================================================================
 * Cover-Stile
 * =================================================================== */

/* Standard: .fwg-cover ist bereits unten ausgerichtet mit Verlauf
   (siehe .fwg-cover / .fwg-cover-inner oben) - das entspricht "gradient". */

/* Zentriert: Text mittig, gleichmäßiger dunkler Overlay statt Verlauf */
.fwg-cover-style-centered {
	align-items: stretch;
}

.fwg-cover-style-centered .fwg-cover-inner {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: rgba(0, 0, 0, 0.45);
}

/* Minimal: reines Bild, kein Text-Overlay */
.fwg-cover-style-minimal {
	align-items: stretch;
}

.fwg-cover-style-minimal .fwg-cover-inner {
	display: none;
}

/* Nur Studio-Logo: zentriert auf abgedunkeltem Bild */
.fwg-cover-style-logo {
	align-items: stretch;
}

.fwg-cover-style-logo .fwg-cover-inner {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: rgba(0, 0, 0, 0.35);
}

.fwg-cover-logo-img {
	max-width: 200px;
	max-height: 100px;
	width: auto;
	height: auto;
}

/* =====================================================================
 * Präsentationsmodus / Diashow, Ablauf-Countdown, Auswahl-Limit (ab 1.11.0)
 * =================================================================== */

/* "Diashow starten"-Button in der Bedienleiste */
.fwg-slideshow-start {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: var(--fwg-accent, #2271b1);
	color: #fff;
	border: 2px solid var(--fwg-accent, #2271b1);
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.fwg-slideshow-start:hover {
	filter: brightness(0.92);
}

/* Play/Pause-Steuerung – nur im Diashow-Modus sichtbar (JS toggelt [hidden]) */
.fwg-lightbox-play {
	position: absolute;
	top: 18px;
	left: 26px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.fwg-lightbox-play:hover {
	background: rgba(255, 255, 255, 0.28);
}

.fwg-lightbox-play[hidden] {
	display: none;
}

.fwg-lightbox-overlay.fwg-lb-light .fwg-lightbox-play {
	background: rgba(0, 0, 0, 0.1);
	color: #333;
}

/* Etwas satterer Hintergrund, wenn als Vollbild-Diashow gestartet */
.fwg-lightbox-overlay.is-slideshow {
	background: rgba(0, 0, 0, 0.97);
}

/* Sanfter Fade-In beim Bildwechsel.
   Basiszustand ist IMMER sichtbar (opacity:1) - die Animation blendet nur
   kurz ein. So kann ein Bild nie unsichtbar "hängen bleiben", egal ob
   onload/complete feuert. */
@keyframes fwgLbFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.fwg-lightbox-figure img {
	opacity: 1;
}

.fwg-lightbox-figure img.is-fading {
	animation: fwgLbFadeIn 0.35s ease;
}

/* Ablauf-Countdown – dezenter Hinweis über dem Raster */
.fwg-expiry-hint {
	margin: 0 0 16px;
	padding: 8px 14px;
	background: #f6f7f7;
	border: 1px solid #e0e0e0;
	border-left: 3px solid var(--fwg-accent, #2271b1);
	border-radius: 4px;
	font-size: 13.5px;
	color: #555;
}

.fwg-expiry-hint strong {
	color: #222;
}

.fwg-expiry-icon {
	margin-right: 4px;
}

/* Auswahl-Limit: "/ N" hinter dem Favoriten-Zähler */
.fwg-fav-max {
	color: #666;
	font-weight: 400;
}

/* --- Dark-Theme-Varianten --- */
.fwg-theme-dark .fwg-expiry-hint {
	background: #23262b;
	border-color: #33373e;
	color: #c7c7c7;
}

.fwg-theme-dark .fwg-expiry-hint strong {
	color: #f0f0f0;
}

.fwg-theme-dark .fwg-fav-max {
	color: #aeb2b8;
}

/* =====================================================================
 * Videos & Einzel-Download (ab 1.13.0)
 * =================================================================== */

/* Play-Badge über Video-Kacheln im Raster */
.fwg-item-video .fwg-item {
	position: relative;
	display: block;
}

.fwg-video-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	pointer-events: none;
	transition: background 0.15s ease;
}

.fwg-video-badge::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent #fff;
}

.fwg-item-video .fwg-item:hover .fwg-video-badge {
	background: rgba(0, 0, 0, 0.72);
}

/* Platzhalter, wenn ein Video kein Poster-Bild hat */
.fwg-video-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 140px;
	background: #1c1f24;
	color: #cfd3d8;
	padding: 16px;
	box-sizing: border-box;
}

.fwg-video-placeholder-name {
	font-size: 13px;
	text-align: center;
	word-break: break-word;
	opacity: 0.85;
}

/* Einzel-Download-Button (unten rechts, kollidiert nicht mit Herz/Kommentar) */
.fwg-dl-btn {
	position: absolute;
	bottom: 8px;
	right: 8px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
	text-decoration: none;
}

.fwg-dl-btn:hover {
	background: rgba(0, 0, 0, 0.65);
}

.fwg-dl-btn svg {
	width: 20px;
	height: 20px;
	display: block;
}

.fwg-dl-btn svg path {
	fill: rgba(255, 255, 255, 0.9);
}

/* Video in der Lightbox */
.fwg-lightbox-video {
	max-width: 90vw;
	max-height: 84vh;
	width: auto;
	height: auto;
	background: #000;
	border-radius: 2px;
	outline: none;
}

.fwg-lightbox-figure img[hidden],
.fwg-lightbox-video[hidden] {
	display: none;
}
