/* ==================================================================
   Tech237 — Design system
   Thème clair / sombre, responsive, aucune dépendance externe
   ================================================================== */

/* ---------- Variables ---------- */
:root {
  --bg: #f4f6fb;
  --bg-alt: #eceff7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-soft: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --accent: #06b6d4;
  --accent-strong: #0891b2;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0e1628;
  --surface: #131c31;
  --surface-2: #182238;
  --text: #e2e8f0;
  --text-soft: #94a3b8;
  --muted: #64748b;
  --border: #243049;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .5);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-strong); }
code, pre { font-family: var(--mono); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200; }
.skip-link:focus { left: 0; }
.muted { color: var(--muted); }
.grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: all .2s; text-decoration: none; line-height: 1.2;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(99, 102, 241, .45); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--accent), #0891b2); color: #fff; box-shadow: 0 4px 14px rgba(6, 182, 212, .35); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(6, 182, 212, .45); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, .06); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-small { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand-text small { font-size: .68rem; color: var(--muted); font-weight: 500; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .93rem;
  color: var(--text-soft);
}
.main-nav a:hover { background: rgba(99, 102, 241, .08); color: var(--primary); }
.main-nav a.active { background: rgba(99, 102, 241, .12); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 14px; color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.search-box input { border: 0; background: transparent; outline: 0; color: var(--text); width: 150px; font-size: .9rem; }
.search-box input::placeholder { color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-soft); cursor: pointer;
  display: grid; place-items: center; transition: all .2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; border-radius: 2px; transition: all .25s; }

