/**
 * Hero Category — frontend styles
 * Scopé sous .em-hc-*
 *
 * Variables CSS injectées par PHP via inline style (build_style_vars) :
 *   --em-hc-{prop} : valeur configurable depuis Gutenberg
 * Fallbacks alignés sur la maquette catégorie-dalles-gazon.html.
 *
 * @package Extra_MatGeco
 * @module hero-category
 */

.em-hc {
	position: relative;
	overflow: hidden;
	min-height: var(--em-hc-min-h, 500px);
	background: #0f1a10;
	display: flex;
	color: #fff;
}

/* === Outer widths === */
.em-hc.em-hc-w-full { max-width: 100%; }
.em-hc.em-hc-w-100  { max-width: 100%; }
.em-hc.em-hc-w-90   { max-width: 90%;  margin-inline: auto; }
.em-hc.em-hc-w-80   { max-width: 80%;  margin-inline: auto; }
.em-hc.em-hc-w-75   { max-width: 75%;  margin-inline: auto; }
.em-hc.em-hc-w-66   { max-width: 66%;  margin-inline: auto; }
.em-hc.em-hc-w-50   { max-width: 50%;  margin-inline: auto; }
.em-hc.em-hc-w-custom { max-width: var(--em-hc-custom-w, 100%); margin-inline: auto; }

/* === Background layer === */
.em-hc-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}
/* Zoom de recadrage (point focal) — appliqué uniquement si un zoom personnalisé est réglé.
 * Scopé à la couche de fond dédiée : le contenu (.em-hc-inner) n'est pas affecté ;
 * .em-hc a overflow:hidden donc le débordement est rogné. */
.em-hc-bg.em-hc-bg-zoom {
	transform: scale(var(--em-hc-bg-scale, 1));
	transform-origin: var(--em-hc-bg-origin, center);
}

/* === Inner container === */
.em-hc-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--em-hc-container-max, 1320px);
	margin-inline: auto;
	padding: var(--em-hc-pad-v, 56px) var(--em-hc-pad-h, 32px);
	display: grid;
	grid-template-columns: 1fr var(--em-hc-stats-w, 320px);
	gap: var(--em-hc-gap, 48px);
	align-items: var(--em-hc-valign, center);
}

/* Vertical align modifiers */
.em-hc.em-hc-valign-start .em-hc-inner   { align-items: start; }
.em-hc.em-hc-valign-center .em-hc-inner  { align-items: center; }
.em-hc.em-hc-valign-end .em-hc-inner     { align-items: end; }

/* Layout variants */
.em-hc.em-hc-layout-content-only .em-hc-inner,
.em-hc.em-hc-layout-centered .em-hc-inner {
	grid-template-columns: 1fr;
}
.em-hc.em-hc-layout-centered .em-hc-content {
	max-width: 900px;
	margin-inline: auto;
	text-align: center;
}
.em-hc.em-hc-layout-centered .em-hc-lead    { margin-inline: auto; }
.em-hc.em-hc-layout-centered .em-hc-badges,
.em-hc.em-hc-layout-centered .em-hc-actions { justify-content: center; }
.em-hc.em-hc-layout-stats-content .em-hc-inner {
	grid-template-columns: var(--em-hc-stats-w, 320px) 1fr;
}
.em-hc.em-hc-layout-stats-content .em-hc-content { order: 2; }
.em-hc.em-hc-layout-stats-content .em-hc-stats   { order: 1; }

/* Content alignment */
.em-hc.em-hc-align-left .em-hc-content   { text-align: left; }
.em-hc.em-hc-align-center .em-hc-content { text-align: center; }
.em-hc.em-hc-align-right .em-hc-content  { text-align: right; }
.em-hc.em-hc-align-center .em-hc-badges,
.em-hc.em-hc-align-center .em-hc-actions { justify-content: center; }
.em-hc.em-hc-align-right .em-hc-badges,
.em-hc.em-hc-align-right .em-hc-actions  { justify-content: flex-end; }
.em-hc.em-hc-align-center .em-hc-lead    { margin-inline: auto; }
.em-hc.em-hc-align-right .em-hc-lead     { margin-inline-start: auto; }

