/* Pages article du blog — complète blog.css et blog-index.css (tokens .bx) */
.ba { padding-bottom: 96px; }

/* ---------- Barre de progression ---------- */
.ba-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.ba-progress span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--gold, #c7a16a), #e9d6b6);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- Hero immersif ---------- */
.ba-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  display: flex; flex-direction: column;
  background: var(--indigo);
}
.ba-hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.ba-hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; color: transparent;
  transform: scale(1.08); animation: ba-zoom 2.4s var(--ease) .1s forwards;
}
@keyframes ba-zoom { to { transform: scale(1); } }
/* Voile indigo : lisibilité du texte en bas à gauche, photo visible à droite */
.ba-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(14, 20, 36, .97) 0%, rgba(14, 20, 36, .9) 45%, rgba(14, 20, 36, .7) 75%, rgba(14, 20, 36, .6) 100%);
}
/* Grain de toile par-dessus la photo */
.ba-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ba-hero-inner { display: flex; flex-direction: column; padding-top: 16px; padding-bottom: 52px; }
.ba-hero .bx-crumbs { margin-bottom: 0; flex-wrap: wrap; }
.ba-hero-grid { padding-top: 20px; padding-top: clamp(16px, 4svh, 48px); display: grid; grid-template-columns: 1fr; gap: 32px; align-items: end; }

.ba-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ba-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px; color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ba-chip.gold { color: var(--ink); background: var(--gold-soft); border-color: transparent; }

.ba-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.5rem); font-size: clamp(1.875rem, min(6vw, 7.5svh), 4.5rem);
  line-height: 1.02; letter-spacing: -.03em;
  margin: clamp(12px, 2.4svh, 22px) 0; max-width: 16ch; font-variation-settings: "opsz" 144;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .25);
}
.ba-title em { font-style: italic; font-weight: 300; color: var(--gold); }
.ba-dek { font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.65; color: rgba(255, 255, 255, .8); max-width: 56ch; }

.ba-hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 28px; margin-top: clamp(18px, 3.5svh, 32px); }
.ba-byline { display: flex; align-items: center; gap: 14px; }
.ba-byline strong { display: block; font-size: .9375rem; font-weight: 600; }
.ba-byline > div > span { display: flex; align-items: center; gap: 10px; font-size: .8125rem; color: rgba(255, 255, 255, .65); margin-top: 2px; }
.ba-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem;
  color: var(--ink); background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}
.ba-start {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .9375rem; font-weight: 600; color: #fff;
  padding: 6px 6px 6px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .3s, border-color .3s;
}
.ba-start span {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--ink); transition: transform .35s var(--ease);
}
.ba-start:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); }
.ba-start:hover span { transform: translateY(3px); }

/* Carte « Dans cet article » */
.ba-glance {
  padding: 22px; border-radius: 20px;
  background: rgba(16, 24, 42, .45); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.ba-glance-title { display: block; font-size: .7188rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 8px; }
.ba-glance ul { list-style: none; margin: 0; padding: 0; }
.ba-glance li + li { border-top: 1px dashed rgba(255, 255, 255, .14); }
.ba-glance li a { display: flex; align-items: center; gap: 16px; padding: 12px 0; color: rgba(255, 255, 255, .85); transition: color .2s; }
.ba-glance li a:hover { color: #fff; }
.ba-glance li strong {
  font-family: var(--serif); font-weight: 400; font-size: 2.25rem; line-height: 1; min-width: 1.1ch;
  color: var(--gold);
}
.ba-glance li span { font-size: .9375rem; line-height: 1.4; }
.ba-glance-more {
  display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .14); font-size: .875rem; font-weight: 600; color: #fff;
}
.ba-glance-more i { transition: transform .3s var(--ease); }
.ba-glance-more:hover i { transform: translateX(4px); }
.ba-hero a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 12px; }

