/* Blog Shared Styles */

:root {
  --bg: #fff;
  --fg: #000;
  --grey-light: #f8f8f8;
  --grey-mid: #e5e5e5;
  --border: 2px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

/* Header */
header {
  border-bottom: var(--border) solid var(--fg);
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.logo {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--fg);
}

header nav {
  display: flex;
  gap: 2rem;
}

header nav a {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
  position: relative;
  transition: all 0.2s;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--fg);
  transition: width 0.2s;
}

header nav a:hover::after {
  width: 100%;
}

/* Footer */
footer {
  border-top: var(--border) solid var(--fg);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 4rem;
}

/* ===================
   Blog Index Styles
   =================== */

main {
  padding: 3rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

main h1 {
  font-family: 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  line-height: 1.1;
}

main .subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 3rem;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-item {
  border-bottom: 1px solid var(--grey-mid);
  padding: 1.5rem 0;
}

.post-item:first-child {
  border-top: var(--border) solid var(--fg);
}

.post-link {
  text-decoration: none;
  color: var(--fg);
  display: block;
}

.post-link:hover .post-title {
  text-decoration: underline;
}

.post-date {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.post-title {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.post-excerpt {
  font-size: 0.95rem;
  color: #444;
}

/* ===================
   Blog Post Styles
   =================== */

article {
  padding: 3rem 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.post-meta {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

article h1 {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
  line-height: 1.2;
}

article > .subtitle {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  color: #666;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: var(--border) solid var(--fg);
}

.content p {
  margin-bottom: 1.5rem;
}

.content h2 {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.content ul, .content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content a {
  color: var(--fg);
  text-decoration: underline;
}

.content small {
  font-size: 0.85rem;
  color: #666;
}

.content small a {
  color: #666;
}

.content blockquote {
  border-left: 3px solid var(--fg);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #444;
}

.content code {
  font-family: 'Courier New', monospace;
  background: var(--grey-light);
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}

.content pre {
  background: var(--grey-light);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* Stats box */
.stats-box {
  margin-top: 3rem;
  padding: 1.5rem;
  border: var(--border) solid var(--fg);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.stats-box h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--grey-mid);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.stat-label {
  color: #666;
}

.stat-value {
  font-weight: bold;
}

/* Week navigation */
.last-week {
  margin-top: 2rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

.last-week + .next-week {
  margin-top: 0.5rem;
}

.next-week {
  margin-top: 2rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

/* Standalone article (no subtitle) */
article.standalone h1 {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: var(--border) solid var(--fg);
}

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-mid);
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===================
   Responsive
   =================== */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  header nav {
    gap: 1.5rem;
  }

  main {
    padding: 2rem 1rem;
  }

  main h1 {
    font-size: 2rem;
  }

  article {
    padding: 2rem 1rem;
  }

  article h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
