/* ==========================================================================
   Comment — design system
   ========================================================================== */

:root {
  --bg: #faf9f7;
  --bg-alt: #ffffff;
  --bg-raised: #ffffff;
  --text: #1c1b1f;
  --text-muted: #5c5a63;
  --border: #e8e5df;
  --primary: #2954e6;
  --primary-dark: #1d3fb8;
  --accent: #f5a524;
  --accent-soft: #fff2dc;
  --success: #1f9d6b;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px -8px rgba(20, 20, 30, 0.08);
  --shadow-lg: 0 4px 8px rgba(20, 20, 30, 0.06), 0 20px 48px -12px rgba(20, 20, 30, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font-head: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --max: 1160px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #14141a;
  --bg-alt: #1b1b23;
  --bg-raised: #21212b;
  --text: #f2f1f6;
  --text-muted: #a8a6b3;
  --border: #322f3d;
  --primary: #6c8cff;
  --primary-dark: #8ba0ff;
  --accent: #ffb648;
  --accent-soft: #3a2d16;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35), 0 24px 56px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14141a;
    --bg-alt: #1b1b23;
    --bg-raised: #21212b;
    --text: #f2f1f6;
    --text-muted: #a8a6b3;
    --border: #322f3d;
    --primary: #6c8cff;
    --primary-dark: #8ba0ff;
    --accent: #ffb648;
    --accent-soft: #3a2d16;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.35), 0 24px 56px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
  max-width: 100vw;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  white-space: nowrap;
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--bg-raised);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(60% 60% at 30% 20%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
              radial-gradient(50% 50% at 80% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  z-index: -1;
}
.hero-inner { max-width: 760px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 32px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 20px;
  max-width: 520px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.98rem;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
}
.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Section headings ---------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0; }
.section-head p { color: var(--text-muted); margin: 6px 0 0; }
.section-head .more { font-weight: 600; color: var(--primary); white-space: nowrap; }
.section-head .more:hover { text-decoration: underline; }

/* ---------- Category chips ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.cat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.cat-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.cat-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ---------- Article cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.article-card .thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-alt);
}
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.article-card:hover .thumb img { transform: scale(1.06); }
.article-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}
.article-card h3 { font-size: 1.08rem; margin: 0; }
.article-card p.excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 6px;
}

/* featured article (large) */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.featured .thumb { aspect-ratio: auto; height: 100%; min-height: 260px; }
.featured .thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured .body { padding: 32px 32px 32px 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.featured h3 { font-size: 1.6rem; }

/* ---------- Filters ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
}
.filter-chip.active, .filter-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }

/* ---------- Article page ---------- */
.article-hero {
  padding: 48px 0 32px;
}
.breadcrumb {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--primary); }
.article-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 820px; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 18px 0 28px;
}
.article-meta span { display: flex; align-items: center; gap: 6px; }
.article-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
}
.article-cover img { width: 100%; max-height: 460px; object-fit: cover; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
  padding-bottom: 64px;
}
.article-body { min-width: 0; font-size: 1.06rem; }
.article-body h2 { margin-top: 1.7em; font-size: 1.5rem; }
.article-body h3 { margin-top: 1.4em; font-size: 1.2rem; }
.article-body p { margin: 0 0 1.1em; color: var(--text); }
.article-body ul, .article-body ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.article-body li { margin-bottom: 0.4em; }
.article-body img { border-radius: var(--radius); margin: 1.5em 0; box-shadow: var(--shadow); }
.ad-slot {
  margin: 2em 0;
  padding: 6px 0;
  min-height: 90px;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  position: relative;
}
.ad-slot::before {
  content: "Publicité";
  display: block;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.article-body strong { color: var(--text); }
.article-body blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.article-body .tip-box, .article-body .step, .article-body .warning-box, .article-body .info-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 1.4em 0;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.94rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--bg-alt); }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-body hr, .article-body .separator { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.article-body i.fas, .article-body i.far { margin-right: 6px; color: var(--primary); }

.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 96px; }
.sidebar .box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar .box h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 14px; }
.mini-article { display: flex; gap: 12px; margin-bottom: 14px; align-items: center; }
.mini-article img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.mini-article span { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.share-row { display: flex; gap: 10px; margin-top: 24px; }
.share-row a {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.share-row a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--primary), #6c4fd6);
  border-radius: var(--radius-lg);
  padding: 48px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-banner h2 { font-size: 1.7rem; margin-bottom: 6px; }
.cta-banner p { opacity: 0.88; margin: 0; max-width: 480px; }
.cta-banner .btn-primary { background: #fff; color: var(--primary); }
.cta-banner .btn-primary:hover { background: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
  margin-top: 40px;
  background: var(--bg-alt);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 14px; }
.footer-grid a { display: block; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 10px; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Contact / static pages ---------- */
.static-page { padding: 56px 0 80px; max-width: 760px; margin: 0 auto; }
.static-page h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 20px; }
.static-page h2 { font-size: 1.3rem; margin-top: 1.6em; }
.static-page p, .static-page li { color: var(--text-muted); }
.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}
.contact-card .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 20px; }
.contact-card a.email { font-size: 1.3rem; font-weight: 700; color: var(--primary); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .featured .body { padding: 0 24px 28px; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; top: 72px; right: 0; left: 0; height: calc(100vh - 72px); background: var(--bg); flex-direction: column; align-items: stretch; padding: 20px; gap: 6px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { padding: 14px 16px; font-size: 1.05rem; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-banner { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
