/*
Theme Name: Mimiris
Theme URI: https://mimiris.fr
Author: Florian Villa
Description: Thème sur mesure de Mimiris : lecture confortable, léger, sans jQuery.
Version: 1.0.2
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: mimiris
*/

/* Polices hébergées dans le thème : aucune requête vers Google (RGPD). */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(assets/fonts/bricolage-grotesque-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(assets/fonts/bricolage-grotesque-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(assets/fonts/source-serif-4-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --fond: #ffffff;
  --surface: #f4f3f0;          /* marche de ton pour séparer les zones */
  --encre: #18181b;
  --encre-douce: #5b5b63;      /* uniquement pour les métadonnées */
  --or: #bd963f;               /* le doré du logo */
  --or-texte: #85661f;         /* doré assombri, lisible sur blanc (AA) */
  --or-pale: #f3ead6;

  --titre: "Bricolage Grotesque", system-ui, sans-serif;
  --texte: "Source Serif 4", Georgia, serif;
  --titre-graisse: 800;

  --marge: clamp(16px, 4vw, 48px);
  --large: 1280px;
  --rayon-image: 22px;
  --rayon-petit: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 18px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--titre);
  font-weight: var(--titre-graisse);
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.sr, .evitement:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.evitement:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--encre); color: #fff; padding: 8px 14px; }

/* Boutons : pleins, en pilule, décidé une fois */
.bouton {
  display: inline-block;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  background: var(--or);
  color: var(--encre);
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: background-color .15s;
}
.bouton:hover { background: #a8842f; }
.bouton-petit { padding: 9px 18px; font-size: 15px; }
.bouton-clair { background: var(--surface); }
.bouton-clair:hover { background: #e9e7e1; }

.categorie {
  display: inline-block;
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 700;
  color: var(--or-texte);
  background: var(--or-pale);
  border-radius: var(--rayon-petit);
  padding: 3px 10px;
}
.meta { font-size: 15px; color: var(--encre-douce); margin: 0; }

/* En-tête */
.entete {
  max-width: var(--large);
  margin: 0 auto;
  padding: 18px var(--marge);
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo img { width: 150px; }
.nav { display: flex; gap: 22px; margin-left: auto; font-family: var(--titre); font-weight: 600; font-size: 15px; }
.nav a { text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--or-texte); }
.menu { display: none; }
.entete { position: relative; }
/* En-tête : une seule pilule, même police et même taille que le menu */
.recherche-entete { flex: 0 0 230px; min-width: 0; gap: 0; align-items: center; background: var(--surface); border-radius: 999px; }
.recherche.recherche-entete input { flex: 1; min-width: 0; width: 100%; background: none; font-size: 15px; padding: 10px 4px 10px 18px; }
.recherche-entete button { display: flex; flex: none; border: 0; background: none; color: var(--encre); padding: 10px 14px 10px 6px; cursor: pointer; }
.recherche-entete button:hover { color: var(--or-texte); }

/* Accueil : ouverture */
.ouverture { max-width: var(--large); margin: 0 auto; padding: 56px var(--marge) 40px; }
.ouverture h1 { font-size: clamp(2.5rem, 6.2vw, 5.6rem); max-width: 19ch; }
.chapeau { font-size: 20px; line-height: 1.5; max-width: 40ch; margin: 22px 0 0; }

/* Article à la une */
.une {
  max-width: var(--large);
  margin: 0 auto;
  padding: 0 var(--marge);
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.une-image img { border-radius: var(--rayon-image); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.une-texte h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); margin: 14px 0 16px; }
.une-texte h2 a { text-decoration: none; }
.une-texte p { margin: 0 0 16px; }
.une-texte .meta { margin-bottom: 26px; }

/* Derniers articles */
.derniers { max-width: var(--large); margin: 0 auto; padding: 140px var(--marge) 0; }
.derniers-tete { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.derniers-tete h2, .themes h2, .a-lire h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.recherche { display: flex; gap: 8px; }
.recherche input {
  font: inherit;
  font-family: var(--titre);
  font-size: 16px;
  border: 0;
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 18px;
  min-width: 0;
}
.outils { margin-top: 28px; }
.tri { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; font-family: var(--titre); font-weight: 600; font-size: 15px; }
.tri a { text-decoration: none; padding: 7px 16px; border-radius: 999px; }
.tri a[aria-current] { background: #fff; color: var(--encre); }
.tri a:not([aria-current]) { color: var(--encre-douce); }
.tri a:not([aria-current]):hover { color: var(--encre); }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 40px; }
.filtres a {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
}
.filtres a[aria-current] { background: var(--encre); color: #fff; }
.filtres a:not([aria-current]):hover { background: var(--or-pale); }

.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px 32px; }
.carte-lien { text-decoration: none; display: block; }
.carte img { border-radius: var(--rayon-image); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; margin-bottom: 16px; }
.carte h3 { font-size: 22px; line-height: 1.2; margin: 10px 0 10px; }
.carte-lien:hover h3 { text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 4px; }
.extrait { font-size: 16px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.derniers > .bouton { margin-top: 56px; }

/* Thèmes */
.themes { max-width: var(--large); margin: 140px auto 0; padding: 0 var(--marge); }
.pastilles { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pastilles a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--or-pale);
  border-radius: 18px;
  padding: 18px 24px;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  transition: background-color .15s;
}
.pastilles a:hover { background: #ebdcb9; }
.pastilles .nombre { font-size: 15px; font-weight: 500; color: var(--or-texte); }

/* Pied */
.pied { background: var(--encre); color: #fff; max-width: var(--large); margin: 140px auto 0; border-radius: 28px 28px 0 0; padding: 0 var(--marge) 24px; }
.pied-haut { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: clamp(40px, 6vw, 72px) 0 40px; }
.pied-mission { max-width: 44ch; margin: 0; color: #dcdce0; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.pied-liens a { color: #dcdce0; text-decoration: none; }
.pied-liens a:hover { color: var(--or); }
.pied-logo { display: block; width: 150px; height: auto; margin: 0 0 20px; }
.pied-bas { margin: 0; font-size: 14px; color: #9a9aa2; }

/* Page catégorie */
.rubrique { max-width: var(--large); margin: 0 auto; padding: 40px var(--marge) 56px; }
.rubrique h1 { font-size: clamp(3.2rem, 11vw, 10rem); line-height: .9; letter-spacing: -0.045em; margin-top: 8px; }
.rubrique-bas { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; margin-top: 28px; }
.rubrique-bas .chapeau { margin: 0; max-width: 46ch; }
.rubrique-compte { margin: 0; font-family: var(--titre); font-size: 20px; color: var(--or-texte); }
.rubrique-compte strong { display: block; font-size: clamp(3rem, 6vw, 5rem); line-height: 1; color: var(--encre); }
.une-rubrique { background: var(--surface); border-radius: 28px; padding: clamp(16px, 2.5vw, 32px); max-width: calc(var(--large) - 2 * var(--marge)); }
.une-rubrique .une-texte h2 { margin-top: 0; }
.rubrique ~ .derniers { padding-top: 96px; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 64px; font-family: var(--titre); font-weight: 700; }
.pagination a { min-width: 46px; height: 46px; display: grid; place-items: center; padding: 0 16px; border-radius: 999px; background: var(--surface); text-decoration: none; }
.pagination a:hover { background: var(--or-pale); }
.pagination a[aria-current] { background: var(--encre); color: #fff; }
.pagination .suivante { background: var(--or); }
.filtres-grands a { font-size: 18px; padding: 12px 22px; }

.rubrique ~ .derniers .derniers-tete { margin-bottom: 40px; align-items: center; }
.rubrique-recherche h1 { font-size: clamp(2.8rem, 8vw, 7rem); }
.rubrique-recherche .recherche { flex: 0 1 460px; }
.rubrique-recherche .recherche input { flex: 1; }
.rubrique-recherche ~ .derniers { padding-top: 24px; }
.rubrique-recherche ~ .derniers .outils { margin: 0 0 40px; }

/* Page article */
.lecture-tete { max-width: 1120px; margin: 0 auto; padding: 40px var(--marge) 0; }
.ariane { font-size: 15px; color: var(--encre-douce); margin-bottom: 20px; }
.ariane a { text-decoration: none; }
.ariane a:hover { color: var(--or-texte); }
.lecture-tete h1 { font-size: clamp(2.2rem, 4.8vw, 4rem); }
.lecture-tete .chapeau { max-width: none; margin: 20px 0 18px; font-size: 20px; }
.lecture-image { max-width: 1120px; margin: 40px auto 0; padding: 0 var(--marge); }
.lecture-image img { border-radius: var(--rayon-image); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.lecture-corps {
  max-width: var(--large);
  margin: 64px auto 0;
  padding: 0 var(--marge);
  display: grid;
  grid-template-columns: 240px minmax(0, 700px) 120px;
  justify-content: center;
  gap: 56px;
  align-items: start;
}
.sommaire { position: sticky; top: 24px; font-size: 15px; line-height: 1.4; }
.sommaire summary { font-family: var(--titre); font-weight: 800; font-size: 17px; cursor: pointer; list-style: none; margin-bottom: 12px; }
.sommaire summary::-webkit-details-marker { display: none; }
.sommaire ol { list-style: none; margin: 0; padding: 0; }
.sommaire li a { display: block; padding: 7px 0 7px 14px; border-left: 3px solid var(--surface); text-decoration: none; color: var(--encre-douce); }
.sommaire li a:hover { color: var(--encre); border-left-color: var(--or); }

.texte { font-size: 19px; line-height: 1.7; }
.texte p { margin: 0 0 1.2em; }
.texte h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 2em 0 .6em; scroll-margin-top: 24px; }
.texte a { color: var(--or-texte); text-underline-offset: 3px; }
.en-bref { background: var(--or-pale); border-radius: var(--rayon-image); padding: 24px 28px; }
.tableau { overflow-x: auto; margin: 0 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: 17px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #e4e2dc; }
th { font-family: var(--titre); }
.faq { background: var(--surface); border-radius: 14px; padding: 4px 22px; margin-bottom: 10px; }
.faq summary { font-family: var(--titre); font-weight: 700; padding: 14px 0; cursor: pointer; }
.faq p { margin: 0 0 16px; }
.sources-titre { font-size: 20px !important; }
.sources { font-size: 15px; line-height: 1.5; color: var(--encre-douce); padding-left: 18px; overflow-wrap: anywhere; }

.partage { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-family: var(--titre); font-weight: 600; }
.partage a, .partage button { font: inherit; text-align: left; background: var(--surface); border: 0; border-radius: var(--rayon-petit); padding: 8px 12px; text-decoration: none; cursor: pointer; color: var(--encre); }
.partage a:hover, .partage button:hover { background: var(--or-pale); }

.a-lire { max-width: var(--large); margin: 120px auto 0; padding: 0 var(--marge); }
.a-lire .grille { margin-top: 32px; }

/* Tablette */
/* En-tête : menu replié avant que les catégories ne serrent la recherche */
@media (max-width: 1200px) {
  .nav { display: none; }
  .recherche-entete { margin-left: auto; }
  .menu { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px; flex: none; background: var(--surface); border: 0; border-radius: 999px; padding: 0 12px; cursor: pointer; }
  .menu span { height: 2px; background: var(--encre); border-radius: 2px; }
  .menu-ouvert .nav { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 16px var(--marge) 24px; gap: 14px; font-size: 18px; box-shadow: 0 12px 24px rgba(0,0,0,.08); /* taste-skill-ignore: menu ouvert */ z-index: 4; }
}

@media (max-width: 1100px) {
  .lecture-corps { grid-template-columns: minmax(0, 700px); }
  .sommaire { position: static; background: var(--surface); border-radius: 16px; padding: 18px 22px; }
  .sommaire summary { margin: 0; }
  .sommaire details[open] summary { margin-bottom: 10px; }
  .partage { position: static; flex-direction: row; flex-wrap: wrap; }
  .grille { grid-template-columns: repeat(2, 1fr); }
}

/* Téléphone */
@media (max-width: 760px) {
  .recherche-entete { display: none; }
  .menu { margin-left: auto; }
  .menu-ouvert .recherche-entete { display: flex; position: absolute; top: 100%; left: var(--marge); right: var(--marge); width: auto; z-index: 5; margin: 8px 0 0; }
  .menu-ouvert .nav { padding-top: 72px; }
  body { font-size: 17px; }
  .logo img { width: 124px; }
  .ouverture { padding: 28px var(--marge) 28px; }
  .chapeau { font-size: 18px; }
  .une { grid-template-columns: 1fr; }
  .une-texte { order: -1; }
  .une-rubrique { margin: 0 var(--marge); border-radius: 22px; }
  .rubrique { padding-bottom: 36px; }
  .rubrique ~ .derniers { padding-top: 64px; }
  .filtres.filtres-grands { flex-wrap: wrap; overflow: visible; margin: 22px 0 0; padding: 0; }
  .rubrique h1 { font-size: clamp(3.2rem, 15vw, 6rem); }
  .une-image img { aspect-ratio: 4 / 3; }
  .derniers, .themes, .a-lire { margin-top: 88px; }
  .derniers { padding-top: 88px; margin-top: 0; }
  .recherche { width: 100%; }
  .rubrique-recherche .recherche { flex-basis: 100%; }
  .recherche input { flex: 1; }
  .filtres { flex-wrap: nowrap; overflow-x: auto; margin: 22px calc(-1 * var(--marge)) 28px; padding: 0 var(--marge); scrollbar-width: none; }
  .filtres a { white-space: nowrap; }
  .grille { grid-template-columns: 1fr; gap: 44px; }
  .pied { margin-top: 88px; border-radius: 22px 22px 0 0; }
  .lecture-tete { padding-top: 20px; }
  .lecture-tete .chapeau { font-size: 18px; }
  .lecture-image { margin-top: 28px; padding: 0; }
  .lecture-image img { border-radius: 0; aspect-ratio: 3 / 2; }
  .lecture-corps { margin-top: 32px; gap: 32px; }
  .texte { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- Ajouts propres à WordPress --- */
strong, b { font-weight: 600; }
.pagination .page-numbers { min-width: 46px; height: 46px; display: grid; place-items: center; padding: 0 16px; border-radius: 999px; background: var(--surface); text-decoration: none; }
.pagination a.page-numbers:hover { background: var(--or-pale); }
.pagination .current { background: var(--encre); color: #fff; }
.pagination .dots { background: none; }
.pagination .next { background: var(--or); }
.pagination .next:hover { background: #a8842f; }

.texte .wp-block-table { overflow-x: auto; margin: 0 0 1.4em; }
.texte figure { margin: 0 0 1.4em; }
.texte img { border-radius: 14px; }
.texte figcaption { font-size: 15px; color: var(--encre-douce); margin-top: 8px; }
.texte ul, .texte ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.texte li { margin-bottom: .4em; }
.texte h3 { font-size: 1.3rem; margin: 1.6em 0 .5em; }
.texte blockquote { margin: 0 0 1.2em; padding: 4px 0 4px 22px; border-left: 4px solid var(--or); font-style: italic; }

.page-simple { max-width: 760px; margin: 0 auto; padding: 40px var(--marge) 0; }
.page-simple h1 { font-size: clamp(2.2rem, 5vw, 4rem); margin-bottom: 32px; }

.introuvable { max-width: var(--large); margin: 0 auto; padding: 64px var(--marge) 0; }
.introuvable h1 { font-size: clamp(3rem, 9vw, 8rem); line-height: .95; }
.introuvable .recherche { max-width: 520px; margin: 32px 0 24px; }
.introuvable .recherche input { flex: 1; }

.vide { font-size: 20px; margin: 0 0 40px; }

.commentaires { max-width: 700px; margin: 80px auto 0; padding: 0 var(--marge); }
.commentaires h2 { font-size: 1.8rem; margin-bottom: 24px; }
.commentaires ol { list-style: none; padding: 0; }
.commentaires .comment-body { background: var(--surface); border-radius: 14px; padding: 18px 22px; margin-bottom: 12px; font-size: 17px; }
.commentaires .comment-meta { font-size: 15px; color: var(--encre-douce); }
.commentaires textarea, .commentaires input[type="text"], .commentaires input[type="email"], .commentaires input[type="url"] { font: inherit; width: 100%; border: 0; background: var(--surface); border-radius: 14px; padding: 12px 16px; }
.commentaires .submit { font-family: var(--titre); font-weight: 700; background: var(--or); border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer; }

@media (max-width: 760px) {
  .pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; }
}
.nav ul { display: flex; gap: inherit; list-style: none; margin: 0; padding: 0; }
.menu-ouvert .nav ul { flex-direction: column; }
