/* ==========================================================================
   Wanted-Poster (Mitgliedersuche)
   Overlay ueber der Startseite, muss aktiv geschlossen werden.
   Schriften liegen lokal (keine Verbindung zu Google-Servern):
   Rye (SIL Open Font License), Special Elite (Apache License 2.0)
   ========================================================================== */

@font-face {
	font-family: 'Rye';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/rye-latin.woff2') format('woff2');
}

@font-face {
	font-family: 'Special Elite';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/special-elite-latin.woff2') format('woff2');
}

.wanted-overlay {
	--w-ink: #3a2412;
	--w-paper: #f1dfb2;
	--w-red: #a3201a;

	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	/* ueber der mobilen Titelleiste (10001) und dem Seitenmenue (10002) */
	z-index: 10010;
	display: flex;
	padding: 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: rgba(15, 10, 5, 0.75);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: wanted-fade 0.3s ease-out;
}

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

.wanted-overlay.is-closing {
	animation: wanted-fade-out 0.3s ease-in forwards;
}

/* Seite dahinter nicht scrollen, solange das Poster offen ist */
html.wanted-open,
html.wanted-open body {
	overflow: hidden;
}

/* Rahmen: traegt Schatten und Nagel (das Poster selbst ist an den Kanten beschnitten) */
.wanted-frame {
	position: relative;
	margin: auto;
	width: 100%;
	max-width: 540px;
	filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.6));
	transform: rotate(-1.2deg);
	animation: wanted-drop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.wanted-frame::before {
	content: '';
	position: absolute;
	top: 10px;
	left: 50%;
	z-index: 2;
	width: 16px;
	height: 16px;
	margin-left: -8px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #d9d9d9 0%, #8a8a8a 45%, #3d3d3d 100%);
	box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.5);
}

