/* ==========================================================================
   MedAmine — article.css (singular views + block editor)
   Prose · article header · takeaways · short answer · TOC · components · block styles
   ========================================================================== */

/* ---------- Article header ---------- */
.article { padding-top: var(--s-6); }
.article-header { margin-bottom: var(--s-6); }
.article-title { font-size: var(--fs-h1); line-height: 1.15; margin: 0 0 var(--s-4); }
.article-dek { font-size: var(--fs-lede); line-height: 1.55; color: var(--c-ink-2); margin: 0 0 var(--s-5); }

.byline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); padding-block: var(--s-4); border-block: 1px solid var(--c-line); }
.byline__photo img, .byline__photo .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.byline__text { flex: 1 1 260px; min-width: 0; }
.byline__text p { margin: 0; line-height: 1.45; }
.byline__author { font-size: var(--fs-small); }
.byline__author a { font-weight: 700; color: var(--c-ink); text-decoration: none; }
.byline__author a:hover { color: var(--c-brand-ink); text-decoration: underline; }
.byline__role { display: block; color: var(--c-ink-3); font-size: var(--fs-xs); }
.byline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .5em; font-size: var(--fs-xs); color: var(--c-ink-3); margin-top: var(--s-1) !important; }
.byline__meta .icon { width: 1em; height: 1em; vertical-align: -0.12em; }
.byline__meta a { color: inherit; }
.byline__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------- Key takeaways ("L'essentiel") ---------- */
.takeaways { margin: var(--s-6) 0; padding: var(--s-5) var(--s-6); background: var(--c-brand-50); border-left: 4px solid var(--c-brand); border-radius: 0 var(--radius) var(--radius) 0; }
.takeaways__title { font-size: 1.125rem; margin: 0 0 var(--s-3); }
.takeaways__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.takeaways__list li { position: relative; padding-left: 1.6em; line-height: 1.55; }
.takeaways__list li::before { content: ""; position: absolute; left: .2em; top: .55em; width: .5em; height: .5em; background: var(--c-brand); border-radius: 2px; }

/* ---------- Featured media ---------- */
.article-media { margin: var(--s-6) 0; }
.article-media img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article-media figcaption, .prose figcaption, .prose .wp-element-caption { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--c-ink-3); line-height: 1.5; }

/* ---------- Short answer ("En bref") ---------- */
.en-bref { margin: var(--s-6) 0; padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.en-bref__label { margin: 0 0 var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-brand-ink); }
.en-bref__text { margin: 0; font-size: 1.0625em; line-height: 1.6; }

/* ---------- TOC (inline) ---------- */
.toc { margin: var(--s-6) 0; border: 1px solid var(--c-line); border-radius: var(--radius); }
.toc summary { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5); cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; }
.toc summary::-webkit-details-marker { display: none; }
.toc__count { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 999px; background: var(--c-brand-50); color: var(--c-brand-ink); font-size: var(--fs-xs); }
.toc__chevron { margin-left: auto; color: var(--c-brand); transition: transform .15s; }
.toc details[open] .toc__chevron { transform: rotate(180deg); }
.toc__list { margin: 0; padding: 0 var(--s-5) var(--s-4) calc(var(--s-5) + 1.2em); display: grid; gap: var(--s-1); font-size: var(--fs-small); }
.toc__list a, .toc-bar__list a { color: var(--c-ink-2); text-decoration: none; line-height: 1.45; display: inline-block; padding: .15em 0; }
.toc__list a:hover, .toc-bar__list a:hover { color: var(--c-brand-ink); text-decoration: underline; }
.toc__list a[aria-current="true"], .toc-bar__list a[aria-current="true"] { color: var(--c-brand-ink); font-weight: 700; }
.toc__list li::marker { color: var(--c-brand); font-weight: 700; }

/* ---------- TOC sticky bar ---------- */
.toc-bar { position: fixed; top: calc(var(--header-h) + 8px); left: 50%; z-index: 40; width: min(100% - 2 * var(--gutter), var(--measure)); transform: translateX(-50%); transition: top .2s ease; }
.admin-bar .toc-bar { top: calc(var(--header-h) + 40px); }
.site-header.is-hidden ~ .site-main .toc-bar { top: 8px; }
.admin-bar .site-header.is-hidden ~ .site-main .toc-bar { top: 40px; }
.toc-bar[hidden] { display: none; }
.toc-bar__inner { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: rgb(255 255 255 / .97); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--fs-small); }
.toc-bar__toggle { display: inline-flex; align-items: center; gap: .3em; padding: .3em .2em; border: 0; background: none; color: var(--c-ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.toc-bar__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.toc-bar__current { flex: 1; min-width: 0; color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-bar__top { display: inline-flex; align-items: center; gap: .3em; padding: .35em .7em; border-radius: var(--radius-sm); color: var(--c-ink-2); text-decoration: none; white-space: nowrap; font-weight: 600; }
.toc-bar__top:hover { background: var(--c-brand-50); color: var(--c-brand-ink); }
.toc-bar__list { margin: var(--s-2) 0 0; padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-5) + 1.2em); max-height: 60vh; overflow-y: auto; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--fs-small); display: grid; gap: var(--s-1); }
.toc-bar__list[hidden] { display: none; }

