@font-face {
  font-family: "Minecraft";
  src: url("../fonts/Monocraft.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #111214;
  --muted: #9a9fa9;
  --line: #e7e9ef;
  --bg-from: #e9ecf8;
  --bg-to: #f8f9fd;
  --card: #ffffff;
  --accent: #111214;
  --red: #e0352b;
  --red-ink: #7a140e;
  --soft: #f4f5f9;
}

* { box-sizing: border-box; }

::selection { background: var(--red); color: #fff; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Minecraft", monospace;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-from) 0%, var(--bg-to) 60%, #fff 100%) fixed;
  -webkit-font-smoothing: none;
}

img.px, .px img { image-rendering: pixelated; }

.wiki-shot { width: 100%; max-width: 100%; height: auto; display: block; margin: 20px 0 24px; border: 1px solid var(--line); }

a { color: inherit; }

/* ── Carte principale ─────────────────────────────────────────────── */

.shell {
  width: 100%;
  min-height: 100vh;
  background: var(--card);
  overflow-x: clip;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 14px 56px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand img { height: 52px; width: auto; display: block; }
.logo { position: relative; display: block; }
.brand .logo-white { display: none; }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 3px 0;
  background: currentColor;
}

.tabs { display: flex; gap: 32px; padding-left: 8px; }

.tabs a {
  text-decoration: none;
  font-size: 12px;
  color: var(--muted);
}

.tabs a.active, .tabs a:hover { color: var(--ink); }

.topbar-end { display: flex; align-items: center; }

.search { position: relative; z-index: 60; display: flex; align-items: center; gap: 10px; }

/* Suggestions sous la barre de recherche */
.suggest {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 6px 0 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(17, 18, 20, 0.12);
  text-align: left;
  text-shadow: none;
}

.suggest[hidden] { display: none; }

.suggest a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.4;
}

.suggest a:hover, .suggest a.on { background: #f2f3f7; }
.suggest img { width: 28px; height: 28px; flex: none; image-rendering: pixelated; }
.suggest .t { font-size: 12px; }
.suggest .s { margin-top: 2px; font-size: 10px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; }
.suggest .txt { min-width: 0; }
.suggest .all a { margin-top: 6px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.suggest .all a:hover, .suggest .all a.on { color: var(--ink); }

.search input {
  width: 190px;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  text-align: right;
  color: var(--ink);
}

.search input::placeholder { color: var(--muted); }

.search button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  display: flex;
}

.version-pill {
  font-size: 11px;
  color: var(--muted);
  margin-left: 18px;
  white-space: nowrap;
}

.lang-switch {
  margin-left: 14px;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch:hover { color: var(--ink); }

/* ── Pied de page ─────────────────────────────────────────────────── */

.site-foot {
  padding: 28px 56px 36px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.site-foot p { margin: 0; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .heart { color: #e5484d; }

@media (max-width: 760px) {
  .site-foot { padding: 22px 16px 28px; font-size: 10px; }
}

/* ── Corps : 3 colonnes ───────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 400px;
  gap: 56px;
  padding: 32px 56px 72px;
  align-items: start;
}

.side-left {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.side-left ul { list-style: none; margin: 0; padding: 0; }

.side-left li a {
  display: block;
  padding: 3px 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  line-height: 1.6;
}

.side-left li.lvl3 a { padding-left: 12px; }

.side-left li a.with-icon { display: flex; align-items: center; gap: 10px; padding: 5px 0; transition: color 0.15s, transform 0.15s; }
.side-left li a.with-icon img { width: 20px; height: 20px; flex: none; image-rendering: pixelated; }
.side-left li a.with-icon:hover { transform: translateX(3px); }
.side-left li a:hover, .side-left li a.current { color: var(--ink); }

/* Sommaire d'une page : rail vertical, la section lue est marquée */
.side-left .toc { border-left: 2px solid var(--line); }
.side-left .toc li a { position: relative; padding: 4px 0 4px 14px; transition: color 0.15s; }
.side-left .toc li.lvl3 a { padding-left: 26px; font-size: 9px; }
.side-left .toc li a::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}
.side-left .toc li a:hover::before { background: var(--muted); }
.side-left .toc li a.current::before { background: var(--ink); }

.side-left .label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 8px;
}

.side-left .group + .group { margin-top: 28px; }

.side-foot { margin-top: auto; padding-top: 36px; }

.side-foot a {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 3px 0;
}

.side-foot a:hover { color: var(--ink); }

/* ── Article ──────────────────────────────────────────────────────── */

article h1, .page-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 400;
  margin: 8px 0 28px;
  letter-spacing: -0.02em;
}

article h2 {
  position: relative;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  margin: 64px 0 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

/* Petit bloc pixel au-dessus de chaque section */
article h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--ink);
}

.cat-head h2 { padding-top: 0; border-top: 0; }
.cat-head h2::before { display: none; }

article h3 { font-size: 17px; font-weight: 400; margin: 34px 0 10px; scroll-margin-top: 24px; }
article h3::before { content: "› "; color: var(--muted); }

article p, article li { font-size: 13px; line-height: 2; }
article p { margin: 0 0 18px; }
article ul, article ol { padding-left: 22px; margin: 0 0 20px; }
article ul { list-style: none; padding-left: 20px; }
article ul > li { position: relative; }
article ul > li::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 0.85em;
  width: 6px;
  height: 6px;
  background: var(--ink);
}
article ol > li::marker { color: var(--muted); }
article p, article ul, article ol, article blockquote { max-width: 80ch; }
article li { margin-bottom: 4px; }
article strong { font-weight: 400; background: linear-gradient(transparent 62%, rgba(224, 53, 43, 0.22) 62%); }

