/*
 * COMPAK — phase 3: tecpap.ma layout in COMPAK's identity (module "global").
 * Tokens, site-wide base typography and the shared tp-* components (CLONE.md). Class names and token
 * names are a CONTRACT used by every module; see DEV.md "Phase 3 — tecpap layout".
 * Measured values (tecpap.ma, 1440 wide unless noted) are quoted next to each rule.
 */

/* ========================================================================== Tokens */
:root {
	--tp-accent: #00752f;
	--tp-accent-hover: #005a24;
	--tp-dark: #0b3d22;
	--tp-dark-2: #00521f;
	--tp-heading: #16211a;          /* beautify pass: near-black with a hint of the brand green */
	--tp-heading-2: #333;
	--tp-text: #3d4a42;             /* beautify pass: darker body text (was tecpap #4e4e4e) */
	--tp-nav: rgba(51, 51, 51, 0.7);
	--tp-kraft: #c9a77a;
	--tp-line: #e5e5e5;
	--tp-font: "Roboto", Helvetica, Arial, sans-serif;
	--tp-border: #e9e9e9;          /* card / section hairlines (tecpap rgb(233,233,233)) */
	--tp-mark: url("../img/global-mark.svg");
	/* Phase 2 classes still in use read --ck-font: point it at Roboto. */
	--ck-font: var(--tp-font);
}

/* ========================================================================== Base typography
 * tecpap: body Roboto 300 16px/24px #4e4e4e; headings 300 #222; links accent.
 */
html { -webkit-text-size-adjust: 100%; }
body {
	font-family: var(--tp-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: var(--tp-text);
	-webkit-font-smoothing: antialiased;
}
/* Many Elementor widgets / plugins name their own font (Manrope, Inter, Figtree, Plus Jakarta…):
 * one font everywhere, icon fonts excluded. */
body :is(h1, h2, h3, h4, h5, h6, p, a, li, dt, dd, label, legend, blockquote, figcaption, td, th, span, strong, b, em, small, div, button, input, select, textarea, option):not(i):not([class*="icon"]):not([class*="fa-"]):not([class^="fa"]):not(.dashicons):not([class*="eicon"]):not([class*="revicon"]) {
	font-family: var(--tp-font) !important;
}
p { margin: 0 0 15px; }
b, strong { font-weight: 500; }
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 25px;
	font-family: var(--tp-font);
	font-weight: 500;              /* beautify pass: headings firmer than tecpap's 300 */
	color: var(--tp-heading);
	letter-spacing: normal;
	text-transform: none;
}
h1 { font-size: 54px; line-height: 58px; }     /* tecpap article title */
h2 { font-size: 36px; line-height: 42px; }
h3 { font-size: 24px; line-height: 28px; }     /* tecpap product heading */
h4 { font-size: 18px; line-height: 23px; }
h5, h6 { font-size: 16px; line-height: 24px; }
/* tecpap keeps its 54/58 h1 on phones (measured on its product page at 390). */
@media (max-width: 767px) {
	h2 { font-size: 28px; line-height: 34px; }
}
a { color: var(--tp-accent); text-decoration: none; transition: color 0.15s ease; }
a:hover, a:focus { color: var(--tp-accent-hover); }
ul, ol { margin: 0 0 15px; padding-left: 30px; }
li { line-height: 24px; }
em, i:not([class]) { font-style: italic; }

/* Square accent bullets (tecpap's "A propos" list): <ul class="tp-list"> — 25px text indent. */
.tp-list, .tp-section ul.tp-list { margin: 0 0 15px; padding: 0; list-style: none; }
.tp-list > li { position: relative; padding-left: 25px; }
.tp-list > li::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 10px;
	width: 5px;
	height: 5px;
	background: var(--tp-accent);
}

.tp-highlight { color: var(--tp-accent); }

/* ========================================================================== Layout
 * tecpap container: 1120px content at x160 (1440); 930px at 1024; 25px gutters below 960.
 */
.tp-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 40px;
}
@media (max-width: 1219px) { .tp-container { max-width: 1000px; padding-inline: 35px; } }
@media (max-width: 959px) { .tp-container { max-width: none; padding-inline: 25px; } }
.e-con.e-con.tp-container { --padding-left: 40px; --padding-right: 40px; max-width: 1200px; margin-inline: auto; padding-inline: 40px; }
@media (max-width: 1219px) { .e-con.e-con.tp-container { --padding-left: 35px; --padding-right: 35px; max-width: 1000px; padding-inline: 35px; } }
@media (max-width: 959px) { .e-con.e-con.tp-container { --padding-left: 25px; --padding-right: 25px; max-width: none; padding-inline: 25px; } }

