/* python-smisk.org — shared stylesheet */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2128;
  --border: #30363d;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --accent3: #f78166;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --code-bg: #161b22;
  --code-border: #30363d;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-brand .logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #0d1117;
  font-family: var(--font-mono);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}

.topbar-nav a:hover {
  color: var(--text);
  background: var(--surface2);
}

/* BREADCRUMB */
.breadcrumb {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb .current { color: var(--text); }

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 53px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
}

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 20px;
}

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: block;
  padding: 5px 8px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font-mono);
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

.sidebar-nav a.active { font-weight: 600; }

/* MAIN CONTENT */
.content {
  padding: 40px 48px;
  max-width: 900px;
}

/* HEADINGS */
h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 36px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 10px;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* PARAGRAPHS */
p { margin-bottom: 14px; color: var(--text); }

/* LINKS */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* CODE */
code, tt {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: #f97583;
}

pre {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
  color: var(--text);
}

pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* DEFINITION LIST - API docs */
dl { margin: 16px 0; }

dt {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  margin-bottom: 2px;
  color: var(--text);
}

dd {
  padding: 12px 14px 12px 20px;
  margin-bottom: 16px;
  border-left: 1px solid var(--border);
  margin-left: 14px;
}

/* FIELD LIST (API params) */
.field-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  width: 100%;
  border-collapse: collapse;
}

.field-list th {
  background: var(--surface2);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-list td {
  padding: 8px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.field-list tr:last-child th,
.field-list tr:last-child td { border-bottom: none; }

/* TOC */
.toctree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}

.toctree ul { list-style: none; }

.toctree > ul > li { margin-bottom: 12px; }

.toctree > ul > li > a {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.toctree li li { padding-left: 16px; }
.toctree li li a { font-size: 13px; color: var(--accent); }
.toctree li li li { padding-left: 16px; }
.toctree li li li a { font-size: 12.5px; color: var(--text-muted); }

/* VERSIONS GRID */
.versions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.version-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  display: block;
}

.version-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  text-decoration: none;
}

.version-card .ver { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--accent); }
.version-card .date { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.version-card .tag { font-size: 11px; background: rgba(63,185,80,0.15); color: var(--accent2); padding: 2px 6px; border-radius: 20px; display: inline-block; margin-top: 6px; }

/* INDEX TABLE */
.indextable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.indextable td { vertical-align: top; padding: 3px 8px 3px 0; }
.indextable dt { font-family: var(--font-mono); font-size: 12.5px; background: none; border: none; padding: 2px 0; color: var(--text-muted); }
.indextable dd { padding: 0; margin: 0; border: none; }
.indextable dd a { font-size: 12px; }

/* MODULE INDEX */
.modindex-table {
  width: 100%;
  border-collapse: collapse;
}
.modindex-table tr td { padding: 5px 8px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.modindex-table tr:last-child td { border-bottom: none; }
.modindex-table .mod-name { font-family: var(--font-mono); }

/* ALERTS / NOTES */
.note, .warning, .versionadded {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
}

.versionadded {
  background: rgba(63, 185, 80, 0.08);
  border-left: 3px solid var(--accent2);
  color: var(--accent2);
  font-style: italic;
}

/* NAV PREV/NEXT */
.doc-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.doc-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
  max-width: 45%;
}

.doc-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.doc-nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
.doc-nav .nav-title { font-size: 13px; font-family: var(--font-mono); }
.doc-nav .prev { text-align: left; }
.doc-nav .next { text-align: right; margin-left: auto; }

/* FOOTER */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

.footer a { color: var(--text-muted); }

/* SECTION ANCHOR */
.section-anchor {
  color: var(--text-dim);
  margin-left: 8px;
  font-size: 0.8em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}

h1:hover .section-anchor,
h2:hover .section-anchor,
h3:hover .section-anchor { opacity: 1; }

/* INTRO BLOCK */
.intro-block {
  background: linear-gradient(135deg, rgba(88,166,255,0.06), rgba(63,185,80,0.04));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 32px;
}

.intro-block p { margin-bottom: 8px; }
.intro-block p:last-child { margin-bottom: 0; }

/* CLASS DEFINITION BOX */
.class-def {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 16px 0 4px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.class-def .kw { color: #c084fc; }
.class-def .name { color: #f97583; }
.class-def .param { color: var(--text-muted); }

/* HR */
hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* SEARCH FORM */
.search-form {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.search-form input[type=text] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 12px;
  font-size: 14px;
  flex: 1;
  outline: none;
  font-family: var(--font-sans);
}

.search-form input[type=text]:focus { border-color: var(--accent); }

.search-form input[type=submit] {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* UL in doc content */
.doc-content ul { list-style: disc; padding-left: 22px; margin: 12px 0; }
.doc-content ul li { margin-bottom: 4px; }

/* SIMPLE TABLE */
table.docutils {
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

table.docutils th, table.docutils td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

table.docutils th { background: var(--surface2); color: var(--text-muted); font-weight: 600; }

/* ALPHA INDEX */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
}

.alpha-nav a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.12s, color 0.12s;
}

.alpha-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* INDEX ENTRY */
.index-section h2 {
  font-size: 16px;
  margin-top: 28px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.index-entry { font-size: 13.5px; padding: 3px 0; }
.index-entry dt { font-family: var(--font-mono); background: none; border: none; padding: 3px 0; color: var(--text); }
.index-entry dd { padding: 2px 0 2px 16px; border: none; margin: 0; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 24px 20px; }
}
