/**
 * gw-webcams — Basis-Styles (Single-Webcam + geteilte Tile-/Badge-/Credit-Styles).
 *
 * Theme-neutral (erbt Schrift/Farben vom aktiven Theme, z. B. Avada). Marken-Werte
 * als `var(--awb-…, #hex)` referenziert, damit sie Avada-nativ erben (Fallback =
 * meinSeenland-CI: Petrol #17415f, Teal #01708e, Text #141617, Josefin Sans).
 *
 * Mobile-first; alle interaktiven Ziele ≥ 44px.
 */

.gw-webcam,
.gw-webcams-dashboard {
	--gw-brand: var(--awb-color5, #17415f);
	--gw-cta: var(--awb-color6, #01708e);
	--gw-cta-hover: #015f78;
	--gw-ink: #141617;
	--gw-ink-soft: #434549;
	--gw-card: #fff;
	--gw-panel: #f9f9fb;
	--gw-badge: #f2f3f5;
	--gw-border: #e0e2e6;
	--gw-ok: #2c7a3f;
	--gw-warn: #b5520a;
	--gw-off: #8a8d92;
	--gw-form-radius: 6px;
	/* Editorial-Hervorhebung: weiche Radien + abgestufte Schatten. */
	--gw-card-radius: 14px;
	--gw-shadow-soft: 0 10px 30px -20px rgba(12, 35, 52, 0.45);
	--gw-shadow-lift: 0 28px 50px -26px rgba(12, 35, 52, 0.6);
	--gw-glass: rgba(8, 20, 28, 0.58);
	--gw-glass-strong: rgba(8, 20, 28, 0.7);
	font-family: "Josefin Sans", inherit, sans-serif;
	color: var(--gw-ink);
}

.gw-webcam *,
.gw-webcam *::before,
.gw-webcam *::after,
.gw-webcams-dashboard *,
.gw-webcams-dashboard *::before,
.gw-webcams-dashboard *::after {
	box-sizing: border-box;
}

.gw-webcam img,
.gw-webcam iframe,
.gw-webcams-dashboard img,
.gw-webcams-dashboard iframe {
	max-width: 100%;
}

/* --- Single-Webcam-Seite -------------------------------------------------- */

.single-gw_webcam h1 {
	overflow-wrap: break-word;
	hyphens: auto;
}

@media (max-width: 640px) {
	.single-gw_webcam h1 {
		font-size: 2rem !important;
		line-height: 1.2 !important;
	}
}

/* Avadas datums-basierte Vor/Zurück-Navigation auf Singles ausblenden. */
.single-gw_webcam .single-navigation,
.single-gw_webcam .fusion-post-slideshow {
	display: none;
}

.gw-webcam-back {
	margin: 0 0 1.25em;
	font-size: 0.95em;
	font-weight: 600;
}

.gw-webcam-back a {
	color: var(--gw-cta);
	text-decoration: none;
}

.gw-webcam-back a:hover,
.gw-webcam-back a:focus {
	text-decoration: underline;
}

.gw-webcam-details {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4em 1.2em;
	margin: 1.25em 0;
	padding: 1.2em 1.4em;
	border: 1px solid var(--gw-border);
	border-radius: var(--gw-form-radius);
	background: rgba(0, 0, 0, 0.02);
}

.gw-webcam-details dt {
	margin: 0;
	font-weight: 600;
	color: var(--gw-ink-soft);
}

.gw-webcam-details dd {
	margin: 0;
}

/* --- Kamera-Medienblock (Bild / Consent / Link-out) ----------------------- */

.gw-webcam-media {
	position: relative;
	overflow: hidden;
	margin: 0 0 0.75rem;
	background: var(--gw-badge);
	border-radius: var(--gw-form-radius);
}

.gw-webcam-media--image {
	aspect-ratio: 16 / 9;
}

.gw-webcam-img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	background: var(--gw-badge);
	/* Sanfte, selbstbewusste Bewegung: dezenter Hover-Zoom (Card steuert das). */
	transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

/* Erstes Erscheinen nach dem Lazy-Load: weiches Einblenden (nur Opacity, damit
 * der Hover-/Refresh-Transform am `transform` ungestört bleibt — kein fill). */
.gw-webcam-img[data-gw-loaded] {
	animation: gw-webcam-fadein 0.5s ease;
}

@keyframes gw-webcam-fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* --- Bild-Overlays (image-forward Cam-Card) ------------------------------- */

/* Subtiler Top-/Bottom-Verlauf, damit Overlay-Text auf jedem Bild lesbar bleibt. */
.gw-webcam-media--image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(to bottom, rgba(8, 20, 28, 0.5) 0%, rgba(8, 20, 28, 0) 24%),
		linear-gradient(to top, rgba(8, 20, 28, 0.6) 0%, rgba(8, 20, 28, 0) 34%);
}

.gw-webcam-overlay {
	position: absolute;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	max-width: calc(100% - 1.2rem);
}

.gw-webcam-overlay--tl {
	top: 0.7rem;
	left: 0.7rem;
}

.gw-webcam-overlay--tr {
	top: 0.7rem;
	right: 0.7rem;
	justify-content: flex-end;
}

/* ● LIVE (pulsierender Punkt) — glasige Chip-Optik. */
.gw-webcam-live {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.65rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: #fff;
	background: var(--gw-glass);
	backdrop-filter: blur(7px) saturate(1.2);
	-webkit-backdrop-filter: blur(7px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.7);
}

.gw-webcam-live-dot {
	width: 0.52rem;
	height: 0.52rem;
	border-radius: 50%;
	background: #ff4d4d;
	box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
}

.gw-webcam-live--live .gw-webcam-live-dot {
	background: #36d17a;
	animation: gw-webcam-livepulse 1.8s ease-in-out infinite;
}

.gw-webcam-live--stale .gw-webcam-live-dot {
	background: #f0a23b;
}

.gw-webcam-live--offline .gw-webcam-live-dot {
	background: var(--gw-off);
}

@keyframes gw-webcam-livepulse {
	0% {
		box-shadow: 0 0 0 0 rgba(54, 209, 122, 0.6);
	}
	70% {
		box-shadow: 0 0 0 0.5rem rgba(54, 209, 122, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(54, 209, 122, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gw-webcam-live--live .gw-webcam-live-dot {
		animation: none;
	}
}

.gw-webcam-overlay-fresh {
	display: inline-flex;
	align-items: center;
	padding: 0.28rem 0.6rem;
	font-size: 0.68rem;
	font-weight: 600;
	color: #f4f7f9;
	background: var(--gw-glass);
	backdrop-filter: blur(7px) saturate(1.2);
	-webkit-backdrop-filter: blur(7px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
}

/* Wetter-Chip (Icon + Temperatur) oben rechts — glasige Pille. */
.gw-webcam-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.32rem 0.7rem;
	font-size: 0.86rem;
	font-weight: 700;
	color: #fff;
	background: var(--gw-glass-strong);
	backdrop-filter: blur(7px) saturate(1.2);
	-webkit-backdrop-filter: blur(7px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.7);
}

.gw-webcam-chip-icon {
	font-size: 1.05rem;
	line-height: 1;
}

.gw-webcam-chip-temp {
	font-variant-numeric: tabular-nums;
}

/* Pflicht-Anbieter-Credit als Bild-Overlay (unten links). */
.gw-webcam-overlay-credit {
	position: absolute;
	left: 0.85rem;
	bottom: 0.7rem;
	z-index: 3;
	max-width: calc(100% - 1.6rem);
	overflow: hidden;
	font-size: 0.7rem;
	font-weight: 500;
	line-height: 1.2;
	color: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
	white-space: nowrap;
	text-overflow: ellipsis;
}

a.gw-webcam-overlay-credit:hover,
a.gw-webcam-overlay-credit:focus {
	color: #fff;
	text-decoration: underline;
}

/* --- Nacht-Zustand (intentionaler Nachtruhe-Gradient statt schwarzem Loch) - */

/* Echtes (dunkles) Live-Nachtbild: dezent abdunkeln + kühler Petrol-Schleier. */
.gw-webcam-media--night .gw-webcam-img {
	filter: brightness(0.72) saturate(0.85);
}

/* Archiv-Tageslichtbild bei Nacht: NICHT abdunkeln (es ist ein helles Bild),
 * nur ein leichter Abend-Touch + klares „Letztes Tageslichtbild"-Label. */
.gw-webcam-media--daylight-archive .gw-webcam-img {
	filter: brightness(0.94) saturate(1.02) sepia(0.06);
}

.gw-webcam-night {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0 0.75rem 0.95rem;
	pointer-events: none;
	background:
		linear-gradient(to top, rgba(7, 17, 32, 0.82) 0%, rgba(7, 17, 32, 0.18) 45%, rgba(7, 17, 32, 0.4) 100%);
}

/* Archiv-Variante: ruhiger, blauer Abend-Verlauf (kein „Loch"-Eindruck). */
.gw-webcam-night--daylight {
	background:
		linear-gradient(to top, rgba(12, 35, 52, 0.72) 0%, rgba(12, 35, 52, 0.04) 42%, rgba(12, 35, 52, 0.12) 100%);
}

.gw-webcam-night-text {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.32rem 0.7rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: #eaf1f6;
	text-align: center;
	background: var(--gw-glass);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Consent-Platzhalter (Zwei-Klick, kein Dritt-Request vor Klick). */
.gw-webcam-media--consent {
	aspect-ratio: 16 / 9;
}

.gw-webcam-consent {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 9rem;
	padding: 1.1rem 1.25rem;
	color: #fff;
	background:
		linear-gradient(rgba(20, 22, 23, 0.72), rgba(20, 22, 23, 0.72)),
		var(--gw-brand);
}

.gw-webcam-consent-text {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.45;
}

.gw-webcam-consent-terms,
.gw-webcam-consent-linkout {
	color: #fff;
	text-decoration: underline;
}

.gw-webcam-consent-btn {
	min-height: 44px;
	padding: 0.6rem 1.4rem;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #fff;
	background: var(--gw-cta);
	border: 0;
	border-radius: 2px;
	cursor: pointer;
	transition: background 0.16s ease;
}

.gw-webcam-consent-btn:hover,
.gw-webcam-consent-btn:focus {
	background: var(--gw-cta-hover);
}

.gw-webcam-consent-linkout {
	font-size: 0.8rem;
}

/* Das nach Consent eingefügte Iframe füllt den Block. */
.gw-webcam-media--consent iframe {
	width: 100%;
	height: 100%;
	min-height: 12rem;
	border: 0;
}

/* Link-out (kein Bild, kein Iframe — nur Verweis auf Anbieter). */
.gw-webcam-media--linkout,
.gw-webcam-media--unavailable {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 9rem;
	padding: 1.25rem;
	text-align: center;
}

.gw-webcam-linkout-link {
	display: inline-flex;
	flex-direction: column;
	gap: 0.4rem;
	align-items: center;
	min-height: 44px;
	color: var(--gw-cta);
	text-decoration: none;
	font-weight: 600;
}

.gw-webcam-linkout-link:hover,
.gw-webcam-linkout-link:focus {
	color: var(--gw-cta-hover);
	text-decoration: underline;
}

.gw-webcam-linkout-icon {
	font-size: 1.75rem;
}

.gw-webcam-media--unavailable {
	color: var(--gw-ink-soft);
	font-style: italic;
}

.gw-webcam-media--unavailable p {
	margin: 0;
}

/* --- Status-Badge (live/stale/offline) ------------------------------------ */

.gw-webcam-status {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.55rem;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #fff;
	background: var(--gw-off);
	border-radius: 2px;
}

.gw-webcam-status::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: currentColor;
}

.gw-webcam-status--live {
	background: var(--gw-ok);
}

.gw-webcam-status--live::before {
	animation: gw-webcam-pulse 1.6s ease-in-out infinite;
}

.gw-webcam-status--stale {
	background: var(--gw-warn);
}

.gw-webcam-status--offline {
	background: var(--gw-off);
}

/* Single-Detailblock: Status-Badge als eigenständiger Inline-Chip (nicht absolut). */
.gw-webcam > .gw-webcam-status,
.gw-webcam-details + .gw-webcam-status {
	position: static;
	margin: 0 0 0.75rem;
}

@keyframes gw-webcam-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gw-webcam-status--live::before {
		animation: none;
	}
}

/* --- Provider-Credit (Pflicht) -------------------------------------------- */

.gw-webcam-credit {
	margin: 0.5rem 0 0;
	font-size: 0.75rem;
	color: var(--gw-ink-soft);
}

.gw-webcam-credit a {
	color: var(--gw-cta);
	text-decoration: none;
}

.gw-webcam-credit a:hover,
.gw-webcam-credit a:focus {
	text-decoration: underline;
}

/* --- Daten-Zeilen (Luft/Wasser/Bade) -------------------------------------- */

.gw-webcam-data {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	margin: 0.25rem 0 0;
	font-size: 0.9rem;
	color: var(--gw-ink);
}

.gw-webcam-data-icon {
	font-size: 1.05rem;
	line-height: 1;
}

.gw-webcam-data-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.gw-webcam-feels {
	font-size: 0.8rem;
	color: var(--gw-ink-soft);
}

.gw-webcam-data--missing {
	font-size: 0.82rem;
	font-style: italic;
	color: var(--gw-ink-soft);
}

/* --- Badegewässer-Badge + Badestatus -------------------------------------- */

.gw-webcam-bathing-badge {
	display: inline-block;
	padding: 0.18rem 0.55rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--gw-cta);
	border-radius: 2px;
}

.gw-webcam-bathing-status {
	margin-left: 0.4rem;
	font-size: 0.82rem;
	color: var(--gw-ink-soft);
}

/* --- Frische-Label -------------------------------------------------------- */

.gw-webcam-tile-freshness,
.gw-webcams-ort-freshness {
	margin: 0.3rem 0 0;
	font-size: 0.72rem;
	color: var(--gw-ink-soft);
}

/* --- Mobile-Overflow-Schutz (Bugfix 2026-06-06) --- */
.gw-webcams-dashboard{overflow-x:clip}
.gw-webcams-dashboard .gw-webcams-grid{min-width:0}
.gw-webcams-dashboard .gw-webcam-tile{min-width:0;max-width:100%}
.gw-webcams-dashboard .gw-webcam-tile *{min-width:0}
