/* =========================================================================================
   COMPAK fixes — module "home": the home page (post 22), phase 3 = tecpap.ma's one-page layout.
   Built from Elementor containers/widgets (migrations/home-10-page.php) that carry module global's shared
   tp-* components (.tp-container, .tp-section--*, .tp-title, .tp-list, .tp-highlight, .tp-stats, .tp-features
   in global-10-tecpap.css). This file only holds what those do not cover: the hero, the À propos row, the
   clients carousel, and a little glue so Elementor's widget wrappers behave like global's plain markup.
   Measured on tecpap at 1440 / 1024 / 768 / 390 (CLONE.md, spec-home-*.json).
   Colours come from global's --tp-* tokens (fallbacks only so nothing breaks if a token is missing).
   Loaded on the front page only (inc/home.php).
   ========================================================================================= */

/* =========================================================================================
   1. Hero (tecpap tm-top-a): 900 px block under the overlaid header (visible 900 / 850 / 816 px at
   ≥1220 / 960–1219 / 768–959), 500 px on phones below the 113 px bar. Headline bottom-left, 65 px above the
   bottom edge, 45 px Roboto 400 uppercase #333 (30 px on phones).
   ========================================================================================= */
.e-con.e-con.tp-home-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	height: 900px;
	min-height: 0;
	justify-content: flex-end;
	background-color: #222;
}
@media (max-width: 1219px) { .e-con.e-con.tp-home-hero { height: 850px; } }
@media (max-width: 959px) { .e-con.e-con.tp-home-hero { height: 816px; } }
@media (max-width: 767px) { .e-con.e-con.tp-home-hero { height: 500px; } }

/* Light wash so tecpap's dark text reads over the video (strongest at the top behind the logo/nav and at the
   bottom-left behind the headline). */
