/* Reiseseite: Karte füllt den Bildschirm. Das Band mit Reisekachel und Tagen liegt unten (Hochformat)
   oder rechts (Querformat), der Zurück-Pfeil sitzt fest am Anfang des Bands. */

html.gg-html, body.reise-page { height: var(--app-height, 100%); margin: 0; padding: 0; overflow: hidden; overscroll-behavior: none; }
/* Bleibt außerhalb des Bildschirminhalts ein Streifen frei (Safari-Leisten), hat er die Farbe der Kacheln. */
html.gg-html { background: var(--bg); }

/* --band-pad: unterer Innenabstand des Bands. Hochformat: Das Band wird um so viel (höchstens um den Sperrbereich unten) nach unten
   geschoben, ohne dass sich Größe oder Inhalt ändern: die Karte wird entsprechend höher, die Kacheln bleiben vollständig. */
.gg-reise {
	--end-size: 10px; --end-size-active: 12px; --end-ring: 1.5px; --end-color: #111;
	position: fixed; inset: 0;
	height: var(--app-height, auto); /* als installierte Web-App: echte Bildschirmhöhe (siehe header-reise.php) */
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) auto;
	background: var(--bg);
}
.gg-mapwrap { position: relative; min-height: 0; min-width: 0; }
.gg-map { position: absolute; inset: 0; background: #1b2420; }

/* Die Karte darf unter Uhr und Kamerabereich liegen. Ein leichter Schleier dort hält die Statusleiste lesbar.
   Ohne solchen Bereich (Safe Area = 0) hat er die Höhe 0. */
.gg-mapwrap::before {
	content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 450; pointer-events: none;
	height: calc(env(safe-area-inset-top, 0px) * 1.4);
	background: linear-gradient(to bottom, rgba(14, 20, 18, 0.55), rgba(14, 20, 18, 0));
}

/* Band: Pfeil (fest) und Streifen (scrollt) */
.gg-band {
	display: flex; min-width: 0; min-height: 0;
	background: var(--bg); border-top: 1px solid var(--line);
}
.gg-back {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	width: calc(46px + env(safe-area-inset-left, 0px));
	padding: 0 0 0 env(safe-area-inset-left, 0px);
	color: var(--text); text-decoration: none;
	background: none; /* gleiche Fläche wie das Band: wirkt wie ein Teil des Rahmens */
}
.gg-back:hover { color: var(--route); }
.gg-back-icon { display: block; }

.gg-strip {
	flex: 1 1 auto; min-width: 0;
	display: flex; gap: 10px;
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x proximity; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
	padding: 10px calc(50% - 74px) 10px 10px;
}
.gg-strip {
  scrollbar-width: none;
}

.gg-strip::-webkit-scrollbar {
  display: none;
}

@media (pointer: fine) {
  .gg-strip {
    scrollbar-width: thin; /* oder 'auto' */
    scrollbar-color: var(--surface) var(--bg);
  }

  /* WebKit-Styling (für Hover-Effekt & ältere Browser) */
  .gg-strip::-webkit-scrollbar {
    display: block;
    height: 8px;
  }

  .gg-strip::-webkit-scrollbar-track {
    background: var(--surface-2);
  }

  .gg-strip::-webkit-scrollbar-thumb {
    background-color: var(--surface);
    border-radius: 4px;
  }

  .gg-strip::-webkit-scrollbar-thumb:hover {
    background-color: var(--route);
  }
}


/* Reisekachel: scrollt mit dem Band, steht vor dem ersten Tag */
.gg-info {
	flex: 0 0 min(280px, 72vw); min-width: 0;
	display: flex; flex-direction: column; gap: 3px;
	padding: 10px 12px 10px;
	position: relative;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	scroll-snap-align: start;
}
.gg-title { margin: 0; padding-right: 28px; font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.gg-dates { margin: 0; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gg-facts { margin: 0; font-size: 0.8rem; color: var(--muted); }
.gg-desc {
	margin: 4px 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--muted);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Info-Symbol: öffnet Datenschutz-Hinweise innerhalb der Kachel */
.gg-info-btn {
	position: absolute; top: 4px; right: 4px; z-index: 4;
	display: flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0;
	color: var(--muted); background: none; border: 0; border-radius: 50%; cursor: pointer;
}
.gg-info-btn::after { content: ""; position: absolute; inset: -6px; } /* größere Tippfläche */
.gg-info-btn:hover, .gg-info-btn[aria-expanded="true"] { color: var(--route); }
.gg-legal-pop {
	position: absolute; inset: 0; z-index: 3;
	display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px;
	padding: 14px 44px 14px 16px;
	background: var(--surface); border-radius: var(--radius);
}
.gg-legal-pop[hidden] { display: none; }
.gg-legal-pop p { margin: 0; font-size: 0.8rem; line-height: 1.35; color: var(--muted); }
.gg-legal-pop a, .gg-legal-pop .linklike { color: var(--text); font-size: 0.95rem; text-align: left; }

/* Tage */
.gg-days { flex: 0 0 auto; display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gg-li { flex: 0 0 148px; scroll-snap-align: center; }

.gg-day {
	display: block; height: 100%;
	color: inherit; text-decoration: none;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.gg-day-img { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.gg-day-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gg-day-text { display: block; padding: 6px 8px 8px; }
.gg-day-date { display: block; font-size: 0.72rem; color: var(--muted); }
.gg-day-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-size: 0.85rem; font-weight: 600; line-height: 1.25; color: var(--text);
}
.gg-day.is-active { border-color: var(--route); box-shadow: 0 0 0 1px var(--route); }

@media (orientation: landscape) {
	.gg-reise {
		grid-template-columns: minmax(0, 1fr) calc(224px + env(safe-area-inset-right, 0px));
		grid-template-rows: minmax(0, 1fr);
	}
	.gg-band { flex-direction: column; border-top: 0; border-left: 1px solid var(--line); margin-bottom: 0; }
	.gg-back { width: auto; height: 44px; justify-content: center; padding: 0; }
	.gg-back-icon { transform: rotate(90deg); } /* Pfeil zeigt nach oben */
	.gg-strip {
		flex: 1 1 0; min-height: 0;
		flex-direction: column;
		overflow-x: hidden; overflow-y: auto;
		scroll-snap-type: y proximity;
		padding: 10px calc(10px + env(safe-area-inset-right, 0px)) calc(50dvh - 92px) 10px;
	}
	.gg-info { flex: 0 0 auto; }
	.gg-desc { -webkit-line-clamp: 6; }
	.gg-days { flex-direction: column; }
	.gg-li { flex: 0 0 auto; }
	.gg-day-img { aspect-ratio: 16 / 10; }
}

/* Marker: Titelbild des Tages sitzt über dem Ort, die Spitze zeigt auf die Stelle */
.leaflet-marker-icon.gg-pin, .leaflet-marker-icon.gg-end { background: none; border: 0; }
.gg-pin-body { position: relative; width: 44px; height: 52px; transform-origin: 50% 100%; transition: transform 0.15s ease; }
.gg-pin-body img {
	display: block; width: 44px; height: 44px; box-sizing: border-box;
	border-radius: 50%; object-fit: cover;
	border: 2px solid #fff; background: var(--surface-2);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
	opacity: 0.8; transition: opacity 0.15s ease;
}
.gg-pin-body::after {
	content: ""; position: absolute; left: 50%; top: 42px; margin-left: -7px;
	border: 7px solid transparent; border-top: 10px solid #fff; border-bottom: 0;
	opacity: 0.8;
}
.gg-pin.is-active .gg-pin-body { transform: scale(1.2); }
.gg-pin.is-active .gg-pin-body img { opacity: 1; border-color: var(--route); }
.gg-pin.is-active .gg-pin-body::after { opacity: 1; border-top-color: var(--route); }
.gg-pin--dot i {
	display: block; width: 18px; height: 18px; box-sizing: border-box;
	border-radius: 50%; background: var(--route); border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Start und Ziel der Tagesstrecken: kleine schwarze Punkte mit weißem Rand unter den Bildern.
   Größen (inklusive Rand) und Farbe stehen oben in .gg-reise und lassen sich dort anpassen. */
.gg-end i {
	position: absolute; left: 50%; top: 50%;
	width: var(--end-size); height: var(--end-size);
	margin: calc(var(--end-size) / -2) 0 0 calc(var(--end-size) / -2);
	box-sizing: border-box; border-radius: 50%;
	background: #fff; /* weißer Rand: der Punkt darin liegt um --end-ring eingerückt (auch Bruchteile von Pixeln) */
	transition: width 0.15s ease, height 0.15s ease, margin 0.15s ease;
}
.gg-end i::after {
	content: ""; position: absolute; inset: var(--end-ring);
	border-radius: 50%; background: var(--end-color);
}
.gg-end.is-active i {
	width: var(--end-size-active); height: var(--end-size-active);
	margin: calc(var(--end-size-active) / -2) 0 0 calc(var(--end-size-active) / -2);
}

/* Karten-Steuerelemente im Farbschema der Seite. Der Vorsatz ".gg-reise .gg-map" schlägt das später geladene Leaflet-CSS. */
.gg-reise .gg-map { font-family: var(--font); }
.gg-reise .gg-map .leaflet-top { top: env(safe-area-inset-top, 0px); }     /* Bedienelemente nie im Kamerabereich */
.gg-reise .gg-map .leaflet-left { left: env(safe-area-inset-left, 0px); }

.gg-reise .gg-map .leaflet-bar,
.gg-reise .gg-map .leaflet-control-layers {
	background: var(--surface); color: var(--text);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: none; background-clip: padding-box;
}
.gg-reise .gg-map .leaflet-bar a {
	background-color: transparent; color: var(--text);
	border-bottom: 1px solid var(--line);
	width: 40px; height: 40px; line-height: 40px; font-family: var(--font); font-size: 20px;
}
.gg-reise .gg-map .leaflet-bar a:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.gg-reise .gg-map .leaflet-bar a:last-child { border-bottom: 0; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.gg-reise .gg-map .leaflet-bar a:hover, .gg-reise .gg-map .leaflet-bar a:focus { background-color: var(--surface-2); color: var(--text); }
.gg-reise .gg-map .leaflet-bar a.leaflet-disabled { background-color: transparent; color: var(--muted); opacity: 0.5; }

/* Ebenen-Schalter: eigenes helles Symbol statt des dunklen Leaflet-Bilds */
.gg-reise .gg-map .leaflet-control-layers .leaflet-control-layers-toggle {
	background-color: var(--text);width: 40px; height: 40px; background-size: 22px 22px; background-repeat: no-repeat; background-position: center;
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'><path d='M12 3 3 8l9 5 9-5-9-5z'/><path d='M3 12.5l9 5 9-5'/><path d='M3 17l9 5 9-5' opacity='.55'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e9e7e0' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'><path d='M12 3 3 8l9 5 9-5-9-5z'/><path d='M3 12.5l9 5 9-5'/><path d='M3 17l9 5 9-5' opacity='.55'/></svg>");
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
	-webkit-mask-size: 65%; mask-size: 65%;
}
.gg-reise .gg-map .leaflet-control-layers-expanded { padding: 8px 14px 8px 10px; color: var(--text); background: var(--surface); }
.gg-reise .gg-map .leaflet-control-layers label { display: block; padding: 3px 0; font-size: 0.9rem; color: var(--text); }
.gg-reise .gg-map .leaflet-control-layers-selector { accent-color: var(--route); }
.gg-reise .gg-map .leaflet-control-layers-separator { border-top: 1px solid var(--line); margin: 6px -14px 6px -10px; }
.gg-reise .gg-map .leaflet-control-attribution {
	background: var(--bg); color: var(--muted); font-size: 11px;
}
.gg-reise .gg-map .leaflet-control-attribution a { color: var(--text); }

/* Einwilligung für die Karte */
.gg-consent {
	position: absolute; inset: 0; z-index: 900;
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
	background: var(--bg); 
}
.gg-consent[hidden] { display: none; }
.gg-consent-box {
	max-width: 30rem; max-height: 100%; overflow: auto;
	padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.gg-consent-box h2 { margin: 0 0 8px; font-size: 1.2rem; }
.gg-consent-box p { margin: 0 0 10px; font-size: 0.92rem; }
.gg-consent-hosts { color: var(--muted); font-size: 0.85rem !important; }
.gg-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gg-btn {
	min-height: 44px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
	color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.gg-btn:hover { background: var(--line); }
.gg-btn--primary { color: var(--route); background: var(--bg); border-color: var(--line); }
.gg-btn--primary:hover { background: var(--route-soft); }

@media (prefers-reduced-motion: reduce) {
	.gg-pin-body, .gg-pin-body img, .gg-end i { transition: none; }
}
