/* ── SECTION BLOG (dans index.html) ── */
#blog {
  background: var(--bg-surface);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.blog-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.blog-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1.5px var(--blue);
  pointer-events: none;
  z-index: 1;
}
.blog-card:hover::before {
  opacity: 1;
}
.blog-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-4px);
  color: inherit;
}

.blog-card-header {
  padding: 28px 28px 0;
}

.blog-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.blog-card-num::before {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text-dim);
}

.blog-card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  background: var(--orange-dim);
  border: 1px solid rgba(255, 109, 0, 0.2);
  border-radius: 4px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 12px;
  transition: var(--transition);
}
.blog-card:hover .blog-card-title {
  color: var(--blue);
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 0 28px;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 24px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}
.blog-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.blog-card-arrow {
  font-size: 13px;
  color: var(--blue);
  transition: var(--transition);
}
.blog-card:hover .blog-card-arrow {
  transform: translateX(4px);
  color: var(--orange);
}

/* ── PAGE ARTICLE ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  align-items: start;
}

/* Article header */
.article-header {
  padding: 80px 80px 60px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.article-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.15;
  pointer-events: none;
}
.article-header-inner {
  position: relative;
  z-index: 1;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.article-breadcrumb a {
  color: var(--text-muted);
  transition: var(--transition);
}
.article-breadcrumb a:hover {
  color: var(--blue);
}
.article-breadcrumb i {
  font-size: 9px;
}

.article-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  background: var(--orange-dim);
  border: 1px solid rgba(255, 109, 0, 0.2);
  border-radius: 4px;
  padding: 4px 12px;
  margin-bottom: 20px;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  max-width: 800px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.article-meta-item i {
  color: var(--orange);
  font-size: 11px;
}

/* Article body */
.article-body {
  padding: 64px 80px;
  background: var(--bg-base);
}

.article-content {
  max-width: 740px;
}

/* Typography article */
.article-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.2;
}
.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 14px;
}

.article-content p {
  font-size: 16.5px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 22px;
}

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

.article-content ul,
.article-content ol {
  margin: 0 0 24px 0;
  padding-left: 0;
  list-style: none;
}
.article-content ul li,
.article-content ol li {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 8px;
}
.article-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.article-content ol {
  counter-reset: ol-counter;
}
.article-content ol li {
  counter-increment: ol-counter;
}
.article-content ol li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

/* Callout blocks */
.callout {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}
.callout.orange {
  border-left-color: var(--orange);
}
.callout.green {
  border-left-color: var(--green);
}

.callout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 10px;
}
.callout.orange .callout-label {
  color: var(--orange);
}
.callout.green .callout-label {
  color: var(--green);
}

.callout p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Code inline */
.article-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--orange);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

/* Comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 14px;
}
.compare-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
}
.compare-table td {
  padding: 14px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}
.compare-table tr:last-child td {
  border-bottom: none;
}
.compare-table .bad {
  color: #f85149;
}
.compare-table .good {
  color: var(--green);
}

/* Article sidebar */
.article-sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.sidebar-widget-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Table of contents */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-list li {
  margin-bottom: 8px;
}
.toc-list a {
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.toc-list a::before {
  content: "//";
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 1px;
}
.toc-list a:hover {
  color: var(--blue);
}
.toc-list a.active {
  color: var(--blue);
}

/* Author widget */
.author-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.author-widget img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  filter: grayscale(30%);
}
.author-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.author-role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--orange);
}
.author-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Share widget */
.share-links {
  display: flex;
  gap: 8px;
}
.share-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}
.share-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* Article footer nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 48px 80px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.article-nav-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.article-nav-card:hover {
  border-color: var(--blue);
  color: inherit;
}
.article-nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-nav-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.article-nav-card.next {
  text-align: right;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}
.back-to-top:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--bg-elevated);
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  z-index: 9999;
  transition: width 0.1s linear;
  width: 0%;
}

/* ── RESPONSIVE BLOG ── */
@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
  }
}

@media (max-width: 991px) {
  .article-header {
    padding: 60px 24px 40px;
  }
  .article-body {
    padding: 40px 24px;
  }
  .article-nav {
    padding: 32px 24px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .article-nav {
    grid-template-columns: 1fr;
  }
  .article-title {
    font-size: 26px;
  }
}