article a, .link {
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: background 0.12s, color 0.12s;
}

article a:hover { color: var(--red); }

article .lead { font-size: 15px; line-height: 1.9; color: #333; max-width: 70ch; }

article code {
  font-family: inherit;
  font-size: 0.92em;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
}

article pre {
  position: relative;
  background: #14151a;
  color: #e9eaf0;
  padding: 18px 20px 18px 34px;
  overflow-x: auto;
  margin: 0 0 24px;
  max-width: 80ch;
  border-left: 4px solid var(--red);
}

/* Invite de commande façon chat Minecraft */
article pre::before {
  content: ">";
  position: absolute;
  left: 14px;
  top: 18px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--red);
}

article pre code { background: none; border: 0; padding: 0; font-size: 12px; }

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 12px;
  border: 1px solid var(--line);
}

article th, article td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}

article th {
  font-weight: 400;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--ink);
}

article tbody tr:nth-child(even) { background: #fafbfd; }
article tbody tr:hover { background: var(--soft); }
article td:first-child code { white-space: nowrap; }

article blockquote {
  position: relative;
  margin: 0 0 24px;
  padding: 16px 20px 16px 22px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  color: #333;
}

article blockquote p { margin: 0; }
article blockquote p + p { margin-top: 10px; }
article blockquote strong { background: none; }

/* Version d'ajout */
article p.since {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -12px 0 28px;
  padding: 2px 10px;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-ink);
  background: rgba(224, 53, 43, 0.14);
  border: 1px solid rgba(224, 53, 43, 0.55);
}

article p.since::before { content: ""; width: 6px; height: 6px; background: var(--red); }

.page-link .tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
  border: 1px solid var(--line);
  vertical-align: 1px;
}