/* ---------- Prose ---------- */
.prose { font-size: var(--fs-body); line-height: var(--lh-body); }
.prose > * { margin-block: 0 1.4em; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2 { font-size: var(--fs-h2); margin: 2.4em 0 .6em; }
.prose h3 { font-size: var(--fs-h3); margin: 1.9em 0 .5em; line-height: 1.25; }
.prose h4 { font-family: var(--font-body); font-size: var(--fs-h4); margin: 1.6em 0 .4em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose h2 + h3 { margin-top: .8em; }
.prose a { color: inherit; text-decoration: underline; text-decoration-color: var(--c-brand); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
.prose a:hover { color: var(--c-brand-ink); text-decoration-thickness: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--c-brand); }
.prose strong { font-weight: 700; color: var(--c-ink); }
.prose a.btn, .prose .btn { text-decoration: none; }
.prose .kpi__after { color: var(--c-success); }
.prose hr, .prose .wp-block-separator { border: 0; border-top: 1px solid var(--c-line); margin-block: 2.5em; }
.prose img { border-radius: var(--radius-sm); }
.prose figure { margin-inline: 0; }
.prose blockquote:not(.expert-quote blockquote), .prose .wp-block-quote { margin: 2em 0; padding: .2em 0 .2em 1.25em; border-left: 4px solid var(--c-brand); font-family: var(--font-display); font-weight: 600; font-size: 1.0625em; line-height: 1.55; }
.prose .wp-block-quote cite, .prose blockquote cite { display: block; margin-top: .6em; font-family: var(--font-body); font-weight: 400; font-style: normal; font-size: var(--fs-small); color: var(--c-ink-3); }
.prose .wp-block-columns { display: flex; flex-wrap: wrap; gap: var(--s-5); }
.prose .wp-block-column { flex: 1 1 260px; min-width: 0; }
.prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.prose .wp-block-button__link { display: inline-flex; padding: .7em 1.25em; border-radius: 999px; background: var(--c-brand); color: var(--c-white); font-weight: 700; text-decoration: none; }
.prose .wp-block-button__link:hover { background: var(--c-brand-ink); color: var(--c-white); }
.prose .wp-block-embed iframe, .prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius-sm); }
.prose .wp-block-details { border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); }
.prose .wp-block-details summary { cursor: pointer; font-weight: 700; }

