/*
 * Ankhmania — thème public du wiki, d’après le thème DokuWiki « theme_egypte » du site d’origine :
 * fond à hiéroglyphes, bannière (sphinx et pyramide), menu marron collé à la page blanche.
 * 1rem = 9,4px (réglé dans html).
 */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/opensans-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: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/opensans-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/opensans-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;
}

:root {
  --bg: #f3e5ab;
  --sheet: #fff;
  --text: #3d2b1f;
  --title: #2e1f14;
  --muted: #8a7766;
  --line: #e6dcc6;
  --link: #1f4fbf;
  --link-hover: #12337f;
  --missing: #d0241b;
  --gold: #c89b37;
  --gold-light: #ffd700;
  --brown: #6f4e37;
  --brown-light: #7b5f45;
  --brown-dark: #4e3626;
  --teal: #00a38d;
  --serif: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --radius: 8px;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 58.75%; /* 1rem = 9,4px : texte courant à 15px */
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 1.6rem;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url(../img/hieroglyphes.webp) var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.6rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.8rem 1.2rem;
  background: #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  vertical-align: -0.3rem;
}

/* ---------- En-tête ---------- */

.header__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 1.8rem;
  margin: 0;
  padding: 0.6rem 0.2rem;
  font-size: 1.3rem;
}

.header__links .header__admin {
  font-weight: 600;
  color: var(--brown);
}

.banner {
  display: block;
  height: 12rem;
  background: url(../img/banniere.webp) center / cover no-repeat var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* ---------- Menu (marron, collé à la page) ---------- */

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brown);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 0.5rem 1.2rem;
}

.nav__home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  height: 3.8rem;
  flex: none;
  color: #fff;
  border-radius: 5px;
}

.nav__home .icon {
  width: 2.2rem;
  height: 2.2rem;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  color: #fff;
  font-weight: 700;
  font-size: 1.55rem;
  white-space: nowrap;
}

.nav__home:hover,
.nav__home:focus-visible,
.nav__home.active,
.menu a:hover,
.menu a:focus-visible,
.menu .active a {
  color: var(--gold-light);
  background: var(--brown-light);
  text-decoration: none;
}

.header__search {
  display: flex;
  width: 26rem;
  max-width: 100%;
  margin-left: auto;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.header__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 1.4rem;
  background: transparent;
}

.header__search input:focus {
  outline: none;
}

.header__search:focus-within {
  box-shadow: 0 0 0 2px var(--gold-light);
}

.header__search button {
  border: 0;
  background: transparent;
  color: var(--brown);
  padding: 0 1rem;
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

/* ---------- Contenu ---------- */

.main {
  flex: 1;
  padding: 0 0 3rem;
}

.sheet {
  background: var(--sheet);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 3.2rem 2.8rem;
  min-height: 30rem;
}

.sheet::after {
  content: '';
  display: block;
  clear: both;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3.4rem;
  line-height: 1.2;
  color: var(--title);
  margin: 0 0 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.entry-content h2,
.sheet > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.25;
  color: var(--title);
  margin: 3.2rem 0 1.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dotted #9b9689;
}

.entry-content h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.1rem;
  color: var(--title);
  margin: 2.6rem 0 1rem;
}

.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-size: 1.7rem;
  color: var(--title);
  margin: 2rem 0 0.8rem;
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin: 0 0 1.4rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 2.4rem;
}

.entry-content li {
  margin: 0.2rem 0;
}

.entry-content ul li::marker {
  color: #a39a82;
}

.entry-content blockquote {
  margin: 1.6rem 0;
  padding: 0.8rem 1.6rem;
  border-left: 3px solid var(--gold);
  background: #faf8f2;
  font-style: italic;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0;
}

.entry-content pre,
.entry-content code {
  font-family: ui-monospace, 'DejaVu Sans Mono', monospace;
  font-size: 1.4rem;
}

