/* ═══════════════════════════════════════════════════════
   WIKI LUVA META — wiki.luvameta.com
   Estilo: Wikipedia layout · Tema oscuro LM
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Linux+Libertine+Display&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2129;
  --border:      #30363d;
  --border-light:#21262d;
  --text:        #c9d1d9;
  --text-strong: #e6edf3;
  --text-muted:  #8b949e;
  --text-subtle: #484f58;
  --link:        #58a6ff;
  --link-hover:  #79c0ff;
  --link-visited:#bc8cff;
  --accent:      #388bfd;
  --accent-bg:   rgba(56,139,253,0.10);
  --green:       #3fb950;
  --green-bg:    rgba(63,185,80,0.10);
  --yellow:      #d29922;
  --yellow-bg:   rgba(210,153,34,0.10);
  --red:         #f85149;
  --red-bg:      rgba(248,81,73,0.10);
  --purple:      #a371f7;
  --code-bg:     #0d1117;
  --nav-h:       48px;
  --sidebar-w:   220px;
  --content-max: 860px;
  --radius:      6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: 'Linux Libertine Display', 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* ── TOP NAV ── */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 20px;
}
.top-bar-logo {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.top-bar-logo span.badge {
  font-size: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.top-bar-nav {
  display: flex; gap: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}
.top-bar-nav a {
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.top-bar-nav a:hover { color: var(--text-strong); background: var(--surface-2); text-decoration: none; }
.top-bar-nav a.active { color: var(--link); }

.top-bar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

/* Language switcher */
.lang-switch {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  display: flex; gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
}
.lang-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
  transition: all 0.15s;
}
.lang-btn:hover { color: var(--text); background: var(--surface-2); }
.lang-btn.active { background: var(--accent); color: #fff; }

/* ── LAYOUT ── */
.page-wrapper {
  display: flex;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 32px;
  min-height: calc(100vh - var(--nav-h));
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  padding: 24px 0 40px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

.sidebar-section { margin-bottom: 20px; }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 0 6px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.sidebar-section ul { list-style: none; }
.sidebar-section ul li a {
  display: block;
  padding: 3px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.1s;
}
.sidebar-section ul li a:hover { color: var(--link); text-decoration: none; }
.sidebar-section ul li a.active { color: var(--link); font-weight: 500; }

.sidebar-note {
  font-size: 12px;
  color: var(--text-subtle);
  border-left: 2px solid var(--border);
  padding: 6px 8px;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── MAIN CONTENT ── */
.content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
  padding: 28px 0 60px;
}

/* ── PAGE TITLE ── */
.page-title {
  font-family: 'Linux Libertine Display', 'Georgia', serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  line-height: 1.25;
}
.page-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -14px;
  margin-bottom: 20px;
}

/* ── INFOBOX (Wikipedia-style) ── */
.infobox {
  float: right;
  clear: right;
  margin: 0 0 20px 24px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  overflow: hidden;
}
.infobox-title {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-strong);
  text-align: center;
}
.infobox table {
  width: 100%;
  border-collapse: collapse;
}
.infobox td {
  padding: 5px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.4;
}
.infobox td:first-child {
  color: var(--text-muted);
  white-space: nowrap;
  width: 90px;
  font-size: 12px;
}
.infobox td:last-child { color: var(--text); }

/* ── HEADINGS ── */
.content h2 {
  font-family: 'Linux Libertine Display', 'Georgia', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin: 28px 0 12px;
}
.content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 20px 0 8px;
}
.content h4 {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 6px;
}

/* ── TEXT ── */
.content p { margin-bottom: 12px; }
.content p:last-child { margin-bottom: 0; }

/* ── TABLE OF CONTENTS ── */
.toc {
  float: right;
  clear: right;
  margin: 0 0 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  min-width: 200px;
  max-width: 280px;
}
.toc-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-strong);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}
.toc ol, .toc ul { margin-left: 16px; }
.toc li { padding: 2px 0; }
.toc a { color: var(--text-muted); font-size: 13px; }
.toc a:hover { color: var(--link); }

/* ── NOTICE BOXES ── */
.notice {
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 16px 0;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  display: flex; gap: 10px; align-items: flex-start;
}
.notice-icon { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.notice.info   { background: var(--accent-bg);  border-left: 3px solid var(--accent); }
.notice.warn   { background: var(--yellow-bg); border-left: 3px solid var(--yellow); }
.notice.ok     { background: var(--green-bg);  border-left: 3px solid var(--green); }
.notice.note   { background: var(--surface);   border-left: 3px solid var(--border); }

/* ── WIKITABLES ── */
.wikitable {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  margin: 16px 0;
}
.wikitable th {
  background: var(--surface-2);
  color: var(--text-strong);
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.wikitable td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
  line-height: 1.5;
}
.wikitable tr:nth-child(even) td { background: var(--surface); }

/* ── STATUS BADGES ── */
.status {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.status-active   { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.status-ready    { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.status-planned  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.status-vigente  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.status-interno  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.status-publico  { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }

/* ── CODE ── */
.content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  color: #79c0ff;
  border-radius: 3px;
  padding: 1px 5px;
  border: 1px solid var(--border-light);
}
.content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 14px 0;
}
.content pre code {
  background: none; border: none; padding: 0;
  font-size: 13px;
  color: var(--text);
}

/* ── NODO GRID ── */
.nodo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.nodo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.nodo-card:hover {
  border-color: var(--link);
  background: var(--surface-2);
  text-decoration: none;
}
.nodo-card-flag { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.nodo-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 2px;
}
.nodo-card-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.nodo-card-status { margin-top: 4px; }

/* ── DOC CARDS ── */
.doc-list { margin: 12px 0; }
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s;
}
.doc-item:hover { border-color: var(--link); text-decoration: none; }
.doc-item-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}
.doc-item-body { flex: 1; min-width: 0; }
.doc-item-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}
.doc-item-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── STEP FLOW ── */
.step-flow { margin: 16px 0; }
.step-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-body { flex: 1; }
.step-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 3px;
}
.step-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── LISTS ── */
.content ul, .content ol {
  margin: 8px 0 12px 22px;
  line-height: 1.7;
}
.content li { margin-bottom: 3px; }

/* ── CLEARFIX ── */
.clearfix::after { content: ''; display: table; clear: both; }

/* ── FOOTER ── */
.wiki-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0 0;
  margin-top: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text-subtle);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.wiki-footer a { color: var(--text-muted); font-size: 12px; }
.wiki-footer a:hover { color: var(--link); }
.wiki-footer-updated { margin-left: auto; }

/* ── CHANGELOG ── */
.changelog-entry {
  border-left: 2px solid var(--border);
  padding: 10px 0 10px 16px;
  margin-bottom: 12px;
  position: relative;
}
.changelog-entry::before {
  content: '';
  position: absolute; left: -5px; top: 14px;
  width: 8px; height: 8px;
  background: var(--border);
  border-radius: 50%;
}
.changelog-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.changelog-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.changelog-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.changelog-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.changelog-tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ── SEARCH ── */
.wiki-search {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
}
.wiki-search input {
  flex: 1; padding: 7px 12px;
  background: none; border: none; outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text);
}
.wiki-search input::placeholder { color: var(--text-subtle); }
.wiki-search button {
  padding: 7px 14px;
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.wiki-search button:hover { background: var(--accent-bg); color: var(--link); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-wrapper { padding: 0 12px; }
  .infobox { float: none; width: 100%; margin: 0 0 16px; }
  .toc { float: none; max-width: 100%; margin: 0 0 16px; }
  .nodo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .top-bar-nav { display: none; }
}
