/* ============================================================
   MBEZORA — Page Article
   ------------------------------------------------------------
   Fichier : assets/css/article.css   (préfixe .ar-)
   Chargé par pages/article.php, APRÈS blog.css.
   Les anciens styles .article-layout, .article-main,
   .article-body… de main.css ne sont plus utilisés.
============================================================ */

.ar-page { --c: var(--blue); }
.ar-page [id] { scroll-margin-top: calc(var(--nav-h, 72px) + 24px); }

/* ============================================================
   BARRE DE PROGRESSION
============================================================ */
.ar-progress {
  position: fixed;
  top: var(--nav-h, 72px); left: 0; right: 0;
  z-index: 999;
  height: 3px;
  pointer-events: none;
}
.ar-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 12px rgba(0,194,255,.6);
}

/* ============================================================
   EN-TÊTE
============================================================ */
.ar-hero { padding: 70px 0 80px; }
.ar-hero.has-cover { padding-bottom: 170px; }
.ar-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(700px 360px at 15% 110%, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%);
  pointer-events: none;
}
.ar-hero .container { position: relative; z-index: 1; }
.ar-hero-inner { max-width: 900px; }

.ar-cat {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-top: 1.5rem;
  padding: .35rem .9rem;
  border-radius: 50px;
  background: var(--c);
  color: #fff;
  font-size: .8rem; font-weight: 700;
  box-shadow: 0 10px 24px -10px var(--c);
  transition: transform .25s;
}
.ar-cat:hover { color: #fff; transform: translateY(-2px); }

.ar-hero h1 {
  margin: 1rem 0 1rem;
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.025em;
  max-width: 24ch;
}
.ar-lead {
  max-width: 62ch;
  color: rgba(226,232,255,.82);
  font-size: 1.15rem;
  line-height: 1.7;
}
.ar-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .75rem 1.6rem;
  margin-top: 1.8rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
  color: rgba(226,232,255,.75);
  font-size: .88rem;
}
.ar-meta i { color: var(--accent); margin-right: .35rem; }
.ar-meta .bp-author-name { color: #fff; font-size: .92rem; }
.ar-meta .bp-author small { display: block; color: rgba(226,232,255,.6); font-size: .76rem; }

/* ---- 404 ---- */
.ar-hero--404 { text-align: center; padding: 100px 0; }
.ar-hero--404 .container { max-width: 760px; }
.ar-hero--404 h1 { margin: .5rem auto 1rem; }
.ar-hero--404 .hm-hero-lead { margin: 0 auto 2rem; }
.ar-404-code {
  display: block;
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), #A78BFA);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ============================================================
   COUVERTURE (image entière sur fond flouté)
============================================================ */
.ar-cover { position: relative; z-index: 2; max-width: 1140px; margin: -130px auto 0; }
.ar-cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  border-radius: 26px;
  background: color-mix(in srgb, var(--c) 20%, #0B1530);
  box-shadow: 0 50px 100px -40px rgba(6,15,38,.65);
  animation: ar-cover-in .9s cubic-bezier(.2,.8,.2,1) .2s both;
}
@keyframes ar-cover-in { from { opacity: 0; transform: translateY(30px) scale(.98); } }
.ar-cover .mb-carousel { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; }
.ar-cover .mb-carousel-track { position: absolute; inset: 0; height: auto; }
.ar-cover .mb-carousel-slide.ar-slide { position: relative; flex: 0 0 100%; min-width: 100%; height: auto; overflow: hidden; }
.ar-cover .ar-slide-bg {
  position: absolute; inset: -30px;
  width: calc(100% + 60px); height: calc(100% + 60px);
  max-width: none;
  object-fit: cover;
  filter: blur(26px) saturate(1.3) brightness(.75);
}
.ar-cover .ar-slide-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: none;
  padding: 14px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.35));
}
.ar-cover .mb-carousel-arrow { z-index: 3; width: 42px; height: 42px; }
.ar-cover .mb-carousel-dots { z-index: 3; bottom: 14px; }
.ar-cover figcaption {
  display: flex; justify-content: flex-end; align-items: center; gap: .4rem;
  margin-top: .6rem;
  color: var(--text-muted);
  font-size: .8rem;
}

