/*
Theme Name: TP2000 - Divi Child
Description: Theme enfant Divi 5 - TP2000 | Typographie automatique locale WOFF2
Author: Divilogy
Author URI: https://divilogy.fr/
Template: Divi
Version: 1.1.0
Text Domain: tp2000-divi-child
*/

/*
* Attribution automatique des familles locales.
* Archivo = titres H1-H6 ; Hanken Grotesk = textes et interface.
* Les tailles, graisses, interlignages, tracking et couleurs restent geres par Divi 5.
* Aucune classe CSS n'est requise dans les modules.
* Ne pas ajouter de font-family dans les presets/modules pour ces elements.
*/
:root {
	--tp-font-heading: "TP Archivo", "Helvetica Neue", Arial, sans-serif;
	--tp-font-body: "TP Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}

/* Repli pour le site entier, y compris hors modules Divi. */
html,
body,
body #page-container {
	font-family: var(--tp-font-body);
}

/* Texte courant et commandes : styles explicites pour eviter le repli Divi. */
body #page-container :is(.et_pb_text_inner,
	.et_pb_blurb_description,
	p, li, dt, dd, blockquote, label,
	button, input, textarea, select,
	.et_pb_button,
	.et-menu a,
	.et_mobile_menu a) {
	font-family: var(--tp-font-body);
}

/* Titres semantiques, dans les modules comme dans le header/footer. 
* Les elements enfants heritent naturellement de la famille du titre.
* On ne cible pas tous les span : cela protegera notamment les icones.
*/
body #page-container :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--tp-font-heading);
}


/* TP2000 - Number Counters */
body #page-container .et_pb_number_counter .percent p,
body #page-container .et_pb_number_counter .percent-value {
	font-family: var(--tp-font-heading) !important;
	font-variant-numeric: tabular-nums;
}


/* =======================================
TP2000 - Client cards hover
======================================= */

.tp-client-card {
	position: relative;
	overflow: hidden;

	transition:
		transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
		box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
		border-color 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Trait rouge initialement masqué */
.tp-client-card::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 3px;
	background: #C1222B;

	transform: scaleY(0);
	transform-origin: top;

	transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);

	pointer-events: none;
	z-index: 1;
}

