/* ylnhari blog — shared styles */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #2563eb;
  --bg: #ffffff;
  --code-bg: #f4f4f5;
  --border: #e5e7eb;
  --max-width: 720px;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

html {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 2rem 1.5rem 4rem;
  font-family: var(--font-body);
}

article {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

h1 {
  font-size: 2.25rem;
  margin-top: 1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.35rem;
}

h3 {
  font-size: 1.2rem;
  color: var(--muted);
}

p {
  margin: 0 0 1.4rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: none;
}

/* Byline */

.byline {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.25rem 0 2rem;
}

/* Images */

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 6px;
}

/* Blockquotes */

blockquote {
  margin: 2rem 0;
  padding: 0.75rem 0 0.75rem 1.5rem;
  border-left: 4px solid var(--accent);
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
}

blockquote p {
  margin: 0;
}

/* Code */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

/* Lists */

ul, ol {
  padding-left: 1.75rem;
  margin: 0 0 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

li > ul, li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* Horizontal rule */

hr {
  border: none;
  text-align: center;
  margin: 3rem 0;
  color: var(--muted);
  letter-spacing: 0.5em;
}

hr::before {
  content: '· · ·';
  font-family: var(--font-sans);
  font-size: 1.2rem;
}

/* Footer note */

.footer-note {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3rem;
}

/* Blog index page */

.blog-index header {
  padding: 3rem 0 2rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2.5rem;
}

.blog-index header h1 {
  margin-top: 0;
  font-size: 2rem;
}

.blog-index header p {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin: 0;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-card {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card h2 {
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  border: none;
  padding: 0;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-card .meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.post-card .description {
  font-size: 0.95rem;
  margin: 0;
  color: #374151;
}

.post-card .tags {
  margin-top: 0.6rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  background: var(--code-bg);
  color: var(--muted);
  padding: 0.2em 0.6em;
  border-radius: 20px;
  margin-right: 0.4rem;
  text-transform: lowercase;
}

.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* Responsive */

@media (max-width: 600px) {
  html {
    font-size: 17px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  body {
    padding: 1.5rem 1rem 3rem;
  }
}
