/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-bg:          #ffffff;
  --color-surface:     #ffffff;
  --color-border:      #e0ddd5;
  --color-text:        #222222;
  --color-text-muted:  #777066;
  --color-accent:      #2a5c9e;
  --color-accent-dark: #1a3d6e;
  --color-tag-bg:      #eeecea;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono:  "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius:     4px;
  --max-width:  920px;
  --side-pad:   2.5rem;
}

html { font-size: 15px; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ─── Site Banner ───────────────────────────────────────────────────────────── */

.site-banner {
  background: var(--color-surface);
  border-bottom: 3px solid var(--color-accent);
}

.site-banner__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem var(--side-pad);
  font-size: 0.85rem;
  line-height: 1.65;
  color: #3a3530;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-banner__inner p {
  margin: 0;
}

.site-banner a { color: var(--color-accent); }
.site-banner em { font-style: normal; font-weight: 600; }

/* ─── Site Header ───────────────────────────────────────────────────────────── */

.site-header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem var(--side-pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-logo img {
  display: block;
  width: 130px;
  height: auto;
}

.site-meta {
  flex: 1;
}

.site-description {
  margin: 0 0 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

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

.site-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.site-nav a:hover { color: var(--color-accent); text-decoration: none; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */

.site-body {
  max-width: var(--max-width);
  margin: 1.5rem auto;
  padding: 0 var(--side-pad);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.sidebar      { grid-column: 1; grid-row: 1; }
.main-content { grid-column: 2; grid-row: 1; min-width: 0; }

@media (max-width: 800px) {
  .site-body    { grid-template-columns: 1fr; }
  .sidebar      { grid-column: 1; grid-row: 2; }
  .main-content { grid-column: 1; grid-row: 1; }
}

/* ─── Post Card (Index / Archive) ───────────────────────────────────────────── */

.post-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-card__title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.post-card__title a {
  color: var(--color-text);
}
.post-card__title a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.post-card__meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.post-card__meta a { color: var(--color-text-muted); }
.post-card__meta a:hover { color: var(--color-accent); }
.meta-sep { opacity: 0.5; }

.post-card__excerpt p {
  margin: 0 0 0.4rem;
  color: #444;
  font-size: 0.9rem;
}

.read-more {
  font-size: 0.82rem;
  font-weight: 600;
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */

.pagination {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.85rem;
}
.pagination__info { color: var(--color-text-muted); }

/* ─── Single Post ───────────────────────────────────────────────────────────── */

.single-post__title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.single-post__meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
}
.single-post__meta a { color: var(--color-text-muted); }
.single-post__meta a:hover { color: var(--color-accent); }
.meta-label { opacity: 0.7; }

/* ─── Post Content ──────────────────────────────────────────────────────────── */

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  color: #2a2a2a;
}

.post-content p { margin: 0 0 1em; }

.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-sans);
  margin: 1.4em 0 0.5em;
  line-height: 1.3;
}
.post-content h2 { font-size: 1.25rem; }
.post-content h3 { font-size: 1.08rem; }

.post-content a { color: var(--color-accent); }
.post-content a:hover { color: var(--color-accent-dark); }

.post-content blockquote {
  border-left: 3px solid var(--color-border);
  margin: 1.25em 0;
  padding: 0.25em 0 0.25em 1.1em;
  color: #555;
  font-style: italic;
}

.post-content pre, .post-content code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: #f0eeeb;
  border-radius: var(--radius);
}
.post-content pre {
  padding: 0.85em 1em;
  overflow-x: auto;
  margin: 1.25em 0;
}
.post-content code { padding: 0.1em 0.3em; }
.post-content pre code { padding: 0; background: none; }

.post-content figure {
  margin: 1.25em 0;
  text-align: center;
}
.post-content figure img { margin: 0 auto; }
.post-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.35em;
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}
.post-content li { margin-bottom: 0.25em; }

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.75em 0;
}

/* Responsive Video Embeds */
.embed-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 1.25em 0;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.embed-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ─── Post Footer / Tags ────────────────────────────────────────────────────── */

.single-post__footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.82rem;
}
.tags-label {
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}
.tag, .cat-link {
  display: inline-block;
  color: #aaa9a4;
  font-size: 0.78rem;
}
.tag:hover, .cat-link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* ─── Comments ──────────────────────────────────────────────────────────────── */

.comments {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--color-border);
}

.comments__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.comment {
  padding: 0.9rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.comment__meta {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.comment__author { font-weight: 600; }
.comment__author a { color: var(--color-text); }
.comment__date { color: var(--color-text-muted); }

.comment__body {
  font-size: 0.9rem;
  line-height: 1.6;
}
.comment__body p:last-child { margin-bottom: 0; }

.comments__closed {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ─── Archive header ────────────────────────────────────────────────────────── */

.archive-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--color-border);
}
.archive-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}
.archive-title {
  margin: 0.1rem 0 0.25rem;
  font-size: 1.4rem;
}
.archive-count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ─── Static pages ──────────────────────────────────────────────────────────── */

.static-page__header h1 {
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* ─── Post Nav ──────────────────────────────────────────────────────────────── */

.post-nav {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  font-size: 0.85rem;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */

.sidebar {
  font-size: 0.83rem;
  position: sticky;
  top: 1.5rem;
}

.widget {
  margin-bottom: 1.5rem;
}

.widget h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.widget ul ul {
  padding-left: 0.85em;
  margin-top: 0.2rem;
}
.widget li { margin-bottom: 0.25rem; }
.widget a { color: var(--color-text); }
.widget a:hover { color: var(--color-accent); }

/* ─── Site Footer ───────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2rem;
}
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ─── Utility ───────────────────────────────────────────────────────────────── */

.comment-count { color: var(--color-text-muted); font-size: 0.78rem; }
