/* AI-optimized static blog: minimal, high-contrast, readable, print-friendly */

:root {
  --text: #1a1a1a;
  --bg: #fafafa;
  --accent: #2563eb;
  --muted: #64748b;
  --border: #e2e8f0;
  --max-width: 720px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-base: 1.125rem;
  --line-height: 1.7;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text);
  background: var(--bg);
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Site header: clear landmark for screen readers and crawlers */
.site-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.nav {
  margin-bottom: 0.5rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

/* Main content area */
.main {
  flex: 1;
}

/* Homepage */
.home-intro {
  margin-bottom: 2rem;
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.article-preview {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-preview:last-child {
  border-bottom: none;
}

.article-preview header {
  margin-bottom: 0.5rem;
}

.article-preview h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.article-preview h2 a {
  color: var(--text);
  text-decoration: none;
}

.article-preview h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-preview time {
  font-size: 0.9rem;
  color: var(--muted);
}

.article-preview .author {
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.article-preview .excerpt {
  margin: 0.5rem 0 0.75rem 0;
  color: var(--text);
}

.article-preview p a {
  color: var(--accent);
  text-decoration: none;
}

.article-preview p a:hover {
  text-decoration: underline;
}

/* Breadcrumb: helps AI and users understand location */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .current {
  color: var(--text);
}

/* Article page */
.article {
  padding-bottom: 2rem;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.article-meta {
  font-size: 0.95rem;
  color: var(--muted);
}

.article-meta time {
  font-style: normal;
}

.article-meta .author {
  margin-left: 0.75rem;
}

.article-body {
  color: var(--text);
}

.article-body h2 {
  font-size: 1.4rem;
  margin: 1.75rem 0 0.75rem 0;
}

.article-body h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem 0;
}

.article-body p {
  margin: 0 0 1rem 0;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.25rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.article-body code {
  font-size: 0.9em;
  background: var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-body pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--border);
  border-radius: 6px;
  margin: 0 0 1rem 0;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

/* Site footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 640px) {
  .page {
    padding: 1rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }
}

/* Print: hide nav, simplify for reading */
@media print {
  .nav,
  .site-footer,
  .breadcrumb {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page {
    max-width: 100%;
    padding: 0;
  }

  .site-header {
    border-bottom: 1px solid #ccc;
  }

  a {
    color: #000;
  }

  .article-preview {
    break-inside: avoid;
  }
}
