/* Wiki GRD Télécom : tutoriels par niveaux. Couleurs du site (site.css) ; une teinte par niveau. */
:root { --lv-facile: var(--teal); --lv-intermediaire: #6ea8ff; --lv-confirme: var(--accent); --lv-expert: #ff7a8a; }
[data-lv="facile"] { --lv: var(--lv-facile); } [data-lv="intermediaire"] { --lv: var(--lv-intermediaire); }
[data-lv="confirme"] { --lv: var(--lv-confirme); } [data-lv="expert"] { --lv: var(--lv-expert); } [data-lv="tous"] { --lv: var(--fg); }

/* ── En-tête ─────────────────────────────────────────────────────────────────────────── */
.wk-hero { position: relative; overflow: hidden; padding: 34px 0 40px; isolation: isolate; }
.wk-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 85% 10%, color-mix(in srgb, var(--teal) 20%, transparent), transparent 60%), radial-gradient(50% 70% at 10% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%); }
.wk-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(70% 90% at 70% 30%, #000, transparent 75%); opacity: .55; }
.wk-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 30px; align-items: center; margin-top: 10px; }
.wk-hero h1 { margin: 10px 0 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.wk-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--teal), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wk-hero .lead { max-width: 60ch; }
.wk-search { display: flex; align-items: center; gap: 12px; margin-top: 22px; max-width: 640px; padding: 0 16px; min-height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: inset 0 0 0 1px var(--line), 0 14px 40px #0004; backdrop-filter: blur(10px); transition: box-shadow .25s; }
.wk-search:focus-within { box-shadow: inset 0 0 0 2px var(--teal), 0 18px 50px color-mix(in srgb, var(--teal) 20%, transparent); }
.wk-search svg { width: 22px; height: 22px; color: var(--teal); flex: none; }
.wk-search input, .wk-search input:focus { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: none; color: var(--fg); font: 600 16px var(--body); }
.wk-search kbd { padding: 2px 8px; border-radius: 6px; font: 700 12px var(--mono); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.wk-orbit { position: relative; aspect-ratio: 1; max-width: 300px; justify-self: center; width: 100%; }
.wk-orb { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--teal) 40%, transparent); animation: wk-spin 26s linear infinite; }
.wk-orb::after { content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 18px var(--teal); }
.wk-orb.o2 { inset: 14%; border-color: color-mix(in srgb, var(--accent) 45%, transparent); animation-duration: 18s; animation-direction: reverse; }
.wk-orb.o2::after { background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.wk-orb.o3 { inset: 28%; border-color: color-mix(in srgb, #ff7a8a 45%, transparent); animation-duration: 12s; }
.wk-orb.o3::after { background: #ff7a8a; box-shadow: 0 0 18px #ff7a8a; }
.wk-orbit-card { position: absolute; inset: 36%; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.wk-orbit-card b { font: 800 clamp(24px, 3vw, 34px)/1 var(--display); }
.wk-orbit-card small { color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
@keyframes wk-spin { to { transform: rotate(360deg); } }

/* Niveaux : cinq grandes tuiles cliquables. */
.wk-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.wk-level { position: relative; display: grid; gap: 4px; padding: 16px; text-align: left; border: 0; border-radius: 20px; cursor: pointer; color: var(--fg); background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s, box-shadow .25s, background .25s; overflow: hidden; }
.wk-level::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lv); transform: scaleX(0); transform-origin: left; transition: transform .35s; }
.wk-level:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 55%, transparent); }
.wk-level[aria-pressed="true"] { background: color-mix(in srgb, var(--lv) 14%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--lv), 0 14px 34px color-mix(in srgb, var(--lv) 18%, transparent); }
.wk-level[aria-pressed="true"]::after { transform: scaleX(1); }
.wk-level-top { display: flex; align-items: center; justify-content: space-between; }
.wk-level-top b { font: 800 22px var(--display); color: var(--lv); }
.wk-level-name { font: 800 15px var(--body); }
.wk-level small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.wk-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.wk-bars i { width: 5px; border-radius: 2px; background: color-mix(in srgb, var(--fg) 18%, transparent); }
.wk-bars i:nth-child(1) { height: 6px; } .wk-bars i:nth-child(2) { height: 9px; } .wk-bars i:nth-child(3) { height: 12px; } .wk-bars i:nth-child(4) { height: 16px; }
.wk-bars i.on { background: var(--lv, var(--teal)); }
.wk-bars.all i.on:nth-child(1) { background: var(--lv-facile); } .wk-bars.all i.on:nth-child(2) { background: var(--lv-intermediaire); } .wk-bars.all i.on:nth-child(3) { background: var(--lv-confirme); } .wk-bars.all i.on:nth-child(4) { background: var(--lv-expert); }
.wk-lv { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border-radius: 999px; font: 800 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lv); background: color-mix(in srgb, var(--lv) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 35%, transparent); }
.wk-lv .wk-bars { height: 12px; } .wk-lv .wk-bars i { width: 3px; } .wk-lv .wk-bars i:nth-child(1) { height: 4px; } .wk-lv .wk-bars i:nth-child(2) { height: 7px; } .wk-lv .wk-bars i:nth-child(3) { height: 9px; } .wk-lv .wk-bars i:nth-child(4) { height: 12px; }

/* ── Liste ───────────────────────────────────────────────────────────────────────────── */
.wk-band { padding-top: 18px; }
.wk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.wk-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-cats button { padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer; font: 700 13px var(--body); color: var(--muted); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, background .2s, box-shadow .2s; }
.wk-cats button:hover { color: var(--fg); }
.wk-cats button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.wk-count { margin: 0; color: var(--muted); font: 700 13px var(--mono); }
.wk-demo { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; color: var(--muted); font-size: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; perspective: 1200px; }
.wk-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 260px; padding: 20px; border-radius: 22px; overflow: hidden; isolation: isolate; color: var(--fg); text-decoration: none; background: linear-gradient(160deg, color-mix(in srgb, var(--lv) 9%, var(--surface)), var(--surface) 55%); box-shadow: inset 0 0 0 1px var(--line); transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateZ(0); transform-style: preserve-3d; transition: transform .18s ease-out, box-shadow .3s; }
.wk-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lv); opacity: .85; }
.wk-card:hover, .wk-card:focus-visible { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 60%, transparent), 0 22px 50px color-mix(in srgb, var(--lv) 16%, #0005); outline: none; }
.wk-card-glow { position: absolute; inset: 0; z-index: -1; opacity: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--lv) 24%, transparent), transparent 70%); transition: opacity .3s; }
.wk-card:hover .wk-card-glow { opacity: 1; }
.wk-card-top { display: flex; align-items: center; gap: 8px; }
.wk-ex { padding: 3px 8px; border-radius: 999px; font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.wk-done { margin-left: auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 900; color: var(--accent-ink); background: var(--teal); }
.wk-card-num { position: absolute; right: 14px; top: 6px; z-index: -1; font: 800 64px/1 var(--display); color: color-mix(in srgb, var(--lv) 14%, transparent); transform: translateZ(30px); }
.wk-card-img { margin: 2px -4px 0; border-radius: 14px; overflow: hidden; aspect-ratio: 16/8; }
.wk-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.wk-card:hover .wk-card-img img { transform: scale(1.06); }
.wk-card-cat { font: 700 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: auto; }
.wk-card-img + .wk-card-cat { margin-top: 0; }
.wk-card-title { font: 700 19px/1.25 var(--display); letter-spacing: -.01em; text-wrap: balance; transform: translateZ(20px); }
.wk-card-ex { color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wk-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font: 600 12.5px var(--body); }
.wk-tag { padding: 2px 8px; border-radius: 999px; background: var(--bg-2); }
.wk-go { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent-ink); background: var(--lv); font-weight: 900; transform: translateX(-4px); opacity: .8; transition: transform .25s, opacity .25s; }
.wk-card:hover .wk-go { transform: none; opacity: 1; }
.wk-card.is-done { opacity: .82; }
.wk-grid.is-in .wk-card { animation: wk-in .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes wk-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.wk-empty { grid-column: 1/-1; display: grid; gap: 6px; justify-items: center; padding: 50px 20px; text-align: center; color: var(--muted); border-radius: 22px; border: 1px dashed var(--line); }
.wk-empty b { color: var(--fg); font-size: 17px; }

/* ── Lecture ─────────────────────────────────────────────────────────────────────────── */
.wk.is-reading .wk-hero, .wk.is-reading .wk-band { display: none; }
.wk-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: 4px; background: transparent; pointer-events: none; }
.wk-progress i { display: block; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--teal), var(--accent)); box-shadow: 0 0 12px color-mix(in srgb, var(--teal) 60%, transparent); }
.wk-read-hero { position: relative; padding: 30px 0 36px; overflow: hidden; isolation: isolate; }
.wk-read-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 120% at 90% 0%, color-mix(in srgb, var(--lv) 22%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--lv) 6%, transparent), transparent); }
.wk-read-hero h1 { margin: 14px 0 10px; max-width: 22ch; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.07; letter-spacing: -.03em; text-wrap: balance; }
.wk-read-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; color: var(--muted); font: 600 13.5px var(--body); }
.wk-read-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 50px; }
.wk-toc { position: sticky; top: 96px; display: grid; gap: 10px; padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.wk-toc nav { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.wk-toc nav a { padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; line-height: 1.35; text-decoration: none; box-shadow: inset 2px 0 0 transparent; transition: color .2s, background .2s, box-shadow .2s; }
.wk-toc nav a.sub { padding-left: 22px; font-size: 13px; }
.wk-toc nav a:hover { color: var(--fg); }
.wk-toc nav a.on { color: var(--fg); background: var(--bg-2); box-shadow: inset 2px 0 0 var(--teal); }
.wk-toc-none { color: var(--muted); font-size: 13px; }
.wk-mark { justify-content: center; min-height: 42px; font-size: 13.5px; }
.wk-back { color: var(--muted); font-size: 13.5px; text-decoration: none; } .wk-back:hover { color: var(--fg); }
.wk-article { max-width: 760px; font-size: 16.5px; }
.wk-article h2 { scroll-margin-top: 100px; margin-top: 18px; padding-top: 6px; }
.wk-article h3 { scroll-margin-top: 100px; }
.wk-cover { width: 100%; border-radius: 20px; }
.wk-copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border: 0; border-radius: 8px; cursor: pointer; font: 700 11.5px var(--body); color: var(--fg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.wk-related { padding-bottom: 60px; } .wk-related h2 { margin: 0 0 18px; }
.wk-loading, .wk-read-missing { padding: 60px 0; color: var(--muted); }
.wk-read-missing { display: grid; gap: 12px; justify-items: start; }

@media (max-width: 1100px) { .wk-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .wk-hero-grid { grid-template-columns: 1fr; } .wk-orbit { display: none; }
  .wk-read-grid { grid-template-columns: 1fr; gap: 20px; } .wk-toc { position: static; }
}
@media (max-width: 560px) { .wk-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wk-level small { display: none; } .wk-search kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .wk-orb, .wk-grid.is-in .wk-card { animation: none; } .wk-card { transform: none; } }

/* ── Administration › Wiki ───────────────────────────────────────────────────────────── */
.wka-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0 14px; }
.wka-kpi { text-align: left; cursor: pointer; border: 0; color: var(--fg); }
.wka-kpi[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--lv, var(--teal)); }
.wka-kpi b { color: var(--lv, var(--fg)); }
.wka-gen { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.wka-custom { position: sticky; top: 16px; display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.wka-custom h3 { margin: 0; }
.wka-parts { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.wka-part { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.wka-models { display: grid; gap: 14px; min-width: 0; }
.wka-model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.wka-model { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; text-align: left; border: 0; border-radius: 18px; cursor: pointer; color: var(--fg); background: linear-gradient(160deg, color-mix(in srgb, var(--lv) 10%, var(--surface)), var(--surface) 60%); box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; }
.wka-model::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--lv); }
.wka-model:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 60%, transparent), 0 14px 30px #0004; }
.wka-model-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wka-model-top small, .wka-model > small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.wka-model > small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wka-model b { font: 700 15.5px/1.3 var(--display); }
.wka-model-cat { margin-top: auto; font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wka-toolbar { position: sticky; top: 0; z-index: 3; }
.wka-area { min-height: 460px; }
.wka-html { width: 100%; min-height: 460px; padding: 16px; border-radius: 14px; font: 500 13px/1.6 var(--mono); color: var(--fg); background: var(--bg); border: 1px solid var(--line); }
.wka-lvpick { display: grid; grid-template-columns: 1fr; gap: 6px; }
.wka-lvopt { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.wka-lvopt input { position: absolute; opacity: 0; pointer-events: none; }
.wka-lvopt:has(input:checked) { background: color-mix(in srgb, var(--lv) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--lv); }
.wka-lvopt:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.wka-cover { width: 100%; border-radius: 12px; }
.wka-layout.is-full { position: fixed; inset: 0; z-index: 90; padding: 16px; overflow: auto; background: var(--bg); }
.wka-preview { margin-top: 20px; padding: 18px; border-radius: 20px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.wka-prev .wk-read-hero { padding: 10px 0 18px; }
@media (max-width: 1000px) { .wka-gen { grid-template-columns: 1fr; } .wka-custom { position: static; } .wka-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
