/* Default Theme Styles */
:root {
  --color-primary: #3b82f6;
  --color-secondary: #64748b;
  --color-accent: #10b981;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-border: #e5e7eb;
  --font-heading: system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --max-width: 768px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; line-height: 1.6; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header { padding: 0.5rem 0; background: #111827; }
main { padding: 2rem 0; min-height: calc(100vh - 200px); }
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Navigation */
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header nav ul { list-style: none; display: flex; gap: 1.5rem; }
header nav a { color: #f3f4f6; font-weight: 500; }
header nav a:hover { color: var(--color-primary); text-decoration: none; }
.site-title { font-size: 1.25rem; font-weight: 700; color: #ffffff; }
.site-title:hover { text-decoration: none; color: var(--color-primary); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1.5rem; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Article content */
article { max-width: 100%; }
article .content { line-height: 1.8; }

article .content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

article .content pre {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.5rem 0;
}

article .content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

article .content pre code { background: none; padding: 0; }

article .content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

article .content ul,
article .content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

article .content li { margin-bottom: 0.5rem; }

article .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

article .content th,
article .content td {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  text-align: left;
}

article .content th { background: var(--color-bg-alt); font-weight: 600; }

/* Post meta */
article header { border: none; padding: 0; margin-bottom: 1.5rem; }
time { color: var(--color-text-muted); font-size: 0.875rem; }
.author, .reading-time {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.tag {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.tag:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }

/* Post cards (list pages) */
.post-card {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.post-card:last-child { border-bottom: none; }
.post-card h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.post-card h2 a { color: var(--color-text); }
.post-card h2 a:hover { color: var(--color-primary); text-decoration: none; }
.excerpt { color: var(--color-text-muted); margin-top: 0.5rem; }
.description { color: var(--color-text-muted); margin-bottom: 2rem; }

/* Post navigation (prev/next) */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.page-info { color: var(--color-text-muted); font-size: 0.875rem; }

/* Game links */
.game-link a {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 600;
}

.game-link a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

/* Game container */
#game-container {
  display: flex;
  justify-content: center;
}

#game-container canvas {
  border-radius: 0.5rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-bg: #111827;
    --color-bg-alt: #1f2937;
    --color-border: #374151;
  }
}
