:root {
  --bg: #fff;
  --fg: #1a1a1a;
  --max-width: 560px;
  --muted: #999;
  --accent: #002FA7;
  --border: #ebebeb;
  --mono: ui-monospace, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  font-weight: 400;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  line-height: 1.25;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.5em; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.1em; }
h4, h5, h6 { font-size: 1em; }

p { margin: 0 0 1rem; }
strong, b { font-weight: 600; }
h1 + p, h2 + p, h3 + p { margin-top: 0; }

/* ── Links ── */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
/* a:visited { color: var(--muted); } */
a:hover { color: var(--accent) }

/* ── Meta ── */
time {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
}

/* ── Elements ── */
img { max-width: 100%; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

ul, ol { margin: 0 0 1rem 1.25em; }
li { margin-bottom: 0.2em; }

/* ── Code ── */
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--fg);
}

/* ── Blockquote ── */
blockquote {
  border-left: 2px solid var(--border);
  padding-left: 0.9rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ── Forms ── */
input, textarea {
  font-family: var(--sans);
  font-size: 1em;
  color: var(--fg);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.45rem 0;
  width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--fg); }
input::placeholder { color: var(--muted); }
textarea {
  min-height: 100px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.45rem 0.65rem;
}

.form-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1rem;
}
.form-row input { flex: 1; }

button {
  font-family: var(--sans);
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 0.45rem 1.1rem;
  white-space: nowrap;
}
button:hover { opacity: 0.75; }

/* ── Header + Nav ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

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

.logo-title {
  font-size: 1em;
  /* font-weight: 600; */
  color: var(--fg) !important;
  margin: 0;
  text-decoration: none;
}

.logo-subtitle {
  font-size: 0.85em;
  color: var(--muted);
  margin: 0;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding-top: 0.1rem;
}

.nav-links a {
  font-size: 0.9em;
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--fg); }

/* ── Footer ── */
footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85em;
  color: var(--muted);
  line-height: 1.6;
}

.connect > a{
  color: var(--muted);
}

/* ── Post list ── */
.posts_list { list-style: none; padding: 0; margin: 0; }

.home_post {
  display: grid;
  grid-template-columns: 1fr auto; /* 👈 key change */
  align-items: center;             /* cleaner vertical alignment */
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
  column-gap: 1rem;                /* spacing between title & date */
}
.home_post:last-child { border-bottom: 1px solid var(--border); }

.post_date {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
  /* text-align: right;   */
  white-space: nowrap;
}
.homepost_title {
  font-size: 1em;
  font-weight: 400;
  /* color: var(--fg) !important; */
  text-decoration: none;
}
.homepost_title:hover { text-decoration: underline; }

.read-all {
  text-align: right;
  margin: 0.5rem 0 0;
  font-size: 0.85em;
}
.read-all a {
  color: var(--muted);
  text-decoration: none;
}
.read-all a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Post navigation ── */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem;
  padding-top: 1.5rem;
  /* border-top: 1px solid var(--border); */
}
.post-nav-prev, .post-nav-next {
  text-decoration: none;
  font-size: 0.9em;
  line-height: 1.4;
  max-width: 45%;
}
.post-nav-prev { color: var(--accent); }
.post-nav-next { color: var(--accent); margin-left: auto; text-align: right; }
.post-nav-prev:hover, .post-nav-next:hover { text-decoration: underline; }

/* ── Back link ── */
.back {
  display: inline-block;
  margin: 2rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85em;
}
.back:hover { color: var(--fg); }

/* ── Tags ── */
.post-tags {
  margin: 0 0 1.5rem;
  font-size: 0.85em;
}
.tag {
  color: var(--muted);
  text-decoration: none;
}
.tag:hover { color: var(--accent); }

/* ── Related Posts ── */
.related-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-posts li {
  margin-bottom: 0.5rem;
}
.related-posts a {
  font-size: 0.95em;
}

/* ── Tag Page ── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list .post-date {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
}

/* ── Tag Cloud ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.tag-filter {
  font-size: 0.8em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  /* border-radius: 4px; */
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tag-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tag-filter.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ── Filter Info ── */
.filter-info {
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.filter-tag {
  color: var(--accent);
  font-weight: 500;
}
.filter-info button {
  font-size: 0.85em;
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
}
.filter-info button:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* ── Series ── */
.series-banner {
  font-size: 0.9em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.series-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.series-nav h3 {
  margin-bottom: 1rem;
  margin-top: 0;
}

.series-posts {
  margin: 0 0 1rem 1.5rem;
  padding: 0;
}

.series-posts li {
  margin-bottom: 0.4rem;
  font-size: 0.9em;
}

.series-posts li.current {
  color: var(--muted);
  font-style: italic;
}

.series-posts li.current span {
  font-weight: 500;
}

/* ── Series Page ── */
.series-item {
  margin-bottom: 2rem;
}

.series-item h2 {
  margin-bottom: 0.25rem;
}

.series-count {
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.series-item .series-posts {
  list-style: decimal;
}

.series-item .series-posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.series-item .series-posts .post_date {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
}

/* ── Projects ── */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.project-list li {
  padding: 0.2rem 0;
  font-size: 0.95em;
}
.project-list li a {
  color: var(--accent);
  text-decoration: none;
}
.project-list li a:hover {
  text-decoration: underline;
}

/* ── Gallery ── */
.gallery-count {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.gallery-empty {
  color: var(--muted);
  font-style: italic;
}

.gallery-grid {
  column-count: 2;
  column-gap: 0.2rem;
}

.gallery-grid img {
  width: 100%;
  transition: opacity 0.2s ease;
  break-inside: avoid;
  margin-bottom: 0.2rem;
}

.gallery-grid img:hover {
  opacity: 0.85;
}

@media (min-width: 600px) {
  .gallery-grid {
    column-count: 3;
    column-gap: 0.25rem;
  }
  
  .gallery-grid img {
    margin-bottom: 0.25rem;
  }
}

.comment-email > a{
  color: var(--muted)

}