.e-con.e-con.tp-home-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	/* Beautify pass: light wash only at the top (behind the green logo and the menu); a dark shade at the
	   bottom-left so the headline and buttons are white and bold over any clip. */
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0, rgba(255, 255, 255, 0.55) 230px, rgba(255, 255, 255, 0) 360px),
		linear-gradient(0deg, rgba(8, 28, 16, 0.78) 0, rgba(8, 28, 16, 0.5) 230px, rgba(8, 28, 16, 0) 430px),
		linear-gradient(90deg, rgba(8, 28, 16, 0.3) 0, rgba(8, 28, 16, 0) 60%);
}
@media (max-width: 767px) {
	.e-con.e-con.tp-home-hero::after {
		background:
			linear-gradient(0deg, rgba(8, 28, 16, 0.85) 0, rgba(8, 28, 16, 0.55) 260px, rgba(8, 28, 16, 0.1) 440px);
	}
}
.e-con.e-con.tp-home-hero > .e-con {
	position: relative;
	z-index: 1;
}
.e-con.e-con.tp-home-hero__inner {
	--padding-bottom: 65px;
	padding-bottom: 65px;
}
.tp-home-hero .tp-home-hero__title .elementor-heading-title {
	margin: 0;
	color: #fff;
	font-family: var(--tp-font, "Roboto", Helvetica, Arial, sans-serif);
	font-size: 46px;
	font-weight: 700;
	line-height: 58px;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
@media (max-width: 767px) {
	.tp-home-hero .tp-home-hero__title .elementor-heading-title { font-size: 24px; line-height: 30px; }
}
/* Hero buttons: "Demander un devis" (green) + "Nos produits" (white outline). */
.tp-home-hero .elementor-widget.tp-home-hero__actions { width: 100%; margin-top: 28px; }
.tp-home-hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.tp-home-hero__cta .tp-btn--lg { padding: 14px 30px; font-size: 15px; font-weight: 500; border-radius: 6px; }
.tp-home-hero__cta .tp-btn--ghost { background: transparent; box-shadow: inset 0 0 0 2px #fff; color: #fff; }
.tp-home-hero__cta .tp-btn--ghost:hover,
.tp-home-hero__cta .tp-btn--ghost:focus { background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); color: var(--tp-accent); }
@media (max-width: 767px) {
	.tp-home-hero .elementor-widget.tp-home-hero__actions { margin-top: 20px; }
	.tp-home-hero__cta { gap: 10px; }
	.tp-home-hero__cta .tp-btn--lg { padding: 12px 14px; font-size: 13px; }
}

/* Background video (assets/js/home-hero-video.js): fills the hero under the wash, fades in once it plays;
   absolutely positioned, so the layout never moves. */
.e-con.e-con.tp-home-hero > video.tp-home-hero__video {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	opacity: 0;
	transition: opacity 0.6s ease;
	pointer-events: none;
}
.e-con.e-con.tp-home-hero--playing > video.tp-home-hero__video { opacity: 1; }
/* Pause / play button (moving content longer than 5 s must be pausable): small, bottom-right of the hero. */
.e-con.e-con.tp-home-hero > .tp-home-hero__toggle {
	position: absolute;
	z-index: 2;
	right: 100px;        /* beautify pass: clear of the floating WhatsApp button (bottom-right, 58 px) */
	bottom: 33px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(51, 51, 51, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	color: var(--tp-heading-2, #333);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.tp-home-hero .tp-home-hero__toggle:hover { background: rgba(255, 255, 255, 0.9); color: var(--tp-heading-2, #333); }
.tp-home-hero .tp-home-hero__toggle:focus-visible { outline: 2px solid var(--tp-accent, #00752f) !important; outline-offset: 3px !important; }
.tp-home-hero .tp-home-hero__toggle svg { display: block; width: 18px; height: 18px; }
@media (max-width: 767px) {
	.e-con.e-con.tp-home-hero > .tp-home-hero__toggle { right: 80px; bottom: 22px; }
}

/* =========================================================================================
   2. À propos de nous (tm-top-b): photo flush left (40 % wide, 5:4), text column right, vertically centred.
   ========================================================================================= */
.e-con.e-con.tp-home-about__row {
	flex-direction: row;
	align-items: center;
	gap: 30px;
	--gap: 30px;
	--padding-top: 30px;
	--padding-right: 30px;
	--padding-bottom: 30px;
	padding: 30px 30px 30px 0;
}
.tp-home-about__row > .tp-home-about__img {
	/* 40 % of the full section width (576 px at 1440), the row itself has 30 / 20 px right padding */
	--tp-home-pr: 30px;
	flex: 0 0 calc((100% + var(--tp-home-pr)) * 0.4);
	width: calc((100% + var(--tp-home-pr)) * 0.4);
	max-width: none;
	margin: 0;
}
.tp-home-about__img img {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	border-radius: 0;
}
.tp-home-about__row > .tp-home-about__text { flex: 1 1 0; min-width: 0; margin: 0; }
.tp-home-about__text .tp-list a { color: inherit; }
.tp-home-about__text .tp-list a:hover { color: var(--tp-accent, #00752f); }
.tp-home-about__text > :last-child { margin-bottom: 0; }
@media (max-width: 1219px) {
	.e-con.e-con.tp-home-about__row { gap: 20px; --gap: 20px; --padding-right: 20px; padding-right: 20px; }
	.tp-home-about__row > .tp-home-about__img { --tp-home-pr: 20px; }
}
@media (max-width: 767px) {
	.e-con.e-con.tp-home-about__row {
		flex-direction: column;
		align-items: stretch;
		gap: 9px;
		--gap: 9px;
		padding: 0;
	}
	/* tecpap: photo 17 px under the title, 39 px wider than the screen (x −19), so 5:4 = 344 px tall at 390 */
	.e-con.e-con.tp-home-about__row { margin-top: -15px; }
	.e-con.e-con.tp-home-about { overflow: hidden; }
	.e-con.e-con.tp-home-about__row > .elementor-widget.tp-home-about__img { flex: none; width: calc(100% + 39px); max-width: none; margin-left: -19px; }
	.tp-home-about__row > .tp-home-about__text { padding: 0 20px; }
}

/* =========================================================================================
   4 + 6. "COMPAK, c'est" (stats, pending) and "COMPAK, c'est aussi" (features) use global's .tp-stats /
   .tp-features grids. Glue: the classes sit on Elementor widget WRAPPERS here, so the inner heading inherits
   the wrapper's type instead of Elementor's heading defaults.
   ========================================================================================= */
.e-con.e-con:is(.tp-stat, .tp-feature) { width: auto; --width: auto; min-width: 0; align-items: center; }
.elementor-widget:is(.tp-stat__icon, .tp-feature__icon) { width: 100%; line-height: 0; }
.elementor-widget:is(.tp-stat__icon, .tp-feature__icon) .elementor-shortcode { display: flex; justify-content: center; align-items: flex-end; height: 100%; }
.elementor-widget:is(.tp-stat__value, .tp-stat__label, .tp-feature__label) { width: 100%; }
.elementor-widget:is(.tp-stat__value, .tp-stat__label, .tp-feature__label) .elementor-heading-title {
	margin: 0;
	color: inherit;
	font: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
}

/* "COMPAK, c'est" holds 6 points (3 capacity figures + 3 strengths): 3 columns × 2 rows from 768 up instead of
   global's 4 columns; no separator after the last cell of a row; 50 px between the rows. */
@media (min-width: 768px) {
	.e-con.e-con.tp-home-stats .tp-stats,
	.tp-home-stats .tp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 50px; }
	.tp-home-stats .tp-stat:nth-child(3n)::after { display: none; }
}

/* =========================================================================================
   5. "Nos secteurs" band (tecpap's "Ils nous font confiance" slot; pending "clients", switched on): filter tabs +
   arrow carousel (assets/js/home-clients.js) of white sector tiles in tecpap's logo slots.
   ========================================================================================= */
.tp-home-clients__tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 15px;
	margin: 5px 0 25px;
	padding: 0;
	list-style: none;
}
.tp-home-clients__tabs li { margin: 0; padding: 0; }
.tp-home-clients__tabs button {
	min-height: 33px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: rgba(255, 255, 255, 0.85); /* tecpap #4e4e4e on light green; on COMPAK's darker green: white (contrast) */
	font-family: var(--tp-font, "Roboto", Helvetica, Arial, sans-serif);
	font-size: 13px;
	font-weight: 400;
	line-height: 24px;
	text-transform: uppercase;
	box-shadow: none;
	cursor: pointer;
}
.tp-home-clients__tabs button[aria-selected="true"] { color: #fff; font-weight: 700; }
.tp-home-clients__tabs button:hover { color: #fff; background: none; text-decoration: underline; }
.tp-home-clients__tabs button:focus-visible { outline: 2px solid #fff !important; outline-offset: 2px; }
.tp-home-clients__stage { position: relative; }
.tp-home-clients__track {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 25px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 1220px) { .tp-home-clients__track { gap: 40px; } }
@media (min-width: 768px) and (max-width: 959px) { .tp-home-clients__track { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tp-home-clients__item {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 250 / 182;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #fff;
	border-radius: 2px;
}
.tp-home-clients__item[hidden] { display: none; }
.tp-home-clients__item img { max-width: 80%; max-height: 70%; object-fit: contain; }
.tp-home-clients__item.tp-home-sector { flex-direction: column; gap: 14px; padding: 12px; text-align: center; }
.tp-home-sector__icon { display: block; width: auto; height: 56px; }
.tp-home-sector__name {
	color: var(--tp-heading-2, #333);
	font-family: var(--tp-font, "Roboto", Helvetica, Arial, sans-serif);
	font-size: 14px;
	font-weight: 400;
	line-height: 18px;
	text-transform: uppercase;
}
.tp-home-clients__nav {
	position: absolute;
	top: 50%;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: -20px 0 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	cursor: pointer;
}
.tp-home-clients__nav::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	border: solid #fff;
	border-width: 0 0 3px 3px;
	transform: translate(-30%, -50%) rotate(45deg);
}
.tp-home-clients__nav--next::before { transform: translate(-70%, -50%) rotate(-135deg); }
.tp-home-clients__nav--prev { left: -45px; }
.tp-home-clients__nav--next { right: -45px; }
.tp-home-clients__nav[hidden] { display: none; }
.tp-home-clients__nav:hover { background: none; }
.tp-home-clients__nav:focus-visible { outline: 2px solid #fff !important; }
@media (max-width: 959px) {
	.tp-home-clients__nav--prev { left: -29px; }
	.tp-home-clients__nav--next { right: -29px; }
}
@media (max-width: 767px) {
	.tp-home-clients__nav { display: none; }
	/* tecpap shows 4 tiny logos per row (66×48); a sector name needs more room: 2 per row (deliberate deviation). */
	.tp-home-clients__track { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
	.tp-home-sector__icon { height: 44px; }
	.tp-home-sector__name { font-size: 13px; line-height: 16px; }
}

/* Sections 3 and 7 are printed whole by modules shop ([compak_gammes]) and pages ([compak_contact]); the
   Elementor wrappers only carry the anchors and must add no box of their own. */
.e-con.e-con:is(.tp-home-products, .tp-home-contact) { --padding-top: 0px; --padding-bottom: 0px; padding: 0; }
.elementor-widget.tp-home-sc { width: 100%; margin: 0; }

/* tecpap's clients band (tm-bottom-a): its title has 55 px top padding (83 px box, not the 45 px of the products
   band) and its slideset keeps 25 px below the tiles. */
#ils-nous-font-confiance .elementor-widget.tp-title .elementor-heading-title { padding-top: 55px; }
.tp-home-clients__stage { margin-bottom: 25px; }

/* "COMPAK, c'est": the owner's values are words ("Afrique & Europe" = 269 px at tecpap's 30 px, uppercase 700)
   where tecpap has short figures. Keep them on one line in tecpap's columns (250 / 214 / 161 px) by stepping the
   value size down per width; all four values in a row share one size. Phones keep tecpap's 30 px (340 px column). */
.tp-home-stats .tp-stat__value .elementor-heading-title { white-space: nowrap; font-size: 27px; }
@media (max-width: 1219px) { .tp-home-stats .tp-stat__value .elementor-heading-title { font-size: 23px; } }
@media (max-width: 959px) { .tp-home-stats .tp-stat__value .elementor-heading-title { font-size: 17px; } }
@media (max-width: 767px) { .tp-home-stats .tp-stat__value .elementor-heading-title { font-size: 30px; } }