/* Effets sur les appareils avec survol */
@media (hover: hover) and (pointer: fine) {

	.tp-client-card:hover {
		transform: translateY(-2px);
		border-color: #CDD1D5;

		box-shadow:
			0 4px 14px rgba(20, 23, 26, 0.06),
			0 2px 5px rgba(20, 23, 26, 0.04);
	}

	.tp-client-card:hover::before {
		transform: scaleY(1);
	}
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {

	.tp-client-card,
	.tp-client-card::before {
		transition: none;
	}
}


/* =========================================
TP2000 - Ouvrages : Hover Effects
========================================= */

.tp-ouvrage-card {
	transition:
		transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
		box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
		border-color 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Image : zoom contenu dans son cadre */
.tp-ouvrage-image {
	overflow: hidden;
}

.tp-ouvrage-image img {
	display: block;
	transform: scale(1);
	transition:
		transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Numéro : transition de couleur */
.tp-ouvrage-index,
.tp-ouvrage-index * {
	transition: color 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Effets au survol */
@media (hover: hover) and (pointer: fine) {

	.tp-ouvrage-card:hover {
		transform: translateY(-2px);
		border-color: #CDD1D5;
		box-shadow:
			0 4px 14px rgba(20, 23, 26, 0.06),
			0 2px 5px rgba(20, 23, 26, 0.04);
	}

	.tp-ouvrage-card:hover .tp-ouvrage-image img {
		transform: scale(1.02);
	}

	.tp-ouvrage-card:hover .tp-ouvrage-index,
	.tp-ouvrage-card:hover .tp-ouvrage-index * {
		color: #C1222B;
	}
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {

	.tp-ouvrage-card,
	.tp-ouvrage-image img,
	.tp-ouvrage-index,
	.tp-ouvrage-index * {
		transition: none;
	}
}


/* =========================================
TP2000 - Bandeau Les +
========================================= */

.tp-plus-panel {
	position: relative;

	/* Quadrillage subtil de la maquette */
	background-image:
		repeating-linear-gradient(0deg,
			transparent 0 56px,
			rgba(255, 255, 255, 0.035) 56px 57px),
		repeating-linear-gradient(90deg,
			transparent 0 56px,
			rgba(255, 255, 255, 0.035) 56px 57px);
}

/* Filet rouge supérieur */
.tp-plus-panel::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;

	width: clamp(120px, 18vw, 220px);
	height: 4px;

	background: #C1222B;
	pointer-events: none;
	z-index: 1;
}


/* =========================================
   TP2000 - Badge méthodologie étape 0
   ========================================= */

.tp-method-highlight .et_pb_timeline_card {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	grid-template-areas:
		"title badge"
		"body body";
	align-items: center;
	column-gap: 12px;
	row-gap: 14px;
}

/* Titre à gauche */
.tp-method-highlight .et_pb_timeline_title {
	grid-area: title;
	margin: 0;
}

/* Badge à droite du titre */
.tp-method-highlight .et_pb_timeline_date {
	grid-area: badge;
	display: inline-flex;
	align-items: center;
	justify-self: start;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 4px 10px;

	background: #FBF0F0;
	border: 1px solid #E9AEB2;
	border-radius: 999px;

	font-family: var(--tp-font-body);
	font-size: 11.5px;
	font-weight: bold;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #C1222B;
}

/* Description sur toute la largeur */
.tp-method-highlight .et_pb_timeline_content {
	grid-area: body;
	min-width: 0;
}

/* Adaptation aux écrans étroits */
@media (max-width: 1250px) {
	.tp-method-highlight .et_pb_timeline_card {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"title"
			"badge"
			"body";
		row-gap: 12px;
	}
}


/* =========================================
   TP2000 - Numérotation méthodologie
   ========================================= */

/* Initialisation du compteur à -1 */
.tp-method-timeline .et_pb_timeline_track {
	counter-reset: tp-method-step -1;
}

/* Incrémentation pour chaque étape */
.tp-method-timeline .et_pb_timeline_item {
	counter-increment: tp-method-step;
}

/* Numéro centré dans les marqueurs */
.tp-method-timeline .et_pb_timeline_marker::before {
	content: counter(tp-method-step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	box-sizing: border-box;

	font-family: "TP Archivo", sans-serif;
	font-size: 19px;
	font-weight: bold;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: #1E2227;

	pointer-events: none;
}

/* Numéro blanc dans le premier cercle rouge */
.tp-method-timeline .tp-method-highlight .et_pb_timeline_marker::before {
	color: #FFFFFF;
}


/* TP2000 - Hover des profils recherchés */

.tp-job-links .et_pb_link_text {
	transition: color 220ms cubic-bezier(.22, .61, .36, 1);
}

.tp-job-links .et_pb_link .et-pb-icon,
.tp-job-links .et_pb_link svg {
	display: inline-block;
	transition:
		color 220ms cubic-bezier(.22, .61, .36, 1),
		transform 220ms cubic-bezier(.22, .61, .36, 1);
}

/* Survol du lien complet */
@media (hover: hover) and (pointer: fine) {

	.tp-job-links .et_pb_link:hover .et_pb_link_text {
		color: #C1222B !important;
	}

	.tp-job-links .et_pb_link:hover .et-pb-icon,
	.tp-job-links .et_pb_link:hover svg {
		color: #C1222B !important;
		transform: translateX(3px);
	}
}

/* Navigation au clavier */
.tp-job-links .et_pb_link:focus-visible .et_pb_link_text,
.tp-job-links .et_pb_link:focus-visible .et-pb-icon {
	color: #C1222B !important;
}

@media (prefers-reduced-motion: reduce) {

	.tp-job-links .et_pb_link_text,
	.tp-job-links .et_pb_link .et-pb-icon,
	.tp-job-links .et_pb_link svg {
		transition: none;
	}
}


/* TP2000 - Centrage bouton header */


/* TP2000 - Bouton Nous écrire */

@media (min-width: 1025px) {
	.tp-header-cta.et_pb_link {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		box-sizing: border-box;
	}
}

.tp-header-cta .et_pb_link_inner {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}


/* TP2000 - Bouton hamburger mobile */

@media (max-width: 1024px) {
	.tp-mobile-burger .mobile_menu_bar {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		padding: 0;
		box-sizing: border-box;
		background: #FFFFFF;
		border: 1px solid #CDD1D5;
		border-radius: 8px;
		cursor: pointer;
	}

	.tp-mobile-burger .mobile_menu_bar::before {
		position: static;
		font-size: 22px;
		line-height: 1;
	}
}


/* TP2000 - Largeur du menu déroulant mobile */

@media (max-width: 1024px) {

	.tp-mobile-burger .et_mobile_menu {
		left: auto !important;
		right: 0 !important;

		width: min(360px, calc(100vw - 32px)) !important;
		max-width: none !important;
		box-sizing: border-box;

		padding: 6px 14px 14px;
		background: #FFFFFF;
		border-top: 2px solid #C1222B;
		border-radius: 0 0 8px 8px;

		box-shadow: 0 12px 30px rgba(22, 25, 28, .12);
	}

	.tp-mobile-burger .et_mobile_menu li a {
		display: block;
		width: 100%;
		box-sizing: border-box;

		padding: 14px 8px;
		font-size: 17px;
		line-height: 1.4;
		color: #1E2227 !important;

		white-space: normal;
	}

	.tp-mobile-burger .et_mobile_menu li a:hover {
		color: #C1222B !important;
	}

}


/* TP2000 - Bandeau réseaux mobile */

@media (max-width: 1024px) {

	.tp-mobile-social {
		overflow: hidden;
		max-height: 44px;
		opacity: 1;
		visibility: visible;
		transition:
			max-height 200ms cubic-bezier(.22, .61, .36, 1),
			opacity 160ms ease;
	}

	.tp-header-nav.tp-header-compact .tp-mobile-social {
		max-height: 0;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tp-mobile-social {
		transition: none;
	}
}


/* TP2000 - Navigation fluide entre les sections */

html {
	scroll-behavior: smooth;
}

/* Compensation du header sticky */
[id^="section_"] {
	scroll-margin-top: 85px;
}

/* Header desktop de 95px */
@media (min-width: 1280px) {
	[id^="section_"] {
		scroll-margin-top: 96px;
	}
}

/* Accessibilite - Respect des preferences utilisateur */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}


/* TP2000 - Navigation active au defilement */

.tp-scrollspy-menu a.tp-is-active {
	color: #C1222B !important;
}

@media (min-width: 1025px) {
	.tp-scrollspy-menu .et_pb_menu__menu a[href*="#"] {
		position: relative;
		transition: color 200ms cubic-bezier(.22, .61, .36, 1);
	}

	.tp-scrollspy-menu .et_pb_menu__menu a[href*="#"]::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: -2px;
		width: 16px;
		height: 2px;
		background: #C1222B;
		opacity: 0;
		transition: opacity 240ms cubic-bezier(.22, .61, .36, 1);
	}

	.tp-scrollspy-menu .et_pb_menu__menu a.tp-is-active::after {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tp-scrollspy-menu .et_pb_menu__menu a {
		transition: none;
	}
}


/* TP2000 - Correction responsive des statistiques */

@media (max-width: 1024px) {

	/* Organisation verticale de chaque statistique */
	#section_stats .tp-stat-card {
		display: flex !important;
		flex-direction: column !important;
		align-items: stretch !important;
		justify-content: flex-start !important;
		row-gap: 16px !important;
		height: auto !important;
		min-height: 0 !important;
	}

	/* Chiffres et unites sur une seule ligne */
	#section_stats .tp-stat-figure {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: baseline !important;
		justify-content: flex-start !important;
		column-gap: 4px !important;
		row-gap: 0 !important;
		width: 100% !important;
		height: auto !important;
		min-height: 0 !important;
		margin-top: 10px !important;
	}

	#section_stats .tp-stat-figure>* {
		flex: 0 0 auto !important;
		align-self: baseline !important;
		width: auto !important;
		max-width: none !important;
		height: auto !important;
		min-height: 0 !important;
		margin-bottom: 0 !important;
	}

	/* Supprime la hauteur interne reservee par Divi */
	#section_stats .tp-stat-figure .et_pb_number_counter,
	#section_stats .tp-stat-figure .et_pb_number_counter .percent,
	#section_stats .tp-stat-figure .et_pb_number_counter .percent p {
		height: auto !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		line-height: .95 !important;
	}

	/* Le M€ reste obligatoirement a droite du 14 */
	#section_stats .tp-stat-unit,
	#section_stats .tp-stat-unit p {
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		white-space: nowrap !important;
		line-height: 1 !important;
	}

}