/* ---------- Blog (s'ajoute à style.css) ---------- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.post-back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-back:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Index */
.series-intro {
  max-width: 760px;
  margin-bottom: 32px;
}

.series-intro p {
  color: var(--muted);
}

.post-grid {
  align-items: stretch;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card h3 {
  margin: 10px 0 10px;
}

.post-card p {
  color: var(--muted);
}

.post-card .post-meta {
  margin: auto 0 14px;
  padding-top: 14px;
}

/* Article */
.post .post-section + .post-section {
  margin-top: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.post .post-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.post h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

.post p,
.post li {
  line-height: 1.7;
}

.post p {
  margin: 0 0 16px;
  color: var(--text);
}

.post-list {
  margin: 0 0 18px;
  padding-left: 20px;
}

.post-list li {
  margin-bottom: 8px;
  color: var(--text);
}

.post-list li::marker {
  color: var(--accent);
}

.post code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* Blocs de code */
.code-block {
  margin: 0 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #050913;
  overflow: hidden;
}

.code-block figcaption {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: #d5e0f0;
  tab-size: 4;
}

.post .code-block code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  word-break: normal;
  white-space: pre;
}

/* Encadrés */
.callout {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.06);
}

.callout-tip {
  border-left-color: var(--accent);
  background: rgba(46, 230, 197, 0.06);
}

.post .callout p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

/* Navigation entre articles */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  color: var(--text);
  font-weight: 600;
}

.post-nav-link span {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.post-nav-link.next {
  margin-left: auto;
  text-align: right;
}

.post-nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 900px) {
  .post-nav {
    flex-direction: column;
  }

  .post-nav-link,
  .post-nav-link.next {
    max-width: none;
    margin-left: 0;
    text-align: left;
  }
}

/* Article diagrams (SVG) — moved here from the inline <style> of the
   blog pages, which the site's Content-Security-Policy blocks. */
.diagram-figure {
  margin: 0 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(640px 320px at 50% -4%, rgba(46, 230, 197, 0.10), transparent 70%),
    radial-gradient(640px 360px at 86% 110%, rgba(56, 189, 248, 0.10), transparent 70%),
    #080e1b;
  padding: 22px 18px 14px;
}

.diagram-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-figure figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.diagram-figure .d-title    { fill: #f2f7fe; font: 700 20px system-ui, sans-serif; }
.diagram-figure .d-sub      { fill: #c3d2e6; font: 400 14px ui-monospace, monospace; }
.diagram-figure .d-sub[style] { fill: #ffc2c2; }
.diagram-figure .d-opc      { fill: #7fe9d4; font: 500 14px ui-monospace, monospace; }
.diagram-figure .d-ret      { fill: #bcd0ea; font: 400 14.5px system-ui, sans-serif; }
.diagram-figure .d-dtitle   { fill: #ff8585; font: 700 16.5px system-ui, sans-serif; }
.diagram-figure .d-dtext    { fill: #e6edf6; font: 400 14.5px system-ui, sans-serif; }
.diagram-figure .d-dwarn    { fill: #ffb3b3; font: 400 14.5px system-ui, sans-serif; }
.diagram-figure .d-pilltxt  { fill: #bdeee3; font: 600 15px system-ui, sans-serif; }
.diagram-figure .d-badgetxt { fill: #120a0a; font: 700 18px system-ui, sans-serif; }
