/* ============================================================
   Blogkit — central theme. Change it here, change the whole site.
   ============================================================ */
:root {
  /* Colors */
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-text-muted: #52606d;
  --color-brand: #0f766e;
  --color-brand-strong: #115e59;
  --color-accent: #b45309;
  --color-border: #e4e0da;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text-base: 1.0625rem;
  --leading: 1.7;

  /* Layout */
  --container: 46rem;
  --container-wide: 64rem;
  --radius: 10px;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.07), 0 4px 14px rgb(0 0 0 / 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14181d;
    --color-surface: #1c2229;
    --color-text: #e6e8ea;
    --color-text-muted: #9aa5b1;
    --color-brand: #2dd4bf;
    --color-brand-strong: #5eead4;
    --color-accent: #fbbf24;
    --color-border: #2c343d;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  }
}

/* ---- Basic reset ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--color-brand); }
a:hover { color: var(--color-brand-strong); }

.container { max-width: var(--container-wide); margin-inline: auto; padding-inline: 1.25rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-brand); color: #fff; padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.site-header__inner {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding-block: 1rem;
}
.site-header__brand {
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  color: var(--color-text); text-decoration: none;
}
.site-header__brand:hover { color: var(--color-brand); }
.site-header__nav { display: flex; gap: 1.25rem; }
.site-header__nav a { color: var(--color-text-muted); text-decoration: none; font-weight: 500; }
.site-header__nav a:hover { color: var(--color-brand); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 4rem; border-top: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text-muted); font-size: 0.9rem;
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  align-items: center; justify-content: space-between; padding-block: 1.5rem;
}
.site-footer nav { display: flex; gap: 1rem; }
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-brand); }

/* ---- Sections and card grid ---- */
.section { margin-block: 2.5rem; }
.section--center { text-align: center; margin-block: 6rem; }
.section__title {
  font-size: 1.5rem; letter-spacing: -0.01em; margin-bottom: 1.25rem;
}
.section__more { margin-top: 1.5rem; font-weight: 600; }
.card-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.card-grid--featured { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }

/* ---- Post card ---- */
.post-card {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.post-card--featured { border-color: var(--color-brand); }
.post-card__cover img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  font-size: 0.82rem; color: var(--color-text-muted);
}
.post-card__title { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.post-card__title a { color: var(--color-text); text-decoration: none; }
.post-card__title a:hover { color: var(--color-brand); }
.post-card__excerpt { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }

/* ---- Badges and tags ---- */
.badge {
  display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-decoration: none;
}
.badge--category { background: color-mix(in srgb, var(--color-brand) 14%, transparent); color: var(--color-brand); }
.badge--featured { background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent); }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.tag { font-size: 0.82rem; color: var(--color-text-muted); text-decoration: none; }
.tag:hover { color: var(--color-brand); }
.term-list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.term-list--inline { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.term-list__count { color: var(--color-text-muted); font-size: 0.82rem; }

/* ---- Post ---- */
.post { max-width: var(--container); margin-inline: auto; }
.post__header { margin-block: 2.5rem 2rem; }
.post__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 0.75rem;
}
.post__title { font-size: 2.2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.post__description { font-size: 1.15rem; color: var(--color-text-muted); margin: 0; }
.post__cover { border-radius: var(--radius); margin-top: 1.5rem; box-shadow: var(--shadow); }
.post__footer {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border);
  display: grid; gap: 0.75rem; color: var(--color-text-muted); font-size: 0.9rem;
}
.post__updated, .post__author { margin: 0; }

/* ---- Prose (markdown content) ---- */
.prose { max-width: var(--container); }
.prose h2, .prose h3 { letter-spacing: -0.01em; margin-top: 2.2em; }
.prose .heading-anchor { color: inherit; text-decoration: none; }
.prose .heading-anchor:hover { text-decoration: underline; }
.prose pre {
  background: #11161c; color: #e6e8ea;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  overflow-x: auto; font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.6;
}
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.prose :not(pre) > code {
  background: color-mix(in srgb, var(--color-border) 55%, transparent);
  padding: 0.12em 0.35em; border-radius: 5px;
}
.prose blockquote {
  margin-inline: 0; padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--color-brand); color: var(--color-text-muted);
}
.prose img { border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--color-border); padding: 0.5rem 0.75rem; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--color-border); margin-block: 2.5rem; }

/* ---- Page ---- */
.page { max-width: var(--container); margin-inline: auto; }
.page__header { margin-block: 2.5rem 1.5rem; }
.page__description { color: var(--color-text-muted); font-size: 1.1rem; }

/* ---- Pagination ---- */
.pagination {
  display: flex; gap: 1rem; align-items: center; justify-content: center;
  margin-top: 2rem; color: var(--color-text-muted); font-size: 0.95rem;
}
