/*
 * Site-wide styles for Mirakle.
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

a { color: #111; }
a:hover { text-decoration: underline; }

.site-header {
  border-bottom: 1px solid #111;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-header .brand {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
}

.site-nav a:hover { text-decoration: underline; }

.site-nav form { margin: 0; }

.site-nav .auth-button {
  background: none;
  border: 1px solid #111;
  color: #111;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border-radius: 3px;
}

.site-nav .auth-button:hover {
  background: #111;
  color: #fff;
}

.site-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.site-main.wide {
  max-width: 1000px;
}

.page-title {
  font-size: 2.25rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.page-lede {
  color: #555;
  font-size: 1.05rem;
  margin: 0 0 2.5rem;
}

.post-list .post {
  border-top: 1px solid #eee;
  padding: 1.75rem 0;
}

.post-list .post:first-child { border-top: none; padding-top: 0; }

.post-list .post h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.post-list .post h2 a {
  text-decoration: none;
}

.post-meta {
  color: #666;
  font-size: 0.9rem;
}

.post-tags {
  margin-top: 0.5rem;
}

.post-tags span {
  display: inline-block;
  background: #f4f4f4;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-right: 6px;
  color: #444;
}

.post-article .post-header {
  margin-bottom: 2.5rem;
}

.post-article .post-header h1 {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content h2 { margin-top: 2.5rem; font-size: 1.6rem; }
.post-content h3 { margin-top: 2rem; font-size: 1.3rem; }

.post-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #f5f5f5;
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.embedded-stat {
  margin: 2.5rem 0;
  padding: 1.25rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
}

.back-link {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}

.flash {
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 3px;
  font-size: 0.95rem;
}

.flash.notice { background: #f0f7f0; border: 1px solid #cfe3cf; color: #2a5a2a; }
.flash.alert  { background: #fdf2f0; border: 1px solid #e8c4be; color: #7a2a1e; }