/* Sections. Paddings named after tecpap's blocks (top / bottom):
 * --top-c 25/50 (green products band), --top-d 60/60 (stats), --bottom-a 25/40 (clients),
 * --bottom-b 25/40 (features), --bottom-c 20/45 (contact), --main 60/60 (inner page body). */
.tp-section,
.e-con.e-con.tp-section {
	position: relative;
	box-sizing: border-box;
	--padding-top: 0px;
	--padding-bottom: 0px;
	padding-top: var(--tp-pt, 0px);
	padding-bottom: var(--tp-pb, 0px);
	background-color: #fff;
	color: var(--tp-text);
}
.tp-section--white, .e-con.e-con.tp-section--white { background-color: #fff; }
.tp-section--green, .e-con.e-con.tp-section--green {
	/* tecpap lays a texture photo over its green; COMPAK: flat brand green with a very soft light falloff. */
	background-color: var(--tp-accent);
	background-image: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%);
	color: #fff;
}
.tp-section--top-c { --tp-pt: 25px; --tp-pb: 50px; border-top: 1px solid var(--tp-border); }
.tp-section--top-d { --tp-pt: 60px; --tp-pb: 60px; border-top: 1px solid var(--tp-border); }
.tp-section--bottom-a { --tp-pt: 25px; --tp-pb: 40px; border-top: 1px solid var(--tp-border); }
.tp-section--bottom-b { --tp-pt: 25px; --tp-pb: 40px; border-top: 1px solid var(--tp-border); }
.tp-section--bottom-c { --tp-pt: 20px; --tp-pb: 45px; }
.tp-section--main { --tp-pt: 60px; --tp-pb: 60px; }
.tp-section--green :is(h1, h2, h3, h4, p, li) { color: #fff; }
/* White cards keep their dark text inside green bands. */
.tp-section--green .tp-card :is(h1, h2, h3, h4, p, li) { color: var(--tp-text); }
.tp-section--green .tp-card .tp-card__title { color: var(--tp-heading-2); }

/* ========================================================================== Section title  (.tp-title)
 * tecpap h3.uk-panel-title: 25px/28px Roboto 300 uppercase, centred, padding-top 60 (white) / 45 (green),
 * margin-bottom 32. Ornament in that padding: two 70px hairlines with a 35px gap and the mark centred on
 * the line: white sections line at +22, mark ~34px; green sections line at +17, mark 28px.
 * Plain: <h2 class="tp-title">Nos produits</h2>  (any heading level).
 * Elementor: Heading widget, CSS classes = tp-title.
 */
.tp-title:not(.elementor-widget),
.elementor-widget.elementor-widget.tp-title .elementor-heading-title {
	position: relative;
	display: block;
	margin: 0 0 32px;
	padding: 60px 0 0;
	color: var(--tp-heading);
	font-family: var(--tp-font);
	font-size: 32px;               /* beautify pass: bigger, bold section titles (tecpap 25px 300) */
	font-weight: 700;
	line-height: 38px;
	letter-spacing: 0.01em;
	text-align: center;
	text-transform: uppercase !important;
}
.elementor-widget.elementor-widget.tp-title { margin-bottom: 32px; }
.elementor-widget.elementor-widget.tp-title .elementor-heading-title { margin: 0; }
.tp-title:not(.elementor-widget)::before,
.elementor-widget.elementor-widget.tp-title .elementor-heading-title::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: 175px;
	height: 44px;
	margin-left: -87.5px;
	background:
		linear-gradient(var(--tp-title-line, #ededf0), var(--tp-title-line, #ededf0)) 0 22px / 70px 1px no-repeat,
		linear-gradient(var(--tp-title-line, #ededf0), var(--tp-title-line, #ededf0)) 105px 22px / 70px 1px no-repeat;
}
.tp-title:not(.elementor-widget)::after,
.elementor-widget.elementor-widget.tp-title .elementor-heading-title::after {
	content: "";
	position: absolute;
	top: 5px;
	left: 50%;
	width: 34px;
	height: 34px;
	margin-left: -17px;
	background-color: var(--tp-title-mark, var(--tp-accent));
	-webkit-mask: var(--tp-mark) center / contain no-repeat;
	mask: var(--tp-mark) center / contain no-repeat;
}
/* On green bands: white title, white lines and mark, smaller ornament (tecpap 45px padding). */
.tp-section--green .tp-title:not(.elementor-widget),
.tp-title--light:not(.elementor-widget),
.tp-section--green .elementor-widget.elementor-widget.tp-title .elementor-heading-title,
.elementor-widget.elementor-widget.tp-title--light .elementor-heading-title {
	--tp-title-line: rgba(255, 255, 255, 0.7);
	--tp-title-mark: #fff;
	padding-top: 45px;
	color: #fff;
}
.tp-section--green .tp-title:not(.elementor-widget)::before,
.tp-title--light:not(.elementor-widget)::before,
.tp-section--green .elementor-widget.elementor-widget.tp-title .elementor-heading-title::before,
.elementor-widget.elementor-widget.tp-title--light .elementor-heading-title::before {
	height: 34px;
	background-position: 0 17px, 105px 17px;
}
.tp-section--green .tp-title:not(.elementor-widget)::after,
.tp-title--light:not(.elementor-widget)::after,
.tp-section--green .elementor-widget.elementor-widget.tp-title .elementor-heading-title::after,
.elementor-widget.elementor-widget.tp-title--light .elementor-heading-title::after {
	top: 3px;
	width: 28px;
	height: 28px;
	margin-left: -14px;
}
/* tecpap's "Tecpap, c'est" titles are #333. */
.tp-title--muted:not(.elementor-widget),
.elementor-widget.elementor-widget.tp-title--muted .elementor-heading-title { color: var(--tp-heading-2); }

/* ========================================================================== Button (.tp-btn)
 * tecpap "EN SAVOIR PLUS": 14px/23px Roboto 300 uppercase, padding 8px 40px (185×40), radius 4px,
 * accent fill, white text; <button> "ENVOYER": line-height 18px (141×34).
 */
.tp-btn,
a.tp-btn,
button.tp-btn,
input.tp-btn,
.elementor-widget.elementor-widget.tp-btn .elementor-button,
.wpcf7 .wpcf7-submit {
	display: inline-block;
	box-sizing: border-box;
	min-height: 0;
	margin: 0;
	padding: 8px 40px;
	border: 0;
	border-radius: 4px;
	background: var(--tp-accent);
	box-shadow: none;
	color: #fff;
	font-family: var(--tp-font);
	font-size: 14px;
	font-weight: 500;              /* beautify pass */
	line-height: 23px;
	letter-spacing: 0.04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	vertical-align: middle;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
button.tp-btn, input.tp-btn, .wpcf7 .wpcf7-submit { line-height: 18px; }
.tp-btn:hover, .tp-btn:focus,
.elementor-widget.elementor-widget.tp-btn .elementor-button:hover,
.wpcf7 .wpcf7-submit:hover {
	background: var(--tp-accent-hover);
	color: #fff;
}
/* beautify pass: buttons lift slightly on hover. */
.tp-btn:hover, .elementor-widget.elementor-widget.tp-btn .elementor-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 82, 31, 0.25);
}
@media (prefers-reduced-motion: reduce) { .tp-btn:hover { transform: none; } }
.elementor-widget.elementor-widget.tp-btn .elementor-button-text { font: inherit; }

/* ========================================================================== Product card (.tp-card)
 * tecpap panel 250×461 on the green band: white, 1px #e9e9e9, padding 25; photo flush on top
 * (250×266); title 16px/28px 300 uppercase centred with a 50×2 accent underline (13px padding);
 * button 10px below the title's 25px margin. Hover: photo zooms (uk-overlay-scale).
 * <div class="tp-card"><a class="tp-card__media" href=""><img …></a>
 *   <h3 class="tp-card__title"><a href="">Sacs en papier</a></h3><a class="tp-btn" href="">En savoir plus</a></div>
 */
.tp-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 25px;
	border: 1px solid var(--tp-border);
	background: #fff;
	color: var(--tp-text);
	text-align: center;
}
.tp-card__media {
	display: block;
	align-self: center;
	width: calc(100% + 52px);   /* flush with the card's outer edges (250px card at 1440) … */
	max-width: 266px;           /* … but never wider than 266px: centred in wider cards (tecpap 768/390) */
	margin: -26px 0 25px;       /* align-self: center does the centring; auto margins would collapse to 0 */
	overflow: hidden;
	aspect-ratio: 250 / 266;
	background: #f3f3f3;
}
.tp-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease-out;
}
.tp-card:hover .tp-card__media img,
.tp-card:focus-within .tp-card__media img { transform: scale(1.1); }
.tp-card__title {
	position: relative;
	margin: 0 0 25px;
	padding: 0 0 13px;
	color: var(--tp-heading);
	font-size: 17px;
	font-weight: 700;              /* beautify pass (tecpap 300) */
	line-height: 28px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.tp-card__title::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 50px;
	height: 2px;
	margin-left: -25px;
	background: var(--tp-accent);
}
.tp-card__title a { color: inherit; }
.tp-card__title a:hover { color: var(--tp-accent); }
/* Beautify pass: one-line description under the title; the card lifts a little on hover. */
.tp-card__desc { margin: -10px 0 20px; color: var(--tp-text); font-size: 14px; line-height: 21px; }
.tp-section--green .tp-card .tp-card__desc { color: var(--tp-text); }
.tp-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.tp-card:hover, .tp-card:focus-within { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18); }
@media (prefers-reduced-motion: reduce) { .tp-card, .tp-card:hover { transition: none; transform: none; } }
.tp-card .tp-btn { margin-top: auto; }
.tp-card .tp-card__title + .tp-btn { margin-top: 10px; }
/* Card grid (tecpap measured): 4 columns from 960px (250px cards, 40px gutters at ≥1220; 214px, 25px
 * gutters at 1024), 2 columns from 480 to 959 (347px at 768, 25px gutter), 1 full-width column below 480. */
