.forberries-timeline {
	--fb-timeline-active: #7297ce;
	--fb-timeline-idle: #e1e4e8;
	--fb-timeline-dark: #1a2641;
	--fb-timeline-gap: 100px;
	--fb-timeline-dot: 20px;
	--fb-timeline-line: 3px;

	position: relative;
	width: 100%;
	max-width: 100%;
}

.forberries-timeline__rail {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	z-index: 0;
	width: var(--fb-timeline-dot);
	transform: translateX(-50%);
	pointer-events: none;
}

.forberries-timeline__line,
.forberries-timeline__line-progress {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--fb-timeline-line);
	transform: translateX(-50%);
	border-radius: 999px;
}

.forberries-timeline__line {
	bottom: 18px;
	background: var(--fb-timeline-idle);
}

.forberries-timeline__line-progress {
	height: 0;
	background: var(--fb-timeline-active);
}

.forberries-timeline__arrow {
	position: absolute;
	bottom: 2px;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--fb-timeline-idle);
	transform: translateX(-50%);
	transition: color 0.2s ease;
}

.forberries-timeline__arrow.is-active {
	color: var(--fb-timeline-active);
}

.forberries-timeline__arrow svg {
	display: block;
}

.forberries-timeline__list {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 40px;
	margin: 0;
	padding: 0 0 28px;
	list-style: none;
}

.forberries-timeline__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--fb-timeline-dot) minmax(0, 1fr);
	column-gap: var(--fb-timeline-gap);
	align-items: center;
}

.forberries-timeline__text {
	order: 1;
	min-width: 0;
}

