/*
 * tdn-method-timeline — Phase C.6 Bloc 4 Page Entreprises (Méthodologie TDN)
 *
 * Section pink-100 avec :
 *   - Eyebrow "— MÉTHODOLOGIE TDN —" + H2 2 lignes centrées + sous-texte
 *   - Frise horizontale 5 étapes en zigzag (steps 1/3/5 haut, steps 2/4 bas +148px)
 *   - Courbe pointillée décor full-width derrière les cards
 *   - Card étape : bg white drop-shadow + icon container 64×64 pink-50 + title uppercase + desc
 *
 * Spec Figma : node 8115:2245. Pattern générique réutilisable potentiel KP/PS.
 */

/* ===== 1. Section root ============================================ */
.tdn-method-timeline {
	position: relative;
	background: var(--tdn-color-pink-100, #F6C9D0);
	padding: 100px 0 100px;
	font-family: var(--tdn-font-family-brand, 'Nunito Sans', sans-serif);
	overflow: hidden;
}

.tdn-method-timeline__inner {
	max-width: 1442px;
	margin: 0 auto;
	padding: 0 52px;
	position: relative;
	z-index: 1;
}

/* ===== 2. Header (eyebrow + H2 + subtitle) ======================= */
.tdn-method-timeline__header {
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: center;
	margin-bottom: 100px;
}

.tdn-method-timeline__eyebrow {
	display: flex;
	gap: 14px;
	align-items: center;
}

/* Eyebrow + dashes : pink-500 vif (override Figma pink-700 cassis trop sombre) */
.tdn-method-timeline__eyebrow-dash {
	display: block;
	width: 32px;
	height: 1px;
	background: var(--tdn-color-pink-500, #C06D80);
	flex-shrink: 0;
}

.tdn-method-timeline__eyebrow-text {
	font-weight: var(--tdn-eyebrow-weight);
	font-size: 16px;
	letter-spacing: var(--tdn-letter-spacing-wider);
	text-transform: uppercase;
	/* C7 matrice : fond pink-100 → eyebrow pink-700 (ex pink-500 hors matrice) */
	color: var(--tdn-color-pink-700, #9c413d);
	white-space: nowrap;
	font-style: normal;
}

.tdn-method-timeline__title {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	font-weight: var(--tdn-h2-weight);
	font-size: clamp(40px, 4.5vw, 60px);
	line-height: 0.855;
	letter-spacing: -0.03em;
	text-align: center;
	font-style: normal;
}

.tdn-method-timeline__title-line-1 {
	display: block;
	color: var(--tdn-color-midnight-900, #1A1A2E);
}

.tdn-method-timeline__title-line-2 {
	display: block;
	color: var(--tdn-color-pink-500, #C06D80);
}

.tdn-method-timeline__subtitle {
	margin: 0;
	font-weight: 400;
	font-size: 24px;
	line-height: 1.2;
	color: var(--tdn-color-neutral-700, #4D4D4C);
	text-align: center;
	max-width: 993px;
	font-style: normal;
}

/* ===== 3. Timeline (frise 5 steps zigzag) ======================== */
.tdn-method-timeline__steps {
	position: relative;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 42px;
	align-items: start;
}

/* Courbe pointillée full-width derrière les cards */
.tdn-method-timeline__curve {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 100%;
	height: auto;
	pointer-events: none;
	user-select: none;
	z-index: 0;
	opacity: 0.7;
}

/* Steps zigzag : 1/3/5 en haut, 2/4 décalées de 148px vers le bas.
 * :nth-of-type(article) car la courbe <img> est aussi enfant de __steps,
 * ce qui décale les indices :nth-child. */
.tdn-method-timeline__steps > .tdn-method-timeline__step {
	position: relative;
	z-index: 1;
}

.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-of-type(2),
.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-of-type(4) {
	margin-top: 148px;
}

/* ===== 4. Card étape =============================================
 * Structure : <article class="__step"> wrappe <div class="__step-card">.
 * __step = container layout (grid 2 cols mobile pour numero + card,
 * juste position relative desktop). __step-card = card visuelle (bg, padding).
 * Permet d'injecter un cercle numéro en col 1 (CSS counter + ::before) en
 * mobile sans toucher au markup. */
.tdn-method-timeline__step {
	position: relative;
}

.tdn-method-timeline__step-card {
	background: var(--tdn-color-neutral-0, #FFFFFF);
	border-radius: 24px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	align-items: center;
	box-shadow: 0 14px 16px rgba(0, 0, 0, 0.10);
}

.tdn-method-timeline__step-icon-wrap {
	background: var(--tdn-color-pink-50, #FEF6F9);
	border-radius: 9999px;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.tdn-method-timeline__step-icon {
	display: block;
	width: 32px;
	height: 32px;
	object-fit: contain;
}

.tdn-method-timeline__step-title {
	margin: 0;
	font-weight: var(--tdn-h2-weight);
	font-size: 18px;
	line-height: 16px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--tdn-color-midnight-900, #1A1A2E);
	text-align: center;
	font-style: normal;
}

.tdn-method-timeline__step-description {
	margin: 0;
	font-weight: 400;
	font-size: 18px;
	line-height: 22.75px;
	color: var(--tdn-color-neutral-700, #4D4D4C);
	text-align: center;
	font-style: normal;
}

/* ===== 5. Responsive <1024 (5 cols → 2 cols + reset zigzag) ====== */
@media (max-width: 1023px) {
	.tdn-method-timeline {
		padding: 80px 0;
	}

	.tdn-method-timeline__inner {
		padding: 0 32px;
	}

	.tdn-method-timeline__header {
		margin-bottom: 60px;
		gap: 24px;
	}

	.tdn-method-timeline__title {
		font-size: 40px;
	}

	.tdn-method-timeline__subtitle {
		font-size: 18px;
	}

	.tdn-method-timeline__steps {
		grid-template-columns: 1fr 1fr;
		gap: 24px;
	}

	.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-child(2),
	.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-child(4) {
		margin-top: 0;
	}

	.tdn-method-timeline__curve {
		display: none;
	}
}

/* ===== 6. Responsive <768 (mobile — timeline verticale numéros + cards) ===
 * Refonte cible Figma Morgan : col gauche = cercles 01-05 reliés par une ligne
 * verticale midnight, col droite = card blanche (icon + titre + description).
 * Implémenté en CSS pur via counter (decimal-leading-zero) + ::before sur step
 * pour le cercle + ::before sur steps pour la ligne. Aucune modif des numéros
 * ne nécessite de changer le HTML. */
@media (max-width: 767px) {
	.tdn-method-timeline__inner {
		padding: 0 16px;
	}

	.tdn-method-timeline__title {
		font-size: 32px;
	}

	/* Steps en flex column (override grid desktop hérité, sinon align-items:start
	 * desktop crée des rows implicites inégales). Gap 32px uniforme entre cards. */
	.tdn-method-timeline__steps {
		display: flex;
		grid-template-columns: none;
		flex-direction: column;
		gap: 32px;
		align-items: stretch;
		counter-reset: timeline-step;
		position: relative;
	}

	/* Ligne verticale pink-700 (rose foncé) 4px épaisse reliant tous les cercles
	 * numéros (centrée 22px = (width 48 / 2) - (line-width 4 / 2)). */
	.tdn-method-timeline__steps::before {
		content: '';
		position: absolute;
		left: 22px;
		top: 24px;
		bottom: 24px;
		width: 4px;
		background: var(--tdn-color-pink-700, #963838);
		z-index: 0;
	}

	/* Chaque step = grid 2 cols : cercle numéro (48px) + card blanche.
	 * margin-top: 0 universel pour annuler le zigzag desktop nth-of-type(2/4)
	 * qui n'était pas correctement reset par le @1023 (mauvais sélecteur
	 * :nth-child vs :nth-of-type avec curve <img> comme 1er enfant DOM). */
	.tdn-method-timeline__step,
	.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-of-type(2),
	.tdn-method-timeline__steps > .tdn-method-timeline__step:nth-of-type(4) {
		counter-increment: timeline-step;
		display: grid;
		grid-template-columns: 48px 1fr;
		gap: 16px;
		align-items: center;
		margin-top: 0;
	}

	/* Cercle numéro en col 1 (counter CSS, pas de modif markup) */
	.tdn-method-timeline__step::before {
		content: counter(timeline-step, decimal-leading-zero);
		grid-column: 1;
		width: 48px;
		height: 48px;
		border-radius: 50%;
		background: var(--tdn-color-neutral-0, #fff);
		color: var(--tdn-color-midnight-900, #1A1A2E);
		font-family: var(--tdn-font-family-brand, 'Nunito Sans', sans-serif);
		font-weight: 700;
		font-size: 14px;
		letter-spacing: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 1;
		position: relative;
	}

	/* Card en col 2 : align texte gauche (vs center desktop) pour cohérence
	 * avec layout vertical compact mobile */
	.tdn-method-timeline__step-card {
		grid-column: 2;
		align-items: flex-start;
		gap: 12px;
		padding: 20px;
	}

	.tdn-method-timeline__step-title,
	.tdn-method-timeline__step-description {
		text-align: left;
	}

	.tdn-method-timeline__step-icon-wrap {
		align-self: center;
	}
}

/* ===== 7. Bandeau décor cool-shapes collé au bord bas de section
 * bottom: 0 pour que le bandeau touche pile la section midnight suivante,
 * sans gap blanc/rose intermédiaire. */
.tdn-method-timeline__bandeau {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: auto;
	pointer-events: none;
	user-select: none;
	z-index: 0;
	opacity: 0.5;
	display: block;
}

@media (max-width: 1023px) {
	.tdn-method-timeline__bandeau {
		display: none;
	}
}

/* ===== 8. Ajouts défensifs ======================================= */
.tdn-method-timeline,
.tdn-method-timeline__title,
.tdn-method-timeline__subtitle,
.tdn-method-timeline__step-title,
.tdn-method-timeline__step-description {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
