/* =============================================================================
   ARTICLE — en-tête en trois mises en page, partage, progression.
   (Visionneuse : visionneuse.css, partagée avec la fiche produit — 0.7.0.)
   Chargé uniquement sur les articles (bloquant : c'est le premier écran).

   Choix de la mise en page : réglage par défaut dans l'extension
   (Coordonnées & textes › Articles), modifiable article par article.
     .pa--une        texte à gauche, photo à droite (défaut)
     .pa--gris       la même, posée sur une bande brume (se détache du texte)
     .pa--couverture photo plein cadre, titre dessus (photo ≥ 1 600 px exigée)

   ⚠️ Aucun hex : tokens uniquement. ⚠️ Toujours des espaces autour de + et -
   dans calc()/clamp() : sans eux, la déclaration entière est ignorée.
   ============================================================================= */

/* --- Barre de progression de lecture -------------------------------------
   Pilotée par le défilement, en CSS pur (navigateurs récents). Ailleurs :
   pas de barre, sans autre conséquence. */
.pa-progression { position: fixed; inset: 0 0 auto; z-index: 1100; height: 3px; background: var(--marine); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
@keyframes pa-progression { to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
	.pa-progression { animation: pa-progression linear both; animation-timeline: scroll(root); }
}
.admin-bar .pa-progression { top: var(--wp-admin--admin-bar--height, 0px); }

/* --- Structure commune ------------------------------------------------------ */
.pa { padding-block: clamp(2rem, 1rem + 3vw, 4rem) 0; }
.pa__grille { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.pa--sans-image .pa__grille { grid-template-columns: minmax(0, 52rem); }

.pa__titre { margin-top: 1.4rem; font-family: var(--ff-headline); font-size: clamp(2.25rem, 1.5rem + 2.4vw, 3.6rem); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; color: var(--title); }
.pa__chapo { margin-top: 1.4rem; font-size: clamp(1.25rem, 1rem + .8vw, 1.625rem); font-weight: var(--fw-regular); line-height: 1.45; text-wrap: pretty; }

.pa__pied { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid color-mix(in srgb, var(--line) 15%, transparent); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.pa-auteur { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.pa-auteur__photo { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden; background: var(--marine); color: var(--paper); font-family: var(--ff-headline); font-size: 1rem; }
.pa-auteur__photo img { width: 100%; height: 100%; object-fit: cover; }
.pa-auteur__nom { display: block; font-family: var(--ff-headline); font-size: 1.0625rem; }
.pa-auteur:hover .pa-auteur__nom { text-decoration: underline; }
.pa-auteur__role { display: block; font-size: var(--fs-xs); color: var(--muted); }
.pa__infos { font-size: var(--fs-sm); color: var(--muted); text-align: right; line-height: 1.5; }
.pa__infos time { display: block; color: var(--fg); font-weight: var(--fw-medium); }

/* --- Photo ------------------------------------------------------------------ */
.pa__visuel { position: relative; margin: 0; border-radius: var(--r-card); overflow: hidden; aspect-ratio: 4 / 3; background: var(--mist); }
.pa__visuel img { width: 100%; height: 100%; object-fit: cover; }
/* ⚠️ PETITE PHOTO (largeur réelle < 1 000 px) : jamais agrandie au-delà de sa
   taille. Le cadre prend ses proportions et sa largeur réelles ; il est
   centré dans sa colonne. C'était le flou de l'ancienne version. */
.pa__visuel--petite { aspect-ratio: auto; justify-self: center; max-width: var(--pa-max, 100%); }
.pa__visuel--petite img { height: auto; }
.pa__credit { position: absolute; right: .8rem; bottom: .8rem; max-width: calc(100% - 4.5rem); padding: .25em .6em; border-radius: 6px; background: color-mix(in srgb, var(--ink) 55%, transparent); color: var(--paper); font-size: var(--fs-xs); line-height: 1.4; }
.pa__agrandir { position: absolute; left: .8rem; bottom: .8rem; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--paper); color: var(--ink); transition: transform .3s var(--ease-out); }
.pa__agrandir:hover { transform: scale(1.08); }
.pa__agrandir .icon { width: 1rem; }

/* --- Variante « fond gris » --------------------------------------------------
   Toute la tête est posée sur une bande brume aux coins bas arrondis (le
   langage du hero de l'accueil) : la frontière avec le texte est nette. */
.pa--gris { padding: 0; }
.pa--gris .pa__bande { padding-block: clamp(2rem, 1rem + 3vw, 4rem) clamp(2.5rem, 1.5rem + 3vw, 4.5rem); background: var(--mist); border-radius: 0 0 var(--r-section) var(--r-section); --surface: var(--paper); }
.pa--gris .pa__visuel { background: var(--paper); }
.pa--gris .pa__rubriques .pm-badge { background: var(--ink); }

/* --- Variante « couverture » ------------------------------------------------- */
.pa--couverture { padding: 0; }
.pa--couverture .pa__bande { position: relative; isolation: isolate; display: grid; align-items: end; min-height: min(84vh, 46rem); margin-inline: clamp(.75rem, 1.5vw, 1.5rem); border-radius: var(--r-section); overflow: hidden; color: var(--paper); --title: var(--paper); --fg: var(--paper); --line: var(--paper); --muted: color-mix(in srgb, var(--paper) 78%, transparent); }
.pa--couverture .pa__visuel { position: absolute; inset: 0; z-index: -1; border-radius: 0; aspect-ratio: auto; }
.pa--couverture .pa__visuel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 28%, color-mix(in srgb, var(--ink) 80%, transparent)); pointer-events: none; }
.pa--couverture .pa__credit { top: 1.2rem; bottom: auto; z-index: 1; }
.pa--couverture .pa__agrandir { top: 1.2rem; bottom: auto; z-index: 1; }
.pa--couverture .pa__grille { grid-template-columns: minmax(0, 56rem); padding-block: clamp(2rem, 1rem + 4vw, 4.5rem); }
.pa--couverture .pa__titre { font-size: clamp(2.5rem, 1.6rem + 3vw, 4.4rem); max-width: 18ch; }
.pa--couverture .pa__chapo { max-width: 46ch; }
.pa--couverture .pa__rubriques .pm-badge { background: var(--paper); color: var(--ink); }
.pa--couverture .pa-auteur__photo { background: var(--paper); color: var(--marine); }

/* --- Corps : colonne de partage + texte ------------------------------------- */
.pa__corps { display: grid; grid-template-columns: 4rem minmax(0, var(--lecture)) 4rem; justify-content: center; gap: 2rem; margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); }
.pa__corps .pm-prose { width: auto; margin: 0; }
.pa-rail { position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; display: grid; gap: .6rem; justify-items: center; transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), visibility 0s; }
/* Un média large passe à sa hauteur (visionneuse.js) : la colonne s'efface,
   et sort du parcours clavier le temps du croisement. */
.pa-rail.is-masque { opacity: 0; transform: translate3d(-10px, 0, 0); visibility: hidden; pointer-events: none; transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), visibility 0s .25s; }
.pa-rail__titre { margin-bottom: .4rem; font-family: var(--ff-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }
.pa-rail .pm-rond .icon { width: 40%; }
.pa-rail__retour { position: absolute; left: calc(100% + .5rem); top: 0; white-space: nowrap; font-size: var(--fs-xs); }
/* Le partage horizontal de fin d'article ne sert que là où la colonne n'existe pas. */
.pa__pied-article .pm-partage { display: none; }

@media (max-width: 900px) {
	.pa__grille { grid-template-columns: 1fr; }
	.pa__visuel { order: -1; aspect-ratio: 3 / 2; }
	.pa__visuel--petite { aspect-ratio: auto; }
	.pa--couverture .pa__visuel { order: 0; }
	.pa__infos { text-align: left; }
	.pa__corps { grid-template-columns: minmax(0, 1fr); padding-inline: var(--gutter); }
	.pa-rail { display: none; }
	.pa__pied-article .pm-partage { display: flex; }
}

/* Images du texte : agrandissables. */
.pm-prose img[data-pm-zoom] { cursor: zoom-in; }
