/*
Theme Name: Herpsa EduTech
Theme URI: https://herpsa.com
Author: Herpsa
Description: Thème pédagogique pour cours d'éco-gestion — STMG, BTS NDRC/CI/MCO, Terminale Générale, Seconde.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: herpsa
*/

:root {
  --primary:       #1e3a5f;
  --primary-light: #2c5282;
  --accent:        #d4a843;
  --accent-light:  #e8c86e;

  --slate-50:  #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0;
  --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b;
  --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b;
  --white: #ffffff;

  --radius: 0.5rem; --radius-xl: 1rem; --radius-2xl: 1.25rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0/.05);
  --shadow:    0 1px 3px 0 rgb(0 0 0/.1),0 1px 2px -1px rgb(0 0 0/.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0/.1),0 4px 6px -4px rgb(0 0 0/.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0/.1),0 8px 10px -6px rgb(0 0 0/.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.6;
  color: var(--slate-800); background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; color: var(--slate-800); letter-spacing: -0.025em; margin-top: 0; }
h1 { font-size: clamp(1.875rem, 4vw, 3.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; } h4 { font-size: 1.125rem; }
p  { color: var(--slate-500); margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,.60);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.site-branding a { display: flex; align-items: center; gap: .75rem; color: inherit; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg,#1e3a5f,#2c5282);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: box-shadow .2s;
}
.site-branding a:hover .logo-icon { box-shadow: var(--shadow-lg); }
.logo-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { display: none; }
@media(min-width:640px){ .logo-text { display: block; } }
.logo-name { font-size: 1.125rem; font-weight: 800; color: var(--slate-800); line-height: 1; letter-spacing: -0.03em; }
.logo-sub  { font-size: 11px; color: var(--slate-400); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.main-navigation { display: none; }
@media(min-width:768px){ .main-navigation { display: flex; align-items: center; gap: .25rem; } }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.main-navigation ul li { margin: 0; }
.main-navigation ul li a {
  display: block; padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; color: var(--slate-600); transition: all .2s;
}
.main-navigation ul li a:hover { color: var(--slate-900); background: var(--slate-100); }
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a,
.main-navigation ul li.current-page-ancestor > a {
  background: var(--primary); color: #fff; box-shadow: var(--shadow);
}
.header-actions { display: flex; align-items: center; gap: .5rem; }
.menu-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  border: none; background: transparent; cursor: pointer; color: var(--slate-700); transition: background .2s;
}
.menu-toggle:hover { background: var(--slate-100); }
.menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
@media(min-width:768px){ .menu-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--slate-100); background: rgba(255,255,255,.95); backdrop-filter: blur(20px); }
.mobile-nav.is-open { display: block; }
@media(min-width:768px){ .mobile-nav { display: none !important; } }
.mobile-nav ul { list-style: none; margin: 0; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.mobile-nav ul li { margin: 0; }
.mobile-nav ul li a {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-radius: 12px;
  font-size: .875rem; font-weight: 500; color: var(--slate-600); transition: all .2s;
}
.mobile-nav ul li a:hover { background: var(--slate-100); }
.mobile-nav ul li.current-menu-item > a { background: var(--primary); color: #fff; }

/* ── HERO ── */
.hero-section {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg,#1e3a5f 0%,#2c5282 50%,#1e3a5f 100%);
  padding: 6rem 1.5rem 8rem;
}
.hero-decorations { position: absolute; inset: 0; pointer-events: none; }
.hero-blob-1 { position: absolute; top: 80px; left: 40px; width: 288px; height: 288px; background: rgba(212,168,67,.10); border-radius: 50%; filter: blur(60px); }
.hero-blob-2 { position: absolute; bottom: 40px; right: 80px; width: 384px; height: 384px; background: rgba(255,255,255,.05); border-radius: 50%; filter: blur(60px); }
.hero-ring-1 { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; height: 600px; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; }
.hero-ring-2 { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 400px; height: 400px; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; }
.hero-content { position: relative; max-width: 1280px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-radius: 9999px;
  background: rgba(255,255,255,.10); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.10); margin-bottom: 2rem;
}
.hero-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.9)} }
.hero-badge span { font-size: .875rem; color: rgba(255,255,255,.80); font-weight: 500; }
.hero-title { font-size: clamp(2.5rem,6vw,3.75rem); color: #fff; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
.hero-title-accent { display: block; color: var(--accent); }
.hero-description { margin-top: 1.5rem; font-size: 1.125rem; color: #cbd5e1; line-height: 1.7; max-width: 560px; }
.hero-actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .875rem 2rem; background: var(--accent); color: var(--primary);
  font-size: 1rem; font-weight: 600; border-radius: 12px; border: none; cursor: pointer;
  box-shadow: 0 4px 24px rgba(212,168,67,.30); transition: all .2s; text-decoration: none;
}
.btn-primary:hover { background: var(--accent-light); color: var(--primary); box-shadow: 0 8px 32px rgba(212,168,67,.40); transform: translateY(-1px); }
.btn-primary svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-outline {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .875rem 2rem; background: rgba(255,255,255,.08); color: #fff;
  font-size: 1rem; font-weight: 500; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.20); cursor: pointer;
  backdrop-filter: blur(8px); transition: background .2s; text-decoration: none;
}
.btn-outline:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-outline svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.hero-wave { position: absolute; bottom: 0; left: 0; right: 0; line-height: 0; }
.hero-wave svg { width: 100%; display: block; }

