/* Python Package Hub — Minimal Responsive CSS */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 1100px;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

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

/* Layout */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Header */

.site-header {
  background: var(--blue);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.site-header nav a {
  color: rgba(255,255,255,0.85);
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.site-header nav a:hover { color: #fff; text-decoration: none; }

/* Footer */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p + p { margin-top: 0.5rem; }

/* Breadcrumb */

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

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

/* Hero (homepage) */

.hero {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero-sub { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.hero code { background: var(--code-bg); color: var(--code-text); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.95rem; }

/* Package grid */

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.package-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}

.package-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,0.1);
  text-decoration: none;
}

.package-card-name {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--blue);
}

.package-card-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.package-card-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: inline-block;
  padding: 0.1rem 0.4rem;
}

/* Package page */

.package-header { margin-bottom: 1.75rem; }
.package-header h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
.package-header code { background: var(--code-bg); color: var(--code-text); padding: 0.15rem 0.4rem; border-radius: 4px; }

.package-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }

.badge {
  font-size: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.badge-cat { background: #eff6ff; border-color: #bfdbfe; color: var(--blue); font-family: var(--font); }

.summary {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Quick install block */

.install-quick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--code-bg);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.install-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  flex-shrink: 0;
}

.install-cmd {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #86efac;
  background: none;
  border: none;
  user-select: all;
}

/* Sections */

.package-page section {
  margin-bottom: 2.25rem;
}

.package-page h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.package-page h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}

/* Code blocks */

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0.5rem 0 1rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #f1f5f9;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  color: #0f172a;
}

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

/* Error cards */

.error-card {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-left: 4px solid #ef4444;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.error-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #b91c1c;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.error-card p { font-size: 0.9rem; margin-bottom: 0.35rem; line-height: 1.5; }

/* Description */

.pkg-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 0.75rem 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  line-height: 1.6;
  max-height: 200px;
  overflow: hidden;
}

.meta-small { font-size: 0.825rem; color: var(--text-muted); margin-top: 0.25rem; }

/* About section */

.about-section { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-top: 2rem; }
.about-section h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
.about-section p, .about-section li { font-size: 0.9rem; color: var(--text-muted); }
.about-section ul { margin: 0.5rem 0 0.75rem 1.25rem; }
.about-section li { margin-bottom: 0.25rem; }

/* Sidebar */

.sidebar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.sidebar-card h3 { font-size: 0.875rem; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.resource-list { list-style: none; }
.resource-list li { margin-bottom: 0.4rem; }
.resource-list a { font-size: 0.875rem; }

/* Page meta */

.page-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* Sections heading spacing */
section h2:not(:first-child) { margin-top: 0.5rem; }

/* Package links row */

.pkg-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.75rem; font-size: 0.875rem; }
.pkg-links a { color: var(--blue); }

/* Dependency tag list */

.dep-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }

.dep-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--blue);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  text-decoration: none;
  transition: background 0.1s;
}
.dep-tag:hover { background: #dbeafe; text-decoration: none; }

/* Release history table */

.releases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.releases-table th {
  text-align: left;
  padding: 0.4rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.releases-table td {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--text);
}
.releases-table tr.current-release td { background: #f0fdf4; }

/* Runtime error cards — slightly different tint from install errors */

.error-card--runtime {
  background: #fff7ed;
  border-color: #fed7aa;
  border-left-color: #f97316;
}
.error-card--runtime .error-title { color: #c2410c; }
