/*
Theme Name: Metalexis (enfant)
Theme URI: https://metalexis.org
Description: Thème enfant sobre et conforme pour Metalexis.org, basé sur TwentyTwentyFour.
Author: Metalexis
Author URI: https://metalexis.org
Template: twentytwentyfour
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: metalexis-child
*/
/*
 Theme Name: Twenty Twenty-Four Child
 Template: twentytwentyfour
*/

/* ————— Scoper au contenu pour éviter d'impacter l’en-tête/menu ————— */
.entry-content p{ text-align: justify; }
.entry-content nav ul{ list-style: none; padding-left: 0; }
.entry-content nav li{ margin: .2em 0; }

/* lecture & sommaire */
.entry-content .mlx-readtime{margin:.25rem 0 .75rem;color:#6b7280}
.entry-content .mlx-toc{margin:1rem 0;padding:1rem;border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.entry-content .mlx-toc__title{font-weight:600;margin-bottom:.35rem}
.entry-content .mlx-toc ul{margin:.25rem 0 .25rem 1rem}

/* blocs <details> pour annexes */
.entry-content details{margin:1rem 0;border:1px solid #e5e7eb;border-radius:8px;padding:.5rem 1rem;background:#fafafa}
.entry-content details>summary{cursor:pointer;font-weight:600;margin:-.5rem -1rem .5rem -1rem;padding:.5rem 1rem;list-style:none}
.entry-content details>summary::-webkit-details-marker{display:none}

/* utilitaire « écran seulement » (pour titres cachés) */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* TL;DR + points clés */
.entry-content .mlx-tldr{margin:1rem 0;padding:1rem;border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.entry-content .mlx-tldr__title{font-weight:600;margin-bottom:.35rem}
.entry-content .mlx-key{margin:.75rem 0 1.25rem;padding:.75rem 1rem;border-left:4px solid #c2a990;background:#fafafa;border-radius:8px}
.entry-content .mlx-key__title{font-weight:600;margin-bottom:.25rem}
.entry-content .mlx-key__list{margin:.25rem 0 .25rem 1rem}
.entry-content .mlx-print__btn{padding:.5rem .75rem;border:1px solid #111;border-radius:8px;background:#111;color:#fff;cursor:pointer}

/* mise en page A4 “propres à l’impression” */
.entry-content .mlx-method{background:#fff;padding:2rem;border:1px solid #e5e7eb;border-radius:12px}
.entry-content .mlx-steps{list-style:decimal;margin:1rem 0 1.25rem;padding-left:1.25rem}
.entry-content .mlx-grids{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.entry-content .mlx-grid{border:1px solid #e5e7eb;border-radius:10px;padding:.75rem 1rem;background:#fafafa}
@media (max-width:900px){ .entry-content .mlx-grids{grid-template-columns:1fr} }

/* impression */
@media print{
  header, footer, nav, .wp-block-navigation, .mlx-start, .mlx-related, .mlx-cite__actions{display:none !important}
  .entry-content{max-width:none}
  a[href]::after{content:" (" attr(href) ")"; font-size:.9em}
  .entry-content .mlx-method{border:0;border-radius:0;padding:0}
  @page{size:A4; margin:15mm}
}
.entry-content .mlx-start{margin:0 0 1rem}
.entry-content .mlx-topbar{display:flex;gap:.75rem;align-items:center;margin:.25rem 0 1rem}
.entry-content .mlx-topbar .mlx-readtime{margin:0}
.entry-content .mlx-topbar .mlx-print{margin:0}


.entry-content .mlx-vignettes{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin:1rem 0}
.entry-content .mlx-v{border:1px solid #e5e7eb;border-radius:12px;background:#fff;padding:1rem}
.entry-content .mlx-v h3{margin:.2rem 0 .5rem 0}
.entry-content .mlx-v__pb,.entry-content .mlx-v__apport{margin:.25rem 0}
@media (max-width:1000px){ .entry-content .mlx-vignettes{grid-template-columns:1fr} }

.entry-content .gloss dt{font-weight:700;margin-top:.75rem}
.entry-content .gloss dd{margin:0 0 .5rem 0}
.entry-content .mlx-glossary nav a{text-decoration:none;border-bottom:1px dotted}
.entry-content .mlx-glossary nav{margin:.5rem 0 1rem}

.entry-content .mlx-key__list{list-style:disc;padding-left:1.2rem;margin:.25rem 0 .25rem 1rem}

/* ———————————————————————————————
   Identité PDF (CSS only, pas de PHP)
   ——————————————————————————————— */

/* Rien à l'écran, seulement en impression */
.mlx-print-wm{display:none}

@media print{
  /* ↑ remplace ta ligne @page existante : on réserve de la place pour l’entête/pied */
  @page { size: A4; margin: 22mm 15mm 18mm; } /* top | côtés | bottom */

  /* Tes règles existantes restent valides… on ajoute seulement ceci : */
  /* En-tête répété (logo + nom + URL) */
  body::before{
    content: "MetaLexis — metalexis.org";
    position: fixed; top: 0; left: 0; right: 0;
    padding: 6mm 0 4mm 22mm;            /* décalage pour le logo */
    border-bottom: 1px solid #e5e7eb;
    background: #fff no-repeat 4mm center;
    background-image: url('https://metalexis.org/wp-content/uploads/2025/08/Carre-geometrique-monochrome.png');
    background-size: 12mm 12mm;         /* taille du logo */
    font-weight: 700; font-size: 12pt; line-height: 1.1; color: #111;
    z-index: 9999;
  }

  /* Pied de page répété (© + pagination) */
  body::after{
    content: "© MetaLexis — metalexis.org · Page " counter(page) " / " counter(pages);
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 3mm 0;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    font-size: 9pt; color: #6b7280; text-align: right;
    z-index: 9999;
  }

  /* Évite tout chevauchement avec l’entête/pied */
  .entry-content{ max-width:none; margin-top: 12mm; margin-bottom: 10mm; }
}