/* ============================================
   Minimal Blog Theme
   Inspired by: rachsmith.com, eli.thegreenplace.net,
   nnisarg.in, manuelmoreale.com, jvns.ca
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-body: "Georgia", "Times New Roman", serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;

  --color-bg: #ffffff;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-accent: #1a6b3c;
  --color-accent-hover: #145530;
  --color-border: #e0e0e0;
  --color-code-bg: #f6f6f6;
  --color-blockquote-border: #c0c0c0;
  --color-blockquote-bg: #fafafa;

  --max-width: 640px;
  --line-height: 1.7;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #d4d4d4;
    --color-text-secondary: #999999;
    --color-accent: #5cb87a;
    --color-accent-hover: #7dcea0;
    --color-border: #333333;
    --color-code-bg: #242424;
    --color-blockquote-border: #444444;
    --color-blockquote-bg: #222222;
  }
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--line-height);
  padding: 0 1.5rem;
}

/* --- Layout --- */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

/* --- Header --- */
.site-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav {
  margin-top: 0.5rem;
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-right: 1.2rem;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--color-accent);
}

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.site-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-accent);
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  margin-right: 1rem;
}

/* --- Home Page / Post List --- */
.post-list {
  list-style: none;
}

.post-list-year {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.post-list li {
  margin-bottom: 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.post-list-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  min-width: 5.5rem;
}

.post-list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}

.post-list a:hover {
  color: var(--color-accent);
}

/* --- Single Post --- */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.post-meta a {
  color: var(--color-accent);
  text-decoration: none;
}

.post-meta a:hover {
  text-decoration: underline;
}

/* --- Post Content --- */
.post-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: var(--color-accent-hover);
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.3rem;
}

.post-content blockquote {
  border-left: 3px solid var(--color-blockquote-border);
  background: var(--color-blockquote-bg);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* --- Code --- */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--color-code-bg);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
}

/* --- Images --- */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  display: block;
}

.post-content figure {
  margin: 1.5rem 0;
}

.post-content figcaption {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}

/* --- Tables --- */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th {
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--color-code-bg);
}

/* --- Tags --- */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list a {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  background: var(--color-code-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.tag-list a:hover {
  color: var(--color-accent);
}

.post-tags {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.post-tags a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-accent);
  text-decoration: none;
  margin-right: 0.5rem;
}

/* --- Excalidraw Embed --- */
.excalidraw-embed {
  margin: 1.5rem 0;
  background: var(--color-bg);
  border-radius: 4px;
  overflow: hidden;
}

.excalidraw-embed img,
.excalidraw-embed svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Page (About, etc.) --- */
.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .post-list li {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.75rem;
  }

  .post-title {
    font-size: 1.5rem;
  }
}

/* --- Horizontal Rule --- */
.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* --- Selection --- */
::selection {
  background: var(--color-accent);
  color: white;
}