.tp-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px;
	align-items: stretch;
}
@media (max-width: 1219px) { .tp-cards { gap: 25px; } }
@media (max-width: 959px) { .tp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .tp-cards { grid-template-columns: minmax(0, 1fr); } }

/* ========================================================================== Stats & features
 * tecpap measured (spec-home-<w>.json, tm-top-d / tm-bottom-b): both are 4 equal columns spanning the
 * container plus one gutter on the left (x120…1280 at 1440; 1160 / 4 = 290px columns), gutter 40px at
 * ≥1220 and 25px below; 4 columns down to 768, one column below 768.
 * - .tp-stats: content starts one gutter in (x160, 250 wide); round 113px icon; value 30/28 700 uppercase
 *   #333 25px below; label 20/24 300 uppercase 10px below; separator 1px #333, 70px tall, 77px from top.
 * - .tp-features: content is the column minus 20px each side (x140, 250 wide); 63px icon; label 18/23 300
 *   #333 25px below; 25px kept under the labels; separator 45px from the top.
 * Spacing does not rely on margin collapsing (Elementor flex containers): after a .tp-title (32px bottom
 * margin) the grids add padding-top 43px (stats, = 75 in total) / 38px (features, = 70).
 * <div class="tp-stats"><div class="tp-stat"><span class="tp-stat__icon"><?php echo compak_fx_tp_icon('factory'); ?></span>
 *   <h3 class="tp-stat__value">…</h3><div class="tp-stat__label">…</div></div> ×4</div>
 */
