/* =============================================================
   SINGLE-BLOG.CSS — Article de blog, layout Bruzzo
   Hero, featured image, sidebar (auteur + TOC + CTA),
   contenu principal (680px), responsive
   ============================================================= */

/* ----- HERO ARTICLE ----- */
.blog-hero {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 80px 5% 60px;
}

/* Breadcrumb dans le hero : reset du padding global de base.css */
.blog-hero .breadcrumb {
  padding: 0;
  max-width: none;
  margin: 0 0 24px;
}

.blog-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-primary);
  margin-bottom: 24px;
  max-width: 800px;
}
.blog-hero .accroche {
  font-size: 1.2rem;
  line-height: 1.5;
  max-width: 700px;
  color: var(--color-text);
}
.blog-hero .meta {
  margin-top: 20px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-secondary);
}
.blog-hero .meta .updated {
  color: var(--color-accent-dark);
  font-weight: 600;
}

/* ----- FEATURED IMAGE ----- */
.featured-image {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 5% 48px;
}
.featured-image img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
  background: var(--color-border);
}

/* ----- LAYOUT BRUZZO (220px sidebar + contenu) ----- */
.content-layout {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 5% 60px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}

/* ----- SIDEBAR ----- */
.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  margin-bottom: 12px;
}

/* Auteur */
.author-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.author-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
}
.author-card .author-info { line-height: 1.3; }
.author-card .author-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
  display: block;
}
.author-card .author-name:hover { color: var(--color-accent-dark); }
.author-card .author-role {
  font-size: 0.72rem;
  color: var(--color-secondary);
}

/* ----- TOC ----- */
.toc-wrapper {
  position: relative;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.toc-wrapper::-webkit-scrollbar { width: 3px; }
.toc-wrapper::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.toc {
  list-style: none;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  line-height: 1.3;
  border-left: 2px solid var(--color-border);
  padding-left: 12px;
}
.toc-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 20px;
  background: var(--color-accent-dark);
  transition: top 0.25s ease, height 0.25s ease;
  z-index: 1;
}
.toc li { padding: 7px 0; }
.toc li a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: block;
  line-height: 1.35;
}
.toc li a:hover {
  color: var(--color-accent-dark);
  transform: translateX(4px);
}

/* H3 items : collapsés par défaut, visibles dans le groupe actif */
.toc .toc-h3 {
  padding-left: 14px;
  position: relative;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}
.toc .toc-h3.toc-h3-visible {
  max-height: 3em;
  opacity: 1;
  padding-top: 7px;
  padding-bottom: 0;
}
.toc .toc-h3 a {
  font-size: 0.77rem;
  color: var(--color-text);
}
.toc .toc-h3::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-border);
  transform: translateY(-50%);
}

/* TOC active */
.toc li.is-active > a {
  color: var(--color-accent-dark);
  font-weight: 600;
}
.toc .toc-h3.is-active > a {
  color: var(--color-accent-dark);
  font-weight: 500;
}
.toc .toc-h3.is-active::before {
  background: var(--color-accent-dark);
}

/* ----- CONTENU PRINCIPAL ----- */
.main-content { max-width: 700px; }
.main-content h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 56px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.main-content h2:first-child { margin-top: 0; }
.main-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 40px;
  margin-bottom: 12px;
}
.main-content p {
  font-size: 1.1rem;
  line-height: 1.65;
  margin-bottom: 18px;
}
.main-content ul,
.main-content ol {
  font-size: 1.1rem;
  line-height: 1.65;
  margin-bottom: 18px;
  padding-left: 1.5em;
}
.main-content li { margin-bottom: 6px; }
/* Les liens de PROSE, pas les boutons. `.main-content a` (0,1,1) bat `.btn`
   (0,1,0) : tout bouton placé dans le corps de l'article héritait donc du bleu
   souligné du lien courant, au lieu du blanc sur fond noir. Invisible sur
   desktop, où `.mobile-cta` est en display:none — le défaut ne se voyait qu'en
   dessous de 1024px, sur le CTA « Prendre rendez-vous » de fin d'article.
   `[class~="btn"]` couvre toutes les variantes : btn--full, btn--outline,
   btn--inverse, sidebar-cta. Signalé par RM le 2026-08-09 sur capture mobile. */
.main-content a:not([class~="btn"]) {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.main-content a:not([class~="btn"]):hover { text-decoration: none; }

/* CTA mobile */
.mobile-cta { display: none; }

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 180px 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .blog-hero { padding: 48px 5% 32px; }
  .content-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sidebar {
    position: static;
    order: -1;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 32px;
  }
  .sidebar-cta { display: none; }

  /* TOC collapsible en mobile */
  .sidebar-section[aria-label] .toc-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .sidebar-section[aria-label] .sidebar-section-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-section[aria-label] .sidebar-section-title::after {
    content: '+';
    font-size: 1rem;
    color: var(--color-secondary);
    transition: transform 0.2s ease;
  }
  .sidebar-section[aria-label].is-open .sidebar-section-title::after {
    content: '-';
  }
  .sidebar-section[aria-label].is-open .toc-wrapper {
    max-height: 500px;
  }

  /* CTA mobile visible */
  .mobile-cta {
    display: block;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 480px) {
  .blog-hero h1 { font-size: 1.75rem; }
  .blog-hero .accroche { font-size: 1.05rem; }
  .featured-image { padding-bottom: 32px; }
  .mobile-cta { margin-top: 40px; }
}
