/* ==========================================================
   Community LMS — Page d'accueil (refonte premium EdTech/SaaS)
   Chargé uniquement sur is_front_page(). Les tokens de couleur
   viennent de design-system.css (--community-*), jamais redéfinis
   ici : voir MISSION section "DESIGN SYSTEM".
   ========================================================== */

/* --- Utilitaires de section, partagés par tout le fichier --- */

.cl-section__inner { max-width: 1120px; margin: 0 auto; padding: 64px 20px; }
.cl-section__title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; line-height: 1.25; color: var(--community-text); margin: 0 0 36px; letter-spacing: -.01em; }
.cl-section__title--center { text-align: center; }
.cl-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
.cl-section__head .cl-section__title { margin-bottom: 0; }
.cl-section__more { font-size: 14px; font-weight: 600; color: var(--community-primary-dark); text-decoration: none; white-space: nowrap; }
.cl-section__more:hover { text-decoration: underline; }
.cl-section__cta { text-align: center; margin-top: 32px; }

@media (max-width: 640px) {
	.cl-section__inner { padding: 44px 16px; }
}

/* ==========================================================
   1 & 2. HERO
   ========================================================== */

.cl-hero {
	padding: 76px 20px 64px;
	background:
		radial-gradient(60% 60% at 85% 0%, rgba(20, 184, 166, .16), transparent 70%),
		var(--community-bg-dark);
	color: #F1F5F9;
	overflow: hidden;
}
.cl-hero__inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
.cl-hero__eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5EEAD4; margin: 0 0 12px; }
.cl-hero__title { font-size: clamp(30px, 5.2vw, 50px); line-height: 1.12; font-weight: 700; margin: 0; color: #F8FAFC; letter-spacing: -.02em; }
.cl-hero__sub { font-size: clamp(15.5px, 1.4vw, 17.5px); color: #B7C3D1; line-height: 1.65; max-width: 54ch; margin: 20px 0 0; }
.cl-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.cl-hero .cl-btn--ghost { border-color: rgba(255, 255, 255, .18); color: #F1F5F9; }
.cl-hero .cl-btn--ghost:hover { border-color: var(--community-primary); color: #5EEAD4; }
.cl-hero__trust { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; margin: 26px 0 0; padding: 0; font-size: 13.5px; color: #94A3B8; }
.cl-hero__trust li { display: flex; align-items: center; gap: 6px; }
.cl-hero__trust span { color: #5EEAD4; font-weight: 700; }

/* --- Mockup HTML/CSS (droite du hero) --- */

.cl-hero__mock { display: flex; justify-content: center; }
.cl-mock {
	width: 100%; max-width: 340px; border-radius: 18px; overflow: hidden;
	background: #0F172A; border: 1px solid rgba(255, 255, 255, .08);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
	transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
}
.cl-mock__head { display: flex; gap: 6px; padding: 12px 14px; background: rgba(255, 255, 255, .03); }
.cl-mock__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.cl-mock__body { padding: 22px; font-family: var(--community-font-sans); }
.cl-mock__greet { margin: 0; font-size: 15px; color: #F1F5F9; font-weight: 600; }
.cl-mock__label { margin: 4px 0 12px; font-size: 12px; color: #64748B; }
.cl-mock__level-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cl-mock__level { font-family: var(--community-font-mono); font-size: 12.5px; color: #5EEAD4; font-weight: 700; }
.cl-mock__xp { font-family: var(--community-font-mono); font-size: 11.5px; color: #94A3B8; }
.cl-mock__bar { height: 7px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.cl-mock__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--community-primary), #5EEAD4); }
.cl-mock__bar--sm { height: 5px; margin: 6px 0; }
.cl-mock__course { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cl-mock__course-label { margin: 0; font-size: 11px; color: #64748B; text-transform: uppercase; letter-spacing: .04em; }
.cl-mock__course-title { margin: 4px 0 8px; font-size: 13.5px; color: #F1F5F9; font-weight: 600; }
.cl-mock__pct { margin: 0; font-size: 11px; color: #94A3B8; font-family: var(--community-font-mono); }
.cl-mock__badges { display: flex; gap: 8px; margin-top: 16px; }
.cl-mock__badge { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .06); display: flex; align-items: center; justify-content: center; font-size: 14px; }

@media (min-width: 900px) {
	.cl-hero__inner { grid-template-columns: 1.15fr 1fr; text-align: left; }
}

/* ==========================================================
   3. DOMAINES D'APPRENTISSAGE
   ========================================================== */

.cl-domains { background: var(--community-bg); border-bottom: 1px solid var(--community-border); }
.cl-domains__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .cl-domains__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cl-domains__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-domain-card {
	display: flex; flex-direction: column; gap: 6px;
	background: var(--community-surface); border: 1px solid var(--community-border);
	border-radius: var(--community-radius-lg); padding: 22px;
	text-decoration: none; color: inherit;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cl-domain-card:hover { transform: translateY(-3px); box-shadow: var(--community-shadow-md); border-color: var(--community-primary); }
.cl-domain-card__icon { font-size: 26px; }
.cl-domain-card__title { margin: 6px 0 0; font-size: 16.5px; font-weight: 700; color: var(--community-text); }
.cl-domain-card__count { margin: 0; font-size: 13px; color: var(--community-text-muted); }
.cl-domain-card__link { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--community-primary-dark); }

/* ==========================================================
   4. FORMATIONS
   ========================================================== */

.cl-courses { background: var(--community-surface); border-bottom: 1px solid var(--community-border); }
.cl-courses__grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .cl-courses__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cl-courses__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-course-card {
	display: flex; flex-direction: column;
	background: var(--community-bg); border: 1px solid var(--community-border);
	border-radius: var(--community-radius-lg); overflow: hidden;
	text-decoration: none; color: inherit;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cl-course-card:hover { transform: translateY(-3px); box-shadow: var(--community-shadow-md); }
.cl-course-card__cover { position: relative; height: 140px; background: linear-gradient(135deg, var(--community-primary), var(--community-primary-dark)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cl-course-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.cl-course-card__cover-fallback { font-size: 34px; }
.cl-course-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cl-course-card__title { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: var(--community-text); line-height: 1.35; }
.cl-course-card__excerpt { margin: 0; font-size: 13.5px; color: var(--community-text-muted); line-height: 1.55; }
.cl-course-card__meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--community-text-muted); margin-top: auto; }
.cl-course-card__cta { font-size: 13.5px; font-weight: 700; color: var(--community-primary-dark); margin-top: 6px; }

/* ==========================================================
   5. MÉTHODE ACADEMY
   ========================================================== */

.cl-method { background: var(--community-bg); border-bottom: 1px solid var(--community-border); }
.cl-method__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 28px; position: relative; }
.cl-method__step { position: relative; padding-left: 52px; }
.cl-method__num {
	position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 10px;
	background: var(--community-surface); border: 1px solid var(--community-border);
	color: var(--community-primary-dark); font-family: var(--community-font-mono); font-weight: 700; font-size: 13px;
	display: flex; align-items: center; justify-content: center;
}
.cl-method__step h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 700; color: var(--community-text); }
.cl-method__step p { margin: 0; color: var(--community-text-muted); font-size: 14px; line-height: 1.6; }

@media (min-width: 860px) {
	.cl-method__steps { grid-template-columns: repeat(4, 1fr); gap: 20px; }
	.cl-method__steps::before { content: ""; position: absolute; top: 19px; left: 8%; right: 8%; height: 1px; background: var(--community-border); z-index: 0; }
	.cl-method__step { padding-left: 0; padding-top: 54px; }
	.cl-method__num { left: 50%; transform: translateX(-50%); z-index: 1; }
	.cl-method__step h3, .cl-method__step p { text-align: center; }
}

/* ==========================================================
   6. DÉFIS
   ========================================================== */

.cl-challenges { background: var(--community-surface); border-bottom: 1px solid var(--community-border); }
.cl-challenges__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .cl-challenges__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-challenge-card {
	display: flex; flex-direction: column; gap: 10px;
	background: var(--community-bg); border: 1px solid var(--community-border);
	border-radius: var(--community-radius-lg); padding: 22px;
	text-decoration: none; color: inherit;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cl-challenge-card:hover { transform: translateY(-3px); box-shadow: var(--community-shadow-md); }
.cl-challenge-card__title { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: var(--community-text); }
.cl-challenge-card__status { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--community-primary-dark); }

/* ==========================================================
   7. PROGRESSION / GAMIFICATION
   ========================================================== */

.cl-gamif { padding: 64px 20px; background: var(--community-bg); }
.cl-gamif__inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.cl-gamif__text h2 { font-size: 24px; margin: 0 0 12px; font-weight: 700; color: var(--community-text); }
.cl-gamif__text p { color: var(--community-text-muted); line-height: 1.65; max-width: 52ch; margin: 0; font-size: 14.5px; }

.cl-gamif__card { position: relative; background: var(--community-surface); border: 1px solid var(--community-border); border-radius: var(--community-radius-lg); padding: 22px; max-width: 300px; box-shadow: var(--community-shadow-sm); }
.cl-gamif__card--preview { opacity: .92; }
.cl-gamif__preview-tag { position: absolute; top: -10px; right: 16px; background: var(--community-accent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cl-gamif__level { font-family: var(--community-font-mono); font-size: 13px; color: var(--community-primary-dark); font-weight: 700; }
.cl-gamif__bar { height: 8px; background: var(--community-border); border-radius: 999px; margin: 12px 0 8px; overflow: hidden; }
.cl-gamif__bar span { display: block; height: 100%; background: var(--community-primary); }
.cl-gamif__xp { display: block; font-family: var(--community-font-mono); font-size: 12.5px; color: var(--community-text-muted); }
.cl-gamif__extra { display: block; margin-top: 8px; font-size: 12.5px; color: var(--community-primary-dark); font-weight: 600; }

@media (min-width: 760px) { .cl-gamif__inner { grid-template-columns: 1.2fr 1fr; } }

/* ==========================================================
   8. COMMUNAUTÉ
   ========================================================== */

.cl-community { background: var(--community-surface); border-bottom: 1px solid var(--community-border); }
.cl-community__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .cl-community__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-community-card { background: var(--community-bg); border: 1px solid var(--community-border); border-radius: var(--community-radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.cl-community-card__author { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--community-text); }
.cl-community-card__content { margin: 0; font-size: 13.5px; color: var(--community-text-muted); line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.cl-community-card__meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--community-text-muted); margin-top: auto; }

/* ==========================================================
   9. RESSOURCES
   ========================================================== */

.cl-resources { background: var(--community-bg); border-bottom: 1px solid var(--community-border); }
.cl-resources__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .cl-resources__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-resource-card {
	display: flex; flex-direction: column; gap: 8px;
	background: var(--community-surface); border: 1px solid var(--community-border);
	border-radius: var(--community-radius-md); padding: 18px;
	text-decoration: none; color: inherit;
}
.cl-resource-card:hover { border-color: var(--community-primary); }
.cl-resource-card__title { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--community-text); }
.cl-resource-card__cta { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--community-primary-dark); }

/* ==========================================================
   10. FORMULES
   ========================================================== */

.cl-plans { background: var(--community-surface); border-bottom: 1px solid var(--community-border); }
.cl-plans__grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 720px) { .cl-plans__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cl-plans__grid { grid-template-columns: repeat(3, 1fr); } }

.cl-plan-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--community-bg); border: 1px solid var(--community-border);
	border-radius: var(--community-radius-lg); padding: 26px 24px;
}
.cl-plan-card--featured { border: 2px solid var(--community-primary); box-shadow: 0 12px 28px -10px rgba(20, 184, 166, .3); }
.cl-plan-card--premium { opacity: .8; }
.cl-plan-card__ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--community-primary); color: #062F2B; font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 999px; white-space: nowrap; }
.cl-plan-card__name { margin: 0; font-size: 17px; font-weight: 700; color: var(--community-text); }
.cl-plan-card__soon { font-size: 12.5px; color: var(--community-text-muted); font-weight: 600; margin: 6px 0 0; }
.cl-plan-card__price { font-size: 26px; font-weight: 800; color: var(--community-text); margin: 14px 0 6px; }
.cl-plan-card__price span { font-size: 13px; font-weight: 600; color: var(--community-text-muted); }
.cl-plan-card__saving { font-size: 12.5px; color: var(--community-primary-dark); font-weight: 600; background: #F0FDFA; border-radius: 6px; padding: 5px 9px; display: inline-block; margin: 0 0 8px; }
.cl-plan-card__benefits { list-style: none; margin: 10px 0 18px; padding: 0; display: grid; gap: 7px; }
.cl-plan-card__benefits li { padding-left: 22px; position: relative; font-size: 13px; color: var(--community-text); line-height: 1.4; }
.cl-plan-card__benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--community-primary); font-weight: 700; }
.cl-plan-card__cta { margin-top: auto; text-align: center; justify-content: center; }

.cl-plan-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.cl-plan-toggle { display: flex; flex-direction: column; }
.cl-plan-toggle__switch { display: inline-flex; gap: 4px; background: var(--community-border); border-radius: 999px; padding: 3px; width: fit-content; margin-bottom: 12px; }
.cl-plan-toggle__switch label { display: inline-flex; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--community-text-muted); line-height: 1; }
.cl-plan-toggle__panel { display: none; }
input[id$="-m"]:checked ~ .cl-plan-toggle .cl-plan-toggle__switch label[for$="-m"],
input[id$="-y"]:checked ~ .cl-plan-toggle .cl-plan-toggle__switch label[for$="-y"] { background: var(--community-surface); color: var(--community-text); box-shadow: var(--community-shadow-sm); }
input[id$="-m"]:checked ~ .cl-plan-toggle .cl-plan-toggle__panel--m,
input[id$="-y"]:checked ~ .cl-plan-toggle .cl-plan-toggle__panel--y { display: block; }

/* ==========================================================
   11. PREUVE / CONFIANCE
   ========================================================== */

.cl-why { background: var(--community-bg); border-bottom: 1px solid var(--community-border); }
.cl-why__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .cl-why__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cl-why__grid { grid-template-columns: repeat(5, 1fr); } }

.cl-why__item { background: var(--community-surface); border: 1px solid var(--community-border); border-radius: var(--community-radius-md); padding: 20px; text-align: center; }
.cl-why__item span { font-size: 24px; }
.cl-why__item h3 { margin: 10px 0 6px; font-size: 15px; font-weight: 700; color: var(--community-text); }
.cl-why__item p { margin: 0; font-size: 12.5px; color: var(--community-text-muted); line-height: 1.5; }

/* ==========================================================
   12. CTA FINAL
   ========================================================== */

.cl-cta { padding: 60px 20px; text-align: center; background: var(--community-bg); }
.cl-cta__inner { max-width: 560px; margin: 0 auto; }
.cl-cta h2 { font-size: 26px; margin: 0 0 12px; font-weight: 700; color: var(--community-text); }
.cl-cta p { margin: 0; color: var(--community-text-muted); font-size: 15px; }

/* ==========================================================
   15. MICRO-INTERACTIONS (légères, jamais lourdes)
   ========================================================== */

.cl-domain-card, .cl-course-card, .cl-challenge-card, .cl-resource-card, .cl-btn {
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

@media (prefers-reduced-motion: reduce) {
	.cl-domain-card, .cl-course-card, .cl-challenge-card, .cl-resource-card, .cl-btn { transition: none; }
}
