:root { --w: 800px; }
* { box-sizing: border-box; }
body { margin:0; font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background:#f7f7f7; color:#222; }
header, footer { background:#fff; border-bottom:1px solid #ddd; }
header { position:sticky; top:0; padding:10px 15px; }
header h1 { margin:0; font-size:1.3rem; }
header h1 a { color:inherit; text-decoration:none; }
header h1 a:visited { color:#9ec1ff; }
header nav { display:flex; gap:12px; align-items:center; margin-top:8px; }
header input[type=search]{ width:100%; max-width:var(--w); padding:8px; border:1px solid #ccc; border-radius:6px; }
header a.admin { text-decoration:none; color:#155; }
main { max-width:var(--w); margin:20px auto; padding:0 15px; }
.post-list article { background:#fff; padding:15px; margin:0 0 12px; border:1px solid #e4e4e4; border-radius:8px; }
.post-list h2 { margin:0 0 5px; font-size:1.2rem; }
.meta { color:#666; font-size:.9rem; margin-bottom:8px; }
.tags a, .cats a { font-size:.85rem; color:#155; text-decoration:none; margin-right:.4em; }
a.readmore { display:inline-block; margin-top:8px; }
article.post { background:#fff; padding:20px; border:1px solid #e4e4e4; border-radius:10px; }
.pager { display:flex; gap:8px; align-items:center; }
.pager a, .pager span { padding:6px 10px; background:#fff; border:1px solid #f7f7f7; border-radius:6px; text-decoration:none; color:#f7f7f7; }
.adminbar { display:flex; gap:8px; margin-bottom:12px; }
.form label { display:block; margin:.6em 0 .2em; }
.form input[type=text], .form input[type=datetime-local], .form textarea { width:100%; padding:8px; border:1px solid #ccc; border-radius:6px; font: inherit; }
.form .row { display:flex; gap:12px; }
.table { width:100%; border-collapse: collapse; }
.table th,.table td{ padding:8px; border-bottom:1px solid #eee; text-align:left; }
.notice { background:#eff7ff; border:1px solid #cfe3ff; padding:8px 10px; border-radius:6px; margin-bottom:10px; }
code { background:#f2f2f2; padding:0 .25em; border-radius:4px; }
pre code { display:block; padding:10px; overflow:auto; }
/* Responsive images inside post bodies */
article.post .body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0.5rem auto;
}
/* === Dark theme palette (history-friendly) === */
:root {
  --w: 800px;
  --bg: #0f1115;
  --bg-elev: #151b23;
  --text: #e7e7e7;
  --muted: #a5aab3;
  --card-border: #586e75;
  --link: #9ec1ff;
  --link-visited: #c5adff;
  --accent: #d4b483; /* warm parchment accent */
}

html, body { background: var(--bg); color: var(--text); }
header, footer { background: var(--bg); border-bottom: 1px solid var(--card-border); }
a { color: var(--link); }
a:visited { color: var(--link-visited); }
.meta { color: var(--muted); }
.tags a, .cats a { color: var(--link); }

.post-list article,
article.post,
.pager a, .pager span,
.table th, .table td,
.notice {
  background: var(--bg-elev);
  border-color: var(--card-border);
}

.post-list article { border: 1px solid var(--card-border); }
article.post { border: 1px solid var(--card-border); }
.pager a, .pager span { border: 1px solid var(--card-border); }
.notice { background: rgba(212,180,131,0.08); border: 1px solid rgba(212,180,131,0.35); }

/* Inputs on dark */
header input[type=search],
.form input[type=text],
.form input[type=datetime-local],
.form textarea {
  background: #0d1218;
  color: var(--text);
  border: 1px solid var(--card-border);
}

/* Hero header image */
.hero {
  height: clamp(160px, 22vw, 280px);
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid var(--card-border);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.6));
}
.hero-inner {
  max-width: var(--w);
  margin: 0 auto; height: 100%;
  display: flex; align-items: flex-end;
  padding: 0 15px 20px;
}
.hero-title {
  font-size: 1.8rem;
  color: #f7f7f7;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* Tag cloud */
.tag-cloud { margin: 12px 0 18px; }
.tag-cloud .tc-title { margin: 0 0 6px; font-size: 0.95rem; color: var(--muted); }
.tag-cloud .cloud { line-height: 2.2; }
.tag-cloud .cloud a {
  text-decoration: none;
  margin-right: .5em;
  display: inline-block;
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
}
.tag-cloud .cloud a:hover { background: rgba(255,255,255,0.08); }

/* weight classes (relative sizing) */
.tag-cloud .cloud a.w1 { font-size: 0.85rem; }
.tag-cloud .cloud a.w2 { font-size: 1.0rem; }
.tag-cloud .cloud a.w3 { font-size: 1.15rem; }
.tag-cloud .cloud a.w4 { font-size: 1.3rem; }
.tag-cloud .cloud a.w5 { font-size: 1.45rem; }

/* Keep post images responsive (already present; ensure not overridden) */
article.post .body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem auto;
}