/* Bande de catégories */
.cat-strip { display: flex; gap: 8px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-soft); background: var(--surface);
  transition: all .2s;
}
.cat-pill:hover { border-color: var(--cat-color, var(--primary)); color: var(--cat-color, var(--primary)); transform: translateY(-1px); }
.cat-pill.active { background: color-mix(in srgb, var(--cat-color, var(--primary)) 12%, var(--surface)); border-color: color-mix(in srgb, var(--cat-color, var(--primary)) 55%, transparent); color: var(--cat-color, var(--primary)); }
.cat-emoji { font-size: 1.05em; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #131c31 0%, #1a1440 55%, #0c2438 100%); color: #fff; }
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 72px 24px 84px; }
.hero-content { max-width: 640px; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: rgba(34, 211, 238, .12); border: 1px solid rgba(34, 211, 238, .35); color: #67e8f9; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.12; letter-spacing: -.03em; margin-bottom: 18px; }
.hero-content > p { font-size: 1.12rem; color: #b8c3dd; margin-bottom: 28px; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.55rem; letter-spacing: -.02em; }
.hero-stats span { font-size: .8rem; color: #8fa0bd; }
.about-stats { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.about-stats strong { color: var(--primary); }

.hero-visual { position: relative; height: 400px; }
.hero-card {
  position: absolute; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); border-radius: 18px; padding: 18px 20px; color: #fff;
  display: flex; flex-direction: column; gap: 4px; width: 230px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4); animation: float 6s ease-in-out infinite;
}
.hero-card strong { font-size: 1rem; }
.hero-card small { color: #b8c3dd; font-size: .8rem; }
.hc-emoji { font-size: 1.9rem; margin-bottom: 6px; }
.hero-card-1 { top: 18px; left: 6%; animation-delay: 0s; }
.hero-card-2 { top: 135px; right: 2%; animation-delay: 1.2s; }
.hero-card-3 { bottom: 14px; left: 14%; animation-delay: 2.1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.hero-orb-1 { width: 240px; height: 240px; background: #6366f1; top: -40px; right: 8%; animation: pulse 7s ease-in-out infinite; }
.hero-orb-2 { width: 200px; height: 200px; background: #06b6d4; bottom: -30px; left: 2%; animation: pulse 9s ease-in-out infinite reverse; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.18); opacity: .6; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; gap: 16px; }
.section-head h2 { font-size: 1.55rem; letter-spacing: -.02em; }
.see-all { font-weight: 600; font-size: .92rem; }

/* ---------- Cartes articles ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.card-cover {
  position: relative; display: block; aspect-ratio: 16/9;
  background-image: var(--cover, linear-gradient(135deg, var(--primary), var(--accent)));
  background-size: cover; background-position: center;
}
.card-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.28), transparent 55%); opacity: 0; transition: opacity .25s; }
.card:hover .card-cover::after { opacity: 1; }
.cat-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: color-mix(in srgb, var(--cat-color, var(--primary)) 90%, #000);
  color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px; letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.06rem; line-height: 1.4; letter-spacing: -.01em; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }
.card-body p { color: var(--text-soft); font-size: .9rem; flex: 1; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .78rem; font-weight: 500; margin-top: auto; }

/* À la une */
.featured-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.featured-main { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 420px; display: block; box-shadow: var(--shadow-md); }
.featured-cover {
  position: absolute; inset: 0;
  background-image: var(--cover, linear-gradient(135deg, var(--primary), var(--accent)));
  background-size: cover; background-position: center;
  transition: transform .6s;
}
.featured-main:hover .featured-cover { transform: scale(1.04); }
.featured-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 30px; color: #fff;
  background: linear-gradient(to top, rgba(4, 8, 20, .92) 12%, rgba(4, 8, 20, .45) 55%, transparent);
}
.featured-overlay h3 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.02em; max-width: 90%; }
.featured-overlay p { color: #c3cbde; font-size: .95rem; max-width: 92%; }
.featured-overlay .card-meta { color: #aab4cc; }
.featured-side { display: flex; flex-direction: column; gap: 14px; }
.featured-mini {
  flex: 1; display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; transition: all .2s;
}
.featured-mini:hover { transform: translateX(5px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow-md); }
.fm-emoji { font-size: 1.5rem; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.featured-mini h4 { font-size: .96rem; line-height: 1.35; color: var(--text); }
.featured-mini small { color: var(--muted); font-size: .76rem; }

/* ---------- Top articles ---------- */
.split-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; }
.top-list { list-style: none; display: flex; flex-direction: column; }
.top-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.top-list li:last-child { border-bottom: 0; }
.top-rank {
  font-size: 1.6rem; font-weight: 800; color: transparent; flex-shrink: 0; line-height: 1.1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text;
}
.top-list a { color: var(--text); font-weight: 600; font-size: .97rem; }
.top-list a:hover { color: var(--primary); }
.top-list small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.sidebar-box h3 { font-size: 1.02rem; margin-bottom: 14px; }
.side-list { display: flex; flex-direction: column; }
.side-list a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.side-list a:last-child { border-bottom: 0; }
.side-list a .cat-emoji { font-size: 1.15rem; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.side-list a span:last-child { display: flex; flex-direction: column; }
.side-list strong { color: var(--text); font-size: .86rem; line-height: 1.4; font-weight: 600; }
.side-list small { color: var(--muted); font-size: .75rem; }
.sidebar-cta {
  background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
.sb-emoji { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.cat-list { display: flex; flex-direction: column; }
.cat-list a { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); color: var(--text); font-weight: 600; font-size: .92rem; }
.cat-list a:last-child { border-bottom: 0; }
.cat-list a:hover { color: var(--primary); }
.cat-list em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }

/* ---------- Page articles (liste) ---------- */
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 40px 0 34px; }
.page-head h1 { font-size: 2rem; letter-spacing: -.02em; }
.page-sub { color: var(--text-soft); margin-top: 8px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.list-layout { display: grid; grid-template-columns: 1fr 320px; gap: 34px; }
.list-grid { grid-template-columns: repeat(2, 1fr); }
.filter-form { display: flex; flex-direction: column; gap: 10px; }
.filter-form input, .filter-form select { width: 100%; }

.empty-state {
  text-align: center; padding: 70px 24px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state > span { font-size: 3rem; }
.empty-state h3 { font-size: 1.3rem; }
.empty-state p { color: var(--text-soft); max-width: 380px; }
.empty-actions { display: flex; gap: 10px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 34px; }
.pagination a {
  min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: .9rem;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination a.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Article (détail) ---------- */
.article-page { padding: 40px 0 70px; }
.article-container { max-width: 1060px; }
.article-head { max-width: 820px; margin: 0 auto 26px; }
.article-head .cat-badge { position: static; margin-bottom: 14px; display: inline-flex; }
.article-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.18; letter-spacing: -.025em; margin-bottom: 14px; }
.article-excerpt { color: var(--text-soft); font-size: 1.08rem; margin-bottom: 18px; }
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 1.05rem; flex-shrink: 0;
}
.article-meta > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; }
.article-meta small { color: var(--muted); font-size: .78rem; }
.article-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-like.liked { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
[data-theme="dark"] .btn-like.liked { background: rgba(239, 68, 68, .15); border-color: rgba(239, 68, 68, .35); }
.article-cover {
  aspect-ratio: 21/9; border-radius: var(--radius); margin-bottom: 30px;
  background-image: var(--cover, linear-gradient(135deg, var(--primary), var(--accent)));
  background-size: cover; background-position: center; box-shadow: var(--shadow-md);
}
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }

/* Contenu riche */
.article-content { min-width: 0; }
.article-content h2 { font-size: 1.5rem; margin: 1.6em 0 .6em; letter-spacing: -.02em; line-height: 1.3; }
.article-content h3 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
.article-content h2:first-child, .article-content h3:first-child { margin-top: 0; }
.article-content p { margin-bottom: 1.05em; color: var(--text); }
.article-content a { text-decoration: underline; text-underline-offset: 3px; }
.article-content ul, .article-content ol { margin: 0 0 1.1em 1.4em; }
.article-content li { margin-bottom: .45em; }
.article-content blockquote {
  border-left: 4px solid var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 1.3em 0; font-style: italic; color: var(--text-soft);
}
.article-content blockquote p { margin: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.3em 0; font-size: .92rem; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.article-content th { background: var(--surface-2); font-weight: 700; }
.article-content tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.article-content strong { font-weight: 700; }
.article-content pre {
  background: #0d1526; color: #dbe4f5; border-radius: 14px; padding: 18px 20px;
  overflow-x: auto; margin: 1.2em 0; font-size: .88rem; line-height: 1.6;
  border: 1px solid #1d2b47; position: relative;
}
.article-content pre::before {
  content: attr(data-lang); position: absolute; top: 8px; right: 14px;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #5c6f94;
  font-family: var(--font); font-weight: 700;
}
.article-content code { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); padding: 2px 7px; border-radius: 6px; font-size: .87em; }
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content img { border-radius: 12px; margin: 1.2em 0; }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 1.8em 0; }
.article-content :not(pre) > code::before, .article-content :not(pre) > code::after { content: ""; }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 8px; }
.tag {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft);
  padding: 5px 13px; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.tag:hover { border-color: var(--primary); color: var(--primary); }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.share-row > span { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.share-btn {
  padding: 6px 14px; border-radius: 9px; border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--text-soft);
}
.share-btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }

/* Commentaires */
.comments { margin-top: 40px; }
.comments h2 { font-size: 1.35rem; margin-bottom: 18px; }
.comment-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.comment { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.comment-body { flex: 1; }
.comment-body strong { display: block; }
.comment-body small { color: var(--muted); font-size: .75rem; }
.comment-body p { margin-top: 6px; font-size: .93rem; }
.comment-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.comment-form h3 { font-size: 1.05rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Formulaires ---------- */
input, select, textarea {
  font-family: var(--font); font-size: .94rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 14px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
textarea { resize: vertical; }
label { font-weight: 600; font-size: .88rem; margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 16px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.flash { padding: 13px 18px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.flash-ok { background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .35); color: var(--green); }
.flash-err { background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); color: var(--red); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 380px 1fr; gap: 26px; align-items: start; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; gap: 12px; font-size: .92rem; color: var(--text-soft); }
.contact-list strong { color: var(--text); }

/* ---------- Newsletter bande ---------- */
.newsletter-band {
  background: linear-gradient(120deg, #131c31, #241a4d 55%, #0c2438);
  color: #fff; padding: 44px 0; position: relative; overflow: hidden;
}
.newsletter-band::after { content: "📬"; position: absolute; right: -30px; bottom: -40px; font-size: 11rem; opacity: .08; transform: rotate(-12deg); }
.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.newsletter-inner h2 { font-size: 1.45rem; margin-bottom: 6px; }
.newsletter-inner p { color: #aab4cc; max-width: 460px; }
.newsletter-form { display: flex; gap: 10px; flex: 1; max-width: 460px; }
.newsletter-form input { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .18); color: #fff; }
.newsletter-form input::placeholder { color: #8292b5; }
.newsletter-form.mini { flex-direction: column; }
.newsletter-form.mini input { color: var(--text); background: var(--surface-2); border-color: var(--border); }

/* ---------- Footer ---------- */
.site-footer { background: #0a0f1e; color: #94a3b8; padding: 54px 0 0; }
.site-footer .brand-text strong { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding-bottom: 38px; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 8px; }
.footer-col a { color: #94a3b8; font-size: .9rem; }
.footer-col a:hover { color: #22d3ee; }
.footer-about p { font-size: .88rem; line-height: 1.6; }
.footer-contact { margin-top: 10px; }
.footer-tip { font-size: .78rem; color: #64748b; margin-top: 8px; }
.footer-tip code { color: #22d3ee; }
.footer-bottom {
  border-top: 1px solid #1c2740; padding: 20px 24px;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: .8rem; color: #64748b;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); padding: 13px 22px; border-radius: 12px;
  font-weight: 600; font-size: .92rem; opacity: 0; transition: all .35s; z-index: 300;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Divers ---------- */
.prose h2 { font-size: 1.4rem; margin: 1.5em 0 .5em; }
.prose p { margin-bottom: 1em; color: var(--text-soft); }
.prose a { text-decoration: underline; }
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.value-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: all .25s;
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.value-card > span { font-size: 1.7rem; }
.value-card h3 { font-size: 1.02rem; margin: 10px 0 6px; }
.value-card p { color: var(--text-soft); font-size: .88rem; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 1em 0 1.6em; }
.cat-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); transition: all .2s;
}
.cat-card:hover { border-color: var(--primary); transform: translateX(3px); color: var(--text); }
.cat-card strong { font-size: .95rem; }
.cat-card small { color: var(--muted); font-size: .75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid, .split-grid, .list-layout, .article-layout { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; padding: 54px 24px 60px; }
  .hero-visual { display: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 14px 20px; gap: 4px;
    transform: translateY(-130%); transition: transform .3s; z-index: 99;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 12px 14px; }
  .nav-toggle { display: block; }
  .search-box input { width: 110px; }
  .brand-text small { display: none; }
  .cards-grid, .list-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .article-actions { margin-left: 0; width: 100%; }
}