.tp-stats,
.tp-features {
	--tp-gut: 40px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	box-sizing: border-box;
	width: calc(100% + var(--tp-gut));
	margin: 0 0 0 calc(-1 * var(--tp-gut));
	padding: 43px 0 0;
	list-style: none;
	text-align: center;
}
.tp-features { padding-top: 38px; padding-bottom: 25px; }
@media (max-width: 1219px) { .tp-stats, .tp-features { --tp-gut: 25px; } }
.tp-stat, .tp-feature { position: relative; box-sizing: border-box; min-width: 0; margin: 0; }
.tp-stat { padding: 0 0 0 var(--tp-gut); }
.tp-feature { padding: 0 20px; }
.tp-stat:not(:last-child)::after,
.tp-feature:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 0;
	top: 77px;
	width: 1px;
	height: 70px;
	background: var(--tp-heading-2);
}
.tp-feature:not(:last-child)::after { top: 45px; }
.tp-stat__icon, .tp-feature__icon { display: flex; justify-content: center; align-items: flex-end; }
.tp-stat__icon { height: 114px; }
.tp-feature__icon { height: 63px; }
.tp-stat__icon svg { width: 113px; height: 113px; }
.tp-feature__icon svg { width: auto; height: 63px; }
.tp-stat__value {
	margin: 25px 0 0;
	color: var(--tp-heading-2);
	font-size: 30px;
	font-weight: 700;
	line-height: 28px;
	text-transform: uppercase;
}
.tp-stat__label {
	margin: 10px 0 0;
	color: var(--tp-text);
	font-size: 20px;
	font-weight: 400;
	line-height: 24px;
	text-transform: uppercase;
}
.tp-feature__label {
	margin: 25px 0 0;
	color: var(--tp-heading-2);
	font-size: 18px;
	font-weight: 400;
	line-height: 23px;
}
/* Same grids when the classes sit on Elementor containers (beat Elementor's per-element flex/width/padding). */
.e-con.e-con:is(.tp-stats, .tp-features) {
	--display: grid;
	--width: calc(100% + var(--tp-gut));
	--margin-left: calc(-1 * var(--tp-gut));
	--padding-left: 0px;
	--padding-right: 0px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	width: calc(100% + var(--tp-gut));
	max-width: none;
	margin-left: calc(-1 * var(--tp-gut));
	padding-left: 0;
	padding-right: 0;
}
.e-con.e-con.tp-stats { --padding-top: 43px; padding-top: 43px; --padding-bottom: 0px; padding-bottom: 0; }
.e-con.e-con.tp-features { --padding-top: 38px; padding-top: 38px; --padding-bottom: 25px; padding-bottom: 25px; }
.e-con.e-con:is(.tp-stat, .tp-feature) { --width: auto; width: auto; min-width: 0; }
.e-con.e-con.tp-stat { --padding-left: var(--tp-gut); --padding-right: 0px; padding-left: var(--tp-gut); padding-right: 0; }
.e-con.e-con.tp-feature { --padding-left: 20px; --padding-right: 20px; padding-left: 20px; padding-right: 20px; }
@media (max-width: 767px) {
	.e-con.e-con:is(.tp-stats, .tp-features) { grid-template-columns: minmax(0, 1fr); row-gap: 50px; width: 100%; --width: 100%; margin-left: 0; --margin-left: 0px; }
	.e-con.e-con.tp-stat { padding-left: 0; --padding-left: 0px; }
	.e-con.e-con.tp-feature { padding-left: 0; --padding-left: 0px; }
	.tp-stats, .tp-features { grid-template-columns: minmax(0, 1fr); row-gap: 50px; width: 100%; margin-left: 0; }
	.tp-stat { padding: 0; }
	.tp-feature { padding: 0 20px 0 0; }
	.tp-stat::after, .tp-feature::after { display: none; }
}

