/* ── Code blocks: single background via highlight.js ── */
pre {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 1.2rem 0 !important;
  border-radius: 0 !important;
}
pre code.hljs {
  background: #272822 !important;
  color: #f8f8f2 !important;
  border-radius: 6px !important;
  padding: 1rem 1.2rem !important;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  display: block !important;
  overflow-x: auto !important;
  border: 1px solid #3a3a3a !important;
  margin: 0 !important;
}
/* Inline code */
code {
  background: #f0f4ff;
  color: #1e40af;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.85em;
}
code.hljs { background: #272822 !important; color: #f8f8f2 !important; padding: 1rem 1.2rem !important; }

/* hljs token colors (monokai) */
.hljs-keyword   { color: #f92672 !important; }
.hljs-built_in  { color: #a6e22e !important; }
.hljs-string    { color: #e6db74 !important; }
.hljs-number    { color: #ae81ff !important; }
.hljs-comment   { color: #75715e !important; font-style: italic; }
.hljs-function  { color: #a6e22e !important; }
.hljs-title     { color: #a6e22e !important; }
.hljs-params    { color: #fd971f !important; }
.hljs-literal   { color: #ae81ff !important; }
.hljs-variable  { color: #f8f8f2 !important; }
.hljs-attr      { color: #a6e22e !important; }
.hljs-meta      { color: #75715e !important; }

/* PyChallenge CTA box */
.pc-box {
  background: #1e293b; border-left: 4px solid #3b82f6; border-radius: 6px;
  padding: 18px 22px; margin: 2rem 0; color: #f1f5f9; clear: both;
}
.pc-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; margin-bottom: 5px; font-weight: 600;
}
.pc-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: #f8fafc; }
.pc-desc  { font-size: .88rem; color: #94a3b8; margin-bottom: 14px; }
.pc-box a {
  display: inline-block; background: #3b82f6; color: #fff !important;
  padding: 8px 18px; border-radius: 4px; font-weight: 600;
  font-size: .88rem; text-decoration: none !important;
}
.pc-box a:hover { background: #2563eb !important; }

/* Nav back/next */
#nav-back, #nav-next {
  display: inline-block; padding: 6px 14px; border: 1px solid #ddd;
  border-radius: 4px; color: #1a0dab; font-size: .9rem;
  margin: 1.2rem 4px 0 0; text-decoration: none;
}
#nav-back:hover, #nav-next:hover { background: #f5f5f5; text-decoration: none; }
#nav-next { float: right; }

/* Nav */
.head-about { display: flex; gap: 4px; }
.head-aboutLink { padding: 4px 10px; border-radius: 4px; transition: background .15s; }
.head-aboutLink:hover { background: #f5f5f5; text-decoration: none !important; }

/* Sticky bar */
#ppc-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a1a2e; color: #fff; padding: 9px 16px;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; z-index: 9999; font-family: Arial, sans-serif;
  font-size: 13px; border-top: 1px solid #2d2d4e;
}
.ppc-muted { color: #a0a8c0; }
#ppc-bar a.ppc-btn {
  background: #3b82f6; color: #fff; padding: 5px 14px; border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: 12px; white-space: nowrap;
}
#ppc-bar button {
  background: none; border: none; color: #666; cursor: pointer;
  font-size: 18px; padding: 0 4px; margin-left: 4px;
}
.ppc-spacer { height: 44px; }

/* Layout */
.main > .post { width: 100%; float: none; }
.post-widget  { display: none; }
.article-entry p  { line-height: 1.75; margin: .9rem 0; }
.article-entry h2 { margin-top: 1.8rem; }
.article-entry img { max-width: 100%; height: auto; border-radius: 4px; margin: .8rem 0; }
.article-entry table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .9rem; }
.article-entry table th { background: #f5f5f5; padding: 7px 10px; border: 1px solid #ddd; text-align: left; }
.article-entry table td { padding: 7px 10px; border: 1px solid #ddd; }
.article-entry table tr:nth-child(even) td { background: #fafafa; }
.main::after { content: ''; display: table; clear: both; }

/* Responsive */
@media (max-width: 750px) {
  .head-about { display: none !important; }
  #barWrap-toggle { display: inline-block !important; }
  body { font-size: 15px; }
  h1 { font-size: 1.6em !important; }
  .ppc-muted { display: none; }
  #ppc-bar { gap: 8px; padding: 8px 12px; }
  .page .main { width: 95%; }
}

/* Index page */
.index-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f1f5f9; padding: 48px 24px; text-align: center;
}
.index-hero h1 { font-size: clamp(1.8rem,4vw,2.6rem); color: #f8fafc; margin: 0 0 10px; font-weight: 700; }
.index-hero p  { color: #94a3b8; font-size: 1rem; margin: 0 0 22px; }
.hero-btns { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-btns a { padding: 10px 22px; border-radius: 5px; font-weight: 600; font-size: .92rem; text-decoration: none; }
.hero-btns .btn-primary   { background: #3b82f6; color: #fff !important; }
.hero-btns .btn-secondary { background: #334155; color: #e2e8f0 !important; border: 1px solid #475569; }
.hero-btns a:hover { opacity: .88; text-decoration: none; }
.toc-wrap { max-width: 1000px; margin: 0 auto; padding: 20px 20px 40px; }
.toc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0; }
.toc-card {
  background: #fff; border: 1px solid #e8e8e8; border-top: 3px solid var(--accent, #3b82f6);
  border-radius: 4px; padding: 16px 18px;
}
.toc-card h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 0 0 10px; font-weight: 700; border: none; line-height: 1.3; }
.toc-card ul { list-style: none; margin: 0; padding: 0; columns: 2; gap: 4px; }
.toc-card ul li a { font-size: .88rem; color: #1a0dab; line-height: 1.85; display: block; }
.toc-card ul li a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .toc-card ul { columns: 1; }
  .toc-grid { grid-template-columns: 1fr; }
  .index-hero { padding: 28px 16px; }
}
