/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* Site-specific styles */
:root {
  --color-bg: #1a1a1a;
  --color-text: #e0e0e0;
  --color-accent: #c41e3a;
  --color-accent-hover: #e63950;
  --color-muted: #888;
  --color-border: #333;
  --font-heading: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --max-width: 800px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  padding: 0 1rem;
}

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

header h1 a {
  color: var(--color-text);
  text-decoration: none;
}

header h1 a:hover {
  color: var(--color-accent);
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav a:hover {
  color: var(--color-accent);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 3rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
}

a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-hover);
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Blog index styles */
.blog-index h2 {
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.post-item h3 a:hover {
  color: var(--color-accent);
}

.post-item time {
  display: block;
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.post-item .summary {
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background-color: var(--color-border);
  color: var(--color-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  text-transform: lowercase;
}

.no-posts {
  color: var(--color-muted);
  font-style: italic;
}

/* Blog post styles */
.blog-post .post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.blog-post .post-header time {
  display: block;
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.blog-post .post-content h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.blog-post .post-content h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.blog-post .post-content h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.blog-post .post-content ul,
.blog-post .post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.blog-post .post-content li {
  margin-bottom: 0.25rem;
}

.blog-post .post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.blog-post .post-content strong {
  color: var(--color-accent);
}

.blog-post .post-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.blog-post .post-footer a {
  color: var(--color-muted);
  text-decoration: none;
}

.blog-post .post-footer a:hover {
  color: var(--color-accent);
}