/**
 * Timeline — Lịch sử phát triển
 */

.dienmay-timeline {
	--tl-primary: var(--dienmay-primary, #dd3333);
	--tl-muted: #b8b8b8;
	--tl-line: #e5e5e5;
	padding: 48px 0 56px;
	max-width: 1200px;
	margin: 0 auto;
}

.dienmay-timeline-empty {
	text-align: center;
	padding: 2rem;
	color: #666;
}

/* —— Navigation —— */
.dienmay-timeline__nav {
	margin-bottom: 40px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.dienmay-timeline__track {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	min-width: min(100%, 640px);
	padding: 0 8px 0;
	gap: 8px;
}

.dienmay-timeline__line {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 7px;
	height: 2px;
	background: var(--tl-line);
	pointer-events: none;
	z-index: 0;
}

.dienmay-timeline__year-btn {
	position: relative;
	z-index: 1;
	flex: 1 1 0;
	min-width: 56px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 0 4px 0;
	border: none;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	transition: color 0.2s ease;
}

.dienmay-timeline__year-label {
	font-size: 14px;
	font-weight: 500;
	color: var(--tl-muted);
	line-height: 1.2;
	white-space: nowrap;
	transition: color 0.2s, font-size 0.2s, font-weight 0.2s;
}

.dienmay-timeline__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--tl-muted);
	transition: background 0.2s, transform 0.2s;
	flex-shrink: 0;
}

.dienmay-timeline__year-btn:hover .dienmay-timeline__year-label,
.dienmay-timeline__year-btn:focus-visible .dienmay-timeline__year-label {
	color: var(--tl-primary);
}

.dienmay-timeline__year-btn:hover .dienmay-timeline__dot,
.dienmay-timeline__year-btn:focus-visible .dienmay-timeline__dot {
	background: var(--tl-primary);
}

.dienmay-timeline__year-btn.is-active .dienmay-timeline__year-label {
	color: var(--tl-primary);
	font-size: 22px;
	font-weight: 700;
}

.dienmay-timeline__year-btn.is-active .dienmay-timeline__dot {
	background: var(--tl-primary);
	transform: scale(1.25);
}

.dienmay-timeline__year-btn:focus-visible {
	outline: 2px solid var(--tl-primary);
	outline-offset: 4px;
	border-radius: 4px;
}

/* —— Panels —— */
.dienmay-timeline__panels {
	position: relative;
	min-height: 280px;
}

.dienmay-timeline__panel {
	display: none;
	animation: dienmay-tl-fade 0.35s ease;
}

.dienmay-timeline__panel.is-active {
	display: block;
}

@keyframes dienmay-tl-fade {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Chữ trái — ảnh phải (không phụ thuộc grid Flatsome) */
.dienmay-timeline__body {
	display: grid;
	grid-template-columns: minmax(0, 42%) minmax(0, 58%);
	gap: 40px 48px;
	align-items: center;
}

.dienmay-timeline__text {
	min-width: 0;
}

.dienmay-timeline__media {
	min-width: 0;
}

.dienmay-timeline__heading {
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	color: #111;
	margin: 0 0 20px;
	line-height: 1.15;
}

.dienmay-timeline__content {
	font-size: 15px;
	line-height: 1.75;
	color: #333;
}

.dienmay-timeline__content p:last-child {
	margin-bottom: 0;
}

.dienmay-timeline__image-wrap {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
	background: #f5f5f5;
}

.dienmay-timeline__image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	aspect-ratio: 16 / 10;
}

.dienmay-timeline__image-placeholder {
	border-radius: 16px;
	background: #f0f0f0;
	min-height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: #888;
	font-size: 14px;
}

@media (max-width: 849px) {
	.dienmay-timeline {
		padding: 32px 0 40px;
	}

	.dienmay-timeline__nav {
		margin-bottom: 28px;
	}

	.dienmay-timeline__track {
		min-width: 520px;
	}

	.dienmay-timeline__year-btn.is-active .dienmay-timeline__year-label {
		font-size: 18px;
	}

	.dienmay-timeline__heading {
		margin-bottom: 14px;
	}

	.dienmay-timeline__body {
		gap: 28px 32px;
	}
}

/* Xếp dọc chỉ trên điện thoại */
@media (max-width: 549px) {
	.dienmay-timeline__body {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}