.forberries-timeline__dot {
	order: 2;
	justify-self: center;
	box-sizing: border-box;
	width: var(--fb-timeline-dot);
	height: var(--fb-timeline-dot);
	border-radius: 50%;
	background: var(--fb-timeline-idle);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.forberries-timeline__item.is-visible .forberries-timeline__dot {
	background: var(--fb-timeline-active);
	transform: scale(1.05);
}

.forberries-timeline__media {
	order: 3;
	min-width: 0;
	width: 100%;
}

.forberries-timeline__item--flip .forberries-timeline__media {
	order: 1;
}

.forberries-timeline__item--flip .forberries-timeline__text {
	order: 3;
}

.forberries-timeline__number {
	display: block;
	margin: 0 0 12px;
	color: var(--fb-timeline-active);
	font-size: 50px;
	font-weight: 700;
	line-height: 1;
}

.forberries-timeline__heading {
	padding: 0 0 5px 0;
	color: var(--fb-timeline-dark);
	font-size: 28px;
	font-weight: 500;
	line-height: 1.25;
}

.forberries-timeline__desc {
	margin: 0;
	color: inherit;
	font-size: inherit;
	line-height: 1.5;
}

.forberries-timeline__desc > *:first-child {
	margin-top: 0;
}

.forberries-timeline__desc > *:last-child {
	margin-bottom: 0;
}

.forberries-timeline__image {
	display: block;
	width: 100%;
	height: 350px;
	object-fit: cover;
	border-radius: clamp(40px, 5vw, 95px);
}

@media (max-width: 900px) {
	.forberries-timeline {
		--fb-timeline-gap: 24px;
	}

	.forberries-timeline__rail {
		/* Wyśrodkuj linię w pierwszej kolumnie grida (szer. = kropka), nie na lewym brzegu raila */
		left: calc(var(--fb-timeline-dot) / 2);
		transform: translateX(-50%);
	}

	.forberries-timeline__item,
	.forberries-timeline__item--flip {
		grid-template-columns: var(--fb-timeline-dot) minmax(0, 1fr);
		row-gap: 16px;
	}

	.forberries-timeline__text,
	.forberries-timeline__item--flip .forberries-timeline__text,
	.forberries-timeline__media,
	.forberries-timeline__item--flip .forberries-timeline__media {
		order: initial;
		grid-column: 2;
	}

	.forberries-timeline__dot,
	.forberries-timeline__item--flip .forberries-timeline__dot {
		order: initial;
		grid-column: 1;
		grid-row: 1 / span 2;
		align-self: center;
	}

	.forberries-timeline__image {
		height: min(400px, 56vw);
	}
}

@media (prefers-reduced-motion: reduce) {
	.forberries-timeline__dot,
	.forberries-timeline__arrow {
		transition: none;
	}
}

/* Edytor — od razu aktywne kolory, żeby było czytelnie przy edycji */
.editor-styles-wrapper .forberries-timeline-editor .forberries-timeline__line,
.editor-styles-wrapper .forberries-timeline-editor .forberries-timeline__dot {
	background: var(--fb-timeline-active);
}

.editor-styles-wrapper .forberries-timeline-editor .forberries-timeline__arrow {
	color: var(--fb-timeline-active);
}

.editor-styles-wrapper .forberries-timeline__editor-item {
	position: relative;
	cursor: pointer;
}

.editor-styles-wrapper .forberries-timeline__editor-item.is-selected {
	outline: 2px solid #a0b718;
	outline-offset: 6px;
	border-radius: 8px;
}

.editor-styles-wrapper .forberries-timeline__editor-toolbar {
	position: absolute;
	top: -42px;
	left: 50%;
	z-index: 5;
	transform: translateX(-50%);
	background: #fff;
	border: 1px solid #1e1e1e;
	border-radius: 2px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.editor-styles-wrapper .forberries-timeline__editor-toolbar .components-toolbar-group {
	border: 0;
}

.editor-styles-wrapper .forberries-timeline__heading.rich-text,
.editor-styles-wrapper .forberries-timeline__desc.rich-text {
	min-height: 1.2em;
}

.editor-styles-wrapper .forberries-timeline__media-drop {
	position: relative;
	width: 100%;
}

.editor-styles-wrapper .forberries-timeline__media-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	height: 400px;
	border: 2px dashed #1a264133;
	border-radius: clamp(40px, 5vw, 95px);
	background: transparent;
	color: #1a2641;
	cursor: pointer;
	font: inherit;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.editor-styles-wrapper .forberries-timeline__media-placeholder-title {
	font-size: 15px;
	font-weight: 600;
}

.editor-styles-wrapper .forberries-timeline__media-placeholder-hint {
	font-size: 13px;
	font-weight: 400;
	opacity: 0.7;
}

.editor-styles-wrapper .forberries-timeline__media-placeholder:hover,
.editor-styles-wrapper .forberries-timeline__media-placeholder:focus {
	border-color: #a0b718;
	color: #a0b718;
	outline: none;
}

.editor-styles-wrapper .forberries-timeline__media-drop .components-drop-zone {
	border-radius: clamp(40px, 5vw, 95px);
}

.editor-styles-wrapper .forberries-timeline__image-button {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.editor-styles-wrapper .forberries-timeline__image-button:focus-visible {
	outline: 2px solid #a0b718;
	outline-offset: 4px;
	border-radius: clamp(40px, 5vw, 95px);
}

.editor-styles-wrapper .forberries-timeline__add-item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 64px;
	margin-top: 8px;
	padding: 15px;
	border: 2px dashed #1a264133;
	border-radius: 22px;
	background: transparent;
	color: #1a2641;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.editor-styles-wrapper .forberries-timeline__add-item:hover,
.editor-styles-wrapper .forberries-timeline__add-item:focus {
	border-color: #a0b718;
	color: #a0b718;
	outline: none;
}

.editor-styles-wrapper .forberries-timeline__add-item-plus {
	font-size: 24px;
	line-height: 1;
	font-weight: 400;
}

.editor-styles-wrapper .forberries-timeline__empty-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 24px;
	border: 1px dashed #1a264133;
	border-radius: 22px;
}

.editor-styles-wrapper .forberries-timeline__empty {
	margin: 0;
	text-align: center;
	color: #1a2641;
}

.editor-styles-wrapper .forberries-timeline__sidebar-hint {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: #757575;
}

.editor-styles-wrapper .forberries-timeline__sidebar-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid #e1e4e8;
	font-size: 13px;
}

.editor-styles-wrapper .forberries-timeline__sidebar-item:last-of-type {
	border-bottom: 0;
}
