/* ============================================================
   WIKI « LORE » — le grimoire ouvert
   L'accueil (/lore) est le rayon de grimoires reliés cuir
   (parchemin.css) ; ici, les pages intérieures : fil d'Ariane,
   catégorie (sommaire de tome), page (manuscrit), scriptorium.
   Chargé après parchemin.css → variables (--titre, --or…) dispo.
   ============================================================ */

/* — Fil d'Ariane : ruban de lecture — */
.wk-fil{ display:flex; align-items:center; flex-wrap:wrap; gap:8px;
  font-family:var(--serif); font-size:13px; margin:0 0 20px; }
.wk-fil a{ text-decoration:none; color:#7a5a1f; font-weight:600; letter-spacing:.3px;
  padding:3px 11px; border-radius:20px; background:rgba(255,255,255,.38);
  border:1px solid rgba(208,177,110,.55); box-shadow:inset 0 1px 0 rgba(255,255,255,.5);
  transition:background .15s ease, color .15s ease, border-color .15s ease; }
.wk-fil a:hover{ background:#fff3d3; color:var(--encre); border-color:var(--or); }
.wk-fil-sep{ color:var(--or-fonce); font-size:11px; opacity:.8; }

/* — En-tête cérémonieux (catégorie / page / scriptorium) — */
.wk-tete{ text-align:center; margin:0 0 24px; }
.wk-kicker{ display:inline-block; font-family:var(--titre); font-weight:600;
  font-size:11px; letter-spacing:2.5px; text-transform:uppercase; color:#8a6a28;
  background:rgba(255,255,255,.42); border:1px solid var(--bord); border-radius:20px;
  padding:4px 15px; margin:0 0 12px; box-shadow:inset 0 1px 0 rgba(255,255,255,.6); }
.wk-titre{ font-family:var(--titre); font-weight:700; letter-spacing:.5px;
  font-size:clamp(25px,3.4vw,38px); line-height:1.1; margin:0; color:var(--encre);
  text-shadow:0 1px 0 rgba(255,255,255,.4); }
.wk-soustitre{ font-family:var(--plume); font-style:italic; font-size:18px;
  color:#5a431f; margin:9px auto 0; max-width:640px; }
.wk-orne{ display:flex; align-items:center; justify-content:center; gap:14px;
  max-width:300px; margin:15px auto 0; color:var(--or-fonce); }
.wk-orne::before, .wk-orne::after{ content:""; flex:1; height:1px;
  background:linear-gradient(90deg, transparent, var(--or-fonce), transparent); }
.wk-orne span{ font-size:15px; opacity:.85; }

/* sceau doré : initiale enluminée de la catégorie (écho des grimoires de l'accueil) */
.wk-sceau{ position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:64px; height:64px; margin:0 0 14px;
  font-family:var(--titre); font-size:34px; font-weight:700; color:#3a2a0f;
  background:linear-gradient(158deg,#fff4cf 0%,#e8c265 52%,#c2933a 100%);
  border:2px solid #7a5a24; border-radius:12px; transform:rotate(-2deg);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 8px rgba(110,78,18,.5),
    0 8px 18px rgba(60,36,8,.35), 0 0 0 1px rgba(0,0,0,.25);
  text-shadow:0 1px 0 rgba(255,255,255,.5); }
.wk-sceau::before, .wk-sceau::after{ content:""; position:absolute; width:9px; height:9px;
  border:1.5px solid rgba(90,67,20,.7); }
.wk-sceau::before{ top:5px; left:5px; border-right:0; border-bottom:0; }
.wk-sceau::after{ bottom:5px; right:5px; border-left:0; border-top:0; }

/* — Barre d'actions (Nouvelle page…) — */
.wk-actions{ display:flex; justify-content:center; flex-wrap:wrap; gap:10px; margin:0 0 8px; }

/* — Titres de section : capitales entre filets dorés — */
.wk-section{ display:flex; align-items:center; gap:14px; margin:30px 0 16px;
  font-family:var(--titre); font-weight:700; font-size:16px; letter-spacing:2px;
  text-transform:uppercase; color:#6a4f1c; }
.wk-section::before, .wk-section::after{ content:""; flex:1; height:1px;
  background:linear-gradient(90deg, transparent, rgba(138,109,47,.55), transparent); }

/* — Sous-catégories : petits tomes reliés cuir — */
.wk-tomes{ display:grid; grid-template-columns:repeat(auto-fill, minmax(235px,1fr)); gap:14px; }
.wk-tome{ position:relative; overflow:hidden; isolation:isolate;
  display:flex; align-items:center; gap:12px;
  padding:13px 15px 13px 24px; text-decoration:none; color:#f0e0b4; border-radius:7px;
  background:
    radial-gradient(130% 110% at 50% 0%, rgba(140,92,44,.4), transparent 62%),
    linear-gradient(160deg, #4c3018 0%, #3a2413 55%, #2b190b 100%);
  border:1px solid #170d04;
  box-shadow:0 8px 18px rgba(18,9,2,.4), inset 0 0 0 2px rgba(0,0,0,.4),
    inset 0 0 0 3px rgba(200,162,86,.5);
  transition:transform .18s ease, box-shadow .18s ease; }
/* dos à nerfs, comme les grands grimoires de l'accueil */
.wk-tome::before{ content:""; position:absolute; inset:0 auto 0 0; width:10px; z-index:1;
  background:
    repeating-linear-gradient(180deg, transparent 0 14px, rgba(0,0,0,.5) 14px 16px,
      rgba(255,216,142,.3) 16px 17px, transparent 17px 21px),
    linear-gradient(90deg, #5c3b1d, #3a2412);
  border-right:1px solid rgba(200,162,86,.4); box-shadow:inset -2px 0 4px rgba(0,0,0,.5); }
.wk-tome:hover, .wk-tome:focus-visible{ transform:translateY(-4px); outline:none;
  box-shadow:0 14px 28px rgba(18,9,2,.55), inset 0 0 0 2px rgba(0,0,0,.4),
    inset 0 0 0 3px rgba(232,190,110,.85); }
.wk-tome-init{ flex:none; width:38px; height:38px; display:flex; align-items:center; justify-content:center;
  font-family:var(--titre); font-size:20px; font-weight:700; color:#3a2a0f;
  background:linear-gradient(158deg,#fff4cf,#e8c265 52%,#c2933a);
  border:1px solid #7a5a24; border-radius:8px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 3px 8px rgba(12,6,1,.45);
  transition:transform .18s ease; }
.wk-tome:hover .wk-tome-init{ transform:rotate(-3deg) scale(1.07); }
.wk-tome-corps{ min-width:0; }
.wk-tome-nom{ display:block; font-family:var(--titre); font-size:14.5px; font-weight:700;
  color:#f4e6b4; line-height:1.2; text-shadow:0 1px 2px rgba(0,0,0,.4); transition:color .15s ease; }
.wk-tome:hover .wk-tome-nom{ color:#ffd980; }
.wk-tome-compte{ display:block; font-family:var(--serif); font-style:italic; font-size:11.5px;
  color:#cba869; margin-top:2px; }
.wk-tome-compte::before{ content:"❧ "; font-style:normal; }

/* — Pages : table des matières à points de conduite — */
.wk-sommaire{ list-style:none; margin:0; padding:0; }
.wk-sommaire a{ display:flex; align-items:baseline; gap:12px; padding:11px 14px;
  text-decoration:none; border-radius:9px;
  border-bottom:1px dashed rgba(138,109,47,.35);
  transition:background .15s ease; }
.wk-sommaire li:last-child a{ border-bottom-color:transparent; }
.wk-som-fleuron{ flex:none; align-self:center; color:var(--or-fonce); font-size:13px;
  transition:transform .2s ease, color .2s ease; }
.wk-som-titre{ font-family:var(--serif); font-weight:700; font-size:16.5px; color:#4a3312;
  transition:color .15s ease; }
.wk-som-pts{ flex:1; min-width:30px; border-bottom:2px dotted rgba(138,109,47,.4);
  transform:translateY(-4px); }
.wk-som-lire{ flex:none; font-family:var(--titre); font-size:10.5px; font-weight:600;
  letter-spacing:1.5px; text-transform:uppercase; color:#8a6a28;
  opacity:0; transform:translateX(-4px); transition:opacity .18s ease, transform .18s ease; }
.wk-sommaire a:hover, .wk-sommaire a:focus-visible{ background:rgba(255,246,222,.65); outline:none; }
.wk-sommaire a:hover .wk-som-titre{ color:var(--encre); }
.wk-sommaire a:hover .wk-som-fleuron{ transform:rotate(-14deg) scale(1.2); color:#a8842f; }
.wk-sommaire a:hover .wk-som-lire, .wk-sommaire a:focus-visible .wk-som-lire{ opacity:1; transform:none; }

/* — Page : le manuscrit — */
.wk-page-tete{ margin-bottom:18px; }
.wk-contenu{ max-width:820px; margin:0 auto; font-size:16px; line-height:1.75; color:#33240f; }
/* lettrine (posée par le gabarit seulement quand le texte commence par une lettre) */
.wk-lettrine::first-letter{ font-family:var(--titre); font-weight:700; font-size:3.1em;
  float:left; line-height:.82; padding:4px 9px 0 0; color:#8a5f1a;
  text-shadow:0 1px 0 rgba(255,255,255,.5); }
.wk-contenu .bb-h{ display:flex; align-items:center; gap:12px; margin:1.5em 0 .55em;
  font-family:var(--titre); font-size:21px; font-weight:700; letter-spacing:.5px;
  color:var(--encre); border:0; }
.wk-contenu .bb-h::after{ content:""; flex:1; height:1px;
  background:linear-gradient(90deg, var(--or-fonce), transparent); }
/* images : encadrées comme des enluminures. Échelle propre à la colonne de
   lecture (820px) — plus généreuse que le forum, où les mêmes classes valent
   180/360/600 dans des messages étroits */
.wk-contenu img.bb-img{ max-width:100%; height:auto; display:block; margin:14px auto;
  border-radius:10px; border:1px solid var(--or-fonce);
  box-shadow:0 10px 24px rgba(60,36,8,.28), 0 0 0 4px rgba(255,255,255,.35); }
.wk-contenu img.bb-img-petit{ max-width:260px; }
.wk-contenu img.bb-img-moyen{ max-width:660px; }
.wk-contenu img.bb-img-grand{ max-width:820px; }
.wk-contenu img.bb-img-pleine{ max-width:100%; }
.wk-contenu .bb-center{ text-align:center; }

/* — Colophon : signature du copiste + actions — */
.wk-colophon{ text-align:center; max-width:820px; margin:34px auto 0; }
.wk-maj{ font-family:var(--plume); font-style:italic; font-size:15.5px; color:#6b5526; margin:12px 0 0; }
.wk-page-actions{ display:flex; justify-content:center; align-items:center; flex-wrap:wrap;
  gap:10px; margin-top:14px; }

/* — Scriptorium (formulaire nouvelle page / édition) — */
.wk-scriptorium{ max-width:860px; margin:0 auto;
  background:linear-gradient(180deg,#f7ecd2,#efe1bd);
  border:1px solid var(--bord); border-radius:14px; padding:22px 24px 20px;
  box-shadow:0 10px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.55); }
.wk-champ{ margin:0 0 16px; }
.wk-champ > label{ display:block; font-family:var(--titre); font-size:11.5px; font-weight:600;
  letter-spacing:1.5px; text-transform:uppercase; color:#6a4f1c; margin:0 0 6px; }
.wk-champ input, .wk-champ select, .wk-champ textarea{ width:100%; box-sizing:border-box; }
.wk-aide{ color:#6b5526; font-size:13px; font-style:italic; margin:10px 0 16px; }
.wk-aide code{ font-style:normal; }
.wk-envoi{ display:flex; justify-content:center; margin:4px 0 0; }

/* — Entrées en scène — */
@media (prefers-reduced-motion: no-preference){
  .wk-tete, .wk-tome, .wk-sommaire li, .wk-contenu, .wk-colophon, .wk-scriptorium{
    animation:monte .5s cubic-bezier(.2,.7,.2,1) both; }
  .wk-tome{ animation-delay:calc(var(--i,0) * 45ms); }
  .wk-sommaire li{ animation-delay:calc(var(--i,0) * 35ms); }
}

@media (max-width:640px){
  .wk-som-lire{ display:none; }
  .wk-scriptorium{ padding:16px 14px; }
}

/* — Mentions [[Page]] / @Perso (rendu BBCode + autocomplétion) — */
.mention { text-decoration:none; border-bottom:1px dotted currentColor; }
.mention-page { color:#6b4e9e; }
.mention-perso { color:#2e7d32; }
.mention-pop { border:1px solid #b89b5e; background:#f4ead0; border-radius:6px; max-height:200px; overflow:auto; margin:2px 0; box-shadow:0 4px 10px rgba(0,0,0,.15); }
.mention-it { padding:5px 12px; cursor:pointer; }
.mention-it.sel, .mention-it:hover { background:#e0c98a; }

/* — Héritage (arbre admin / anciens gabarits) — */
.wk-cat{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.wk-cat-nom{ text-decoration:none; }
.wk-compte{ color:#6b5526; font-size:13px; }
.wk-desc{ color:#6b5526; font-size:14px; width:100%; }
.wk-pages{ list-style:none; padding:0; margin:0; }
.wk-pages li{ padding:6px 0; border-bottom:1px solid rgba(138,109,47,.25); }
