/**
 * HappyManage — Day Timeline
 *
 * Timeline horizontale : ligne continue entre les centres du 1er et du
 * dernier node. Sur mobile, bascule en stack vertical avec ligne à gauche.
 *
 * Le track utilise grid pour répartir équitablement N moments. La ligne
 * horizontale est un ::before positionné avec un inset calculé côté PHP
 * (50% / N) pour rester pile aux extrémités quel que soit le nombre.
 *
 * Overrides exposés :
 *   --hm-day-line-color, --hm-day-node-color, --hm-day-node-size,
 *   --hm-day-name-color
 */

.hm-day {
	--hm-day-line-color:  var(--color-line, rgba(10, 10, 10, 0.12));
	--hm-day-node-color:  var(--color-secondary, #696d5e);
	--hm-day-node-size:   14px;
	--hm-day-name-color:  var(--color-text, #0a0a0a);
	--hm-day-inset:       12.5%;   /* surchargé inline depuis le PHP */
}

.hm-day__head {
	text-align: center;
	margin-bottom: 3rem;
}

.hm-day__track {
	position: relative;
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: hm-day-step;
}

.hm-day__track::before {
	content: '';
	position: absolute;
	top: calc(var(--hm-day-node-size) / 2);
	left: var(--hm-day-inset);
	right: var(--hm-day-inset);
	height: 1px;
	background: var(--hm-day-line-color);
}

.hm-day__moment {
	position: relative;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding-top: 0;
}

.hm-day__node {
	width: var(--hm-day-node-size);
	height: var(--hm-day-node-size);
	border-radius: 50%;
	background: var(--hm-day-node-color);
	display: block;
	position: relative;
	z-index: 1;
	margin-bottom: 1.25rem;
	box-shadow: 0 0 0 4px var(--color-white, #fff);
}

.hm-day__time {
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-text-soft, rgba(10, 10, 10, 0.65));
}

.hm-day__name {
	font-family: var(--font-serif, 'Fraunces', serif);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	margin: 0;
	color: var(--hm-day-name-color);
}

.hm-day__signature {
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--color-text-soft, rgba(10, 10, 10, 0.65));
	margin: 0;
	max-width: 18ch;
}

/* Mobile : timeline verticale, ligne à gauche, nodes alignés à gauche */
@media (max-width: 768px) {
	.hm-day__track {
		grid-template-columns: 1fr !important;
		gap: 2rem;
		padding-left: 2rem;
	}
	.hm-day__track::before {
		top: var(--hm-day-node-size);
		bottom: var(--hm-day-node-size);
		left: calc(var(--hm-day-node-size) / 2);
		right: auto;
		width: 1px;
		height: auto;
	}
	.hm-day__moment {
		text-align: left;
		align-items: flex-start;
		flex-direction: column;
	}
	.hm-day__node {
		position: absolute;
		left: calc(-2rem + (var(--hm-day-node-size) / 2) - (var(--hm-day-node-size) / 2));
		top: 4px;
		margin-bottom: 0;
	}
	.hm-day__signature { max-width: none; }
	.hm-day__head { margin-bottom: 2rem; }
}
