/* ============================================================
 * Lage & Erreichbarkeit — Tab-Timeline (Pannonian Living)
 * Mobile-first: vertikale Liste. Ab >=992px die Zickzack-Chevron-Timeline
 * aus dem Figma-Design. Tab-Icons sind Inline-SVGs; ihre Farben laufen über
 * --reach-chip (Kreis) und --reach-ink (Glyphe), damit der aktive Tab sauber
 * invertiert (dunkler Kreis + helles Icon).
 * ============================================================ */

.custom-reachability {
	--reach-ink: #12161d;
	--reach-place: #61656e;
	--reach-chip: #eae3da;
	--reach-bg: #fafafa;
	--reach-band-a: #f0ece4;
	--reach-band-b: #e7dfd3;
	--reach-line: rgba(18, 22, 29, 0.22);
	width: 100%;
}

/* ---------- Kopf: Titel + Tabs ---------- */

.pl-reach__head {
	display: flex;
	flex-direction: column;
	gap: 26px;
	align-items: flex-start;
}

.pl-reach__title {
	margin: 0;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 600;
	font-size: 38px;
	line-height: 1.04;
	color: var(--reach-ink);
}

.pl-reach__subtitle {
	margin: 10px 0 0;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 400;
	font-size: 19px;
	line-height: 1.45;
	color: var(--reach-place);
	max-width: 640px;
}

/* ---------- Tabs ---------- */

