.gfwp {
	--gf-green: #1b8500;       /* kleine grüne Texte (Kontrast auf Weiß) */
	--gf-btn: #4ba834;         /* Button-Grün der Website */
	--gf-btn-hover: #3d9128;
	--gf-ink: #333333;
	--gf-grey: #333333;
	--gf-paper: #ffffff;
	--gf-mist: #f3f5f1;
	--gf-font: Arial, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	box-sizing: border-box;
}

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

.gfwp[hidden] {
	display: none;
}

/* ---- Overlay ---------------------------------------------------------- */
.gfwp__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 28, 18, 0.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* ---- Dialog ----------------------------------------------------------- */
.gfwp__dialog {
	position: relative;
	width: 100%;
	max-width: 780px;
	min-width: 0;
	max-height: calc(100vh - 2.5rem);
	max-height: calc(100dvh - 2.5rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: clamp(2rem, 5vw, 2.75rem) clamp(1.25rem, 4.5vw, 2.75rem) clamp(1.5rem, 4vw, 2.25rem);
	background: var(--gf-paper);
	color: var(--gf-grey);
	font-family: var(--gf-font);
	text-align: center;
	border-radius: 10px;
	box-shadow: 0 30px 80px -20px rgba(10, 20, 8, 0.55);
	transform: translateY(18px) scale(0.98);
	opacity: 0;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.gfwp__dialog:focus {
	outline: none;
}

.gfwp.is-visible .gfwp__overlay {
	opacity: 1;
}

.gfwp.is-visible .gfwp__dialog {
	transform: none;
	opacity: 1;
}

/* ---- Kopf ------------------------------------------------------------- */
.gfwp__head {
	max-width: 560px;
	margin: 0 auto clamp(1.5rem, 4vw, 2rem);
}

.gfwp .gfwp__title {
	margin: 0 0 0.85rem;
	padding: 0;
	font-family: var(--gf-font);
	font-weight: bold;
	font-size: clamp(1.6rem, 5vw, 2.2rem); /* Website-h2 ist 2.5em – im Popup etwas kleiner */
	line-height: 1.2;
	color: #333;
	text-align: center; /* Divi setzt bei h2 eine eigene Ausrichtung */
	text-wrap: balance;
}

.gfwp .gfwp__text {
	margin: 0;
	padding: 0;
	font-family: var(--gf-font);
	font-size: 1rem;
	line-height: 1.6;
	color: #333;
	text-wrap: pretty;
}

/* ---- Gewinner --------------------------------------------------------- */
.gfwp__winners {
	display: grid;
	gap: clamp(1rem, 3vw, 1.5rem);
	margin: 0 0 clamp(1.5rem, 4vw, 2rem);
}

.gfwp__winners--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gfwp__winners--1 {
	grid-template-columns: minmax(0, 1fr);
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

.gfwp .gfwp__winner {
	margin: 0;
	padding: 0;
	min-width: 0;
}

.gfwp__frame {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 6px;
	background: var(--gf-mist);
	isolation: isolate; /* Ecken bleiben auch beim Hover-Zoom rund */
}

/* Bild absolut im Rahmen: füllt ihn immer komplett, egal welches Seitenverhältnis
   das Original hat (height: 100% greift in aspect-ratio-Rahmen nicht zuverlässig). */
.gfwp .gfwp__frame .gfwp__img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gfwp__winner:hover .gfwp__img {
	transform: scale(1.03);
}

/* Klickbares Bild (Lightbox) */
.gfwp .gfwp__zoom {
	position: absolute;
	inset: 0;
	display: block;
	cursor: zoom-in;
	text-decoration: none;
}

.gfwp .gfwp__zoom:focus-visible {
	outline: 3px solid var(--gf-green);
	outline-offset: -3px;
}

/* Lupen-Symbol unten rechts (Font Awesome „magnifying-glass-plus“) */
.gfwp__zoom-icon {
	position: absolute;
	right: 0.6rem;
	bottom: 0.6rem;
	width: 2.2rem;
	height: 2.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35);
	color: var(--gf-btn);
	opacity: 0.9;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.gfwp .gfwp__zoom-icon svg {
	display: block;
	width: 1.3rem;
	height: 1.3rem;
}

.gfwp__zoom:hover .gfwp__zoom-icon,
.gfwp__zoom:focus-visible .gfwp__zoom-icon {
	opacity: 1;
	transform: scale(1.06);
}

.gfwp .gfwp__caption {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin: 0.8rem 0 0;
	padding: 0;
	font-family: var(--gf-font);
}

.gfwp__label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gf-green);
}

.gfwp__name {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--gf-ink);
}

