/*
 * Mise en forme des articles de blog — Presta Web 360.
 * Chargé uniquement sur les articles (inc/single.php).
 * Les classes pw-* sont posées dans le contenu de l'article.
 */

.single-post .entry-content {
	--pw-bleu: var(--global-color-bleu, #1da7e0);
	--pw-bleu-soft: #eaf7fe;
	--pw-bleu-ink: #0b4f6e;
	--pw-bleu-a11y: #0a76a6; /* bleu du site assombri : contraste 5:1 avec le blanc (WCAG AA) */
	--pw-line: #e6e8ec;
	--pw-muted: #6b7280;
	--pw-radius: 14px;
	--pw-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 17px;
	line-height: 1.75;
}

.single-post .entry-content > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.single-post .entry-content h2 { font-weight: 800; font-size: 30px; line-height: 1.2; letter-spacing: -.02em; margin: 56px auto 16px; scroll-margin-top: 100px; }
.single-post .entry-content h3 { font-weight: 700; font-size: 21px; line-height: 1.3; margin: 36px auto 10px; scroll-margin-top: 100px; }
.single-post .entry-content a { color: var(--pw-bleu-a11y); text-underline-offset: 3px; }
.single-post .entry-content code { font-family: var(--pw-mono); font-size: .88em; background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }

/* Encadré « À retenir » */
.pw-tldr { background: var(--pw-bleu-soft); border: 1px solid #d6eefb; border-left: 4px solid var(--pw-bleu); border-radius: var(--pw-radius); padding: 22px 24px; margin-bottom: 32px; }
.pw-tldr p { margin: 0; }
.pw-tldr ul { margin: 0; padding-left: 20px; }
.pw-tldr li { margin: 4px 0; }
.pw-tldr__title,
.pw-toc__title { font: 500 12px/1 var(--pw-mono); letter-spacing: .06em; text-transform: uppercase; color: #0c6a94; margin-bottom: 10px !important; }

/* Sommaire */
.pw-toc { border: 1px solid var(--pw-line); border-radius: var(--pw-radius); padding: 20px 24px; margin: 32px auto; background: #fff; }
.pw-toc ol { margin: 0; padding-left: 20px; }
.pw-toc li { margin: 4px 0; }
.pw-toc a { color: inherit !important; text-decoration: none; }
.pw-toc a:hover { color: var(--pw-bleu-a11y) !important; }

/* Tableaux : défilement horizontal sur mobile */
.pw-table { overflow-x: auto; margin: 24px auto; border: 1px solid var(--pw-line); border-radius: 10px; }
.pw-table table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 0; border: 0; font-size: 15px; line-height: 1.5; }
.pw-table th { background: #f7f8f9; text-align: left; font-weight: 700; }
.pw-table th, .pw-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--pw-line); vertical-align: top; }
.pw-table tr:last-child td { border-bottom: 0; }
.pw-table td:first-child { font-weight: 600; white-space: nowrap; }
.pw-table caption { caption-side: top; text-align: left; padding: 12px 14px; font: 500 12px/1.4 var(--pw-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--pw-muted); border-bottom: 1px solid var(--pw-line); }

/* Images : dimensions fixes pour éviter les décalages (CLS) */
.pw-figure { margin: 32px auto; }
.pw-figure a { display: block; border: 1px solid var(--pw-line); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.pw-figure img { display: block; width: 100%; height: auto; }
.pw-figure figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--pw-muted); text-align: center; }

/* Appels à l'action */
.pw-cta { background: #0b2a3a; color: #fff; border-radius: var(--pw-radius); padding: 32px; margin: 40px auto; }
.pw-cta p { margin: 0 0 8px; }
.pw-cta__kicker { font: 500 12px/1 var(--pw-mono); letter-spacing: .06em; text-transform: uppercase; color: #7fd3f5; margin-bottom: 12px !important; }
.pw-cta__title { font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.pw-cta__list { list-style: none; padding: 0; margin: 16px 0 24px; }
.pw-cta__list li { position: relative; padding-left: 28px; margin: 8px 0; color: #d7e6ee; }
.pw-cta__list li::before { content: "✓"; position: absolute; left: 0; color: #7fd3f5; font-weight: 700; }
.pw-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pw-cta--inline { background: var(--pw-bleu-soft); color: inherit; border: 1px solid #d6eefb; padding: 24px; }
.pw-cta--inline .pw-cta__title { font-size: 19px; }
.pw-cta--inline p:not(.pw-cta__title) { color: #3f4b55; margin-bottom: 16px; }

.single-post .entry-content .pw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 8px; background: var(--pw-bleu-a11y); color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; transition: background-color .15s ease; }
.single-post .entry-content .pw-btn::after { content: "→"; }
.single-post .entry-content .pw-btn:hover { background: #085f86; }
.single-post .entry-content .pw-btn:focus-visible { outline: 3px solid #7fd3f5; outline-offset: 2px; }
.single-post .entry-content .pw-btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.single-post .entry-content .pw-btn--ghost::after { content: none; }
.single-post .entry-content .pw-btn--ghost:hover { background: rgba(255,255,255,.08); }

/* Encadré d'alerte */
.pw-callout { background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #f97316; border-radius: 10px; padding: 16px 20px; margin: 24px auto; }
.pw-callout p { margin: 0; }

/* Liste de contrôle */
.pw-checklist { list-style: none; padding: 0; }
.pw-checklist li { position: relative; padding-left: 32px; margin: 10px 0; }
.pw-checklist li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 5px; background: var(--pw-bleu-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231da7e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border: 1px solid #bfe6f8; }

/* Sources */
.pw-sources { font-size: 15px; color: var(--pw-muted); }
.pw-sources a { font-weight: 600; }

/* FAQ */
.pw-faq h3 { font-size: 18px; padding-top: 20px; border-top: 1px solid var(--pw-line); }
.pw-faq h3:first-child { border-top: 0; padding-top: 0; }

@media (max-width: 600px) {
	.single-post .entry-content { font-size: 16px; }
	.single-post .entry-content h2 { font-size: 24px; margin-top: 44px; }
	.single-post .entry-content h3 { font-size: 19px; }
	.pw-tldr, .pw-toc { padding: 18px; }
	.pw-cta { padding: 24px 20px; }
	.pw-cta__title { font-size: 21px; }
	.pw-cta__actions .pw-btn { width: 100%; }
}

/* ------------------------------------------------------------------
 * Gabarit d'article (template-parts/single-post.php)
 * ------------------------------------------------------------------ */

.pw-article-area {
	width: 100%;
	background: var(--base-3, #fff);
	--pw-line: #e6e8ec;
	--pw-muted: #6b7280;
	--pw-bleu: var(--global-color-bleu, #1da7e0);
	--pw-bleu-a11y: #0a76a6;
	--pw-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pw-article-area a { text-decoration: none; }
.pw-article-area .entry-content a { text-decoration: underline; }
.pw-article-area .entry-content .pw-btn,
.pw-article-area .entry-content .pw-toc a { text-decoration: none; }

.pw-art { max-width: 1132px; margin: 0 auto; padding: 40px 16px 0; }

/* En-tête */
.pw-crumb { font-size: 14px; color: var(--pw-muted); margin-bottom: 16px; }
.pw-crumb a { color: inherit; }
.pw-crumb a:hover { color: var(--pw-bleu-a11y); }
.pw-art__cat { display: inline-block; font: 500 12px/1 var(--pw-mono); letter-spacing: .06em; text-transform: uppercase; color: #0c6a94; background: #eaf7fe; padding: 6px 10px; border-radius: 999px; }
.pw-art__title { max-width: 820px; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 14px 0 16px; text-wrap: balance; }
.pw-byline { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--pw-muted); margin: 0; }
.pw-byline a { color: var(--contrast, #222); font-weight: 700; }
.pw-byline__av { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.pw-art__feat { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 14px; border: 1px solid var(--pw-line); margin-top: 28px; }
.pw-art__head { margin-bottom: 40px; }

/* Grille : contenu + sommaire */
.pw-art__grid { display: grid; grid-template-columns: minmax(0, 720px) 300px; gap: 64px; justify-content: space-between; }
.single-post .pw-art__grid .entry-content > * { margin-left: 0; margin-right: 0; }
.pw-art__main { min-width: 0; }
.pw-art__sticky { position: sticky; top: 24px; }
.admin-bar .pw-art__sticky { top: 56px; }
.pw-kicker { font: 500 12px/1 var(--pw-mono); letter-spacing: .06em; text-transform: uppercase; color: #0c6a94; margin: 0 0 14px; }

.pw-toc-list { list-style: none; margin: 0 0 28px; padding: 0; border-left: 2px solid var(--pw-line); }
.pw-toc-list li { margin: 0; }
.pw-toc-list a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; color: var(--contrast-2, #575760); }
.pw-toc-list a:hover { color: var(--contrast, #222); }
.pw-toc-list a[aria-current] { border-left-color: var(--pw-bleu); color: var(--contrast, #222); font-weight: 600; }

.pw-side-cta { background: #0b2a3a; color: #fff; border-radius: 14px; padding: 22px; }
.pw-side-cta p { margin: 0; }
.pw-side-cta__t { font-weight: 800; font-size: 18px; line-height: 1.3; }
.pw-side-cta__p { color: #d7e6ee; font-size: 14px; margin: 8px 0 16px !important; }
.pw-side-cta__btn { display: flex; justify-content: center; align-items: center; min-height: 46px; background: var(--pw-bleu-a11y); color: #fff !important; font-weight: 700; border-radius: 8px; }
.pw-side-cta__btn:hover { background: #085f86; }
.pw-side-cta__btn:focus-visible { outline: 3px solid #7fd3f5; outline-offset: 2px; }

/* Sommaire mobile */
.pw-toc-m { display: none; border: 1px solid var(--pw-line); border-radius: 12px; padding: 0 18px; margin-bottom: 28px; }
.pw-toc-m summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.pw-toc-m .pw-toc-list { border: 0; margin: 0 0 12px; }
.pw-toc-m .pw-toc-list a { padding-left: 0; }

/* Auteur */
.pw-author { display: flex; gap: 18px; align-items: flex-start; border: 1px solid var(--pw-line); border-radius: 14px; padding: 24px; margin-top: 48px; scroll-margin-top: 100px; }
.pw-author__av { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.pw-author p { margin: 0; }
.pw-author__name { font-weight: 800; font-size: 18px; }
.pw-author__role { color: var(--pw-muted); font-size: 14px; margin: 2px 0 10px !important; }
.pw-author__bio { font-size: 15px; line-height: 1.6; color: var(--contrast-2, #575760); }
.pw-author__links { font-size: 14px; margin-top: 10px !important; }
.pw-author__links a { color: var(--pw-bleu-a11y); font-weight: 600; }

/* Articles liés */
.pw-related { max-width: 1132px; margin: 56px auto 0; padding: 0 16px 72px; }
.pw-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pw-related__card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--pw-line); border-radius: 14px; padding: 20px; background: #fff; color: var(--contrast, #222); transition: border-color .15s; }
.pw-related__card:hover { border-color: var(--pw-bleu); }
.pw-related__k { font: 500 11px/1 var(--pw-mono); letter-spacing: .06em; text-transform: uppercase; color: #0c6a94; }
.pw-related__t { font-weight: 700; font-size: 17px; line-height: 1.3; }
.pw-related__m { font: 400 12px/1 var(--pw-mono); color: var(--pw-muted); margin-top: auto; padding-top: 8px; }

/* Barre de progression de lecture (CSS seul, navigateurs compatibles) */
.pw-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--global-color-bleu, #1da7e0); transform-origin: 0 50%; transform: scaleX(0); z-index: 1000; pointer-events: none; }
@supports (animation-timeline: scroll()) {
	.pw-progress { animation: pw-grow linear both; animation-timeline: scroll(root); }
	@keyframes pw-grow { to { transform: scaleX(1); } }
}
.admin-bar .pw-progress { top: 32px; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 1000px) {
	.pw-art__grid { grid-template-columns: minmax(0, 1fr); }
	.pw-art__side { display: none; }
	.pw-toc-m { display: block; }
}
@media (max-width: 800px) {
	.pw-related__grid { grid-template-columns: 1fr; }
	.pw-author { flex-direction: column; padding: 20px; }
}
