/* wiki.css — sezione Wiki: la memoria di Horologio. Ricerca cross-wiki,
   recenti, voci raggruppate, lettura markdown, modifica.
   Riferimento: mockup wiki.html. */

.wiki-screen { max-width: 720px; margin: 0 auto; }

/* ===== Header ===== */
.wiki-hd {
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #16121f, #0d0d12);
}
.wiki-hd-entry { display: flex; align-items: center; gap: 8px; }
.wiki-back {
  font-size: 24px; line-height: 1; color: #cfc6e6;
  background: 0; border: 0; cursor: pointer; padding: 0 2px;
}
.wiki-hd-t { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.4px; }
.wiki-hd-s { font-size: 12px; color: rgba(255, 255, 255, 0.4); margin-top: 2px; }
.wiki-search {
  margin-top: 11px;
  display: flex; align-items: center; gap: 9px;
  background: #070709; border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 10px 13px;
}
.wiki-search:focus-within { border-color: rgba(124, 58, 237, 0.5); }
.wiki-sx { color: #a78bfa; font-size: 15px; }
.wiki-search input {
  flex: 1; min-width: 0;
  background: 0; border: 0; outline: 0;
  color: var(--text); font-size: 13px;
}
.wiki-search input::placeholder { color: rgba(255, 255, 255, 0.28); }

/* ===== Body ===== */
.wiki-body { padding: 16px 14px; display: flex; flex-direction: column; gap: 18px; }
.wiki-loading, .wiki-empty {
  text-align: center; color: var(--text-dim); font-size: 13px; padding: 28px;
}
.wiki-msg-warn { text-align: center; color: #fcd34d; font-size: 13px; padding: 32px 24px; line-height: 1.5; }
.wiki-msg-err { text-align: center; color: #fda4af; font-size: 13px; padding: 32px 24px; }

.wiki-glab {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.33); font-weight: 700; margin-bottom: 7px;
}
.wiki-lbl-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px;
}
.wiki-lbl-row .wiki-glab { margin-bottom: 0; }
.wiki-cnt { font-size: 10.5px; color: rgba(255, 255, 255, 0.25); }

/* Aggiornate di recente */
.wiki-rec { display: flex; gap: 9px; }
.wiki-reccard {
  flex: 1; min-width: 0; text-align: left;
  background: #15151c; border: 1px solid #24242e;
  border-radius: 13px; padding: 10px; cursor: pointer;
}
.wiki-reccard:hover { border-color: rgba(124, 58, 237, 0.4); }
.wiki-reccard .rt {
  font-size: 12px; font-weight: 700; color: #f0f0f3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wiki-reccard .rm { font-size: 9.5px; color: #a78bfa; margin-top: 3px; }

/* Righe voce */
.wiki-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 11px; margin-bottom: 7px;
  background: #15151c; border: 1px solid #20202a;
  border-radius: 13px; cursor: pointer;
}
.wiki-row:hover { border-color: rgba(124, 58, 237, 0.4); }
.wiki-row:last-child { margin-bottom: 0; }
.wiki-ic {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.wiki-info { flex: 1; min-width: 0; }
.wiki-title { font-size: 13.5px; font-weight: 700; color: #f0f0f3; }
.wiki-meta {
  font-size: 11px; color: var(--text-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wiki-chev { color: rgba(255, 255, 255, 0.2); font-size: 16px; }

/* ===== Vista voce ===== */
.wiki-sec-tabs {
  display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px;
}
.wiki-sec-tab {
  padding: 6px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-dim); font-size: 12px; cursor: pointer;
}
.wiki-sec-tab.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(236, 72, 153, 0.25));
  color: #fff; border-color: transparent;
}
.wiki-doc-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  font-size: 10.5px; color: rgba(255, 255, 255, 0.4); margin-bottom: 12px;
}
.wiki-doc-meta .mono { font-family: 'JetBrains Mono', monospace; color: #a78bfa; }

/* Markdown renderizzato */
.md { font-size: 14px; line-height: 1.65; color: rgba(233, 233, 246, 0.9); }
.md h1, .md h2, .md h3 { color: #fff; font-weight: 700; line-height: 1.3; }
.md h1 { font-size: 20px; margin: 18px 0 10px; }
.md h2 { font-size: 17px; margin: 16px 0 8px; }
.md h3 { font-size: 15px; margin: 14px 0 6px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.86em;
  background: rgba(124, 58, 237, 0.18); color: #c4b5fd;
  padding: 1px 5px; border-radius: 4px;
}
.md pre {
  background: #070709; border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 12px; overflow-x: auto;
}
.md pre code { background: 0; padding: 0; color: #d8d8e0; }
.md a { color: #a78bfa; }
.md blockquote {
  border-left: 3px solid rgba(124, 58, 237, 0.5);
  margin: 8px 0; padding: 2px 0 2px 12px; color: var(--text-dim);
}
.md strong { color: #fff; }
.md hr { border: 0; border-top: 1px solid var(--panel-border); margin: 16px 0; }

.wiki-edit-btn {
  margin-top: 18px; width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 11px;
  color: #cfc6e6; font-size: 13px; font-weight: 600; cursor: pointer;
}
.wiki-edit-btn:hover { background: rgba(124, 58, 237, 0.18); }

/* Editor */
.wiki-editor {
  width: 100%; min-height: 320px; resize: vertical;
  background: #070709; border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 12px;
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; line-height: 1.6; outline: 0;
}
.wiki-editor:focus { border-color: rgba(124, 58, 237, 0.5); }
.wiki-edit-actions {
  display: flex; gap: 9px; justify-content: flex-end; margin-top: 12px;
}
