/* Single blog post — redesigned hero (own component, not a change to the
   shared page-hero.njk/css/js used by Portfolio elsewhere) + a genuinely
   sticky right-side menu + typographic polish on the body. */

/* Hero: real cover image full-bleed, a dark gradient overlay for
   legibility, height driven by real content + padding (not a fixed tall
   box) — "optimiser l'espace" means no empty box taller than the title
   actually needs. */
.single-blog-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 152px 24px 72px;
  background-size: cover;
  background-position: center;
  background-color: #0b0714;
  overflow: hidden;
  text-align: center;
}

.single-blog-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 2, 10, 0.45) 0%, rgba(3, 2, 10, 0.72) 55%, #030208 100%);
}

/* No cover image: same brand-tinted wash used elsewhere on the site
   (.ai-hub-identity's own background), never a plain empty black box. */
.single-blog-hero--no-image .single-blog-hero__overlay {
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(63, 123, 248, 0.22), transparent 60%),
    radial-gradient(120% 100% at 80% 100%, rgba(184, 107, 248, 0.18), transparent 60%),
    #0b0714;
}

.single-blog-hero__content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.single-blog-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-satoshi);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* Same pill recipe as .blog-filtergroup__btn (blog.css): tinted at rest
   with the topic's own --theme-color rather than plain white/grey, so the
   badge reads as colored from the first frame, not just on interaction
   (there's nothing to hover/select here — it's a static label). */
.single-blog-hero__badge {
  padding: 4px 12px;
  border: 1.5px solid var(--theme-color, rgba(255, 255, 255, 0.4));
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-color, rgba(255, 255, 255, 0.4)) 18%, transparent);
  color: #fff;
}

.single-blog-hero__title {
  margin: 0;
  font-family: var(--font-satoshi);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.25;
  color: #fff;
  text-wrap: balance;
}

@media (min-width: 640px) {
  .single-blog-hero__title {
    font-size: 38px;
  }
}

@media (min-width: 1024px) {
  .single-blog-hero__title {
    font-size: 46px;
  }
}

.single-blog-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .single-blog-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.single-blog-body {
  flex: 1;
  min-width: 0;
}

.single-blog-body p {
  font-family: var(--font-satoshi);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 20px;
}

.single-blog-body section {
  padding-top: 48px;
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.single-blog-body section:first-of-type {
  border-top: none;
}

.single-blog-body h2 {
  font-family: var(--font-satoshi);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 20px;
}

.single-blog-body img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  margin: 32px 0;
}

.single-blog-aside {
  width: 100%;
  border-left: none;
  border-top: 1px solid #4f4f4f;
  padding-top: 24px;
}

@media (min-width: 1024px) {
  .single-blog-aside {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid #4f4f4f;
    border-top: none;
    padding-top: 0;
    padding-left: 24px;
    /* Genuinely sticky (explicit direction: "le menu sur la droite qui
       reste même quand on scroll") — same top offset as every other
       sticky column on the site (page-split.css's --page-split-intro
       --sticky). Capped + scrollable so a long TOC never runs off-screen
       on a short viewport instead of just disappearing past the fold. */
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }
}

.single-blog-aside__block {
  padding: 24px 0;
  border-bottom: 1px solid #4f4f4f;
}

.single-blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.single-blog-share button,
.single-blog-share a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0.5px solid rgba(255, 255, 255, 0.68);
  background: rgb(21, 24, 55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.2s, transform 0.15s ease;
}

.single-blog-share button:hover,
.single-blog-share a:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* Real, working share links (js/share.js opens the actual sharer URLs) —
   each network's own official brand color, not the generic neutral chip
   every button used to share. Copy-link stays neutral (no brand color of
   its own). */
.single-blog-share [data-share-facebook] {
  background: #1877f2;
  border-color: #1877f2;
}

.single-blog-share [data-share-linkedin] {
  background: #0a66c2;
  border-color: #0a66c2;
}

/* Official X brand treatment (black + white glyph) — the icon itself is
   already the X logo, not the old Twitter bird. */
.single-blog-share [data-share-twitter] {
  background: #000;
  border-color: rgba(255, 255, 255, 0.3);
}

.single-blog-share svg {
  width: 18px;
  height: 18px;
}

/* Real styling at last — .blog-tag/.blog-card__tags were rendered here
   with zero CSS behind them (this page never loaded blog.css, the only
   stylesheet that ever defined them), so they showed as plain unstyled
   inline text with a stray inline border-color and nothing else. Same
   per-topic colored-border DA as the Blog index's own filter/card tags
   now (--theme-color set inline from themeMeta.colors, see blog-post.njk
   and pages/blogs.njk) — one consistent tag language across both pages. */
.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-tag {
  display: inline-flex;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--theme-color, rgba(255, 255, 255, 0.4));
  border-radius: 9999px;
  font-family: var(--font-satoshi);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.toc {
  padding: 24px 0;
}

.toc a {
  display: block;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-satoshi);
  font-size: 14px;
  color: #9ca3af;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.toc a.is-active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #60a5fa;
}
