/*
Theme Name: JensDufour Minimal
Theme URI: https://github.com/jensdufour/blog
Author: Jens Dufour
Author URI: https://jensdufour.be
Description: A minimalist blog theme with dark/light mode.
Version: 1.0.0
License: MIT
Text Domain: jensdufour-minimal
*/

/* ── CSS Variables ── */
:root {
  --text: #1a1a1a;
  --bg: #fff;
  --accent: #0366d6;
  --muted: #586069;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #c9d1d9;
    --bg: #0d1117;
    --accent: #58a6ff;
    --muted: #8b949e;
    --border: #30363d;
    --code-bg: #161b22;
  }
}

/* Manual overrides */
[data-theme="dark"] {
  --text: #c9d1d9;
  --bg: #0d1117;
  --accent: #58a6ff;
  --muted: #8b949e;
  --border: #30363d;
  --code-bg: #161b22;
}

[data-theme="light"] {
  --text: #1a1a1a;
  --bg: #fff;
  --accent: #0366d6;
  --muted: #586069;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  transition: color 0.2s, background 0.2s;
}

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.site-header a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
}

.site-header a:hover {
  text-decoration: none;
}

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Links ── */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  margin: 1.5rem 0 0.5rem;
}

p, ul, ol, pre, blockquote, table {
  margin-bottom: 1rem;
}

/* ── Code ── */
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

code {
  font-size: 0.9em;
}

/* ── Images ── */
img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.wp-block-image {
  margin: 1rem 0;
}

/* ── Post list ── */
.post-list {
  list-style: none;
}

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list .post-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.post-list .post-title a {
  color: var(--text);
}

.post-list .post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Post meta ── */
.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Post content ── */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 2rem 0 0.75rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
}

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.entry-content th {
  background: var(--code-bg);
}

/* ── Post navigation ── */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-nav a {
  max-width: 45%;
}

/* ── Footer ── */
.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── 404 ── */
.not-found {
  text-align: center;
  padding: 4rem 0;
}

.not-found h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.pagination .current {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