.entry-content pre {
  background: #f6f4ee;
  border: 1px solid var(--line);
  padding: 1.2rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

a.missing {
  color: var(--missing);
  border-bottom: 1px dashed currentColor;
}

a.missing:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

a.external::after {
  content: '↗';
  font-size: 0.75em;
  margin-left: 0.15em;
  vertical-align: 0.2em;
}

.small {
  font-size: 1.3rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* Images */

.aligncenter {
  display: block;
  margin: 1.6rem auto;
}

.alignleft {
  float: left;
  margin: 0.4rem 2rem 1.2rem 0;
}

.alignright {
  float: right;
  margin: 0.4rem 0 1.2rem 2rem;
}

.image-link {
  display: inline-block;
  line-height: 0;
}

.image-link:has(.aligncenter) {
  display: block;
}

.image-link img {
  border-radius: 4px;
}

.entry-content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1.6rem;
}

.gallery figure {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
}

.gallery .image-link {
  display: block;
}

.gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.gallery figcaption {
  margin-top: 0.4rem;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.6rem 0;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Page Dynasties : tous les tableaux de la même largeur, première colonne identique partout */

.page-histoire .entry-content table.wikitable {
  width: 100%;
}

.page-histoire .wikitable td:first-child {
  width: 11rem; /* un intitulé plus long (« Pharaons / Grands prêtres ») passe à la ligne */
}

/* ---------- Page d'accueil ---------- */

.accueil-intro {
  text-align: center;
  max-width: 76rem;
  margin: 0.8rem auto 2.4rem;
}

.accueil-accroche {
  font-family: var(--serif);
  font-size: 2.8rem;
  line-height: 1.25;
  color: var(--title);
  margin-bottom: 1rem;
}

.accueil-chiffres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 2.4rem;
  margin-top: 1.6rem;
  color: var(--muted);
}

.accueil-chiffres strong {
  display: block;
  font-family: var(--serif);
  font-size: 2.8rem;
  line-height: 1.1;
  color: var(--gold);
}

.accueil-portes,
.cartes {
  display: grid;
  gap: 1.6rem;
  margin: 0 0 2.4rem;
}

.accueil-portes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cartes {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.porte,
.carte-accueil {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fbf6e9;
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.porte:hover,
.carte-accueil:hover,
.porte:focus-visible,
.carte-accueil:focus-visible {
  text-decoration: none;
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.porte img,
.carte-accueil img {
  display: block;
  width: 100%;
  aspect-ratio: 44 / 31;
  object-fit: cover;
}

.porte img.portrait,
.carte-accueil img.portrait {
  object-position: 50% 22%;
}

.porte-titre {
  padding: 1rem 1.4rem 0.2rem;
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--brown);
}

.porte-texte {
  padding: 0 1.4rem 1.4rem;
  font-size: 1.45rem;
}

.carte-titre {
  padding: 0.8rem 1rem 0;
  font-weight: 700;
  color: var(--link);
}

.carte-texte {
  padding: 0.1rem 1rem 1rem;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--muted);
}

.accueil-note {
  margin-top: -1.6rem;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}

.frise {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.frise a {
  flex-basis: 0;
  min-width: 9rem;
  hyphens: none;
  overflow-wrap: normal;
  padding: 1rem 0.6rem;
  color: #000;
  font-size: 1.2rem;
  line-height: 1.3;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.frise a:last-child {
  border-right: 0;
}

.frise a:hover,
.frise a:focus-visible {
  text-decoration: none;
  color: #000;
  filter: brightness(1.12);
}

.frise strong {
  display: block;
  font-size: 1.25rem;
}

.frise span {
  display: block;
  margin-top: 0.2rem;
  opacity: 0.8;
}

.frise-legende {
  margin-top: 0.6rem;
  font-size: 1.2rem;
  text-align: right;
}

@media (max-width: 900px) {
  .cartes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .accueil-portes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .accueil-accroche {
    font-size: 2.3rem;
  }

  .accueil-portes {
    grid-template-columns: minmax(0, 1fr);
  }

  .cartes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frise {
    flex-direction: column;
  }

  .frise a {
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    text-align: left;
    padding: 0.8rem 1.2rem;
  }

  .frise span {
    margin-top: 0;
  }
}

/* Carte de localisation d'un monument (OpenStreetMap) */

.entry-content .carte {
  clear: both;
  max-width: 60rem;
  margin: 2.4rem 0 1.6rem;
}

.carte iframe {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef0e8;
}

.carte figcaption {
  margin-top: 0.4rem;
  font-size: 1.35rem;
  color: var(--muted);
}

/* Carte illustrée de l'Égypte ([carte:egypte]) et carte interactive des monuments ([carte:monuments]) */

.carte-egypte-figure {
  clear: both;
  margin: 1.6rem auto 2.4rem;
  max-width: 76rem;
}

.carte-egypte-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.carte-interactive {
  clear: both;
  height: 62rem;
  max-height: 75vh;
  margin: 1.6rem 0 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef0e8;
  z-index: 0;
}

.carte-bulle {
  display: block;
  width: 20rem;
  text-decoration: none;
  color: var(--text);
}

.carte-bulle img {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.carte-bulle strong {
  display: block;
  font-size: 1.5rem;
  color: var(--link);
}

.carte-bulle span {
  font-size: 1.25rem;
  color: var(--muted);
}

.carte-legende {
  background: rgba(255, 255, 255, 0.92);
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 1.25rem;
  line-height: 1.7;
  box-shadow: var(--shadow);
}

.carte-legende span {
  display: block;
}

.carte-legende i {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.5rem;
  border: 2px solid #3b2a1e;
  border-radius: 50%;
  vertical-align: -0.15rem;
}

@media (max-width: 600px) {
  .carte-interactive {
    height: 44rem;
  }
}

/* Fiches (personnages, lieux) : tableau à droite du texte */

.entry-content table.infobox {
  float: right;
  clear: right;
  width: 40%;
  max-width: 38rem;
  margin: 0 0 2rem 2.4rem;
  border: 3px solid #2b2f33;
  border-collapse: collapse;
  box-shadow: 2px 3px 12px rgba(0, 0, 0, 0.25);
  font-size: 1.4rem;
  line-height: 1.45;
  background: #fff;
}

.infobox th,
.infobox td {
  padding: 0.5rem 0.8rem;
  vertical-align: top;
}

.infobox td:first-child:not([colspan]) {
  font-weight: 600;
  width: 40%;
}

.infobox img {
  display: block;
  margin: 0.4rem auto;
}

.infobox-legende {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}

.infobox .image-link {
  display: block;
}

/* Autres tableaux */

.entry-content table.wikitable {
  border-collapse: collapse;
  margin: 0 0 1.6rem;
  font-size: 1.45rem;
  max-width: 100%;
}

.wikitable th,
.wikitable td {
  border: 1px solid #d6d1c4;
  padding: 0.5rem 0.9rem;
  vertical-align: top;
}

.wikitable th {
  background: #f1eee6;
  text-align: left;
}

/* Colonnes (anciennes « wrap » DokuWiki) */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 0 2.4rem;
  margin-bottom: 0.8rem;
}

.cols > .col-half {
  grid-column: span 2;
}

.col > :last-child {
  margin-bottom: 0.8rem;
}

.note {
  margin: 1.6rem auto;
  max-width: 70rem;
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius);
  background: #eef5fb;
  border: 1px solid #cfe0ef;
}

.note > :last-child {
  margin-bottom: 0;
}

/* Sommaire */

.toc {
  float: right;
  clear: right;
  width: 28rem;
  max-width: 100%;
  margin: 0 0 1.6rem 2.4rem;
  font-size: 1.4rem;
  background: #faf8f2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.8rem 1.4rem;
  color: var(--title);
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0 1.4rem 1rem;
}

.toc li {
  margin: 0.3rem 0;
}

.toc .toc-3 {
  padding-left: 1.4rem;
}

.toc .toc-4 {
  padding-left: 2.8rem;
  font-size: 1.3rem;
}

/* Notes de bas de page */

.entry-content sup a {
  text-decoration: none;
  font-weight: 600;
}

.entry-content .footnotes {
  clear: both;
  list-style: none;
  margin: 3.2rem 0 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
  color: #555;
}

.footnotes li {
  margin: 0.3rem 0;
}

/* Listes de pages (listes automatiques, plan du site, mots clés) */

.page-list {
  columns: 3 17rem;
  column-gap: 3.2rem;
  margin: 0 0 1.6rem;
  padding-left: 2rem;
}

.entry-content .page-list li,
.page-list li {
  break-inside: avoid;
  margin: 0;
  padding: 0.1rem 0;
}

.result-list {
  list-style: none;
  padding: 0;
}

.result-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.result-list .excerpt {
  margin: 0.3rem 0 0;
  font-size: 1.4rem;
  color: #5f6368;
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.letters a {
  display: inline-block;
  min-width: 3rem;
  padding: 0.2rem 0.6rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* Pied de page de la page du wiki */

.page-meta {
  clear: both;
  margin-top: 3.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 1.3rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 2rem;
}

.page-meta p {
  margin: 0;
}

.tag {
  display: inline-block;
  padding: 0.1rem 1rem;
  margin: 0.2rem 0.2rem 0.2rem 0;
  border-radius: 999px;
  background: #eef3ea;
  border: 1px solid #d3e2cb;
}

/* Recherche, formulaires */

.searchform form,
.not-found form {
  display: flex;
  gap: 0.8rem;
  max-width: 56rem;
  margin: 0 0 1.6rem;
}

.searchfield {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.8rem 1.2rem;
  border: 1px solid #c9c4b8;
  border-radius: 6px;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.8rem;
  border: 0;
  border-radius: 6px;
  background: var(--brown);
  color: #fff;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  background: var(--brown-dark);
  color: var(--gold-light);
  text-decoration: none;
}

.search-title {
  font-weight: 600;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Pied de page ---------- */

.footer {
  background: var(--brown-dark);
  color: #e4d6c4;
  font-size: 1.35rem;
  padding: 1.8rem 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 2rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: #fff;
}

.footer a:hover {
  color: var(--gold-light);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Tablettes et téléphones ---------- */

@media (max-width: 900px) {
  .menu a {
    padding: 0.6rem 0.9rem;
    font-size: 1.45rem;
  }

  .header__search {
    width: 20rem;
  }
}

@media (max-width: 760px) {
  .header__links {
    justify-content: center;
  }

  .banner {
    height: 9rem;
  }

  .nav {
    flex-wrap: wrap;
    padding: 0.5rem 0.8rem;
  }

  .nav-toggle {
    display: block;
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    color: #fff;
    text-align: right;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
  }

  .menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    padding: 0.2rem 0 0.4rem;
  }

  .nav.is-open .menu {
    display: flex;
  }

  .header__search {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin: 0.4rem 0 0.3rem;
  }

  .sheet {
    padding: 1.8rem 1.6rem 2rem;
  }

  .page-title {
    font-size: 2.8rem;
  }

  .entry-content h2 {
    font-size: 2.3rem;
  }

  .entry-content table.infobox,
  .toc {
    float: none;
    width: 100%;
    max-width: 38rem;
    margin: 0 auto 2rem;
  }

  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin: 1.6rem auto;
  }

  .cols > .col-half {
    grid-column: auto;
  }

  .entry-content table.wikitable {
    display: block;
    overflow-x: auto;
  }

  .page-histoire .entry-content table.wikitable {
    display: table;
  }
}

@media print {
  .header,
  .footer,
  .trail,
  .toc {
    display: none;
  }

  .sheet {
    box-shadow: none;
    padding: 0;
  }
}

.entry-content {
  overflow-wrap: break-word;
}

/* ---------- Relecture (visible par l'administrateur seulement) ---------- */

mark.rv {
  color: inherit;
  border-radius: 2px;
  cursor: pointer;
  padding: 0.05em 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

mark.rv--ortho { background: #fff0a3; box-shadow: 0 2px 0 #e0b800; }
mark.rv--coherence { background: #ffd8b0; box-shadow: 0 2px 0 #e07b00; }
mark.rv--doute { background: #d4e8ff; box-shadow: 0 2px 0 #3b82d6; }

mark.rv.is-current {
  outline: 2px solid #23272b;
  outline-offset: 1px;
}

.rv-pop {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid #c9c4b8;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: 1.2rem 1.4rem;
  font-size: 1.45rem;
  line-height: 1.5;
}

.rv-pop p {
  margin: 0 0 0.8rem;
}

.rv-pop p:last-child {
  margin-bottom: 0;
}

.rv-pop__kind {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rv-pop__kind--ortho { color: #9a7b00; }
.rv-pop__kind--coherence { color: #b35900; }
.rv-pop__kind--doute { color: #2563ab; }

.rv-pop__fix del {
  color: #a3341a;
  background: #fbe9e4;
  text-decoration-thickness: 1px;
}

.rv-pop__fix ins {
  color: #1f5c22;
  background: #e3f1dc;
  text-decoration: none;
  font-weight: 600;
}

.rv-pop__hint {
  font-size: 1.3rem;
  color: var(--muted);
}

.rv-pop__error {
  color: #a3341a;
  font-weight: 600;
}

.rv-pop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.rv-btn {
  font: inherit;
  font-size: 1.35rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid #c9c4b8;
  border-radius: 6px;
  background: #f6f4ee;
  color: var(--title);
  cursor: pointer;
}

.rv-btn:hover {
  background: #ebe7dc;
  text-decoration: none;
  color: var(--title);
}

.rv-btn--primary {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.rv-btn--primary:hover {
  background: #23652a;
  color: #fff;
}

.rv-panel {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  max-width: calc(100vw - 3.2rem);
  padding: 0.8rem 1.4rem;
  background: #2d3137;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  font-size: 1.4rem;
}

.rv-panel button {
  font: inherit;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 1rem;
  background: #4a5059;
  color: #fff;
  cursor: pointer;
}

.rv-panel button:hover {
  background: #5d646e;
}

.rv-panel .rv-panel__missing {
  background: #8a5a12;
}

.rv-panel a {
  color: var(--gold-light);
}

/* Coche « Vérifié » (relecture) : affichée seulement à l'administrateur connecté (views/verify-badge.php, js/verify.js) */

.verify-badge {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0.8rem 1.2rem;
  padding: 0.4rem 1.1rem 0.4rem 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 99px;
  background: #fbf3df;
  color: var(--brown-dark);
  font: 600 1.25rem/1.2 inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.verify-badge:hover {
  background: #f3e1b0;
}

.verify-badge.is-verified {
  border-color: #2e9d5b;
  background: #e9f6ee;
  color: #1f6e3f;
}

.verify-badge.is-verified:hover {
  background: #d4eedd;
}

.verify-badge__icon {
  font-size: 1.5rem;
}

.verify-badge:disabled {
  opacity: 0.6;
  cursor: wait;
}