.wanted-poster {
	position: relative;
	/* Schriftgroessen unten skalieren mit der Posterbreite (cqi) */
	container-type: inline-size;
	padding: 34px 32px 26px;
	color: var(--w-ink);
	font-family: 'Special Elite', 'Courier New', monospace;
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .18 0 0 0 0 .05 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
		radial-gradient(circle at 16% 14%, rgba(130, 75, 20, 0.2), transparent 24%),
		radial-gradient(circle at 88% 70%, rgba(130, 75, 20, 0.16), transparent 28%),
		radial-gradient(ellipse at center, #f6e8c4 0%, #ecd6a2 55%, #d9b779 85%, #bd9150 100%);
	box-shadow:
		inset 0 0 45px rgba(90, 45, 5, 0.55),
		inset 0 0 6px rgba(60, 30, 0, 0.6);
	/* leicht ausgefranste Papierkanten */
	-webkit-clip-path: polygon(0.6% 0.4%, 12% 0, 25% 0.5%, 38% 0.1%, 52% 0.6%, 66% 0, 80% 0.4%, 93% 0.1%, 99.5% 0.7%, 100% 12%, 99.4% 26%, 100% 41%, 99.5% 57%, 100% 72%, 99.3% 86%, 99.8% 99.5%, 87% 100%, 74% 99.4%, 60% 100%, 47% 99.5%, 33% 100%, 19% 99.4%, 6% 100%, 0.3% 99.6%, 0.7% 85%, 0 70%, 0.6% 54%, 0 38%, 0.5% 22%, 0 9%);
	clip-path: polygon(0.6% 0.4%, 12% 0, 25% 0.5%, 38% 0.1%, 52% 0.6%, 66% 0, 80% 0.4%, 93% 0.1%, 99.5% 0.7%, 100% 12%, 99.4% 26%, 100% 41%, 99.5% 57%, 100% 72%, 99.3% 86%, 99.8% 99.5%, 87% 100%, 74% 99.4%, 60% 100%, 47% 99.5%, 33% 100%, 19% 99.4%, 6% 100%, 0.3% 99.6%, 0.7% 85%, 0 70%, 0.6% 54%, 0 38%, 0.5% 22%, 0 9%);
}

/* Theme-Vorgaben (main.css) fuer Ueberschriften, Absaetze und Listen zuruecksetzen */
.wanted-poster :where(h2, p, ul, li, figure, figcaption) {
	margin: 0;
	padding: 0;
	color: inherit;
}

.wanted-close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 2px solid var(--w-ink);
	border-radius: 50%;
	background: rgba(58, 36, 18, 0.08);
	color: var(--w-ink);
	font-family: Arial, sans-serif;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.wanted-close:hover {
	background: var(--w-ink);
	color: var(--w-paper);
}

.wanted-title {
	font-family: 'Rye', Georgia, serif;
	font-size: clamp(48px, 15vw, 96px);
	font-size: clamp(44px, 17cqi, 96px);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.04em;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.wanted-sub {
	margin: 8px 0 12px;
	padding: 3px 0;
	border-top: 3px double var(--w-ink);
	border-bottom: 3px double var(--w-ink);
	font-size: 15px;
	letter-spacing: 0.35em;
	text-transform: uppercase;
}

.wanted-target {
	font-family: 'Rye', Georgia, serif;
	font-size: clamp(22px, 6.6vw, 36px);
	font-size: clamp(22px, 6.6cqi, 36px);
	line-height: 1.15;
}

.wanted-cc {
	font-size: 15px;
}

/* Portraet-Rahmen mit Silhouette und Vereinssiegel */
.wanted-portrait {
	margin: 14px 0 0;
}

.wanted-portrait-box {
	position: relative;
	width: clamp(130px, 38%, 190px);
	margin: 0 auto;
	aspect-ratio: 10 / 11;
	border: 3px solid var(--w-ink);
	background: rgba(58, 36, 18, 0.07);
	box-shadow: inset 0 0 18px rgba(90, 45, 5, 0.35);
}

.wanted-portrait-box svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: var(--w-ink);
	opacity: 0.85;
}

.wanted-portrait-box text {
	fill: var(--w-paper);
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 70px;
	font-weight: 700;
}

.wanted-seal {
	position: absolute;
	top: -14%;
	right: -40%;
	width: 58%;
	opacity: 0.8;
	mix-blend-mode: multiply;
	filter: sepia(1) saturate(1.4) contrast(1.15);
	transform: rotate(14deg);
	pointer-events: none;
}

.wanted-caption {
	margin-top: 6px;
	font-size: 14px;
}

.wanted-text {
	margin: 12px 0 0;
}

.wanted-text p {
	margin-bottom: 0.5em;
}

.wanted-text strong {
	color: var(--w-red);
	font-weight: 400;
}

/* Kennzeichen der Wunsch-Regionen */
.wanted-revier {
	margin-top: 10px;
}

.wanted-label {
	display: block;
	margin-bottom: 6px;
	font-family: 'Rye', Georgia, serif;
	font-size: 15px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wanted-plates {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	list-style: none;
}

.wanted-plates li {
	padding: 0 7px;
	border: 2px solid var(--w-ink);
	border-radius: 3px;
	background: rgba(255, 248, 225, 0.35);
	font-size: 15px;
	line-height: 1.6;
	letter-spacing: 0.06em;
}

.wanted-plates li:nth-child(3n + 1) { transform: rotate(-2deg); }
.wanted-plates li:nth-child(3n + 2) { transform: rotate(1.5deg); }

.wanted-plates li.is-new {
	border-color: var(--w-red);
	color: var(--w-red);
}

.wanted-plates abbr {
	border: 0;
	text-decoration: none;
	cursor: help;
}

/* Belohnung mit Stempel */
.wanted-reward {
	position: relative;
	margin: 16px 0 0;
	padding: 6px 0 8px;
	border-top: 3px double var(--w-ink);
	border-bottom: 3px double var(--w-ink);
}

.wanted-reward-label {
	display: block;
	font-family: 'Rye', Georgia, serif;
	font-size: 16px;
	letter-spacing: 0.25em;
}

.wanted-reward-value {
	display: block;
	font-family: 'Rye', Georgia, serif;
	font-size: clamp(20px, 5.6vw, 30px);
	font-size: clamp(20px, 5.6cqi, 30px);
	line-height: 1.2;
}

.wanted-stamp {
	position: absolute;
	top: -16px;
	right: -6px;
	padding: 1px 10px;
	border: 3px solid var(--w-red);
	border-radius: 6px;
	color: var(--w-red);
	font-size: 15px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.8;
	transform: rotate(-12deg);
	mix-blend-mode: multiply;
}

/* Buttons */
.wanted-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 18px;
}

.wanted-poster .wanted-cta,
.wanted-poster .wanted-dismiss {
	display: inline-block;
	padding: 9px 20px;
	border: 2px solid var(--w-ink);
	border-radius: 4px;
	font-family: 'Rye', Georgia, serif;
	font-size: 17px;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.wanted-poster .wanted-cta {
	background: var(--w-ink);
	box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
	color: var(--w-paper);
}

.wanted-poster .wanted-cta:hover {
	background: var(--w-red);
	border-color: var(--w-red);
	/* main.css faerbt Links beim Hover mit !important blau */
	color: var(--w-paper) !important;
	transform: translateY(-1px);
}

.wanted-poster .wanted-dismiss {
	background: transparent;
	color: var(--w-ink);
}

.wanted-poster .wanted-dismiss:hover {
	background: rgba(58, 36, 18, 0.12);
}

.wanted-poster button:focus-visible,
.wanted-poster a:focus-visible {
	outline: 3px solid var(--w-red);
	outline-offset: 3px;
}

.wanted-footer {
	margin-top: 14px;
	font-size: 13px;
	letter-spacing: 0.08em;
	opacity: 0.85;
}

@media screen and (max-width: 480px) {

	.wanted-overlay {
		padding: 10px;
	}

	/* oben Platz fuer den Schliessen-Knopf, damit er WANTED nicht verdeckt */
	.wanted-poster {
		padding: 54px 18px 22px;
	}

	.wanted-close {
		top: 10px;
		right: 10px;
	}

	.wanted-sub {
		letter-spacing: 0.2em;
	}

	/* Stempel unter die Belohnung, damit er auf schmalen Displays nichts verdeckt */
	.wanted-stamp {
		position: static;
		display: inline-block;
		margin-top: 6px;
		font-size: 13px;
		transform: rotate(-5deg);
	}

}

/* Niedrige, breite Bildschirme (Laptops): Bild und Text nebeneinander,
   damit das ganze Poster samt Buttons ohne Scrollen sichtbar ist */
@media screen and (max-height: 940px) and (min-width: 600px) {

	.wanted-frame {
		max-width: 600px;
	}

	.wanted-poster {
		padding: 26px 32px 18px;
	}

	.wanted-title {
		font-size: 62px;
	}

	.wanted-sub {
		margin: 4px 0 8px;
	}

	.wanted-target {
		font-size: 28px;
	}

	.wanted-body {
		display: flex;
		align-items: center;
		gap: 22px;
		margin-top: 10px;
	}

	.wanted-portrait {
		flex: 0 0 160px;
		margin: 0;
	}

	.wanted-portrait-box {
		width: 112px;
	}

	.wanted-seal {
		right: -30%;
		width: 50%;
	}

	.wanted-caption {
		font-size: 13px;
		line-height: 1.3;
	}

	.wanted-text {
		margin: 0;
		font-size: 15px;
		line-height: 1.45;
		text-align: left;
	}

	.wanted-revier {
		margin-top: 8px;
	}

	.wanted-plates {
		gap: 5px;
	}

	.wanted-plates li {
		padding: 0 5px;
	}

	.wanted-reward,
	.wanted-actions {
		margin-top: 12px;
	}

	.wanted-stamp {
		top: -8px;
		padding: 0 8px;
		font-size: 13px;
	}

	.wanted-footer {
		margin-top: 8px;
	}

}

@keyframes wanted-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wanted-fade-out {
	from { opacity: 1; }
	to   { opacity: 0; }
}

@keyframes wanted-drop {
	0%   { opacity: 0; transform: translateY(-70px) rotate(-7deg); }
	60%  { opacity: 1; transform: translateY(8px) rotate(0deg); }
	80%  { transform: translateY(-3px) rotate(-2deg); }
	100% { transform: translateY(0) rotate(-1.2deg); }
}

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

	.wanted-overlay,
	.wanted-overlay.is-closing,
	.wanted-frame {
		animation: none;
	}

}