/* ============================================================
   MISE EN PAGE : partage | contenu | sommaire
============================================================ */
.ar-layout {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 290px;
  gap: 3rem;
  align-items: start;
  max-width: 1240px;
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}
.ar-main { min-width: 0; max-width: 760px; }

/* ---- Rail de partage ---- */
.ar-rail-inner {
  position: sticky;
  top: calc(var(--nav-h, 72px) + 32px);
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
}
.ar-rail-label {
  margin-bottom: .35rem;
  color: var(--text-muted);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.ar-share {
  --s: var(--blue);
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #fff;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .95rem;
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.ar-share:hover { background: var(--s); border-color: var(--s); color: #fff; transform: translateY(-2px); }
.ar-share:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 2px; }
.ar-share.is-done { background: #16A34A; border-color: #16A34A; color: #fff; }
.ar-share--wide { width: auto; padding: 0 1rem; font-size: .85rem; font-weight: 600; }
.ar-share[hidden] { display: none; }

/* ---- Sommaire (colonne de droite) ---- */
.ar-aside-inner {
  position: sticky;
  top: calc(var(--nav-h, 72px) + 32px);
  display: grid; gap: 1.25rem;
  max-height: calc(100vh - var(--nav-h, 72px) - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.ar-toc {
  padding: 1.35rem;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ar-toc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.ar-toc-head strong { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-size: .92rem; }
.ar-toc-head strong i { color: var(--c); }
.ar-toc-head span { color: var(--c); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ar-toc-track { height: 4px; margin-bottom: 1rem; border-radius: 4px; background: #E6ECF8; overflow: hidden; }
.ar-toc-track i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 4px; transition: width .15s linear; }

.ar-toc-list { display: grid; gap: .1rem; counter-reset: ar-toc; }
.ar-toc-list li.lv2 { counter-increment: ar-toc; }
.ar-toc-list a {
  position: relative;
  display: flex; gap: .6rem;
  padding: .45rem .6rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: .85rem; line-height: 1.4;
  transition: background .2s, color .2s;
}
.ar-toc-list li.lv2 > a::before {
  content: counter(ar-toc, decimal-leading-zero);
  flex-shrink: 0;
  color: color-mix(in srgb, var(--c) 60%, #94A3B8);
  font-size: .75rem; font-weight: 700;
  padding-top: .1rem;
}
.ar-toc-list li.lv3 > a { padding-left: 2.2rem; font-size: .8rem; }
.ar-toc-list a:hover { background: #fff; color: var(--text); }
.ar-toc-list a.is-active { background: #fff; color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--c); }
.ar-toc-list a.is-read:not(.is-active) { color: color-mix(in srgb, var(--text-muted) 70%, #fff); }

.ar-aside-card {
  padding: 1.35rem;
  border-radius: 20px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--c) 10%, #fff), #fff 70%);
  border: 1px solid color-mix(in srgb, var(--c) 25%, var(--border));
}
.ar-aside-ic {
  width: 42px; height: 42px;
  margin-bottom: .8rem;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c);
  color: #fff;
}
.ar-aside-card strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: .35rem; }
.ar-aside-card p { font-size: .85rem; line-height: 1.55; margin-bottom: .75rem; }

/* ---- Sommaire mobile ---- */
.ar-toc-mobile {
  display: none;
  margin-bottom: 2rem;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ar-toc-mobile summary {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.2rem;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.ar-toc-mobile summary::-webkit-details-marker { display: none; }
.ar-toc-mobile summary i { color: var(--c); }
.ar-toc-mobile summary span { margin-left: auto; color: var(--text-muted); font-size: .8rem; font-weight: 500; }
.ar-toc-mobile summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .7rem; color: var(--text-muted); transition: transform .25s; }
.ar-toc-mobile[open] summary::after { transform: rotate(180deg); }
.ar-toc-mobile .ar-toc-list { padding: 0 .75rem 1rem; }

/* ============================================================
   CONTENU DE L'ARTICLE (typographie de lecture)
============================================================ */
.ar-content {
  color: #334155;
  font-size: 1.08rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}
.ar-content > * + * { margin-top: 1.35rem; }
.ar-content p { color: #334155; }
.ar-content > p:first-child::first-letter {
  float: left;
  margin: .35rem .6rem 0 0;
  color: var(--c);
  font-size: 3.6rem;
  font-weight: 800;
  line-height: .85;
}
.ar-content h2 {
  position: relative;
  margin-top: 3rem;
  padding-top: .5rem;
  color: var(--text);
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  line-height: 1.25;
  letter-spacing: -.015em;
}
.ar-content h2::before {
  content: '';
  display: block;
  width: 48px; height: 4px;
  margin-bottom: 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--c), var(--accent));
}
.ar-content h3 { margin-top: 2.25rem; color: var(--text); font-size: 1.25rem; line-height: 1.35; }
.ar-content h4 { margin-top: 1.75rem; color: var(--text); font-size: 1.08rem; }
.ar-content h2 + *, .ar-content h3 + *, .ar-content h4 + * { margin-top: .85rem; }

/* Lien d'ancrage ajouté par article.js */
.ar-anchor {
  margin-left: .5rem;
  color: color-mix(in srgb, var(--c) 50%, #CBD5E1);
  font-size: .8em;
  opacity: 0;
  text-decoration: none !important;
  transition: opacity .2s;
}
.ar-content h2:hover .ar-anchor, .ar-content h3:hover .ar-anchor, .ar-anchor:focus-visible { opacity: 1; }

.ar-content a:not(.ar-anchor) {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue) 35%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.ar-content a:not(.ar-anchor):hover { text-decoration-color: var(--blue); }
.ar-content strong { color: var(--text); }

.ar-content ul, .ar-content ol { padding-left: 1.5rem; }
.ar-content ul { list-style: none; padding-left: .25rem; }
.ar-content ul > li { position: relative; padding-left: 1.6rem; }
.ar-content ul > li::before {
  content: '';
  position: absolute; left: .2rem; top: .72em;
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--c);
  transform: rotate(45deg);
}
.ar-content ol > li::marker { color: var(--c); font-weight: 800; }
.ar-content li + li { margin-top: .5rem; }

.ar-content blockquote {
  position: relative;
  margin-left: 0; margin-right: 0;
  padding: 1.5rem 1.75rem 1.5rem 4rem;
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 8%, #fff), var(--bg));
  border: 1px solid color-mix(in srgb, var(--c) 20%, var(--border));
  color: var(--text);
  font-size: 1.12rem;
  font-style: italic;
}
.ar-content blockquote::before {
  content: '\201C';
  position: absolute; left: 1.1rem; top: .2rem;
  color: var(--c);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
}
.ar-content blockquote p { color: inherit; }

.ar-content img { border-radius: 16px; box-shadow: 0 20px 40px -24px rgba(15,23,42,.35); }
.ar-content figure { margin-left: 0; margin-right: 0; }
.ar-content figcaption { margin-top: .6rem; color: var(--text-muted); font-size: .85rem; text-align: center; }

.ar-content code {
  padding: .15em .45em;
  border-radius: 6px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em;
}
.ar-content pre {
  position: relative;
  overflow-x: auto;
  padding: 1.35rem 1.4rem;
  border-radius: 16px;
  background: #0B1530;
  color: #E2E8FF;
  font-size: .88rem;
  line-height: 1.7;
  box-shadow: 0 20px 40px -24px rgba(6,15,38,.6);
}
.ar-content pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.ar-copy {
  position: absolute; top: .6rem; right: .6rem;
  padding: .3rem .7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #CBD5F5;
  font-family: var(--font-body);
  font-size: .72rem; font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.ar-content pre:hover .ar-copy, .ar-copy:focus-visible { opacity: 1; }
.ar-copy:hover { background: rgba(255,255,255,.18); }
.ar-copy.is-done { background: #16A34A; border-color: #16A34A; color: #fff; opacity: 1; }

.ar-table { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.ar-content table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ar-content th, .ar-content td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.ar-content th { background: var(--bg2); color: var(--text); font-weight: 700; }
.ar-content tr:last-child td { border-bottom: 0; }

.ar-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; }
.ar-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ar-content hr { height: 1px; border: 0; margin: 2.5rem 0; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.ar-empty { padding: 2rem; border: 2px dashed var(--border); border-radius: 16px; text-align: center; }

/* ============================================================
   FIN D'ARTICLE
============================================================ */
.ar-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.ar-tags a {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .8rem;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text-muted);
  font-size: .8rem; font-weight: 600;
  transition: background .2s, color .2s;
}
.ar-tags a i { color: var(--c); font-size: .68rem; }
.ar-tags a:hover { background: var(--c); color: #fff; }
.ar-tags a:hover i { color: #fff; }
.ar-end { display: grid; gap: 1.25rem; margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }

.ar-share-box {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 1.4rem 1.5rem;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ar-share-box strong { display: block; color: var(--text); font-size: 1rem; }
.ar-share-box > div > span { font-size: .88rem; color: var(--text-muted); }
.ar-share-row { display: flex; flex-wrap: wrap; gap: .45rem; }

.ar-author {
  display: flex; align-items: flex-start; gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.ar-author small { display: block; color: var(--text-muted); font-size: .76rem; }
.ar-author strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: .35rem; }
.ar-author p { font-size: .9rem; line-height: 1.6; }

.ar-cta {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.75rem;
  border-radius: 20px;
  color: #fff;
  background:
          radial-gradient(400px 200px at 100% 0%, rgba(0,194,255,.35), transparent 70%),
          linear-gradient(135deg, var(--sv-navy-2, #0A1A42), #0047CC);
}
.ar-cta strong { display: block; color: #fff; font-size: 1.1rem; margin-bottom: .3rem; }
.ar-cta p { color: rgba(226,232,255,.8); font-size: .9rem; max-width: 46ch; }

.ar-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ar-pn-link {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.2rem 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  color: inherit;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.ar-pn-link:hover { color: inherit; border-color: var(--c); transform: translateY(-3px); box-shadow: 0 20px 40px -26px color-mix(in srgb, var(--c) 60%, transparent); }
.ar-pn-link small { color: var(--c); font-size: .78rem; font-weight: 700; }
.ar-pn-link strong { color: var(--text); font-size: .95rem; line-height: 1.4; }
.ar-pn-link--next { text-align: right; grid-column: 2; }

/* ============================================================
   À LIRE ENSUITE
============================================================ */
.ar-related { padding: 90px 0 30px; background: var(--bg); }
.ar-related .container { max-width: 1320px; }
.ar-related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.ar-related-title { color: var(--text); font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1.75rem; }
.ar-related-head .ar-related-title { margin-bottom: 0; }
.ar-related + .bp-nl-section { background: var(--bg); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1180px) {
  .ar-layout { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
  .ar-rail, .ar-aside { display: none; }
  .ar-main { max-width: none; }
  .ar-toc-mobile { display: block; }
}
@media (max-width: 640px) {
  .ar-hero { padding: 50px 0 60px; }
  .ar-hero.has-cover { padding-bottom: 110px; }
  .ar-lead { font-size: 1.02rem; }
  .ar-meta { gap: .6rem 1.1rem; font-size: .82rem; }
  .ar-cover { margin-top: -80px; }
  .ar-cover-frame { aspect-ratio: 4 / 3; border-radius: 18px; }
  .ar-cover .ar-slide-img { padding: 8px; }

  .ar-layout { padding-top: 2.25rem; padding-bottom: 3.5rem; }
  .ar-content { font-size: 1.02rem; line-height: 1.8; }
  .ar-content > p:first-child::first-letter { font-size: 3rem; }
  .ar-content blockquote { padding: 1.25rem 1.25rem 1.25rem 3rem; font-size: 1.02rem; }
  .ar-content blockquote::before { left: .75rem; font-size: 3rem; }
  .ar-copy { opacity: 1; }

  .ar-author { flex-direction: column; gap: .75rem; }
  .ar-cta .btn { width: 100%; justify-content: center; }
  .ar-pn { grid-template-columns: 1fr; }
  .ar-pn-link--next { grid-column: auto; }
  .ar-related { padding: 60px 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-page *, .ar-page *::before, .ar-page *::after { animation: none !important; transition: none !important; }
}