/* Entrée en douceur */
.ba-hero-text > *, .ba-glance { animation: ba-rise .9s var(--ease) both; }
.ba-hero-text > :nth-child(2) { animation-delay: .08s; }
.ba-hero-text > :nth-child(3) { animation-delay: .16s; }
.ba-hero-text > :nth-child(4) { animation-delay: .24s; }
.ba-glance { animation-delay: .32s; }
@keyframes ba-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Mise en page ---------- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.ba-layout { display: grid; grid-template-columns: 1fr; gap: 32px; padding-top: 56px; }

.ba-toc details { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px; }
.ba-toc summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #a07d48;
}
.ba-toc summary::-webkit-details-marker { display: none; }
.ba-toc summary::after { content: "\ea4e"; font-family: remixicon; font-size: 1.125rem; letter-spacing: 0; transition: transform .3s; }
.ba-toc details[open] summary::after { transform: rotate(180deg); }
.ba-toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0 0 14px; display: flex; flex-direction: column; gap: 2px; }
.ba-toc li { counter-increment: toc; }
.ba-toc a {
  display: flex; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: 10px;
  font-size: .875rem; line-height: 1.45; color: var(--ink-2); transition: background .2s, color .2s;
}
.ba-toc a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; color: #b9ad98; font-size: .75rem; padding-top: 2px; }
.ba-toc a:hover { background: var(--cream); color: var(--ink); }
.ba-toc a.is-active { color: var(--ink); background: rgba(199, 161, 106, .12); }
.ba-toc a.is-active::before { color: #a07d48; }

/* ---------- Contenu ---------- */
.ba-content { min-width: 0; max-width: 700px; font-size: 1.0625rem; color: var(--ink-2); }
.ba-content > * + * { margin-top: 1.25em; }
.ba-content p { line-height: 1.8; }
.ba-content a { color: #8a6a3a; text-decoration: underline; text-decoration-color: rgba(199, 161, 106, .5); text-underline-offset: 3px; }
.ba-content a:hover { text-decoration-color: currentColor; }
.ba-content strong { color: var(--ink); font-weight: 600; }
.ba-lead { font-size: 1.1875rem; line-height: 1.75; color: var(--ink); }
.ba-lead::first-letter {
  float: left; font-family: var(--serif); font-size: 4.1em; line-height: .82; font-weight: 400;
  margin: .06em .1em 0 0; color: var(--gold);
}
.ba-content h2 {
  font-family: var(--serif); font-weight: 450; color: var(--ink);
  font-size: clamp(1.625rem, 3vw, 2.125rem); line-height: 1.15; letter-spacing: -.02em;
  margin-top: 2.4em; scroll-margin-top: 110px;
}
.ba-content h2::before {
  content: ""; display: block; width: 44px; height: 0; margin-bottom: 18px;
  border-top: 2px dashed var(--gold);
}
.ba-content h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); font-size: 1.3125rem; line-height: 1.3; margin-top: 1.8em; }
.ba-content h2 + p, .ba-content h3 + p { margin-top: .75em; }

/* Encadré astuce */
.ba-note {
  display: flex; gap: 16px; padding: 22px 22px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(199, 161, 106, .12), rgba(199, 161, 106, .05));
  border: 1px solid rgba(199, 161, 106, .3);
}
.ba-note-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: var(--gold); color: #fff;
}
.ba-note strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.ba-note p { font-size: .9688rem; line-height: 1.7; }