.crumbs {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.crumbs a { text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
.crumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Colonne droite ───────────────────────────────────────────────── */

.side-right { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 24px; }

.hero-card {
  position: relative;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  --hp: 28px;
  padding: var(--hp);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(10, 11, 16, 0) 35%, rgba(10, 11, 16, 0.85) 100%),
    radial-gradient(ellipse at 50% 30%, rgba(224, 53, 43, 0.12) 0%, rgba(224, 53, 43, 0) 60%),
    repeating-conic-gradient(#2a2d38 0% 25%, #23252f 0% 50%) 0 0 / 32px 32px;
  overflow: hidden;
}

.hero-card .big-icon {
  position: absolute;
  top: 56px;
  left: 50%;
  width: 176px;
  height: 176px;
  transform: translateX(-50%);
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 0 rgba(0, 0, 0, 0.35));
  animation: hero-float 4s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

.hero-card .big-fallback {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 80px;
  opacity: 0.4;
}

/* Visionneuse 3D (modèles réels du mod) */
.hero-card.has-model { padding-top: 0; min-height: 520px; }

.viewer {
  position: relative;
  flex: 1;
  min-height: 320px;
  margin: 0 calc(var(--hp) * -1) 8px;
  cursor: grab;
}

.viewer:active { cursor: grabbing; }
/* OrbitControls force touch-action:none en ligne, ce qui bloque le défilement de la page au doigt.
   pan-y laisse défiler verticalement et garde la rotation horizontale. */
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y !important; }
.viewer .fallback { position: absolute; top: 50%; left: 50%; width: 140px; height: 140px; transform: translate(-50%, -50%); image-rendering: pixelated; opacity: 0.9; }
.viewer.ready .fallback { display: none; }

.viewer .hint {
  position: absolute;
  right: 14px;
  bottom: 4px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e94a6;
  pointer-events: none;
}

.model-tabs { position: absolute; top: 14px; left: 14px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }

.model-tabs button {
  font: inherit;
  font-size: 10px;
  color: #cfd3df;
  background: rgba(10, 11, 16, 0.55);
  border: 1px solid #4a4e5c;
  padding: 4px 10px;
  cursor: pointer;
}

.model-tabs button:hover { color: #fff; border-color: #fff; }
.model-tabs button.on { background: #fff; color: #111214; border-color: #fff; }

.hero-card .kv { font-size: 11px; line-height: 1.9; }
.hero-card .kv b { font-weight: 400; color: #aab0c0; }
.hero-card .kv div { display: flex; gap: 8px; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.hero-card .kv div span:first-child { color: #aab0c0; min-width: 96px; }

.hero-card .more {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}

.hero-card .more:hover { color: var(--red); }

.hero-card h3 { font-size: 20px; font-weight: 400; line-height: 1.3; margin: 0 0 12px; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); }

.logo-card {
  background: #14151a;
  padding: 36px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-card img { width: 100%; height: auto; display: block; image-rendering: pixelated; }

.recipe-card { padding: 20px 24px 24px; background: var(--soft); }

.recipe-card .label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.recipe-card .arrow { font-size: 22px; }

.recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 48px); gap: 4px; }

.slot {
  width: 48px;
  height: 48px;
  background: #8b8b8b;
  border: 2px solid;
  border-color: #373737 #fff #fff #373737;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.slot img { width: 32px; height: 32px; image-rendering: pixelated; }

/* Échanges d'un villageois : objet donné → objet reçu */
.trades { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; margin: 0 0 28px; }
.trade { display: flex; align-items: center; gap: 10px; }
.trade .arrow { font-size: 18px; }
.slot .n { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.slot.ench img { filter: drop-shadow(0 0 3px #b46cff); }
.trade-label { font-size: 11px; line-height: 1.4; }
.arrow { font-size: 22px; color: var(--muted); }

/* ── Accueil du wiki ──────────────────────────────────────────────── */

.cat-block { margin-bottom: 52px; scroll-margin-top: 24px; }

.cat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.cat-head img { width: 40px; height: 40px; image-rendering: pixelated; }
.cat-head h2 { margin: 0; font-size: 26px; font-weight: 400; }
.cat-desc { font-size: 12px; color: #666; margin: 0 0 18px 56px; }

/* Liste des pages : lignes séparées par un trait fin, sur deux colonnes */
.page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: 40px;
  margin-left: 56px;
  border-top: 1px solid var(--line);
}

.page-link {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.page-link > div { flex: 1; min-width: 0; }

/* Flèche rouge qui apparaît au survol */
.page-link::after {
  content: "→";
  flex: none;
  color: var(--red);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
}

.page-link .t { transition: color 0.15s; }
.page-link:hover .t { color: var(--red); }
.page-link:hover::after { opacity: 1; transform: none; }

.cat-block.collapsed .page-link.extra { display: none; }

.cat-more { margin: 16px 0 0 56px; }
.cat-more[hidden] { display: none; }

/* « Voir plus » : bouton texte, souligné en rouge */
.cat-more button {
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 2px solid var(--red);
  cursor: pointer;
  transition: color 0.15s;
}

.cat-more button::after { content: " ↓"; color: var(--red); }
.cat-more button:hover { color: var(--red); }
.page-link img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.page-link .t { font-size: 13px; line-height: 1.4; }
.page-link .s { font-size: 10px; line-height: 1.5; color: var(--muted); margin-top: 2px; }

/* ── Recherche ────────────────────────────────────────────────────── */

/* Grand champ de recherche en haut de la page */
.search-big {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 80ch;
  margin: 0 0 28px;
  padding: 0 0 0 18px;
  border: 2px solid var(--ink);
  transition: border-color 0.15s;
}

.search-big:focus-within { border-color: var(--red); }
.search-big svg { flex: none; color: var(--muted); }
.search-big:focus-within svg { color: var(--red); }

.search-big input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.search-big input::placeholder { color: var(--muted); }
.search-big input::-webkit-search-cancel-button { cursor: pointer; }

.search-big button {
  align-self: stretch;
  padding: 0 22px;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.search-big button:hover { background: var(--red); }

.search-count { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }
.search-count b { font-weight: 400; color: var(--ink); }
article .search-count a { border-bottom-color: var(--red); }

/* Liste des résultats */
.results { max-width: 80ch; border-top: 1px solid var(--line); }

.result {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

article a.result { border-bottom: 1px solid var(--line); }
article a.result:hover { color: inherit; }

.result-icon { flex: none; width: 40px; height: 40px; margin-top: 4px; }
.result-icon img { width: 40px; height: 40px; image-rendering: pixelated; }
.result-body { flex: 1; min-width: 0; }

.result .meta { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); line-height: 1.6; }
.result .t { display: inline-block; font-size: 17px; line-height: 1.4; transition: color 0.15s; }
.result:hover .t { color: var(--red); }
.result .sum { font-size: 12px; line-height: 1.7; color: #444; margin-top: 2px; }
.result .s { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }

.result .go {
  flex: none;
  align-self: center;
  color: var(--red);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.15s, transform 0.15s;
}

.result:hover .go { opacity: 1; transform: none; }

/* Mots trouvés : soulignés en rouge, pas de fond */
.result mark { background: none; color: inherit; border-bottom: 2px solid var(--red); }
.result .s mark { color: var(--ink); }

/* Filtre par catégorie (colonne de gauche) */
.side-left .facets li a { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.side-left .facets .n { margin-left: auto; padding-left: 10px; color: var(--muted); letter-spacing: 0; }
.side-left .facets a.current { color: var(--ink); }
.side-left .facets a.current .n { color: var(--red); }

/* Raccourcis vers les catégories (aucune recherche / aucun résultat) */
.search-cats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; max-width: 80ch; }

article .search-cats a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s;
}

article .search-cats a:hover { color: var(--red); border-bottom-color: var(--red); }
.search-cats img { width: 24px; height: 24px; image-rendering: pixelated; }

.search-empty { max-width: 80ch; padding: 8px 0 0; }
.search-empty .big { font-size: 17px; margin-bottom: 6px; }
.search-empty p { color: var(--muted); }
.search-empty .big { color: var(--ink); }

/* ── Téléchargement ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  border: 0;
  transition: background 0.15s;
}

.btn:hover { background: var(--red); }
article a.btn { border: 0; color: #fff; }
article a.btn:hover { background: var(--red); color: #fff; }

.dl-stores { display: flex; flex-wrap: wrap; gap: 14px; }
.dl-meta { font-size: 11px; color: var(--muted); line-height: 1.9; margin: 18px 0 0; }
.dl-meta .hash { word-break: break-all; }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li { position: relative; padding-left: 44px; margin-bottom: 14px; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}

.old-files a { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 0; text-decoration: none; }
.old-files a:hover { background: #f4f5f9; }

.empty { color: var(--muted); }

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .layout { gap: 36px; padding: 28px 36px 64px; grid-template-columns: 220px minmax(0, 1fr) 340px; }
  .topbar { padding: 14px 36px; }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .side-right { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .hero-card { min-height: 360px; }
}

@media (max-width: 760px) {
  body { font-size: 13px; }

  /* Barre du haut : ligne 1 = menu + logo | version + loupe, ligne 2 = onglets */
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 20px; gap: 6px 12px; }
  .brand { gap: 8px; min-width: 0; }
  .brand img { height: 40px; }
  .menu-toggle { display: block; padding: 10px 8px; margin-left: -8px; }
  .menu-toggle.unused { display: none; }
  .tabs { grid-column: 1 / -1; padding: 0; gap: 24px; }
  .tabs a { padding: 6px 0; font-size: 12px; }
  .topbar-end { gap: 14px; justify-self: end; }
  .version-pill { margin-left: 0; font-size: 10px; }

  /* Recherche : simple loupe, le champ s'ouvre par-dessus la barre */
  .search { gap: 0; }
  .search input { display: none; }
  .search button { padding: 10px 0 10px 10px; }
  .search.open {
    position: absolute;
    inset: 0;
    z-index: 60;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .search.open input {
    display: block;
    flex: 1;
    min-width: 0;
    width: auto;
    height: 100%;
    text-align: left;
    font-size: 16px; /* évite le zoom automatique d'iOS au focus */
    color: var(--ink) !important;
    text-shadow: none !important;
  }
  .search.open input::placeholder { color: var(--muted) !important; }
  .search.open button { color: var(--ink) !important; text-shadow: none !important; padding-left: 14px; }
  .suggest { top: 100%; left: 0; right: 0; width: auto; max-width: none; border-width: 0 0 1px; box-shadow: 0 10px 20px rgba(17, 18, 20, 0.12); }

  /* Corps : une seule colonne */
  .layout { grid-template-columns: minmax(0, 1fr); padding: 8px 20px 40px; gap: 24px; }
  .side-left { display: none; position: static; min-height: 0; max-height: none; padding: 12px 0 20px; border-bottom: 1px solid var(--line); }
  .side-left.open { display: flex; }
  .side-left li a, .side-foot a { padding: 7px 0; font-size: 11px; }
  .side-foot { padding-top: 20px; }

  article h1, .page-title { font-size: 30px; margin-bottom: 20px; }
  article h2 { font-size: 22px; margin: 40px 0 14px; }
  article h3 { font-size: 16px; }
  article { overflow-wrap: break-word; }
  article img { max-width: 100%; height: auto; }
  article table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  article pre { padding: 14px 16px 14px 30px; margin-left: -20px; margin-right: -20px; box-shadow: none; }
  article pre::before { left: 12px; top: 14px; }
  article h2 { padding-top: 18px; }

  .side-right { grid-template-columns: minmax(0, 1fr); }
  .side-right:empty { display: none; }
  .hero-card { --hp: 20px; min-height: 280px; }
  .hero-card.has-model { min-height: 440px; }
  .viewer { min-height: 300px; }
  .hero-card .big-icon { width: 140px; height: 140px; top: 40px; }
  .hero-card .kv div span:first-child { min-width: 84px; }
  .recipe-card { padding: 18px 18px 20px; }

  /* Accueil du wiki : tout aligné sur la même marge gauche */
  .cat-block { margin-bottom: 36px; }
  .cat-head { gap: 12px; margin-bottom: 8px; }
  .cat-head h2 { font-size: 22px; line-height: 1.2; }
  .cat-head img { width: 32px; height: 32px; flex: none; }
  .cat-desc { margin: 0 0 14px; }
  .page-list { margin-left: 0 !important; grid-template-columns: minmax(0, 1fr); }
  .cat-more { margin-left: 0; }
  .page-link { padding: 12px 0; gap: 12px; min-height: 56px; }
  .page-link::after { opacity: 1; transform: none; color: var(--muted); }
  .page-link .t { overflow-wrap: anywhere; }
  .logo-card { display: none; } /* le logo est déjà dans la barre du haut */

  .result .t { font-size: 15px; }
  .result { gap: 14px; padding: 16px 0; }
  .result-icon, .result-icon img { width: 32px; height: 32px; }
  .result .go { display: none; }
  .search-big { padding-left: 14px; gap: 10px; }
  .search-big input { font-size: 16px; padding: 12px 0; }
  .search-big button { padding: 0 14px; }

  .dl-stores { flex-direction: column; }
  .btn { width: 100%; justify-content: center; padding: 16px 20px; }
}

@media (max-width: 420px) {
  .topbar { padding: 8px 16px; }
  .version-pill .mc { display: none; }
  .layout { padding: 4px 16px 32px; }
  .search.open { padding: 0 16px; }
  article h1, .page-title { font-size: 26px; }
  article pre { margin-left: -16px; margin-right: -16px; }
  .hero-card { --hp: 16px; padding: 20px 16px; }
  .hero-card.has-model { padding-top: 0; }
}

@media (hover: none) {
  .page-link:hover .t { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card .big-icon { animation: none; }
}

/* ── Finitions des pages du wiki ──────────────────────────────────── */

/* Barre de lecture rouge en haut de l'écran */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Titre de page : petit soulignement rouge en pixels */
.layout > article > h1 { position: relative; padding-bottom: 18px; }
.layout > article > h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 6px;
  background:
    linear-gradient(90deg, var(--red) 0 33.3%, var(--red-ink) 33.3% 66.6%, var(--ink) 66.6%);
}
.layout > article > h1 + p.since { margin-top: 0; }

/* Le trait au-dessus des h2 devient rouge */
article h2::before { background: var(--red); }

/* Lien « # » à côté des titres, visible au survol */
article .anchor {
  margin-left: 10px;
  padding: 0 4px;
  border: 0;
  font-size: 0.7em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
article h2:hover .anchor, article h3:hover .anchor, article .anchor:focus { opacity: 1; }
article .anchor:hover { background: none; color: var(--red); }

/* Section ciblée par un lien : léger flash */
article h2:target, article h3:target { animation: target-flash 1.4s ease-out; }
@keyframes target-flash {
  0%   { background: rgba(224, 53, 43, 0.16); }
  100% { background: transparent; }
}

/* Liens dans le texte : soulignement rouge */
article p a, article li a, article td a { border-bottom-color: var(--red); border-bottom-width: 2px; }
article p a:hover, article li a:hover, article td a:hover { color: var(--red); }

/* Puces des listes en rouge */
article ul > li::before { background: var(--red); }

/* Bouton « Copier » des blocs de commande */
article pre .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
  padding: 3px 10px;
  color: #8e94a6;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
article pre:hover .copy, article pre .copy:focus { opacity: 1; }
article pre .copy:hover { color: #fff; }
article pre .copy.done { opacity: 1; color: var(--red); }

/* Touches dans les tableaux (« **R** ») : rendues comme une touche de clavier */
article td:first-child > strong:only-child {
  display: inline-block;
  min-width: 28px;
  padding: 0 8px;
  text-align: center;
  background: var(--soft);
  border: 1px solid var(--line);
}



/* Citations : barre rouge */
article blockquote { border-left-color: var(--red); }

/* Sommaire : section en cours en rouge */
.side-left .toc li a.current { color: var(--ink); }
.side-left .toc li a.current::before { background: var(--red); }

/* Navigation précédent / suivant en bas de page */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.page-nav a {
  display: block;
  padding: 4px 0;
  border: 0;
  text-decoration: none;
}

.page-nav a:hover { background: none; color: var(--red); }
.page-nav a:hover span { color: var(--red); }
.page-nav span { display: block; margin-bottom: 6px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.page-nav div { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.4; }
.page-nav img { width: 28px; height: 28px; flex: none; image-rendering: pixelated; }
.page-nav .next { grid-column: 2; text-align: right; }
.page-nav .next div { justify-content: flex-end; }


/* Onglet actif de la barre du haut : trait rouge */
.tabs a { position: relative; }
.tabs a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--red);
}

@media (max-width: 760px) {
  .page-nav { grid-template-columns: 1fr; margin-top: 48px; }
  .page-nav .next { grid-column: 1; }

  article .anchor { display: none; }
  article pre .copy { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  article h2:target, article h3:target { animation: none; }
}
