@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

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

:root {
  --link: #2a3fdb;
  --text: #111;
  --muted: #555;
  --bg: #fff;
  --font: 'Inter', sans-serif;
  --tag: #2a3fdb;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Nav ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: none;
}

nav .nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

nav a:hover { text-decoration: underline; }

.nav-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo img {
  display: block;
  height: 1.25rem;
  width: auto;
  rotate: -15deg;
}

.nav-right {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

/* ── Main content ── */
main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

/* ── Home: description & tags ── */
.home-desc {
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
  color: var(--text);
}

.home-desc a {
  color: var(--link);
  text-decoration: none;
}

.home-desc a:hover { text-decoration: underline; }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-bottom: 2rem;
}

.tag-filter a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
}

.tag-filter a:hover { text-decoration: underline; }
.tag-filter a.active { font-weight: 600; }

/* ── Post list ── */
.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 0.18rem 0;
  font-size: 0.9rem;
}

.post-date {
  color: var(--text);
  white-space: nowrap;
  min-width: 9.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.post-title {
  flex: 1;
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-title:hover { text-decoration: underline; }

.post-tags {
  margin-left: auto;
  padding-left: 1rem;
  white-space: nowrap;
  color: var(--tag);
  font-size: 0.85rem;
}

.post-tags a {
  color: var(--tag);
  text-decoration: none;
}

.post-tags a:hover { text-decoration: underline; }

/* hide posts that don't match active filter */
.post-list li.hidden { display: none; }

/* ── Single post ── */
.post-meta {
  margin-bottom: 0.3rem;
}

.post-meta .post-tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  font-size: 0.9rem;
}

.post-meta .post-tag-list a {
  color: var(--link);
  text-decoration: none;
}

.post-meta .post-tag-list a:hover { text-decoration: underline; }

.post-datetime {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 1.4rem;
}

.post-body h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.4rem;
  font-family: var(--font);
}

.post-body .disclaimer {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 2rem;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.7;
}

.post-content p { margin-bottom: 1.1rem; }

.post-content a {
  color: var(--link);
}

.post-content h2, .post-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.post-content blockquote {
  border-left: 3px solid #ccc;
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
  margin: 1rem 0;
}

.post-content code {
  font-family: monospace;
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post-content pre {
  background: #f4f4f4;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* ── Footer ── */
footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 1.5rem 0;
  border-top: 1px solid #eee;
}

/* ── Tag page ── */
.tag-page h1 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .post-tags { display: none; }
  .post-date { min-width: 7rem; font-size: 0.82rem; }
  .post-body h1 { font-size: 1.8rem; }
}

/* ── Images ── */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
  border-radius: 3px;
}

.post-content figure {
  margin: 1.5rem 0;
}

.post-content figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ── Images (override) ── */
.post-content img {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 3px;
  max-height: 520px;
  object-fit: contain;
}

.post-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.post-content figure img {
  margin: 0 auto;
}

.post-content figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.4rem;
  font-style: italic;
}