/* Les 3 stades */
.ba-stages { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ba-stages li {
  display: flex; gap: 18px; padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
}
.ba-stage-num {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.25rem; color: #fff;
  background:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 4px),
    linear-gradient(140deg, #22385a, #0f1c31);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(199, 161, 106, .5);
}
.ba-stages li:nth-child(2) .ba-stage-num { background: repeating-linear-gradient(118deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 4px), linear-gradient(140deg, #4b6a94, #2c4468); }
.ba-stages li:nth-child(3) .ba-stage-num { background: repeating-linear-gradient(118deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 4px), linear-gradient(140deg, #a9bcd6, #7d97bb); }
.ba-stages h3 { margin: 4px 0 6px; font-size: 1.1875rem; }
.ba-stages p { font-size: .9688rem; line-height: 1.7; }

/* Tableau */
.ba-table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.ba-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .9375rem; }
.ba-table th, .ba-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ba-table thead th { font-size: .7188rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--cream); }
.ba-table tbody th { font-weight: 600; color: var(--ink); }
.ba-table tbody tr:last-child > * { border-bottom: 0; }
.ba-pill { display: inline-block; white-space: nowrap; font-size: .8125rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; }
.ba-pill.ok { color: #2f5a3a; background: #e5f1e7; }
.ba-pill.mid { color: #7a5b25; background: #f6ecd9; }
.ba-pill.style { color: #24406a; background: #e4ebf6; }

/* Citation */
.ba-quote { margin: 2.2em 0; padding: 8px 0 8px 28px; border-left: 3px solid var(--gold); }
.ba-quote blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.4; color: var(--ink); }
.ba-quote figcaption { margin-top: 12px; font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #a07d48; }

/* Étapes numérotées */
.ba-steps { list-style: none; counter-reset: step; padding: 0; position: relative; }
.ba-steps li { counter-increment: step; position: relative; padding: 0 0 22px 56px; line-height: 1.75; }
.ba-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1rem; color: var(--ink); background: var(--gold-soft);
}
.ba-steps li::after {
  content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px;
  border-left: 2px dashed rgba(199, 161, 106, .45);
}
.ba-steps li:last-child { padding-bottom: 0; }
.ba-steps li:last-child::after { display: none; }

/* Listes */
.ba-list, .ba-checklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ba-list li { position: relative; padding-left: 26px; line-height: 1.75; }
.ba-list li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.ba-checklist { padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.ba-checklist li { position: relative; padding-left: 36px; line-height: 1.65; }
.ba-checklist li::before {
  content: "\eb7b"; font-family: remixicon; position: absolute; left: 0; top: -1px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .875rem;
  color: #fff; background: var(--indigo-2);
}

/* FAQ */
.ba-faq { display: flex; flex-direction: column; gap: 10px; }
.ba-faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: border-color .25s, box-shadow .25s; }
.ba-faq details[open] { border-color: rgba(199, 161, 106, .5); box-shadow: var(--shadow-sm); }
.ba-faq summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; font-weight: 600; color: var(--ink); font-size: 1rem;
}
.ba-faq summary::-webkit-details-marker { display: none; }
.ba-faq summary::after {
  content: "\ea13"; font-family: remixicon; font-weight: 400; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); color: #8a6a3a; transition: transform .3s, background .3s;
}
.ba-faq details[open] summary::after { transform: rotate(45deg); background: var(--gold-soft); }
.ba-faq details p { padding: 0 20px 20px; font-size: .9688rem; line-height: 1.75; }
.ba-faq summary:focus-visible, .ba-toc summary:focus-visible, .ba-share a:focus-visible, .ba-share button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 12px; }

/* En bref */
.ba-summary {
  margin-top: 2.6em !important; padding: 28px; border-radius: 20px; color: #fff;
  background:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(28deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    linear-gradient(140deg, #22385a, #0f1c31);
  position: relative; isolation: isolate;
}
.ba-summary::after {
  content: ""; position: absolute; inset: 8px; z-index: -1; pointer-events: none;
  border: 1.5px dashed rgba(214, 170, 105, .6); border-radius: 14px;
}
.ba-content .ba-summary h2 { color: #fff; margin-top: 0; font-size: 1.5rem; }
.ba-content .ba-summary h2::before { display: none; }
.ba-summary p { color: rgba(255, 255, 255, .82); margin-top: 10px; }

/* Partage */
.ba-share {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 2.4em !important; padding-top: 24px; border-top: 1px solid var(--line);
}
.ba-content .ba-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; color: var(--ink); text-decoration: none; }
.ba-content .ba-back:hover i { transform: translateX(-3px); }
.ba-back i { transition: transform .3s; }
.ba-share-links { display: flex; align-items: center; gap: 8px; }
.ba-share-links span { font-size: .8125rem; color: var(--muted); margin-right: 4px; }
.ba-share-links a, .ba-share-links button {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.0625rem;
  color: var(--ink); background: #fff; border: 1px solid var(--line); text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.ba-share-links a:hover, .ba-share-links button:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.ba-share-links button.is-done { background: #2f5a3a; color: #fff; border-color: #2f5a3a; }

/* ---------- Responsive ---------- */
@media (max-width: 639px) {
  .ba-glance { display: none; }
  /* Sur téléphone, le bouton passe avant l'auteur pour rester visible sans défiler */
  .ba-start { order: -1; }
  .ba-hero-foot { flex-direction: column; align-items: flex-start; }
}
/* Écrans bas (téléphones compacts, paysage, petits portables) : on compacte le texte */
@media (max-height: 760px) {
  .ba-dek { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; }
  .ba-chips { gap: 6px; }
  .ba-chip { padding: 5px 10px; font-size: .6875rem; }
}
@media (max-height: 620px) and (max-width: 639px) {
  .ba-dek { -webkit-line-clamp: 2; }
  .ba-hero-foot .ba-byline { display: none; }
}
/* Téléphone en paysage : titre + bouton seulement */
@media (max-height: 500px) {
  .ba-dek, .ba-hero-foot .ba-byline { display: none; }
  .ba-hero-inner { padding-bottom: 44px; }
}
@media (min-width: 640px) {
  .ba-stages li, .ba-checklist, .ba-note { padding: 24px 26px; }
  .ba-summary { padding: 36px 40px; }
}
@media (min-width: 900px) {
  .ba-hero-inner { padding-top: 24px; padding-bottom: 64px; }
  .ba-hero-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; }
  .ba-hero::before {
    background:
      linear-gradient(0deg, rgba(14, 20, 36, .95) 0%, rgba(14, 20, 36, .55) 38%, rgba(14, 20, 36, .1) 70%, rgba(14, 20, 36, .5) 100%),
      linear-gradient(90deg, rgba(14, 20, 36, .85) 0%, rgba(14, 20, 36, .35) 50%, transparent 75%);
  }
  .ba-layout { padding-top: 88px; }
}
@media (min-width: 1024px) {
  .ba-layout { grid-template-columns: 250px minmax(0, 700px); justify-content: center; gap: 72px; }
  .ba-toc { position: sticky; top: 112px; align-self: start; }
  .ba-toc details { background: transparent; border: 0; padding: 0; }
  .ba-toc summary { pointer-events: none; padding-top: 4px; }
  .ba-toc summary::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ba-progress { display: none; }
  .ba-hero-media img { animation: none; transform: none; }
  .ba-hero-text > *, .ba-glance { animation: none; }
}

/* ---------- À lire aussi ---------- */
.ba-related { margin-top: 2.4em !important; }
.ba-content .ba-related-card {
  display: flex; align-items: center; gap: 18px; padding: 12px; margin-top: 10px;
  border-radius: 18px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
.ba-related-card img { width: 112px; height: 84px; flex-shrink: 0; object-fit: cover; border-radius: 12px; color: transparent; background: #e9e4da; }
.ba-related-card div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ba-related-card strong { font-family: var(--serif); font-weight: 450; font-size: 1.125rem; line-height: 1.3; }
.ba-related-card > i {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--cream); color: var(--ink);
  transition: background .3s, color .3s, transform .35s var(--ease);
}
.ba-content .ba-related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.ba-related-card:hover > i { background: var(--gold); color: #fff; transform: rotate(45deg); }
@media (max-width: 479px) {
  .ba-related-card img { width: 84px; height: 72px; }
  .ba-related-card > i { display: none; }
}
