/* Shared styles for all Pactorio help-site pages */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;1,14..32,400&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8f9fa;
  color: #212529;
  line-height: 1.7;
}

/* ── Header ─────────────────────────────────── */
.site-header {
  background: linear-gradient(90deg, #0c1026 0%, #111827 100%);
  color: white;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,243,79,0.12);
}
.site-header .logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.3px;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  line-height: 1;
}
.site-header .logo span { color: #4FFFB0; }
.header-nav { display: flex; gap: 1.5rem; align-items: center; }
.header-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.header-nav a:hover { color: white; }
.header-nav .btn-app {
  background: #2D3FE2;
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}
.header-nav .btn-app:hover { background: #2535C8; }

/* ── Breadcrumb ──────────────────────────────── */
.breadcrumb {
  background: white;
  border-bottom: 1px solid #e9ecef;
  padding: 0.6rem 2rem;
  font-size: 0.8rem;
  color: #6c757d;
}
.breadcrumb a { color: #2D3FE2; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Layout ──────────────────────────────────── */
.page-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 2.5rem;
  align-items: flex-start;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
}
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}
.sidebar-section a {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
}
.sidebar-section a:hover { background: #eef0fd; color: #2D3FE2; }
.sidebar-section a.active { background: #eef0fd; color: #2D3FE2; font-weight: 600; }

/* ── Article ─────────────────────────────────── */
.article {
  flex: 1;
  min-width: 0;
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.article-meta {
  font-size: 0.78rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}
.article h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0c1026;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.article h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0c1026;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #f0f0f0;
}
.article h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #343a40;
  margin: 1.25rem 0 0.35rem;
}
.article p { margin-bottom: 0.9rem; color: #495057; font-size: 0.925rem; }
.article ul, .article ol {
  margin: 0.4rem 0 0.9rem 1.5rem;
  color: #495057;
  font-size: 0.925rem;
}
.article li { margin-bottom: 0.3rem; }
.article a { color: #2D3FE2; text-decoration: none; }
.article a:hover { text-decoration: underline; }
.article strong { color: #212529; }

/* ── Code ─────────────────────────────────────── */
.article code {
  background: #eef0fd;
  color: #1a2a8f;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
}
.code-block-wrap {
  overflow-x: auto;
  border-radius: 8px;
  margin: 0.75rem 0 1.25rem;
}
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  padding: 1.1rem 1.25rem;
  border-radius: 8px;
  white-space: pre;
  margin: 0;
  display: block;
  min-width: 100%;
  width: max-content;
}
.code-block .cm { color: #64748b; }
.code-block .tg { color: #7dd3fc; }
.code-block .at { color: #93aeff; }
.code-block .vl { color: #86efac; }
.code-block .kw { color: #f472b6; }

/* ── Callout boxes ───────────────────────────── */
.callout {
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.875rem;
}
.callout strong { display: block; margin-bottom: 0.2rem; }
.callout-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e3a5f; }
.callout-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }
.callout-success { background: #f0fdf4; border-left: 4px solid #22c55e; color: #14532d; }
.callout-purple  { background: #eef0fd; border-left: 4px solid #2D3FE2; color: #1a2a8f; }

/* ── Steps ───────────────────────────────────── */
.steps { list-style: none; margin-left: 0; padding: 0; }
.steps li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2D3FE2;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.step-body { flex: 1; min-width: 0; }
.step-body h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; color: #0c1026; }
.step-body p  { margin-bottom: 0.4rem; font-size: 0.875rem; }

/* ── Table ───────────────────────────────────── */
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1.25rem;
}
.article th {
  background: #0c1026;
  color: white;
  padding: 0.55rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
}
.article td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #e9ecef;
  color: #495057;
  vertical-align: top;
}
.article tr:nth-child(even) td { background: #f8f9fa; }

/* ── Footer ──────────────────────────────────── */
.site-footer {
  background: linear-gradient(90deg, #0c1026 0%, #111827 100%);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  margin-top: 3rem;
}
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: white; }

/* ── Home page cards ─────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.help-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.help-card:hover { box-shadow: 0 4px 16px rgba(45,63,226,0.12); border-color: #9daef5; }
.help-card .card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.help-card h3 { font-size: 1rem; font-weight: 700; color: #0c1026; margin-bottom: 0.35rem; }
.help-card p { font-size: 0.85rem; color: #6c757d; margin: 0; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .page-layout { flex-direction: column; padding: 1.5rem 1rem; gap: 1.5rem; }
  .sidebar { width: 100%; position: static; }
  .article { padding: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .header-nav .btn-app { display: none; }
}