/* === Content === */
.em-hc-content {
	display: flex;
	flex-direction: column;
}

/*
 * Note spécificité : tous les sélecteurs de texte sont préfixés .em-hc pour
 * garantir la spécificité (0,2,0/1) et battre les règles thème type
 * .entry-content h1 (0,1,1) ou .wp-block h2 (0,1,1). Le Kadence theme applique
 * des styles font-size/font-weight par défaut sur les headings et paragraphes ;
 * sans ce préfixe, nos variables CSS restaient invisibles.
 */

/* Eyebrow (pill au-dessus du titre) — !important pour battre Kadence Global Styles */
.em-hc .em-hc-eyebrow {
	display: inline-block !important;
	align-self: flex-start;
	font-size: var(--em-hc-eyebrow-size, 12px) !important;
	font-weight: var(--em-hc-eyebrow-weight, 700) !important;
	font-style: var(--em-hc-eyebrow-style, normal) !important;
	line-height: var(--em-hc-eyebrow-lh, 1.4) !important;
	text-transform: var(--em-hc-eyebrow-tt, uppercase) !important;
	letter-spacing: var(--em-hc-eyebrow-ls, 1px) !important;
	color: var(--em-hc-eyebrow, #a8f0b8) !important;
	background: rgba(48, 138, 74, 0.18);
	border: 1px solid rgba(72, 168, 100, 0.35);
	padding: 6px 14px;
	border-radius: 20px;
	margin-bottom: var(--em-hc-eyebrow-mb, 16px) !important;
}
.em-hc.em-hc-align-center .em-hc-eyebrow { align-self: center; }
.em-hc.em-hc-align-right  .em-hc-eyebrow { align-self: flex-end; }

/* Title — spécificité + !important pour battre Kadence theme.json + .entry-content h1 */
.em-hc .em-hc-title,
.em-hc h1.em-hc-title,
.em-hc h2.em-hc-title,
.em-hc h3.em-hc-title,
.em-hc h4.em-hc-title,
.em-hc h5.em-hc-title,
.em-hc h6.em-hc-title {
	font-size: var(--em-hc-title-size, 44px) !important;
	font-weight: var(--em-hc-title-weight, 800) !important;
	font-style: var(--em-hc-title-style, normal) !important;
	line-height: var(--em-hc-title-lh, 1.15) !important;
	letter-spacing: var(--em-hc-title-ls, -0.5px) !important;
	text-transform: var(--em-hc-title-tt, none) !important;
	color: var(--em-hc-title, #fff) !important;
	margin: 0 0 var(--em-hc-title-mb, 18px) !important;
}
.em-hc .em-hc-title em {
	font-size: var(--em-hc-title-em-size, inherit) !important;
	font-weight: var(--em-hc-title-em-weight, 800) !important;
	font-style: var(--em-hc-title-em-style, normal) !important;
	letter-spacing: var(--em-hc-title-em-ls, inherit) !important;
	text-transform: var(--em-hc-title-em-tt, inherit) !important;
	color: var(--em-hc-title-em, #6cd087) !important;
}

/* Lead — spécificité + !important pour battre Kadence .entry-content p */
.em-hc .em-hc-lead,
.em-hc p.em-hc-lead {
	font-size: var(--em-hc-lead-size, 17px) !important;
	font-weight: var(--em-hc-lead-weight, 400) !important;
	font-style: var(--em-hc-lead-style, normal) !important;
	line-height: var(--em-hc-lead-lh, 1.55) !important;
	letter-spacing: var(--em-hc-lead-ls, 0) !important;
	text-transform: var(--em-hc-lead-tt, none) !important;
	color: var(--em-hc-lead, rgba(255, 255, 255, 0.9)) !important;
	max-width: var(--em-hc-lead-max, 620px);
	margin: 0 0 var(--em-hc-lead-mb, 20px) !important;
}

/* Badges */
.em-hc-badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--em-hc-badge-gap, 8px);
	margin-bottom: var(--em-hc-badge-mb, 28px);
}
.em-hc .em-hc-badge {
	display: inline-block;
	font-size: var(--em-hc-badge-size, 12px) !important;
	font-weight: var(--em-hc-badge-weight, 700) !important;
	font-style: var(--em-hc-badge-style, normal) !important;
	line-height: var(--em-hc-badge-lh, 1.4) !important;
	letter-spacing: var(--em-hc-badge-ls, 0) !important;
	text-transform: var(--em-hc-badge-tt, none) !important;
	color: var(--em-hc-badge-text, rgba(255, 255, 255, 0.92)) !important;
	background: var(--em-hc-badge-bg, rgba(255, 255, 255, 0.08)) !important;
	border: 1px solid var(--em-hc-badge-border, rgba(255, 255, 255, 0.18));
	padding: var(--em-hc-badge-pad-v, 6px) var(--em-hc-badge-pad-h, 12px) !important;
	border-radius: var(--em-hc-badge-radius, 20px) !important;
}

/* CTAs */
.em-hc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--em-hc-cta-gap, 12px);
}
.em-hc .em-hc-btn,
.em-hc a.em-hc-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--em-hc-cta-size, 14px) !important;
	font-weight: var(--em-hc-cta-weight, 700) !important;
	font-style: var(--em-hc-cta-style, normal) !important;
	line-height: var(--em-hc-cta-lh, 1.4) !important;
	letter-spacing: var(--em-hc-cta-ls, 0) !important;
	text-transform: var(--em-hc-cta-tt, none) !important;
	padding: var(--em-hc-cta-pad-v, 14px) var(--em-hc-cta-pad-h, 24px) !important;
	border-radius: var(--em-hc-cta-radius, 8px) !important;
	text-decoration: none !important;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
	cursor: pointer;
}
.em-hc .em-hc-btn:hover { transform: translateY(-1px); }
.em-hc .em-hc-btn-primary,
.em-hc a.em-hc-btn-primary {
	background: var(--em-hc-cta1-bg, #11802f);
	color: var(--em-hc-cta1-text, #fff);
	border: none;
}
.em-hc .em-hc-btn-primary:hover {
	background: var(--em-hc-cta1-hover, #256b39);
}
.em-hc .em-hc-btn-secondary,
.em-hc a.em-hc-btn-secondary {
	background: var(--em-hc-cta2-bg, #fff);
	color: var(--em-hc-cta2-text, #0f1a10);
	border: none;
}
.em-hc .em-hc-btn-secondary:hover {
	background: var(--em-hc-cta2-hover, #ebeeeb);
}

/* === Stats aside === */
.em-hc-stats {
	background: var(--em-hc-stats-bg, rgba(0, 0, 0, 0.32));
	border: 1px solid var(--em-hc-stats-border, rgba(255, 255, 255, 0.08));
	backdrop-filter: blur(8px);
	padding: var(--em-hc-stats-pad, 24px);
	border-radius: var(--em-hc-stats-radius, 12px);
	display: flex;
	flex-direction: column;
	gap: var(--em-hc-stats-gap, 16px);
}
.em-hc .em-hc-stats-title,
.em-hc h1.em-hc-stats-title,
.em-hc h2.em-hc-stats-title,
.em-hc h3.em-hc-stats-title,
.em-hc h4.em-hc-stats-title,
.em-hc h5.em-hc-stats-title,
.em-hc h6.em-hc-stats-title {
	margin: 0 0 var(--em-hc-stats-title-mb, 16px) !important;
	font-size: var(--em-hc-stats-title-size, 14px) !important;
	font-weight: var(--em-hc-stats-title-weight, 700) !important;
	font-style: var(--em-hc-stats-title-style, normal) !important;
	line-height: var(--em-hc-stats-title-lh, 1.4) !important;
	letter-spacing: var(--em-hc-stats-title-ls, 1px) !important;
	text-transform: var(--em-hc-stats-title-tt, uppercase) !important;
	color: var(--em-hc-stats-title, rgba(255, 255, 255, 0.7)) !important;
}
.em-hc .em-hc-stat {
	padding-bottom: var(--em-hc-stats-gap, 16px);
	border-bottom: 1px solid var(--em-hc-stats-divider, rgba(255, 255, 255, 0.08));
}
.em-hc .em-hc-stat:last-child { padding-bottom: 0; border-bottom: none; }
.em-hc .em-hc-stat-num {
	font-size: var(--em-hc-stats-num-size, 32px) !important;
	font-weight: var(--em-hc-stats-num-weight, 800) !important;
	font-style: var(--em-hc-stats-num-style, normal) !important;
	line-height: var(--em-hc-stats-num-lh, 1) !important;
	letter-spacing: var(--em-hc-stats-num-ls, 0) !important;
	color: var(--em-hc-stats-num, #fff) !important;
	margin-bottom: 6px;
}
.em-hc .em-hc-stat-num small {
	font-size: var(--em-hc-stats-small-size, 14px) !important;
	font-weight: var(--em-hc-stats-small-weight, 700) !important;
	font-style: var(--em-hc-stats-small-style, normal) !important;
	letter-spacing: var(--em-hc-stats-small-ls, 0) !important;
	margin-left: 2px;
	color: var(--em-hc-stats-small, rgba(255, 255, 255, 0.7)) !important;
}
.em-hc .em-hc-stat-lbl {
	font-size: var(--em-hc-stats-lbl-size, 12px) !important;
	font-weight: var(--em-hc-stats-lbl-weight, 400) !important;
	font-style: var(--em-hc-stats-lbl-style, normal) !important;
	line-height: var(--em-hc-stats-lbl-lh, 1.4) !important;
	letter-spacing: var(--em-hc-stats-lbl-ls, 0) !important;
	text-transform: var(--em-hc-stats-lbl-tt, none) !important;
	color: var(--em-hc-stats-lbl, rgba(255, 255, 255, 0.65)) !important;
}

/* === Empty state (éditeur seulement) === */
.em-hc-empty {
	padding: 32px;
	text-align: center;
	background: #fafbfc;
	border: 2px dashed #c3c4c7;
	color: #50575e;
	border-radius: 8px;
}

/* ============================================================
   Responsive Tablette (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
	.em-hc {
		min-height: var(--em-hc-min-h-tablet, var(--em-hc-min-h, 500px));
	}
	.em-hc-inner {
		padding: var(--em-hc-pad-v-tablet, var(--em-hc-pad-v, 40px))
		         var(--em-hc-pad-h-tablet, var(--em-hc-pad-h, 24px));
		gap: var(--em-hc-gap-tablet, var(--em-hc-gap, 32px));
	}
	.em-hc.em-hc .em-hc-title {
		font-size: var(--em-hc-title-size-tablet, var(--em-hc-title-size, 36px)) !important;
	}
	.em-hc.em-hc .em-hc-lead {
		font-size: var(--em-hc-lead-size-tablet, var(--em-hc-lead-size, 16px)) !important;
	}
	.em-hc.em-hc .em-hc-eyebrow {
		font-size: var(--em-hc-eyebrow-size-tablet, var(--em-hc-eyebrow-size, 12px)) !important;
	}
	.em-hc.em-hc .em-hc-stat-num {
		font-size: var(--em-hc-stats-num-size-tablet, var(--em-hc-stats-num-size, 28px)) !important;
	}
	.em-hc.em-hc-tablet-align-left   .em-hc-content { text-align: left; }
	.em-hc.em-hc-tablet-align-center .em-hc-content { text-align: center; }
	.em-hc.em-hc-tablet-align-right  .em-hc-content { text-align: right; }
	.em-hc.em-hc-tablet-stack .em-hc-inner {
		grid-template-columns: 1fr;
	}
	.em-hc.em-hc-tablet-hide-stats .em-hc-stats {
		display: none;
	}
	.em-hc.em-hc-tablet-hide-stats .em-hc-inner {
		grid-template-columns: 1fr;
	}
	.em-hc.em-hc-tablet-hide-badges .em-hc-badges {
		display: none;
	}
	.em-hc.em-hc-w-tab-full   { max-width: 100%; }
	.em-hc.em-hc-w-tab-100    { max-width: 100%; }
	.em-hc.em-hc-w-tab-90     { max-width: 90%;  margin-inline: auto; }
	.em-hc.em-hc-w-tab-80     { max-width: 80%;  margin-inline: auto; }
	.em-hc.em-hc-w-tab-75     { max-width: 75%;  margin-inline: auto; }
	.em-hc.em-hc-w-tab-66     { max-width: 66%;  margin-inline: auto; }
	.em-hc.em-hc-w-tab-50     { max-width: 50%;  margin-inline: auto; }
	.em-hc.em-hc-w-tab-custom { max-width: var(--em-hc-custom-w-tab, 100%); margin-inline: auto; }
}

/* ============================================================
   Responsive Mobile (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
	.em-hc {
		min-height: var(--em-hc-min-h-mobile, 400px);
	}
	.em-hc-inner {
		grid-template-columns: 1fr;
		padding: var(--em-hc-pad-v-mobile, 32px)
		         var(--em-hc-pad-h-mobile, 20px);
		gap: var(--em-hc-gap-mobile, 24px);
	}
	.em-hc.em-hc .em-hc-title {
		font-size: var(--em-hc-title-size-mobile, var(--em-hc-title-size-tablet, var(--em-hc-title-size, 28px))) !important;
	}
	.em-hc.em-hc .em-hc-lead {
		font-size: var(--em-hc-lead-size-mobile, var(--em-hc-lead-size-tablet, var(--em-hc-lead-size, 15px))) !important;
	}
	.em-hc.em-hc .em-hc-eyebrow {
		font-size: var(--em-hc-eyebrow-size-mobile, var(--em-hc-eyebrow-size-tablet, var(--em-hc-eyebrow-size, 11px))) !important;
	}
	.em-hc.em-hc .em-hc-stat-num {
		font-size: var(--em-hc-stats-num-size-mobile, var(--em-hc-stats-num-size-tablet, var(--em-hc-stats-num-size, 24px))) !important;
	}
	.em-hc-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.em-hc-btn {
		justify-content: center;
	}
	.em-hc.em-hc-mobile-align-left   .em-hc-content { text-align: left; }
	.em-hc.em-hc-mobile-align-center .em-hc-content { text-align: center; }
	.em-hc.em-hc-mobile-align-right  .em-hc-content { text-align: right; }
	.em-hc.em-hc-mobile-hide-stats  .em-hc-stats  { display: none; }
	.em-hc.em-hc-mobile-hide-badges .em-hc-badges { display: none; }
	.em-hc.em-hc-w-mob-full   { max-width: 100%; }
	.em-hc.em-hc-w-mob-100    { max-width: 100%; }
	.em-hc.em-hc-w-mob-90     { max-width: 90%;  margin-inline: auto; }
	.em-hc.em-hc-w-mob-80     { max-width: 80%;  margin-inline: auto; }
	.em-hc.em-hc-w-mob-custom { max-width: var(--em-hc-custom-w-mob, 100%); margin-inline: auto; }
}
