/*
Theme Name: AIFuel
Theme URI: https://aifuel.cc
Description: AIFuel Blog theme - clean white style matching aifuel.cc main site
Author: AIFuel Team
Version: 1.2.0
Text Domain: aifuel
*/

:root {
  --bg-page: #f8f9fa;
  --bg-white: #ffffff;
  --bg-header: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --accent: #6c63ff;
  --accent-hover: #5a52d5;
  --accent-light: #eef;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #6c7a89;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --max-width: 1100px;
  --sidebar-width: 300px;
  --code-bg: #1e1e2e;
}

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

body {
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; border-radius: 8px; }

/* Header - dark gradient matching aifuel.cc */
.site-header {
  background: var(--bg-header);
  padding: 0 2rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo .logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}

.site-nav a {
  color: rgba(255,255,255,0.8);
  margin-left: 1.5rem;
  font-size: 0.9rem;
}
.site-nav a:hover { color: #fff; }

/* Main Layout */
.site-content {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
}

.main-content { min-width: 0; }

/* Article Cards (Archive/Home) */
.post-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.post-card-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
}

.post-card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0;
}

.post-card-body {
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  display: flex;
  gap: 1rem;
}

/* Single Article */
.single-article {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.single-article .entry-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.single-article .entry-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.single-article .entry-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.entry-content h2 {
  color: var(--text-primary);
  font-size: 1.35rem;
  margin: 2rem 0 0.8rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--accent);
}

.entry-content h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.6rem;
}

.entry-content p { margin-bottom: 1.2rem; }

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.entry-content img {
  margin: 1.5rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.entry-content ul, .entry-content ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
  color: var(--text-secondary);
}
.entry-content li { margin-bottom: 0.4rem; }

/* === Code Blocks === */
.entry-content code {
  background: #f0f0f5;
  color: var(--accent-hover);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "Fira Code", Menlo, monospace;
}

.code-block {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161625;
  padding: 0.45rem 1rem;
}

.code-block-lang {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  font-family: -apple-system, sans-serif;
}

.code-copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #aaa;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: -apple-system, sans-serif;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.code-copy-btn.copied { background: rgba(40, 200, 64, 0.2); color: #28c840; border-color: rgba(40,200,64,0.3); }

.entry-content pre {
  background: var(--code-bg) !important;
  margin: 0;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.82rem !important;
  line-height: 1.7;
  tab-size: 4;
}

.entry-content pre code {
  background: none !important;
  color: #d4d4d4;
  padding: 0;
  font-family: "JetBrains Mono", "Fira Code", Menlo, monospace;
  font-size: 0.82rem;
  text-shadow: none;
}

/* Standalone pre without wrapper */
.entry-content > pre {
  background: var(--code-bg) !important;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  font-size: 0.82rem;
}

/* Prism token colors */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a737d; font-style: italic; }
.token.punctuation { color: #8888aa; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #e06c75; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #98c379; }
.token.operator, .token.entity, .token.url { color: #56b6c2; }
.token.atrule, .token.attr-value, .token.keyword { color: #c678dd; }
.token.function, .token.class-name { color: #61afef; }
.token.regex, .token.important, .token.variable { color: #d19a66; }

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

.widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.widget ul { list-style: none; }
.widget li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}
.widget li:last-child { border-bottom: none; }

.widget-cta {
  background: var(--accent);
  color: #fff;
  text-align: center;
  border: none;
}
.widget-cta .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,0.2); }
.widget-cta p { font-size: 0.85rem; margin-bottom: 0.8rem; color: rgba(255,255,255,0.9); }
.widget-cta .btn {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin: 0.2rem;
}

/* Footer */
.site-footer {
  background: #1a1a2e;
  padding: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  margin-top: 3rem;
}
.site-footer a { color: rgba(255,255,255,0.8); }

/* Responsive */
@media (max-width: 900px) {
  .site-content { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-card-inner { grid-template-columns: 1fr; }
  .post-card-thumb { height: 180px; }
  .single-article { padding: 1.5rem; }
}

@media (max-width: 600px) {
  .site-content { padding: 0 1rem; }
  .single-article .entry-title { font-size: 1.3rem; }
}