.pl-reach__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.pl-reach__tab {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: pointer;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	line-height: 0;
	-webkit-tap-highlight-color: transparent;
	--reach-chip: #eae3da;
	--reach-ink: #12161d;
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.pl-reach__chip,
.pl-reach__chip svg {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.pl-reach__tab:not(.is-active) {
	opacity: 0.9;
}

.pl-reach__tab:not(.is-active):hover,
.pl-reach__tab:not(.is-active):focus-visible {
	--reach-chip: #ded3c4;
	transform: translateY(-2px);
	opacity: 1;
}

.pl-reach__tab.is-active {
	--reach-chip: #12161d;
	--reach-ink: #ffffff;
	transform: scale(1.06);
	filter: drop-shadow(0 8px 20px rgba(18, 22, 29, 0.28));
}

.pl-reach__tab:focus-visible {
	outline: 2px solid #12161d;
	outline-offset: 3px;
}

/* ---------- Panels ---------- */

.pl-reach__panel {
	display: none;
}

.pl-reach__panel.is-active {
	display: block;
}

/* ============================================================
 * MOBILE-BASIS: vertikale Timeline mit linker Spine
 * ============================================================ */

.pl-reach__timeline {
	position: relative;
	margin-top: 34px;
}

.pl-reach__band {
	display: none;
}

.pl-reach__rows {
	position: relative;
}

.pl-reach__walk {
	position: absolute;
	left: 1px;
	top: 0;
	width: 20px;
	height: auto;
	color: var(--reach-ink);
	z-index: 3;
}

.pl-reach__walk svg {
	display: block;
	width: 100%;
	height: auto;
}

.pl-reach__stops {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 40px 0 0 32px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* linke Spine */
.pl-reach__stops::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 46px;
	bottom: 16px;
	width: 2px;
	border-radius: 2px;
	background: linear-gradient(180deg, #d8cfc1, #ece5db);
}

.pl-reach__stop {
	position: relative;
	padding: 11px 0;
}

.pl-reach__connector {
	display: none;
}

.pl-reach__dot {
	position: absolute;
	left: -26px;
	top: 20px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--reach-bg);
	border: 2px solid var(--reach-ink);
	box-sizing: border-box;
}

.pl-reach__entry {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.pl-reach__time {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 700;
	font-size: 29px;
	line-height: 1;
	color: var(--reach-ink);
}

.pl-reach__place {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 400;
	font-size: 18px;
	line-height: 1.3;
	color: var(--reach-place);
}

/* ============================================================
 * DESKTOP >=992px: horizontale Zickzack-Chevron-Timeline
 * ============================================================ */

@media (min-width: 992px) {
	.pl-reach__head {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-end;
		gap: 40px;
	}

	.pl-reach__title {
		font-size: 56px;
	}

	.pl-reach__subtitle {
		font-size: 22px;
	}

	.pl-reach__tabs {
		flex-wrap: nowrap;
		gap: 16px;
		padding-bottom: 4px;
	}

	.pl-reach__tab {
		width: 64px;
		height: 64px;
	}

	.pl-reach__timeline {
		margin-top: 60px;
	}

	/* Chevron-Band, vertikal zentriert, volle Breite */
	.pl-reach__band {
		display: flex;
		position: absolute;
		left: 0;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		height: 58px;
		z-index: 1;
		border-radius: 7px;
		overflow: hidden;
	}

	.pl-reach__band i {
		--tip: 20px;
		flex: 1;
		display: block;
		margin-left: -1px;
		clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%, var(--tip) 50%);
	}

	.pl-reach__band i:first-child {
		margin-left: 0;
		clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
	}

	.pl-reach__band i:nth-child(odd) {
		background: var(--reach-band-a);
	}

	.pl-reach__band i:nth-child(even) {
		background: var(--reach-band-b);
	}

	.pl-reach__rows {
		position: relative;
		z-index: 2;
		display: flex;
		align-items: stretch;
	}

	/* Fußweg-Icon links, auf Höhe der oberen Einträge */
	.pl-reach__walk {
		position: relative;
		left: auto;
		top: auto;
		flex: 0 0 auto;
		width: 96px;
	}

	.pl-reach__walk svg {
		position: absolute;
		left: 10px;
		bottom: calc(50% + 44px);
		width: 32px;
	}

	.pl-reach__stops {
		flex: 1;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		gap: 0;
		padding: 0;
		min-height: 320px;
	}

	.pl-reach__stops::before {
		display: none;
	}

	.pl-reach__stop {
		position: relative;
		padding: 0;
	}

	.pl-reach__entry {
		position: absolute;
		left: 0;
		right: 12px;
		padding-left: 16px;
		gap: 8px;
	}

	.pl-reach__stop[data-pos="top"] .pl-reach__entry {
		bottom: calc(50% + 38px);
	}

	.pl-reach__stop[data-pos="bottom"] .pl-reach__entry {
		top: calc(50% + 38px);
	}

	/* Verbindungslinie Eintrag <-> Band */
	.pl-reach__connector {
		display: block;
		position: absolute;
		left: 0;
		width: 1px;
		background: var(--reach-line);
	}

	.pl-reach__stop[data-pos="top"] .pl-reach__connector {
		bottom: 50%;
		height: 38px;
	}

	.pl-reach__stop[data-pos="bottom"] .pl-reach__connector {
		top: 50%;
		height: 38px;
	}

	/* Punkt auf dem Band */
	.pl-reach__dot {
		left: -4px;
		top: calc(50% - 4px);
		width: 9px;
		height: 9px;
		background: var(--reach-ink);
		border: 0;
		box-shadow: 0 0 0 4px var(--reach-bg);
	}

	.pl-reach__time {
		font-size: 40px;
	}

	.pl-reach__place {
		font-size: 20px;
	}
}

/* schmales Desktop-Fenster: etwas kompakter, damit lange Ortsnamen passen */
@media (min-width: 992px) and (max-width: 1200px) {
	.pl-reach__time {
		font-size: 34px;
	}
	.pl-reach__place {
		font-size: 18px;
	}
	.pl-reach__title {
		font-size: 48px;
	}
}

/* ============================================================
 * Entrance-Animationen (per IntersectionObserver: .is-inview)
 * ============================================================ */

.custom-reachability:not(.is-inview) .pl-reach__tab {
	opacity: 0;
}

.custom-reachability.is-inview .pl-reach__tab {
	animation: reachTabIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: calc(var(--t, 0) * 70ms);
}

.custom-reachability:not(.is-inview) .pl-reach__panel.is-active .pl-reach__stop {
	opacity: 0;
}

.custom-reachability.is-inview .pl-reach__panel.is-active .pl-reach__stop {
	animation: reachStopIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: calc(var(--i, 0) * 85ms);
}

.custom-reachability.is-inview .pl-reach__panel.is-active .pl-reach__band {
	animation: reachBandIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reachTabIn {
	from { opacity: 0; transform: translateY(10px) scale(0.88); }
	to   { opacity: 1; }
}

@keyframes reachStopIn {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}

@keyframes reachBandIn {
	from { clip-path: inset(0 100% 0 0 round 7px); }
	to   { clip-path: inset(0 0 0 0 round 7px); }
}

@media (prefers-reduced-motion: reduce) {
	.custom-reachability .pl-reach__tab,
	.custom-reachability .pl-reach__stop,
	.custom-reachability .pl-reach__band {
		animation: none !important;
		opacity: 1 !important;
	}
	.pl-reach__tab {
		transition: none;
	}
}
