:root {
  --bg: #0f0d15;
  --bg-elevated: #1a1226;
  --bg-card: #1f1630;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f3ff;
  --text-secondary: #c4b5fd;
  --text-muted: #8b7ea8;
  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-pink: #f472b6;
  --accent-bg: rgba(167, 139, 250, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --max-width: 1200px;
  --narrow-width: 760px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", var(--font-sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #fff;
}

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

.container-narrow {
  max-width: var(--narrow-width);
}

/* ═══ Header ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 13, 21, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  text-transform: uppercase;
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-word {
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent) 0%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
  font-size: 15px;
}

.site-nav a {
  color: var(--text-secondary);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  color: #0f0d15;
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.3);
}

.btn-primary:hover {
  color: #0f0d15;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(167, 139, 250, 0.45);
}

.btn-header {
  padding: 10px 18px;
  font-size: 14px;
}

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

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch:hover {
  color: var(--text);
  background: rgba(167, 139, 250, 0.22);
}

.lang-flag {
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }
  .btn-header {
    display: none;
  }
  /* lang-switch reste visible sur mobile */
}

/* ═══ Breadcrumbs ═══ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  margin: 40px 0 24px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--text-secondary);
}

.crumb-current {
  color: var(--text-secondary);
}

/* ═══ Article ═══ */
.article-header {
  margin-bottom: 32px;
}

.article-category {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent-bright);
  margin-bottom: 20px;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--text);
}

.article-lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.author-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.author-inline strong {
  color: var(--text);
  font-weight: 600;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--bg-elevated);
  padding: 2px;
}

.article-hero {
  margin: 32px 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.article-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 56px 0 20px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: 36px 0 16px;
  color: var(--text);
}

.article-body p {
  margin: 0 0 20px;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(167, 139, 250, 0.4);
}

.article-body a:hover {
  text-decoration-color: var(--accent-bright);
}

.article-body ul,
.article-body ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body code {
  padding: 2px 8px;
  background: rgba(167, 139, 250, 0.15);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--accent-bright);
}

.article-body pre {
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.article-body pre code {
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.article-body th,
.article-body td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--bg-elevated);
  font-weight: 600;
}

/* ═══ FAQ ═══ */
.article-faq {
  margin: 56px 0 40px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.article-faq h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 24px;
  color: var(--text);
}

.article-faq details {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.article-faq details:first-of-type {
  border-top: none;
  padding-top: 0;
}

.article-faq summary {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
}

.article-faq summary::-webkit-details-marker {
  display: none;
}

.article-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 24px;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.article-faq details[open] summary::after {
  content: "−";
}

.article-faq details p {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

/* ═══ CTA ═══ */
.article-cta {
  margin: 56px 0 40px;
  padding: 40px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(244, 114, 182, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: var(--radius-lg);
  text-align: center;
}

.article-cta h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 12px;
  color: var(--text);
}

.article-cta p {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 17px;
}

/* ═══ Articles liés ═══ */
.related-articles {
  margin: 64px 0 80px;
}

.related-articles h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 28px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ═══ Cards (utilisé par index et related) ═══ */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  color: var(--text);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  color: var(--text);
}

.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 10px;
}

.card-category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-bright);
}

.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

.card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══ Blog hero ═══ */
.blog-hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse at top, rgba(167, 139, 250, 0.18), transparent 60%);
}

.blog-hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.blog-hero-mascot {
  width: 220px;
  height: 220px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 16px 40px rgba(167, 139, 250, 0.3));
  animation: mascot-float 4s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.blog-hero-text {
  flex: 1 1 auto;
  min-width: 280px;
  max-width: 640px;
}

@media (max-width: 720px) {
  .blog-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  .blog-hero-mascot {
    width: 160px;
    height: 160px;
  }
}

.blog-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent-bg);
  color: var(--accent-bright);
  margin: 0 0 20px;
}

.blog-hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.blog-hero-lead {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ═══ Category nav ═══ */
.category-nav {
  position: sticky;
  top: 68px;
  z-index: 40;
  background: rgba(15, 13, 21, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.category-nav-inner {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-nav-inner::-webkit-scrollbar {
  display: none;
}

.category-nav-inner a {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.category-nav-inner a:hover,
.category-nav-inner a.active {
  color: var(--text);
  background: var(--accent-bg);
  border-color: rgba(167, 139, 250, 0.4);
}

/* ═══ Grille d'articles ═══ */
.article-grid-section {
  padding: 48px 0 80px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ═══ Pagination ═══ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.pagination a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.pagination .current {
  background: var(--accent);
  color: #0f0d15;
  border-color: var(--accent);
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ═══ Footer ═══ */
.site-footer {
  margin-top: 80px;
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

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

.footer-col h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 16px;
  color: var(--text);
}

.footer-col p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
  max-width: 280px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
