/* ================================================================
   BLOG BATOUCODE — Neon-Tron Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg:            #020617;
  --bg-surface:    rgba(255,255,255,0.03);
  --bg-glass:      rgba(2,6,23,0.85);
  --text:          #e2e8f0;
  --text-muted:    rgba(226,232,240,0.45);
  --primary:       #00f2ff;
  --primary-glow:  rgba(0,242,255,0.22);
  --secondary:     #7000ff;
  --accent:        #ff3366;
  --border:        rgba(0,242,255,0.15);
  --border-subtle: rgba(255,255,255,0.06);
  --shadow:        0 0 24px rgba(0,242,255,0.18);
  --radius:        8px;
  --radius-lg:     16px;
  --font:          'Inter','Plus Jakarta Sans',system-ui,sans-serif;
  --mono:          'Source Code Pro','Courier New',monospace;
  --transition:    0.22s ease;
  --max-w:         1100px;
  --sidebar-w:     280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
html, body { width: 100%; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

img { max-width: 100%; height: auto; display: block; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-logo span { color: var(--primary); }

.header-nav { display: flex; gap: 0.25rem; }

.header-nav a {
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all var(--transition);
}
.header-nav a:hover,
.header-nav a.active { color: var(--primary); background: var(--primary-glow); }

/* ── Layout ──────────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2.5rem;
  align-items: start;
}

.page-wrap.full { grid-template-columns: 1fr; }

/* ── Hero ──────────────────────────────────────────────────── */
.blog-hero {
  grid-column: 1 / -1;
  padding: 2rem 0 1rem;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.blog-hero h1 span { color: var(--primary); }

.blog-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.6rem;
}

/* ── Card article ────────────────────────────────────────────── */
.articles-list { display: flex; flex-direction: column; gap: 1.5rem; }

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.article-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--bg) 100%);
}

.card-cover-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(112,0,255,0.15) 0%, rgba(0,242,255,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--border);
}

.card-body { padding: 1.4rem 1.6rem 1.6rem; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.card-category {
  color: var(--primary);
  background: var(--primary-glow);
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-weight: 500;
  font-size: 0.75rem;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  transition: color var(--transition);
}

.article-card:hover .card-title { color: var(--primary); }

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.read-more {
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition);
}

.article-card:hover .read-more { gap: 0.6rem; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sidebar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.widget-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.widget-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--primary);
}

.category-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }

.category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.category-list li a:hover { color: var(--primary); background: var(--primary-glow); }

.cat-count {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.archive-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }

.archive-list li a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  display: block;
  transition: all var(--transition);
}
.archive-list li a:hover { color: var(--primary); background: var(--primary-glow); }

/* ── Article page ────────────────────────────────────────────── */
.article-header { margin-bottom: 2.5rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }

.article-cover-full {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border-subtle);
}

.article-title-full {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.article-meta-full {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

/* ── Article content ─────────────────────────────────────────── */
.article-content { line-height: 1.85; }

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: var(--text);
}

.article-content p { margin-bottom: 1.2rem; }

.article-content ul,
.article-content ol {
  margin: 0 0 1.2rem 1.5rem;
}

.article-content li { margin-bottom: 0.4rem; }

.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--primary-glow);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-content code {
  font-family: var(--mono);
  background: rgba(0,242,255,0.08);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--primary);
}

.article-content pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.article-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
}

.article-content a { border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.article-content a:hover { border-color: var(--primary); }

/* ── Commentaires ────────────────────────────────────────────── */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.form-group input,
.form-group textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea { min-height: 120px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #020617;
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 0 28px rgba(0,242,255,0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover { border-color: var(--border); color: var(--text); }

.comment-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }

.comment-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.comment-author { font-weight: 600; color: var(--primary); }
.comment-date { color: var(--text-muted); font-size: 0.8rem; }
.comment-text { font-size: 0.92rem; color: var(--text-muted); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 1rem; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 999;
  animation: slideIn 0.3s ease;
}
.toast.ok { border-color: var(--primary); color: var(--primary); }
.toast.err { border-color: var(--accent); color: var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
}

/* ── Nav mobile blog (identique au site principal) ───────────── */

.blog-mobile-nav {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 92vw);
  height: 66px;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  align-items: center;
  justify-content: space-around;
  box-shadow:
    0 0 0 1px var(--border-subtle),
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 300;
  overflow: visible;
}

.bmob-item {
  position: relative;
  flex: 1;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  user-select: none;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bmob-item:active { background: rgba(255,255,255,0.04); }

.bmob-item .mob-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.32);
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), color 0.3s;
}

[data-theme="light"] .bmob-item .mob-ico { color: rgba(15,23,42,0.32); }

.bmob-item .mob-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bmob-item.active .mob-ico {
  transform: translateY(-22px);
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,0.4));
}

.bmob-item .mob-lbl {
  position: absolute;
  bottom: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--primary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease 0.06s, transform 0.3s ease 0.06s;
  white-space: nowrap;
  pointer-events: none;
  text-transform: uppercase;
}

.bmob-item.active .mob-lbl {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-mobile-nav { display: flex; }
  body { padding-bottom: 100px; }

  .page-wrap {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 3rem;
    gap: 2rem;
  }

  .sidebar { order: -1; }

  .form-row { grid-template-columns: 1fr; }

  .article-cover-full { height: 220px; }

  .header-nav { display: none; }
}

/* ── Loader ──────────────────────────────────────────────────── */
.loader {
  display: flex;
  justify-content: center;
  padding: 3rem;
}

.loader::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── No-results ──────────────────────────────────────────────── */
.no-results {
  grid-column: 1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
