/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---- Palette ---- */
:root {
  --bg: #e8e8e8;
  --surface: #ffffff;
  --text: #000000;
  --muted: #555555;
  --link: #800080;
  --link-visited: #800080;
  --highlight: #000080;
  --highlight-text: #ffffff;
  --border-light: #ffffff;
  --border-dark: #808080;
  --font: "MS Sans Serif", Geneva, Helvetica, Arial, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
  --max-width: 620px;
}

/* ---- Base ---- */
html {
  font-size: 15px;
  line-height: 1.6;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

h3 {
  font-size: 1rem;
  margin-top: 20px;
  margin-bottom: 6px;
}

p {
  margin-bottom: 12px;
}

a,
a:visited {
  color: var(--link);
}

ul, ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

li {
  margin-bottom: 4px;
}

blockquote {
  border-left: 3px solid var(--muted);
  padding-left: 12px;
  margin: 12px 0;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 1px 4px;
  border: 1px solid var(--border-dark);
}

pre {
  background: var(--surface);
  padding: 12px;
  border: 2px solid;
  border-color: var(--border-dark) var(--border-light) var(--border-light) var(--border-dark);
  overflow-x: auto;
  margin: 12px 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-light);
  margin: 20px 0;
}

/* ---- Header ---- */
.site-header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dark);
}

.site-title,
.site-title:visited,
.site-title:hover {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
}

/* ---- Main ---- */
main {
  flex: 1;
}

/* ---- Intro ---- */
.intro {
  margin-bottom: 24px;
}

.intro p {
  color: #333333;
  margin-bottom: 0;
}

/* ---- Post list ---- */
.post-list {
  list-style: none;
  padding-left: 0;
  background: var(--surface);
  border: 2px solid;
  border-color: var(--border-dark) var(--border-light) var(--border-light) var(--border-dark);
}

.post-list li {
  margin-bottom: 0;
}

.post-list li + li {
  border-top: 1px solid var(--bg);
}

.post-list li:hover {
  background: var(--highlight);
  color: var(--highlight-text);
}

.post-list li:hover a,
.post-list li:hover time {
  color: var(--highlight-text);
}

.post-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  color: var(--link);
}

.post-list a span {
  text-decoration: underline;
}

.post-list time {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 12px;
}

/* ---- Post ---- */
.post-header {
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dark);
}

.post-header time {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border: 2px solid;
  border-color: var(--border-dark) var(--border-light) var(--border-light) var(--border-dark);
  margin: 12px 0;
  display: block;
}

.post-content > *:last-child {
  margin-bottom: 0;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--border-dark);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--muted);
}