/* ========================================================================== Tabs (.tp-tabs)
 * tecpap uk-subnav-pill: items 13px/24px uppercase, padding 5px 15px (34px tall), 15px apart;
 * active: filled (tecpap light green + dark 700 text). COMPAK: accent fill with WHITE 700 text —
 * dark text on #00752f would fail contrast (deliberate deviation).
 * <ul class="tp-tabs" role="tablist"><li class="is-active"><a href="…" aria-selected="true">Sac shopping</a></li>…</ul>
 */
.tp-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 15px;
	margin: 0 0 25px;
	padding: 0;
	list-style: none;
}
.tp-tabs > li { margin: 0; padding: 0; }
.tp-tabs > li > a,
.tp-tabs > li > button {
	display: block;
	padding: 5px 15px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--tp-text);
	font-family: var(--tp-font);
	font-size: 13px;
	font-weight: 400;
	line-height: 24px;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}
.tp-tabs > li > :is(a, button):hover { color: var(--tp-accent); }
.tp-tabs > li.is-active > :is(a, button),
.tp-tabs > li > [aria-selected="true"] {
	background: var(--tp-accent);
	color: #fff;
	font-weight: 700;
}

/* ========================================================================== Forms (tecpap look)
 * tecpap measured: fields 34px high, 13px text, 1px #f0eded border, 3px corners ([compak_contact]).
 */
.tp-field,
.tp-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], select, textarea) {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: 34px;
	margin: 0;
	padding: 4px 10px;
	border: 1px solid #f0eded;
	border-radius: 3px;
	background: #fff;
	box-shadow: none;
	color: var(--tp-text);
	font-family: var(--tp-font);
	font-size: 13px;
	font-weight: 400;
	line-height: 20px;
}
.tp-form textarea, textarea.tp-field { height: auto; min-height: 120px; padding-top: 8px; }
.tp-field:focus,
.tp-form :is(input, select, textarea):focus { outline: none; border-color: var(--tp-accent); box-shadow: 0 0 0 1px var(--tp-accent); }

/* ========================================================================== Images */
.tp-rounded img, img.tp-rounded { border-radius: 4px; }

/* ========================================================================== Keyboard focus (all pages)
 * The theme removes outlines (":focus { outline: none }"). Visible ring on keyboard focus only.
 */
:focus-visible {
	outline: 2px solid var(--tp-accent) !important;
	outline-offset: 2px !important;
}
:is(.tp-section--green, .tp-footer, .tp-offcanvas) :focus-visible { outline-color: #fff !important; }
