/* =========================================================
   Madame Parkinson — compléments WordPress à mp-theme.css (maquette)
   États réels (hidden, JS), contenus de l'éditeur, visionneuse, barre d'admin.
   ========================================================= */

[hidden] { display: none !important; }
.admin-bar .mp-entete { top: 32px; }
@media (max-width: 782px) { .admin-bar .mp-entete { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mp-entete { top: 0; } }

/* Sous-menus ouverts au clic : le panneau suit le bouton. */
.mp-sous { animation: mp-fadeIn var(--mp-duree) ease both; }
.mp-sous__lien[aria-current="page"] { font-weight: 600; background: var(--mp-lavande); }

.mp-titre-section { margin-bottom: 32px !important; }
.mp-espace-bas { height: 96px; }
section[tabindex="-1"]:focus, [data-focus-arrivee]:focus, .mp-conclusion:focus { outline: none; }

/* ---------- Fenêtre « Chapitre » ---------- */
.mp-modale__sous { display: block; margin-top: 6px; font-size: var(--mp-t-h4); color: var(--mp-rose-fort); }
.mp-modale__chapitre .mp-prose { margin-inline: auto; }
.mp-modale__chapitre .mp-prose h3 { margin-top: 1.4em; }
.mp-modale__chapitre .mp-prose h3:first-child { margin-top: 0; }
.mp-modale__pied [data-modale-suiv], .mp-modale__pied [data-modale-conclusion] { justify-self: end; }
html.mp-sans-defilement { overflow: hidden; }
html.mp-sans-defilement body { padding-right: var(--mp-ascenseur, 0px); }
@media (max-width: 767px) {
  /* Précédent et Suivant côte à côte ; un bouton seul prend toute la largeur. */
  .mp-modale__pied { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .mp-modale__pied [data-modale-vide] { display: none; }
  .mp-modale__pied [data-modale-suiv], .mp-modale__pied [data-modale-conclusion] { justify-self: stretch; }
  .mp-modale__pied .mp-btn { gap: 6px; padding-inline: 8px; }
}
@media (max-width: 399px) {
  .mp-modale__pied { gap: 8px; padding-inline: 10px; }
  .mp-modale__pied .mp-btn { gap: 4px; padding-inline: 4px; font-size: 0.9375rem; white-space: nowrap; }
  .mp-modale__pied .mp-btn .mp-icone { width: 18px; height: 18px; }
}

/* ---------- Formulaires ---------- */
.mp-alerte a { color: inherit !important; font-weight: 600; }
.mp-contact__merci { margin-bottom: 24px; }
.mp-champ.is-erreur .mp-case input { outline: 3px solid var(--mp-erreur); outline-offset: 2px; }
.mp-form-comm__intro { margin: 0 !important; color: var(--mp-texte-doux); }
.mp-form-comm [data-resume] { margin-top: 20px; }
.mp-form-comm__connecte { margin: 0 !important; color: var(--mp-texte-doux); }
.mp-btn:not(.is-chargement) .mp-spinner { display: none; }

/* ---------- Liste ---------- */
.mp-vide__pistes { font-weight: 600; margin-bottom: 8px !important; }
.mp-carte__media .mp-image-absente { aspect-ratio: 4 / 3; }

/* ---------- Article ---------- */
.mp-article { padding-top: 48px; padding-bottom: var(--mp-section); }   /* air avant le pied de page */
.mp-prose ol { list-style: decimal; padding-left: 1.4em; margin: 0 0 1.2em; display: grid; gap: 8px; }
.mp-prose img { border-radius: 12px; }
.mp-prose hr { border: 0; height: 2px; background: var(--mp-lavande); margin: 40px 0; }
.mp-prose h2.a-centre { text-align: center; }
.mp-prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; }
.mp-prose th, .mp-prose td { padding: 10px 12px; border-bottom: 1px solid var(--mp-lavande); text-align: left; }
.mp-sommaire__tete[aria-expanded="true"] .mp-chevron { transform: rotate(180deg); }
.mp-memes__tout { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; margin-top: 28px !important; }
.mp-galerie__aide { color: var(--mp-texte-doux); font-size: var(--mp-t-petit); }
.mp-galerie__item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0; }
.mp-galerie__item:focus-visible { outline: 3px solid var(--mp-focus); outline-offset: 3px; }
.mp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mp-video.is-lecture { padding: 0; background: #000; }
.mp-page { padding-block: 48px 96px; }
.mp-page-tete { padding: 40px 0 56px; }
.mp-page__actions { justify-content: flex-start; margin-top: 32px; }

/* ---------- Commentaires ---------- */
.mp-bulle p + p { margin-top: 0.8em !important; }
.mp-bulle--long p { display: block; -webkit-line-clamp: unset; overflow: visible; }
.mp-bulle--long:not(.is-deplie) { max-height: calc(1.6em * 7 + 28px); overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.mp-attente { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: #FFF4D6; color: #6B4E00; font-weight: 600; font-size: 15px; }
.mp-lien-action--moderer { color: var(--mp-erreur); }
.mp-comm__vide { margin: 0 0 8px !important; }
.mp-comm__merci { margin-bottom: 28px; }
.mp-msg:focus { outline: none; }
.mp-msg:target .mp-bulle, .mp-msg.is-cible .mp-bulle { box-shadow: 0 0 0 3px var(--mp-bleu-fort); }
.mp-form-comm--reponse { scroll-margin-top: calc(var(--mp-entete-h) + 24px); }
.mp-voir-reponses { margin-left: 48px; }
@media (max-width: 767px) { .mp-voir-reponses { margin-left: 0; } }

/* ---------- Visionneuse d'images ---------- */
.mp-visionneuse { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(28, 36, 75, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity 280ms ease; }
.mp-visionneuse.is-ouverte { opacity: 1; }
.mp-visionneuse:not(.is-ouverte) { pointer-events: none; }
.mp-visionneuse .mp-visionneuse__boite { transform: scale(0.96); transition: transform 280ms var(--mp-courbe); }
.mp-visionneuse.is-ouverte .mp-visionneuse__boite { transform: none; }
.mp-visionneuse__boite { position: relative; display: grid; gap: 12px; justify-items: center; max-width: min(1200px, 100%); max-height: 100%; }
.mp-visionneuse__boite img { max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 8px; background: #fff; }
.mp-visionneuse__fermer { justify-self: end; }
.mp-visionneuse__legende { margin: 0 !important; color: #fff; text-align: center; font-size: var(--mp-t-petit); }

/* « Haut de page » : visible seulement après un écran de défilement. */
.mp-haut[data-haut] { opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity var(--mp-duree), transform var(--mp-duree), visibility var(--mp-duree); }
.mp-haut[data-haut].is-visible, .mp-haut[data-haut]:focus { opacity: 1; visibility: visible; transform: none; }
.mp-haut[data-haut].is-ecarte:not(:focus) { opacity: 0; visibility: hidden; }
/* Tant que la marge de droite est trop étroite pour le libellé : la flèche seule, qui ne mord pas sur le contenu (le libellé reste lu). */
@media (max-width: 1679px) {
  .mp-haut { width: 56px; padding: 0; justify-content: center; }
  .mp-haut__texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.mp .mp-modale__photo { max-width: 420px; }
@media (min-width: 768px) { .mp-modale__pied [data-modale-prec] { justify-self: start; } }
@media (max-width: 359px) {
  .mp-acces__liste--icones a { gap: 8px; }
  .mp-acces__liste--icones a[href^="mailto:"] { font-size: 1rem; }
}
.mp-bandeau-article__meta a { color: #fff !important; }
.mp-bandeau-article__meta a:hover { text-decoration-thickness: 2px; }
.mp-prose h2, .mp-prose h3, .mp-prose h4, .mp-prose h5, .mp-prose h6, .mp-form-comm--reponse { scroll-margin-top: 8px; }
body:has(form :focus) .mp-haut { opacity: 0; pointer-events: none; }

@media (max-width: 1024px) { .admin-bar .mp-mobile { height: calc(100dvh - var(--mp-entete-h) - 46px); } }

/* Tablette : le menu devient un volet à droite (« Me contacter » reste dans l'en-tête) ;
   une dernière carte seule sur sa ligne prend toute la largeur. */
@media (min-width: 768px) and (max-width: 1024px) {
  .mp-mobile__panneau { left: auto; width: min(440px, 100%); height: 100%; border-radius: var(--mp-rayon-panneau) 0 0 var(--mp-rayon-panneau); transform: translateX(32px); }
  .mp-mobile__cta { display: none; }
  .mp-hero__photo { max-width: none; }
  .mp-hero__photo img { aspect-ratio: 3 / 2; }
  .mp-grille-articles > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mp-grille-articles > li:last-child:nth-child(odd) .mp-carte { flex-direction: row; align-items: center; gap: 16px; }
  .mp-grille-articles > li:last-child:nth-child(odd) .mp-carte__media { flex: 0 0 calc(50% - 8px); }
  .mp-grille-articles > li:last-child:nth-child(odd) .mp-carte__corps { padding: 8px; align-self: stretch; justify-content: center; }
  .mp-grille-articles > li:last-child:nth-child(odd) .mp-carte__suite { margin-top: 0; }
}
@media (max-width: 767px) {
  .mp-memes__tout { flex-direction: column; align-items: center; }
  .mp-memes__tout .mp-lien-fleche { display: block; min-height: 0; padding-block: 12px; text-align: center; }
  .mp-memes__tout .mp-lien-fleche .mp-icone { display: inline-block; vertical-align: -4px; margin-left: 6px; }
}
/* Téléphones : l'adresse e-mail tient entière, sous son icône. */
@media (max-width: 523px) {
  .mp-coord__ligne { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mp-coord__valeur { font-size: clamp(1.0625rem, 5.2vw, 1.25rem); }
}
/* Petits portables : « Haut de page » plus petit et contre le bord, pour ne pas mordre sur les cartes. */
@media (min-width: 1025px) and (max-width: 1199px) {
  .mp-haut[data-haut] { right: 4px; width: 44px; min-height: 44px; }
}

/* ---------- Fenêtre « Chapitre » sur un écran en largeur : format 16:9, photo à gauche, texte à droite ---------- */
@media (orientation: landscape) and (min-width: 700px) {
  .mp-modale__boite {
    width: min(1180px, 100%, calc((100vh - 2 * var(--mp-marge-fenetre)) * 16 / 9));
    width: min(1180px, 100%, calc((100dvh - 2 * var(--mp-marge-fenetre)) * 16 / 9));
    height: auto; aspect-ratio: 16 / 9;
  }
  .mp-modale__tete { padding-block: 8px; }
  .mp-modale__pied { padding-block: 12px; }
  .mp-modale__corps { display: flex; min-height: 0; padding: 0; overflow: hidden; }
  .mp-modale__chapitre:not([hidden]) { flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr); }
  .mp .mp-modale__photo { align-self: center; justify-self: center; width: calc(100% - 48px); max-width: 460px; max-height: calc(100% - 32px); margin: 0 0 0 16px; }
  .mp-modale__texte { overflow-y: auto; overscroll-behavior: contain; padding: 24px clamp(20px, 3vw, 40px) 28px; }
  .mp-modale__texte:focus-visible { outline-offset: -4px; }
}
/* Écran couché très bas (téléphone) : marges et barres réduites. */
@media (orientation: landscape) and (max-height: 520px) {
  .mp-modale { --mp-marge-fenetre: 14px; }
  .mp-modale__tete, .mp-modale__pied { padding-block: 6px; }
  .mp-modale__pied .mp-btn, .mp-modale__fermer { min-height: 44px; padding-block: 6px; }
}

/* ---------- Page « Merci » ---------- */
.mp-merci__coche { display: grid; place-items: center; width: 72px; height: 72px; margin: 4px auto 16px; border-radius: 50%; background: #fff; color: var(--mp-rose-fort); box-shadow: var(--mp-ombre-carte); }
.mp-merci__coche .mp-icone { width: 36px; height: 36px; }
.mp-merci { padding-block: 48px 0; text-align: center; }
.mp-merci .mp-prose { margin-inline: auto; }
.mp-merci__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.mp-merci__sourire { display: block; margin: 40px auto 0; width: 200px; }
.mp-merci__articles .mp-titre-section { margin-top: 40px !important; text-align: center; }
@media (max-width: 523px) { .mp-merci__actions .mp-btn { width: 100%; } }
