/* css/wiki.css - Foglio di stile per la Wiki Tecnica e Divulgativa sulla Fibra Ottica */

:root {
  --bg-dark: #0a0d14;
  --bg-panel: rgba(15, 23, 42, 0.85);
  --border-color: rgba(56, 189, 248, 0.25);
  --color-neon: #00f0ff;
  --color-accent: #ff3366;
  --color-amber: #f59e0b;
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--color-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-neon);
}

/* Prose Styling for Markdown Content */
.wiki-prose h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.wiki-prose h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.wiki-prose h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-neon);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.wiki-prose h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.wiki-prose p {
  margin-bottom: 1.25rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.wiki-prose ul, .wiki-prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.wiki-prose ul {
  list-style-type: disc;
}

.wiki-prose ol {
  list-style-type: decimal;
}

.wiki-prose li {
  margin-bottom: 0.5rem;
}

.wiki-prose a {
  color: var(--color-neon);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 240, 255, 0.4);
  transition: all 0.2s ease;
}

.wiki-prose a:hover {
  border-bottom-style: solid;
  color: #ffffff;
}

.wiki-prose blockquote {
  border-left: 4px solid var(--color-amber);
  background: rgba(245, 158, 11, 0.08);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #fde68a;
  font-size: 0.9rem;
}

.wiki-prose hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2.5rem 0;
}

.wiki-prose code {
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-neon);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.wiki-prose {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.wiki-prose pre {
  background: #05070a;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  max-width: 100%;
  margin: 1.5rem 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.wiki-prose pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: #e2e8f0;
}

/* Responsive Table Wrapper with Horizontal Scroll */
.table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
}

.wiki-prose table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  min-width: 600px;
}

.wiki-prose th {
  background: rgba(10, 13, 20, 0.95);
  color: var(--color-neon);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wiki-prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.wiki-prose tr:last-child td {
  border-bottom: none;
}

.wiki-prose tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Sources Box */
.sources-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-top: 3rem;
}