/* Code */
.prose code { font-family: var(--font-mono); font-size: .86em; background: #f1eff6; padding: .12em .38em; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre, .prose .wp-block-code { position: relative; font-family: var(--font-mono); font-size: .875rem; line-height: 1.65; background: var(--c-dark); color: #ece8f7; padding: var(--s-5); border-radius: var(--radius); overflow-x: auto; tab-size: 4; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.code-copy { position: absolute; top: var(--s-2); right: var(--s-2); padding: .25em .7em; border: 1px solid rgb(255 255 255 / .2); border-radius: 6px; background: rgb(255 255 255 / .06); color: #ece8f7; font-family: var(--font-body); font-size: var(--fs-xs); cursor: pointer; }
.code-copy:hover { background: rgb(255 255 255 / .14); }

/* Tables */
.prose .wp-block-table { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.5; }
.prose th, .prose td { padding: .7em .9em; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.prose thead th { background: var(--c-surface); font-weight: 700; border-bottom: 2px solid var(--c-line); }

/* ---------- Block style variations ---------- */
.prose .is-style-lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--c-ink-2); }
.prose ul.is-style-check, .prose ul.is-style-cross { list-style: none; padding-left: 0; }
.prose .is-style-check > li, .prose .is-style-cross > li { position: relative; padding-left: 1.9em; }
.prose .is-style-check > li::before, .prose .is-style-cross > li::before { position: absolute; left: 0; top: .05em; display: grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; font-size: .8em; font-weight: 800; }
.prose .is-style-check > li::before { content: "✓"; background: var(--c-success-50); color: var(--c-success); top: .3em; }
.prose .is-style-cross > li::before { content: "✕"; background: var(--c-danger-50); color: var(--c-danger); top: .3em; }
.prose ol.is-style-steps { list-style: none; padding-left: 0; counter-reset: step; }
.prose .is-style-steps > li { position: relative; padding: 0 0 var(--s-4) 3.2em; margin: 0; counter-increment: step; }
.prose .is-style-steps > li::before { content: counter(step); position: absolute; left: 0; top: -.1em; display: grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 50%; background: var(--c-brand); color: var(--c-white); font-family: var(--font-display); font-weight: 700; font-size: .95em; }
.prose .is-style-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 1.05em; top: 2.2em; bottom: .2em; width: 2px; background: var(--c-brand-100); }
.prose .is-style-comparatif table { border: 1px solid var(--c-line); border-radius: var(--radius-sm); overflow: hidden; }
.prose .is-style-comparatif td:first-child, .prose .is-style-comparatif th:first-child { font-weight: 700; background: var(--c-surface); }
.prose .is-style-capture img { border: 1px solid var(--c-line); border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgb(21 18 31 / .06); }
.prose .is-style-encadre { padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.prose .is-style-encadre > *:last-child { margin-bottom: 0; }

/* ---------- Components (blocks) ---------- */
.callout { margin: var(--s-6) 0; padding: var(--s-4) var(--s-5); border-radius: var(--radius-sm); border-left: 4px solid; font-size: .96em; }
.callout__label { display: flex; align-items: center; gap: .45em; margin: 0 0 var(--s-2); font-weight: 700; font-family: var(--font-display); font-size: 1rem; }
.callout__body > *:last-child, .callout__body p:last-child { margin-bottom: 0; }
.callout--tip { background: var(--c-brand-50); border-color: var(--c-brand); }
.callout--tip .callout__label { color: var(--c-brand-ink); }
.callout--note { background: var(--c-surface); border-color: var(--c-ink-3); }
.callout--warning { background: var(--c-warn-50); border-color: var(--c-warn); }
.callout--warning .callout__label { color: var(--c-warn); }
.callout--success { background: var(--c-success-50); border-color: var(--c-success); }
.callout--success .callout__label { color: var(--c-success); }

.plus-loin { margin: var(--s-5) 0; padding: var(--s-3) var(--s-4); border-left: 3px solid var(--c-brand); background: var(--c-surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .96em; }
.plus-loin strong { color: var(--c-brand-ink); }

.expert-quote { margin: var(--s-7) 0; padding: var(--s-5) var(--s-6); border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-line); }
.expert-quote blockquote { margin: 0; font-family: var(--font-display); font-size: 1.1875rem; font-weight: 600; line-height: 1.5; }
.expert-quote blockquote p:last-child { margin-bottom: 0; }
.expert-quote figcaption { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); font-size: var(--fs-small); }
.expert-quote figcaption > span { display: flex; flex-direction: column; }
.expert-quote__photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.expert-quote__name { font-weight: 700; color: var(--c-ink); }
.expert-quote__role { color: var(--c-ink-3); }

.prose .faq { margin-top: 2.4em; }
.prose .faq__title { font-size: var(--fs-h2); }

/* ---------- Article footer ---------- */
.article-footer { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--c-line); display: grid; gap: var(--s-6); }
.sources__title { font-size: 1.125rem; margin-bottom: var(--s-3); }
.sources__list { margin: 0; padding-left: 1.3em; font-size: var(--fs-small); display: grid; gap: var(--s-2); }
.sources__list a { color: var(--c-ink); text-decoration-color: var(--c-brand); }
.sources__publisher { color: var(--c-ink-3); }
.topics__label { margin: 0; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-ink-3); }
.topics .chips { margin-top: var(--s-2); }
.history { font-size: var(--fs-small); color: var(--c-ink-2); }
.history summary { cursor: pointer; font-weight: 700; color: var(--c-ink); }
.history ul { margin: var(--s-3) 0 0; padding-left: 1.2em; }
.disclosure { margin: 0; font-size: var(--fs-xs); color: var(--c-ink-3); font-style: italic; line-height: 1.6; }

.author-box { display: grid; grid-template-columns: 72px 1fr; gap: var(--s-4); padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.author-box__photo img, .author-box__photo .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-box__text p { margin: 0 0 var(--s-2); font-size: var(--fs-small); line-height: 1.6; }
.author-box__label { font-size: var(--fs-xs) !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-brand-ink); }
.author-box__name { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem !important; color: var(--c-ink); margin: 0 !important; }
.author-box__role { color: var(--c-ink-3); }
.related { margin-top: var(--s-8); }
.related .section-title { margin-bottom: var(--s-6); }

/* Case study & service specifics */
.page-hero--case .kpis { margin-bottom: 0; }
.case-study .takeaways { margin-top: var(--s-7); }
.page-article { padding-block: var(--s-6) var(--s-8); }

.page-faq { margin-top: var(--s-7); }
