/* ============================================================
   BASE RESET & VARIABLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f0f4ec;           /* soft sage green background */
  --text: #1a1a1a;
  --text-muted: #555;
  --link: #2563a8;
  --link-hover: #1a4580;
  --border: #d6ddd0;
  --header-bg: #ffffff;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --max-w: 740px;
}

/* ============================================================
   GLOBAL
   ============================================================ */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction:column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title { font-family: 'SF Mono', 'Courier New', Consolas, monospace; font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; text-decoration: none; }

.site-title:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--text);
  text-decoration: none;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.page-content {
  flex:1;
  padding: 3rem 2rem 5rem;
}

.content-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ============================================================
   TYPOGRAPHY — headings
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
li {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

/* ============================================================
   TABLE OF CONTENTS (Contents section)
   ============================================================ */
.toc {
  margin: 1rem 0 2rem;
}
.toc ul {
  list-style: disc;
  padding-left: 1.5rem;
}
.toc li {
  margin-bottom: 0.3rem;
}
.toc a {
  font-size: 0.97rem;
}

/* ============================================================
   POST LIST (archive page)
   ============================================================ */
.post-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1.5rem;
}
.post-list li:first-child {
  border-top: 1px solid var(--border);
}
.post-list .post-title-link {
  font-size: 0.97rem;
  flex: 1;
}
.post-list .post-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   POST PAGE
   ============================================================ */
.post h1 {
  margin-bottom: 0.25rem;
}
.post .post-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: center;
}

.footer-name {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  font-size: 0.9rem;
  color: var(--link);
}
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
    align-items: flex-start;
  }
  .site-nav {
    gap: 1.25rem;
  }
  .page-content {
    padding: 2rem 1.25rem 4rem;
  }
  h1 { font-size: 1.7rem; }
}
