/* ============================================================
   IdeaSpot360 Dev - Clean, High-Performance Tech Blog Theme
   Zero-framework, Ultra-fast, Dark/Light Mode Responsive CSS
   ============================================================ */

:root {
  --bg-color: #ffffff;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --card-bg: #f9fafb;
  --border-color: #e5e7eb;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
  --code-bg: #f3f4f6;
  --code-border: #e5e7eb;
  --code-header: #e5e7eb;
  --pre-bg: #0f172a;
  --pre-text: #f8fafc;
  --accent-color: #3b82f6;
  --accent-light: #eff6ff;
  --callout-bg: #f8fafc;
  --callout-border: #3b82f6;
  --tag-bg: #e0e7ff;
  --tag-text: #3730a3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg-color: #0d1117;
  --text-color: #e6edf3;
  --text-muted: #8b949e;
  --card-bg: #161b22;
  --border-color: #30363d;
  --link-color: #58a6ff;
  --link-hover: #79c0ff;
  --code-bg: #161b22;
  --code-border: #30363d;
  --code-header: #21262d;
  --pre-bg: #161b22;
  --pre-text: #e6edf3;
  --accent-color: #58a6ff;
  --accent-light: #0d1d30;
  --callout-bg: #161b22;
  --callout-border: #58a6ff;
  --tag-bg: #1f293d;
  --tag-text: #79c0ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --text-muted: #8b949e;
    --card-bg: #161b22;
    --border-color: #30363d;
    --link-color: #58a6ff;
    --link-hover: #79c0ff;
    --code-bg: #161b22;
    --code-border: #30363d;
    --code-header: #21262d;
    --pre-bg: #161b22;
    --pre-text: #e6edf3;
    --accent-color: #58a6ff;
    --accent-light: #0d1d30;
    --callout-bg: #161b22;
    --callout-border: #58a6ff;
    --tag-bg: #1f293d;
    --tag-text: #79c0ff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-title .badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 9999px;
  background-color: var(--accent-light);
  color: var(--accent-color);
  font-weight: 600;
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav.site-nav a:hover {
  color: var(--link-color);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content */
main.site-content {
  flex: 1;
  padding: 40px 0;
}

/* Hero / Intro */
.hero {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Post Cards */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  display: block;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.post-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 10px;
  line-height: 1.4;
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Single Post View */
article.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

article.post-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

article.post-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

article.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

article.post-content p {
  margin-bottom: 18px;
}

article.post-content ul, article.post-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

article.post-content li {
  margin-bottom: 6px;
}

article.post-content a {
  color: var(--link-color);
  text-decoration: underline;
}

article.post-content a:hover {
  color: var(--link-hover);
}

/* Code & Preformatted */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background-color: var(--code-bg);
  color: var(--text-color);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--code-border);
}

pre {
  background-color: var(--pre-bg);
  color: var(--pre-text);
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 20px 0;
  position: relative;
  border: 1px solid var(--border-color);
}

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

/* Code Copy Button */
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Callouts / Alerts */
.callout {
  border-left: 4px solid var(--callout-border);
  background-color: var(--callout-bg);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}

.callout.error {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

.callout.tip {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

.callout.warning {
  border-color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.08);
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Ad Slot Container */
.ad-slot {
  margin: 32px 0;
  padding: 16px;
  text-align: center;
  background: var(--card-bg);
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 640px) {
  article.post-content h1 {
    font-size: 1.75rem;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
}

