/**
 * Meilensteine Timeline Styles
 */

.pyrum-meilensteine-timeline-wrapper {
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	padding-top: 20px;
	padding-bottom: 40px;
	cursor: grab;
}

.pyrum-meilensteine-timeline-wrapper.is-dragging {
	cursor: grabbing;
	user-select: none;
}

/* Custom Scrollbar */
.pyrum-meilensteine-timeline-wrapper::-webkit-scrollbar {
	height: 12px;
}

.pyrum-meilensteine-timeline-wrapper::-webkit-scrollbar-track {
	background: #deefdf00;
	border-radius: 6px;
}

.pyrum-meilensteine-timeline-wrapper::-webkit-scrollbar-thumb {
	background: #8cbf94;
	border-radius: 6px;
}

.pyrum-meilensteine-timeline-wrapper::-webkit-scrollbar-thumb:hover {
	background: #709976;
}

/* Firefox Scrollbar */
.pyrum-meilensteine-timeline-wrapper {
	scrollbar-width: thin;
	scrollbar-color: #8cbf94 #deefdf00;
}

.pyrum-meilensteine-timeline {
	display: inline-grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto auto auto;
	min-width: 100%;
}

.pyrum-timeline-line {
	grid-row: 2;
	grid-column: 1;
	position: relative;
	padding: 20px 0;
	width: 100%;
}

.pyrum-timeline-line img {
	width: 100%;
	height: 8px;
	display: block;
	object-fit: fill;
}

.pyrum-timeline-items {
	grid-row: 1 / 4;
	grid-column: 1;
	display: grid;
	grid-template-rows: auto auto auto;
	grid-auto-flow: column;
	grid-auto-columns: max-content;
}

.pyrum-timeline-item {
	position: relative;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	margin-left: 200px;
}

/* Erstes Item (Index 0, Bottom) ohne margin-left */
.pyrum-timeline-item:first-child {
	margin-left: 0;
}

/* Bottom Items in untere Row */
.pyrum-timeline-item--bottom {
	grid-row: 3;
	align-self: start;
	margin-top: 60px;
}

/* Top Items in obere Row */
.pyrum-timeline-item--top {
	grid-row: 1;
	align-self: end;
	margin-left: -200px;
}

.pyrum-timeline-scribble {
	position: absolute;
	left: 10px;
	width: 29px;
	height: 45px;
	z-index: 3;
}

.pyrum-timeline-scribble img {
	width: 100%;
	height: auto;
	display: block;
}

/* Scribble bei Bottom Items nach oben (zur Linie) */
.pyrum-timeline-item--bottom .pyrum-timeline-scribble {
	top: -50px;
}

/* Scribble bei Top Items nach unten (zur Linie) */
.pyrum-timeline-item--top .pyrum-timeline-scribble {
	bottom: -50px;
}

.pyrum-timeline-content {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

/* Bottom Layout: column - Jahr oben, dann Bild+Text */
.pyrum-timeline-item--bottom .pyrum-timeline-content {
	flex-direction: column;
}

/* Top Layout: column - Bild+Text oben, dann Jahr unten */
.pyrum-timeline-item--top .pyrum-timeline-content {
	flex-direction: column;
}

.pyrum-timeline-year {
	font-weight: 600;
	font-size: 1.125rem;
	text-align: center;
}

.pyrum-timeline-media {
	display: flex;
	align-items: center;
	gap: 26px;
}

/* Bild Styling */
.pyrum-timeline-image {
	width: 240px;
	height: 180px;
	flex-shrink: 0;
	overflow: hidden;
	background-color: #f0f0f1;
	border-radius: 12px;
}

.pyrum-timeline-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Text Styling */
.pyrum-timeline-text {
	width: 340px;
	flex-shrink: 0;
}

.pyrum-timeline-text p {
	margin: 0 0 0.75rem 0;
}

.pyrum-timeline-text p:last-child {
	margin-bottom: 0;
}

.pyrum-timeline-text ul,
.pyrum-timeline-text ol {
	margin: 0 0 0.75rem 1.5rem;
	padding: 0;
}

.pyrum-timeline-text li {
	margin-bottom: 0.25rem;
}

/* Mobile: Alle Items unter der Linie */
@media (max-width: 768px) {
	.pyrum-meilensteine-timeline {
		grid-template-rows: auto auto;
	}

	.pyrum-timeline-line {
		grid-row: 1;
	}

	.pyrum-timeline-items {
		grid-row: 2;
		grid-template-rows: auto;
		display: flex;
	}

	/* Alle Items unter der Linie */
	.pyrum-timeline-item--top,
	.pyrum-timeline-item--bottom {
		grid-row: auto;
		align-self: auto;
		margin-top: 0;
		margin-left: 40px;
	}

	/* Erstes Item ohne margin-left */
	.pyrum-timeline-item:first-child {
		margin-left: 0;
	}

	/* Zweites Item mit 40px margin-left */
	.pyrum-timeline-item:nth-child(2) {
		margin-left: 40px;
	}

	/* Alle Items wie Bottom-Items stylen */
	.pyrum-timeline-item--top .pyrum-timeline-scribble {
		top: -50px;
		bottom: auto;
	}

	.pyrum-timeline-item--top .pyrum-timeline-content {
		flex-direction: column-reverse;
	}

	.pyrum-timeline-media {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}

	.pyrum-timeline-image {
		width: 280px;
		height: 200px;
	}

	.pyrum-timeline-text {
		width: 280px;
	}
}