/* ---- Aktionen --------------------------------------------------------- */
.gfwp__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: center;
	justify-content: center;
}

.gfwp .gfwp__btn {
	appearance: none;
	margin: 0;
	border: 0;
	cursor: pointer;
	font-family: var(--gf-font);
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease, border-color 0.2s ease;
}

/* Wie die Divi-Buttons der Website („ZUR WEBSITE“) */
.gfwp .gfwp__btn--primary {
	display: inline-block;
	padding: 15px 26px;
	border-radius: 100px;
	background: var(--gf-btn);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.gfwp .gfwp__btn--primary:hover {
	background: var(--gf-btn-hover);
	color: #fff;
	transform: translateY(-1px);
}

/* Zweiter Text-Button „Schließen“ neben dem Link-Button: ausgeblendet.
   Schließen geht weiterhin über das X, ESC und Klick außerhalb. */
.gfwp .gfwp__btn--ghost {
	display: none;
}

.gfwp .gfwp__btn:focus-visible,
.gfwp .gfwp__close:focus-visible {
	outline: 2px solid var(--gf-green);
	outline-offset: 3px;
}

/* ---- Schließen (X) ---------------------------------------------------- */
.gfwp .gfwp__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 2.4rem;
	height: 2.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 1px solid #dcdfd8;
	border-radius: 50%;
	background: #fff;
	color: var(--gf-grey);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Das X: zwei gekreuzte Linien, exakt in der Kreismitte (unabhängig von der Schrift). */
.gfwp__close-icon {
	position: relative;
	display: block;
	width: 14px;
	height: 14px;
}

.gfwp__close-icon::before,
.gfwp__close-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	margin: -1px 0 0 -8px;
	border-radius: 2px;
	background: currentColor;
}

.gfwp__close-icon::before { transform: rotate(45deg); }
.gfwp__close-icon::after  { transform: rotate(-45deg); }

.gfwp .gfwp__close:hover {
	background: var(--gf-mist);
	border-color: #c3c8bd;
	color: var(--gf-ink);
}

/* ---- Reveal beim Öffnen ----------------------------------------------- */
.gfwp__head,
.gfwp__winner,
.gfwp__actions {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gfwp.is-visible .gfwp__head                { opacity: 1; transform: none; transition-delay: 0.1s; }
.gfwp.is-visible .gfwp__winner:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.2s; }
.gfwp.is-visible .gfwp__winner:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.28s; }
.gfwp.is-visible .gfwp__actions             { opacity: 1; transform: none; transition-delay: 0.36s; }

/* ---- Mobil ------------------------------------------------------------ */
@media (max-width: 600px) {
	.gfwp {
		padding: 0.75rem;
	}

	.gfwp__dialog {
		max-height: calc(100vh - 1.5rem);
		max-height: calc(100dvh - 1.5rem);
	}

	.gfwp__winners--2 {
		grid-template-columns: minmax(0, 1fr);
	}

	.gfwp__frame {
		aspect-ratio: 3 / 2;
	}

	.gfwp__actions {
		flex-direction: column-reverse;
	}

	.gfwp .gfwp__btn--primary {
		width: 100%;
	}
}

/* ---- Reduzierte Bewegung ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.gfwp__overlay,
	.gfwp__dialog,
	.gfwp__head,
	.gfwp__winner,
	.gfwp__actions,
	.gfwp .gfwp__img,
	.gfwp .gfwp__btn {
		transition-duration: 0.001s !important;
		transition-delay: 0s !important;
		transform: none !important;
	}
}