/* ── QUICK ACCESS CARDS ── */
.quick-access { max-width: 1280px; margin: -2rem auto 0; padding: 0 1.5rem; position: relative; z-index: 10; }
.quick-access-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px)  { .quick-access-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px) { .quick-access-grid { grid-template-columns: repeat(4,1fr); } }
.quick-card {
  display: block; background: var(--white); border-radius: var(--radius-2xl);
  padding: 1.5rem; border: 1px solid var(--slate-100); box-shadow: var(--shadow-sm);
  transition: all .3s; color: inherit; text-decoration: none;
}
.quick-card:hover { box-shadow: var(--shadow-xl); transform: translateY(-4px); border-color: var(--slate-200); color: inherit; }
.quick-card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; box-shadow: var(--shadow); }
.quick-card-icon svg { width: 24px; height: 24px; stroke: #fff; stroke-width: 2; fill: none; }
.qc-blue    { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.qc-emerald { background: linear-gradient(135deg,#10b981,#059669); }
.qc-violet  { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.qc-amber   { background: linear-gradient(135deg,#f59e0b,#d97706); }
.qc-cyan    { background: linear-gradient(135deg,#06b6d4,#0891b2); }
.qc-rose    { background: linear-gradient(135deg,#f43f5e,#e11d48); }
.quick-card-title { font-size: 1.125rem; font-weight: 700; color: var(--slate-800); display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.quick-card-arrow { width: 16px; height: 16px; stroke: var(--slate-300); stroke-width: 2; fill: none; transition: stroke .2s; }
.quick-card:hover .quick-card-arrow { stroke: var(--accent); }
.quick-card-desc { font-size: .875rem; color: var(--slate-500); line-height: 1.5; margin: 0; }

/* ── SECTION WRAPPER ── */
.section-wrapper { max-width: 1280px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--slate-800); margin: 0; }
.section-link { font-size: .875rem; font-weight: 500; color: var(--primary); display: flex; align-items: center; gap: .25rem; transition: color .2s; }
.section-link:hover { color: var(--primary-light); }
.section-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── RECENT 2/3 + 1/3 ── */
.recent-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:1024px) { .recent-grid { grid-template-columns: 2fr 1fr; } }

.course-row-list { display: flex; flex-direction: column; gap: .75rem; }
.course-row {
  display: block; background: var(--white); border-radius: 12px;
  padding: 1.25rem; border: 1px solid var(--slate-100); transition: all .3s; color: inherit;
}
.course-row:hover { box-shadow: var(--shadow-lg); border-color: var(--slate-200); color: inherit; }
.course-row-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.course-row-body { flex: 1; min-width: 0; }
.course-row-title { font-weight: 600; color: var(--slate-800); transition: color .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: .5rem 0 .25rem; }
.course-row:hover .course-row-title { color: var(--primary); }
.course-row-desc { font-size: .875rem; color: var(--slate-500); margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-row-date { font-size: .75rem; color: var(--slate-400); white-space: nowrap; padding-top: .25rem; display: flex; align-items: center; gap: .25rem; }
.course-row-date svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── BADGES ── */
.badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .625rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; border: 1px solid; }
.badge svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.badge-1stmg  { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.badge-tstmg  { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.badge-bts1   { background:#f5f3ff; color:#6d28d9; border-color:#ddd6fe; }
.badge-bts2   { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.badge-tg     { background:#ecfeff; color:#0e7490; border-color:#a5f3fc; }
.badge-seconde{ background:#fff1f2; color:#be123c; border-color:#fecdd3; }
.badge-outline { background:transparent; color:var(--slate-600); border-color:var(--slate-200); }

/* ── ANNOUNCEMENTS ── */
.announcements-list { display: flex; flex-direction: column; gap: .75rem; }
.ann-card { background: var(--white); border-radius: 12px; padding: 1.25rem; border: 1px solid var(--slate-100); }
.ann-card.priority-urgent   { border-color: #fecaca; background: #fff5f5; }
.ann-card.priority-important{ border-color: #fde68a; background: #fffdf5; }
.ann-inner { display: flex; gap: .75rem; align-items: flex-start; }
.ann-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ann-dot.urgent    { background: #ef4444; }
.ann-dot.important { background: #f59e0b; }
.ann-title   { font-size: .875rem; font-weight: 600; color: var(--slate-800); margin: 0 0 .25rem; }
.ann-content { font-size: .75rem; color: var(--slate-500); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin: 0 0 .75rem; }
.ann-meta    { display: flex; align-items: center; gap: .5rem; }
.ann-time    { font-size: 10px; color: var(--slate-400); }

/* ── COURSES PAGE ── */
.courses-page { max-width: 1280px; margin: 0 auto; padding: 3rem 1.5rem; }
.courses-page-header { margin-bottom: 2rem; }
.courses-page-header-inner { display: flex; align-items: center; gap: .75rem; margin-bottom: .35rem; }
.courses-page-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.courses-page-icon svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2; fill: none; }
.courses-page-header h1 { margin: 0; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.courses-page-sub { color: var(--slate-400); margin: .25rem 0 0 56px; font-size: .875rem; }
.filters-bar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media(min-width:640px){ .filters-bar { flex-direction: row; align-items: center; justify-content: space-between; } }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-tab { padding: .4rem .875rem; border-radius: var(--radius); font-size: .8125rem; font-weight: 500; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-600); cursor: pointer; transition: all .2s; }
.filter-tab:hover  { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--slate-400); stroke-width: 2; fill: none; pointer-events: none; }
.search-input { padding: .5rem .75rem .5rem 2.25rem; border: 1px solid var(--slate-200); border-radius: var(--radius); background: var(--white); font-size: .875rem; color: var(--slate-800); width: 100%; max-width: 280px; outline: none; transition: border-color .2s; }
.search-input:focus { border-color: var(--primary); }
.subject-section { margin-bottom: 3rem; }
.subject-heading { font-size: 1.25rem; font-weight: 700; color: var(--slate-700); display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.subject-bar { width: 4px; height: 24px; background: var(--accent); border-radius: 2px; }
.subject-count { font-size: .875rem; font-weight: 400; color: var(--slate-400); margin-left: .25rem; }
.courses-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:640px)  { .courses-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px) { .courses-grid { grid-template-columns: repeat(3,1fr); } }
.course-card { display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); overflow: hidden; transition: all .3s; color: inherit; text-decoration: none; }
.course-card:hover { box-shadow: var(--shadow-xl); border-color: var(--slate-200); transform: translateY(-2px); color: inherit; }
.card-thumb { height: 8rem; background: linear-gradient(135deg,var(--slate-100),var(--slate-50)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.course-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb-placeholder { font-size: 2.25rem; font-weight: 700; color: var(--slate-200); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-title { font-weight: 700; color: var(--slate-800); font-size: .9375rem; line-height: 1.4; transition: color .2s; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: .5rem; }
.course-card:hover .card-title { color: var(--primary); }
.card-desc { font-size: .8125rem; color: var(--slate-500); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: 1; margin-bottom: 1rem; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-date { font-size: .75rem; color: var(--slate-400); display: flex; align-items: center; gap: .25rem; }
.card-date svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.card-cta { font-size: .75rem; font-weight: 500; color: var(--primary); display: flex; align-items: center; gap: .25rem; opacity: 0; transition: opacity .2s; }
.card-cta svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.course-card:hover .card-cta { opacity: 1; }

/* ── COURSE DETAIL ── */
.course-detail { max-width: 896px; margin: 0 auto; padding: 3rem 1.5rem; }
.back-link { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--slate-500); transition: color .2s; margin-bottom: 2rem; }
.back-link:hover { color: var(--slate-700); }
.back-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.course-detail-header { margin-bottom: 2rem; }
.course-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.meta-date { font-size: .875rem; color: var(--slate-400); display: flex; align-items: center; gap: .25rem; }
.meta-date svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.course-detail-title { font-size: clamp(1.5rem,3vw,2.25rem); margin: 0 0 1rem; }
.course-detail-desc { font-size: 1.125rem; color: var(--slate-500); line-height: 1.7; margin: 0; }
.course-detail-image { border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--slate-100); margin-bottom: 2.5rem; }
.course-detail-image img { width: 100%; max-height: 400px; object-fit: cover; }
.course-content-block { background: var(--white); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); padding: 2.5rem; margin-bottom: 2.5rem; }
.course-content-block h2,.course-content-block h3,.course-content-block h4 { color: var(--slate-800); margin-top: 1.5rem; margin-bottom: .75rem; }
.course-content-block p { color: var(--slate-600); }
.course-content-block a { color: var(--primary); text-decoration: underline; }
.course-content-block ul li,.course-content-block ol li { color: var(--slate-600); margin-bottom: .4rem; }
.course-content-block table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.course-content-block th { background: var(--primary); color: #fff; padding: .625rem 1rem; text-align: left; }
.course-content-block td { padding: .6rem 1rem; border-bottom: 1px solid var(--slate-100); }
.course-content-block blockquote { border-left: 4px solid var(--accent); padding: .75rem 1.25rem; background: rgba(212,168,67,.08); border-radius: 0 8px 8px 0; margin: 1.5rem 0; }
.files-block { background: var(--slate-50); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); padding: 1.5rem; }
.files-block-title { font-weight: 700; color: var(--slate-800); display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.files-block-title svg { width: 20px; height: 20px; stroke: var(--primary); fill: none; stroke-width: 2; }
.file-item { display: flex; align-items: center; gap: .75rem; background: var(--white); border-radius: 12px; padding: 1rem; border: 1px solid var(--slate-100); transition: all .2s; margin-bottom: .5rem; color: inherit; }
.file-item:hover { box-shadow: var(--shadow); border-color: var(--slate-200); }
.file-icon { width: 40px; height: 40px; border-radius: 8px; background: rgba(30,58,95,.10); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon svg { width: 16px; height: 16px; stroke: var(--primary); fill: none; stroke-width: 2; }
.file-name { font-size: .875rem; font-weight: 500; color: var(--slate-700); transition: color .2s; }
.file-item:hover .file-name { color: var(--primary); }
.file-sub { font-size: .75rem; color: var(--slate-400); }

/* ── EMPTY STATE / SKELETON ── */
.empty-state { background: var(--white); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); padding: 3rem; text-align: center; }
.empty-state svg { width: 48px; height: 48px; stroke: var(--slate-300); fill: none; stroke-width: 1.5; margin: 0 auto 1rem; }
.empty-state h3 { font-size: 1.125rem; color: var(--slate-500); margin-bottom: .25rem; }
.empty-state p { font-size: .875rem; color: var(--slate-400); }
.skeleton { background: var(--slate-100); border-radius: var(--radius); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── RESOURCES ── */
.resource-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px)  { .resource-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px) { .resource-grid { grid-template-columns: repeat(3,1fr); } }
.resource-card { display: flex; align-items: flex-start; gap: 1rem; background: var(--white); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); padding: 1.25rem; transition: all .3s; color: inherit; }
.resource-card:hover { box-shadow: var(--shadow-lg); border-color: var(--slate-200); transform: translateY(-2px); }
.resource-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.resource-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.resource-icon.document { background:#eff6ff; color:#2563eb; }
.resource-icon.video    { background:#fdf4ff; color:#9333ea; }
.resource-icon.link     { background:#ecfdf5; color:#059669; }
.resource-icon.exercise { background:#fff7ed; color:#ea580c; }
.resource-icon.annale   { background:#fff1f2; color:#e11d48; }
.resource-icon.fiche    { background:#fffbeb; color:#d97706; }
.resource-body { flex: 1; min-width: 0; }
.resource-title { font-weight: 600; font-size: .9375rem; color: var(--slate-800); margin: 0 0 .25rem; transition: color .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-card:hover .resource-title { color: var(--primary); }
.resource-desc { font-size: .8125rem; color: var(--slate-500); margin-bottom: .75rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ── FOOTER ── */
.site-footer { background: var(--primary); color: #fff; margin-top: 2.5rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:768px){ .footer-grid { grid-template-columns: repeat(3,1fr); } }
.footer-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.footer-logo-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.10); display: flex; align-items: center; justify-content: center; }
.footer-logo-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; }
.footer-brand-name { font-size: 1.125rem; font-weight: 700; }
.footer-brand-sub  { font-size: .75rem; color: #cbd5e1; }
.footer-desc { font-size: .875rem; color: #cbd5e1; line-height: 1.6; margin: 0; }
.footer-nav-title,.footer-info-title { font-weight: 600; color: var(--accent); margin-bottom: 1rem; font-size: .9375rem; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav ul li { margin-bottom: .15rem; }
.footer-nav ul li a { font-size: .875rem; color: #cbd5e1; transition: color .2s; }
.footer-nav ul li a:hover { color: #fff; }
.footer-info p { font-size: .875rem; color: #cbd5e1; line-height: 1.6; margin: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.10); margin-top: 1.25rem; padding-top: 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .75rem; }
@media(min-width:640px){ .footer-bottom { flex-direction: row; } }
.footer-copy { font-size: .75rem; color: #94a3b8; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: .75rem; color: #94a3b8; transition: color .2s; }
.footer-links a:hover { color: #fff; }

/* ── CONTACT ── */
.contact-page { max-width: 896px; margin: 0 auto; padding: 3rem 1.5rem; }
.contact-form-wrap { background: var(--white); border-radius: var(--radius-2xl); border: 1px solid var(--slate-100); padding: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; color: var(--slate-700); margin-bottom: .5rem; }
.form-input,.form-textarea,.form-select { width: 100%; padding: .625rem .875rem; border: 1px solid var(--slate-200); border-radius: var(--radius); font-size: .875rem; font-family: inherit; color: var(--slate-800); background: var(--white); outline: none; transition: border-color .2s,box-shadow .2s; }
.form-input:focus,.form-textarea:focus,.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.10); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-submit { padding: .75rem 2rem; background: var(--primary); color: #fff; border: none; border-radius: 12px; font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background .2s,transform .2s; }
.form-submit:hover { background: var(--primary-light); transform: translateY(-1px); }

/* ── PAGINATION ── */
.herpsa-pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 3rem; flex-wrap: wrap; }
.herpsa-pagination a,.herpsa-pagination span { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); font-size: .875rem; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-600); transition: all .2s; }
.herpsa-pagination a:hover { border-color: var(--primary); color: var(--primary); }
.herpsa-pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── UTILS ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================
   SINGLE COURS — UX MOBILE (single-cours.php)
   ============================================================ */

/* Wrapper global */
.sc-wrap {
  background: #f8fafc;
  min-height: 100vh;
}

/* ── Topbar sticky progression ── */
.sc-topbar {
  position: fixed;
  top: 64px;          /* hauteur exacte du header site */
  left: 0;
  right: 0;
  z-index: 39;        /* sous le header (z-index 50) mais au-dessus du contenu */
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-100);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.sc-topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px 8px;
}
.sc-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--slate-400);
  margin-bottom: 8px;
  transition: color .2s;
}
.sc-back:hover { color: var(--primary); }
.sc-back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-progress-bar {
  height: 4px;
  background: var(--slate-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.sc-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width .4s ease;
}
.sc-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--slate-400);
}

/* ── Hero ── */
.sc-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #1e3a5f 100%);
  padding: 24px 16px 32px;
  /* Compense header (64px) + barre de lecture fixe (~62px) */
  margin-top: 62px;
}
.sc-hero-inner { max-width: 720px; margin: 0 auto; }
.sc-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sc-badge-ghost {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
}
.sc-chapter-num {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.sc-title {
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}
.sc-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 16px;
}
.sc-meta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sc-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}
.sc-meta-item svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-meta-item strong { color: rgba(255,255,255,0.9); font-weight: 700; }

/* ── PDF CTA ── */
.sc-pdf-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  padding: 14px 16px;
  cursor: pointer;
  transition: background .2s;
  max-width: 720px;
  margin: 0 auto;
}
.sc-pdf-cta:hover { background: var(--accent-light); }
.sc-pdf-left { display: flex; align-items: center; gap: 12px; }
.sc-pdf-icon {
  width: 40px;
  height: 40px;
  background: rgba(30,58,95,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc-pdf-icon svg { width: 20px; height: 20px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-pdf-label { font-size: 14px; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 2px; }
.sc-pdf-sub { font-size: 11px; color: rgba(30,58,95,0.6); }
.sc-pdf-arrow { width: 18px; height: 18px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Body wrapper ── */
.sc-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ── Sommaire ── */
.sc-toc {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  margin: 16px 0;
  overflow: hidden;
}
.sc-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  cursor: pointer;
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
}
.sc-toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-800);
}
.sc-toc-title svg { width: 14px; height: 14px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-toc-toggle-label { font-size: 11px; color: var(--slate-400); }
.sc-toc-body { padding: 4px 0 6px; }
.sc-toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.sc-toc-item:hover { background: var(--slate-50); }
.sc-toc-active { background: #eff6ff !important; }
.sc-toc-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-500);
  flex-shrink: 0;
  transition: all .2s;
}
.sc-toc-active .sc-toc-num { background: var(--primary); color: #fff; }
.sc-toc-done .sc-toc-num { background: #ecfdf5; color: #047857; }
.sc-toc-text { font-size: 12px; color: var(--slate-500); }
.sc-toc-active .sc-toc-text { color: var(--primary); font-weight: 600; }

/* ── Contenu éditorial ── */
.sc-content { padding: 8px 0; }
.sc-content h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-800);
  margin: 2rem 0 .75rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.02em;
}
.sc-content h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.sc-content h3 { font-size: 1rem; font-weight: 700; color: var(--slate-700); margin: 1.25rem 0 .5rem; }
.sc-content p { font-size: 14px; color: var(--slate-600); line-height: 1.75; margin-bottom: .875rem; }
.sc-content strong { color: var(--slate-800); font-weight: 700; }
.sc-content ul, .sc-content ol { padding-left: 1.25rem; margin-bottom: .875rem; }
.sc-content li { font-size: 14px; color: var(--slate-600); line-height: 1.65; margin-bottom: .3rem; }
.sc-content a { color: var(--primary); text-decoration: underline; }
.sc-content blockquote {
  border-left: 4px solid var(--accent);
  padding: .75rem 1rem;
  background: rgba(212,168,67,.08);
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-style: italic;
  font-size: 14px;
  color: var(--slate-700);
}
.sc-content table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 1rem 0; overflow-x: auto; display: block; }
.sc-content th { background: var(--primary); color: #fff; padding: 8px 10px; text-align: left; font-weight: 700; white-space: nowrap; }
.sc-content td { padding: 7px 10px; border-bottom: 1px solid var(--slate-100); }
.sc-content tr:nth-child(even) td { background: var(--slate-50); }

/* Blocs pédagogiques Gutenberg */
.wp-block-notion-cle,
.sc-content .notion-cle {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 1rem 0;
}
.wp-block-notion-cle strong,
.sc-content .notion-cle strong { color: var(--primary); }

.wp-block-a-retenir,
.sc-content .a-retenir {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  margin: 1rem 0;
}

/* ── Labels de section ── */
.sc-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slate-400);
  margin: 24px 0 10px;
}
.sc-section-label svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Bloc vidéo ── */
.sc-video-block { margin: 0 0 8px; }
.sc-video-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 9;
}
.sc-video-frame iframe { width: 100%; height: 100%; display: block; }
.sc-video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
}
.sc-video-link:hover { background: var(--primary-light); color: #fff; }
.sc-video-link svg { width: 16px; height: 16px; fill: #fff; }

/* ── FAQ ── */
.sc-faq { margin-bottom: 8px; }
.sc-faq-item {
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  background: var(--white);
}
.sc-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.sc-faq-q:hover { background: var(--slate-50); }
.sc-faq-q svg { width: 15px; height: 15px; stroke: var(--slate-400); fill: none; stroke-width: 2; flex-shrink: 0; transition: transform .2s; stroke-linecap: round; stroke-linejoin: round; }
.sc-faq-open svg { transform: rotate(180deg); stroke: var(--primary); }
.sc-faq-a {
  padding: 10px 13px 13px;
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.65;
  border-top: 1px solid var(--slate-100);
}

/* ── Liens utiles ── */
.sc-links { margin-bottom: 8px; }
.sc-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 6px;
  transition: border-color .2s, box-shadow .2s;
  color: inherit;
}
.sc-link-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.sc-link-favicon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc-link-favicon svg { width: 14px; height: 14px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-link-body { flex: 1; min-width: 0; }
.sc-link-name { font-size: 13px; font-weight: 600; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.sc-link-card:hover .sc-link-name { color: var(--primary); }
.sc-link-domain { font-size: 11px; color: var(--slate-400); }
.sc-link-arrow { width: 14px; height: 14px; stroke: var(--slate-300); fill: none; stroke-width: 2; flex-shrink: 0; stroke-linecap: round; stroke-linejoin: round; }

/* ── Navigation prev/next ── */
.sc-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 32px;
}
.sc-nav-btn {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all .2s;
  color: inherit;
  display: block;
}
.sc-nav-btn:hover { border-color: var(--primary); background: #eff6ff; }
.sc-nav-next {
  background: var(--primary);
  border-color: var(--primary);
}
.sc-nav-next:hover { background: var(--primary-light); border-color: var(--primary-light); }
.sc-nav-label {
  font-size: 10px;
  color: var(--slate-400);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sc-nav-next .sc-nav-label { color: rgba(255,255,255,0.55); }
.sc-nav-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-nav-next .sc-nav-title { color: #fff; }

/* ============================================================
   CORE WEB VITALS — PATCH v1.1.0
   CLS, touch targets 44px, aspect-ratio images
   ============================================================ */

/* ── 1. CLS — Réserver l'espace des images avant chargement ── */
.card-thumb              { aspect-ratio: 16 / 9; overflow: hidden; }
.course-detail-image img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.sc-video-frame          { aspect-ratio: 16 / 9; }

/* Éviter le saut du header au chargement de la police */
.site-header { min-height: 64px; }
.logo-icon   { width: 40px; height: 40px; flex-shrink: 0; }

/* Éviter les sauts liés aux blobs décoratifs du hero */
.hero-blob-1,
.hero-blob-2,
.hero-ring-1,
.hero-ring-2 { will-change: auto; contain: strict; }

/* ── 2. ZONES TACTILES MINIMALES 44×44px (WCAG 2.5.5) ── */

/* Navigation principale */
.main-navigation ul li a {
  display: flex;
  align-items: center;
}

/* Bouton hamburger mobile */
.menu-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* Liens menu mobile */
.mobile-nav ul li a {
  min-height: 44px;
}

/* Boutons hero */
.btn-primary,
.btn-outline {
  min-height: 44px;
}

/* Filtres de l'archive cours */
.filter-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* PDF CTA */
.sc-pdf-cta {
  min-height: 56px;
}

/* FAQ boutons accordéon */
.sc-faq-q {
  min-height: 44px;
}

/* Navigation prev/next cours */
.sc-nav-btn {
  min-height: 56px;
}

/* Liens de ressources */
.sc-link-card {
  min-height: 44px;
}

/* Items du sommaire */
.sc-toc-item {
  min-height: 40px;
}

/* Quick cards */
.quick-card {
  min-height: 120px;
}

/* Liens du footer */
.footer-nav ul li a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

/* ── 3. FONT-DISPLAY SWAP — évite FOIT (texte invisible) ── */
@font-face {
  font-family: 'Inter';
  font-display: swap;
}

/* ── 4. CONTAIN — évite les repaints coûteux ── */
.course-card,
.quick-card,
.resource-card,
.ann-card {
  contain: layout style;
}

/* ── 5. SCROLL BEHAVIOR — pas d'effet sur prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  html                       { scroll-behavior: auto; }
  .course-card,
  .quick-card                { transition: none; }
  .sc-progress-fill          { transition: none; }
  .hero-badge-dot            { animation: none; }
}

/* ── 6. ACCESSIBILITÉ — focus visible ── */
a:focus-visible,
button:focus-visible,
.filter-tab:focus-visible,
.sc-faq-q:focus-visible,
.sc-toc-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ── 7. IMAGES — éviter le CLS sur les thumbnails de cards ── */
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sc-hero-inner img,
.course-detail-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   PAGE CONTACT — REFONTE v1.1.2
   ============================================================ */

.contact-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* En-tête — aligné sur .courses-page-header */
.contact-header {
  margin-bottom: 1.75rem;
}
.contact-header-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .35rem;
}
.contact-header-inner .courses-page-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.contact-header-inner h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.contact-header-inner p {
  font-size: .875rem;
  color: var(--slate-400);
  margin: 0 0 0 56px;
}

/* Grille 2 colonnes */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media(min-width: 768px) {
  .contact-grid { grid-template-columns: 300px 1fr; }
}

/* Colonne infos */
.contact-infos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Carte info générique */
.contact-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.125rem 1.25rem;
}
.contact-card-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--slate-400);
  margin-bottom: .75rem;
}

/* Lien email */
.contact-email-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--primary);
  font-size: .9375rem;
  font-weight: 600;
  transition: color .2s;
  margin-bottom: .5rem;
}
.contact-email-link:hover { color: var(--primary-light); }
.contact-email-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-email-icon svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-card-hint {
  font-size: .8rem;
  color: var(--slate-400);
  margin: 0;
}

/* Niveaux */
.contact-niveaux {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

/* Tips */
.contact-card-hint-block {
  background: var(--slate-50);
  border-color: var(--slate-200);
}
.contact-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.contact-tips li {
  font-size: .8125rem;
  color: var(--slate-500);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.contact-tips li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Colonne formulaire */
.contact-form-wrap {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}
.contact-form-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 1.25rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--slate-100);
}

/* Ligne 2 colonnes dans le formulaire */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
  margin-bottom: .875rem;
}
@media(min-width: 480px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .8125rem; font-weight: 600; color: var(--slate-700); }
.form-required { color: var(--accent); font-weight: 700; }
.form-input,
.form-select,
.form-textarea {
  padding: .625rem .875rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: inherit;
  color: var(--slate-800);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}
.form-textarea {
  min-height: 130px;
  resize: vertical;
  margin-bottom: .875rem;
}

/* Footer du formulaire */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.form-required-note {
  font-size: .75rem;
  color: var(--slate-400);
}
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  min-height: 44px;
}
.form-submit:hover { background: var(--primary-light); transform: translateY(-1px); }
.form-submit svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Succès / erreur */
.contact-success {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: #047857;
  font-weight: 600;
  font-size: .9rem;
}
.contact-success svg {
  width: 20px;
  height: 20px;
  stroke: #047857;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.contact-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: .875rem 1.125rem;
  color: #be123c;
  font-size: .875rem;
  margin-bottom: 1rem;
}

/* ── Compteur de caractères formulaire contact ── */
.form-counter {
  font-size: .75rem;
  color: var(--slate-400);
  text-align: right;
  margin-top: .25rem;
}

/* ── Bouton déconnexion (visible uniquement si connecté) ── */
.header-logout {
  display: none;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  color: var(--slate-500);
  transition: background .2s, color .2s;
}
.logged-in .header-logout { display: flex; }
.header-logout:hover { background: var(--slate-100); color: var(--slate-800); }
.header-logout svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.header-logout-label { display: none; }
@media(min-width: 640px) { .header-logout-label { display: inline; } }

/* ── Skip link accessibilité ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  z-index: 9999;
  transition: top .15s;
}
.skip-link:focus { top: .5rem; }

/* ── Main landmark ── */
#main-content:focus { outline: none; }

/* ── Logo image ── */
.site-logo {
  height: 44px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
  /* Assure la lisibilité sur le header blanc */
  filter: none;
}

/* Sur fond sombre (hero) si le logo est utilisé en dehors du header, inverser */
.dark-bg .site-logo {
  filter: brightness(0) invert(1);
}

/* Masquer le logo-icon et logo-text natifs si un logo image est défini */
.custom-logo-link .logo-icon,
.custom-logo-link .logo-text {
  display: none;
}

/* Retirer l'ancien logo-icon du site-branding quand logo image présent */
.site-branding img.site-logo + .logo-icon { display: none; }

/* Footer logo — version claire sur fond marine */
.site-footer .site-logo {
  height: 32px;
  filter: brightness(0) invert(1);
  opacity: .85;
}

/* ============================================================
   LOGO — Dark mode & responsive v1.1.7
   ============================================================ */

.site-logo {
  height: 42px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
  /* Éviter le layout shift pendant le chargement */
  aspect-ratio: 320 / 132;
}

/* Footer : logo version claire (blanc) déjà généré côté serveur */
.site-logo--footer {
  height: 34px;
  opacity: .9;
}

/* ── Dark mode — header INTENTIONNELLEMENT identique au mode clair ──
   Le header reste blanc/clair quel que soit le thème système.
   Le logo bleu marine est conçu pour fond blanc — on conserve ce rendu.
── */
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(255,255,255,0.92);
    border-bottom-color: rgba(226,232,240,.60);
  }
  .site-header .site-logo { filter: none; }
  .main-navigation ul li a { color: var(--slate-600); }
  .main-navigation ul li a:hover { color: var(--slate-900); background: var(--slate-100); }
  .main-navigation ul li.current-menu-item > a,
  .main-navigation ul li.current_page_item > a { background: var(--primary); color: #fff; }
  .mobile-nav { background: rgba(255,255,255,.95); border-top-color: var(--slate-100); }
  .mobile-nav ul li a { color: var(--slate-600); }
  .mobile-nav ul li a:hover { background: var(--slate-100); }
  .mobile-nav ul li.current-menu-item > a { background: var(--primary); color: #fff; }
  .menu-toggle { color: var(--slate-700); }
  .menu-toggle:hover { background: var(--slate-100); }
  .header-logout { color: var(--slate-500); }
  .header-logout:hover { background: var(--slate-100); color: var(--slate-800); }
}

/* ── Notice RGPD formulaire contact ── */
.form-rgpd-notice {
  font-size: .75rem;
  color: var(--slate-400);
  text-align: center;
  margin-top: .75rem;
  line-height: 1.5;
}
.form-rgpd-notice a {
  color: var(--slate-500);
  text-decoration: underline;
}
.form-rgpd-notice a:hover {
  color: var(--primary);
}

/* ============================================================
   HEADER v1.2.3 — Logo icône + texte + navigation pill
   ============================================================ */

/* ── Branding : icône carrée arrondie + nom + sous-titre ── */
.site-branding-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);           /* bleu marine */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 6px;
}

.header-logo-icon img,
.header-logo-icon picture {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Logo bleu marine sur fond bleu marine → inverser en blanc */
  filter: brightness(0) invert(1);
  display: block;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-logo-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.01em;
}

.header-logo-sub {
  font-size: .75rem;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Navigation desktop — liens pill ── */
.main-navigation ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation ul li a {
  display: flex;
  align-items: center;
  padding: .3rem .75rem;
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
  line-height: 1;
  height: 34px;
}

.main-navigation ul li a:hover {
  background: var(--slate-100);
  color: var(--primary);
}

/* Lien actif — fond bleu marine, texte blanc, même hauteur */
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a,
.main-navigation ul li.current-menu-ancestor > a {
  background: var(--primary);
  color: #fff;
}

.main-navigation ul li.current-menu-item > a::after,
.main-navigation ul li.current_page_item > a::after {
  display: none;
}

/* ── Dark mode : header reste blanc (intentionnel) ── */
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(255,255,255,.95);
    border-bottom-color: rgba(226,232,240,.6);
  }
  .header-logo-name  { color: var(--primary); }
  .header-logo-sub   { color: var(--slate-400); }
  .main-navigation ul li a { color: var(--primary); }
  .main-navigation ul li a:hover { background: var(--slate-100); }
  .main-navigation ul li.current-menu-item > a,
  .main-navigation ul li.current_page_item > a { background: var(--primary); color: #fff; }
  .menu-toggle { color: var(--slate-700); }
  .menu-toggle:hover { background: var(--slate-100); }
}

/* ============================================================
   FILTRES DROPDOWN v2 — barre de filtres style modèle
   ============================================================ */
.filters-bar-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--page-pad);
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.filters-icon svg { stroke: var(--slate-400); display: block; }
.filters-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--slate-400);
  white-space: nowrap;
}

/* ── Dropdown ── */
.filter-dropdown { position: relative; }

.filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  white-space: nowrap;
  height: 36px;
}
.filter-dropdown-btn:hover {
  border-color: var(--slate-300);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.filter-dropdown-btn[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30,58,95,.12);
}
.filter-dropdown-btn svg { flex-shrink: 0; stroke: var(--slate-400); transition: transform .2s; }
.filter-dropdown-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.filter-dropdown-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  list-style: none;
  padding: .25rem;
  margin: 0;
  z-index: 200;
}
.filter-dropdown-list.open { display: block; }

.filter-dropdown-list li a {
  display: block;
  padding: .4rem .75rem;
  font-size: .8125rem;
  color: var(--slate-700);
  border-radius: 6px;
  text-decoration: none;
  transition: background .12s;
}
.filter-dropdown-list li a:hover { background: var(--slate-100); color: var(--primary); }
.filter-dropdown-list li[aria-selected="true"] a {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── Recherche ── */
.filter-search-form { flex-shrink: 0; }
.filter-search-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 36px;
  min-width: 280px;
  transition: border-color .15s, box-shadow .15s;
}
.filter-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30,58,95,.12);
}
.filter-search-wrap svg { stroke: var(--slate-400); flex-shrink: 0; }
.filter-search-input {
  border: none;
  outline: none;
  font-size: .8125rem;
  color: var(--slate-700);
  background: transparent;
  width: 100%;
}
.filter-search-input::placeholder { color: var(--slate-400); }

@media(max-width: 640px) {
  .filters-bar-v2 { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .filter-search-form { width: 100%; }
  .filter-search-wrap { width: 100%; min-width: unset; }
}

/* ============================================================
   CARDS COURS v1.2.8 — structure alignée sur le modèle
   ============================================================ */

/* Titre de groupe matière */
.course-group { margin-bottom: 2.5rem; }
.course-group-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-left: .75rem;
  border-left: 3px solid var(--accent);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Badge matière (tag avec icône) */
.badge-matiere {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: .2rem .6rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 500;
  color: var(--slate-600);
  background: #fff;
}
.badge-matiere svg { stroke: var(--slate-400); flex-shrink: 0; }

/* Préfixe chapitre dans le titre */
.card-chapter-prefix {
  color: var(--slate-400);
  font-weight: 500;
}

/* ── Cards ressources — alignées sur le modèle ── */
.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem var(--page-pad);
}
@media(min-width: 640px)  { .resource-grid { grid-template-columns: repeat(2, 1fr); } }
@media(min-width: 1024px) { .resource-grid { grid-template-columns: repeat(3, 1fr); } }

.resource-card {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.resource-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: var(--slate-200);
  transform: translateY(-2px);
}

/* Icône colorée selon le type — taille modèle */
.resource-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resource-icon svg { width: 22px; height: 22px; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Couleurs par type */
.resource-icon.exercice        { background: #ecfdf5; } .resource-icon.exercice svg        { stroke: #059669; }
.resource-icon.lien,
.resource-icon.lien-externe    { background: #eff6ff; } .resource-icon.lien svg,
                                                          .resource-icon.lien-externe svg    { stroke: #2563eb; }
.resource-icon.vidéo,
.resource-icon.video           { background: #fef2f2; } .resource-icon.vidéo svg,
                                                          .resource-icon.video svg           { stroke: #dc2626; }
.resource-icon.fiche,
.resource-icon.fiche-de-revision { background: #eff6ff; } .resource-icon.fiche svg,
                                                             .resource-icon.fiche-de-revision svg { stroke: #0284c7; }
.resource-icon.annale          { background: #fdf4ff; } .resource-icon.annale svg          { stroke: #9333ea; }
.resource-icon.document        { background: #fefce8; } .resource-icon.document svg        { stroke: #ca8a04; }

.resource-body { flex: 1; min-width: 0; }
.resource-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .375rem;
  line-height: 1.35;
}
.resource-card:hover .resource-title { color: var(--primary); text-decoration: underline; }
.resource-desc {
  font-size: .8125rem;
  color: var(--slate-500);
  margin-bottom: .5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.resource-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .5rem;
}

/* ── Lien télécharger sous les resource-card ── */
.resource-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-top: .5rem;
  transition: opacity .15s;
}
.resource-download:hover { opacity: .75; }
.resource-download svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Badges colorés par type de ressource (modèle) ── */
.badge-type-exercice        { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-type-lien-externe    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-type-video,
.badge-type-vidéo           { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-type-fiche-de-revision { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.badge-type-annale          { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }
.badge-type-document        { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.badge-type-diaporama       { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
