/* ===== Reset & Base ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); }

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

/* ===== Header ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover {
  color: var(--accent);
  background: var(--code-bg);
}

/* ===== Main Content ===== */
.site-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { margin-top: 0.5rem; }
.footer-links a { margin: 0 0.5rem; }

/* ===== Hero ===== */
.hero {
  color: var(--hero-text, #fff);
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: inherit;
}
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}
.hero-cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.65rem 1.75rem;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  text-decoration: none;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  transition: background 0.2s;
}
.hero-cta:hover {
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
}

/* ===== Section headings ===== */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  letter-spacing: -0.02em;
}

/* ===== Post list ===== */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; }
.post-list a { text-decoration: none; font-weight: 500; }
.post-list a:hover { text-decoration: underline; }
.post-list time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.post-list .post-category { font-size: 0.8rem; color: var(--muted); }

/* ===== Article page ===== */
.post-title { margin-bottom: 0.25rem; }
.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.post-meta a { margin-right: 0.5rem; }

.post-featured-image img {
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.post-content img {
  display: block;
  margin: 1rem 0;
  border-radius: 0.25rem;
}

.post-content h2 { margin-top: 2.5rem; }
.post-content h3 { margin-top: 2rem; }

/* ===== Code blocks ===== */
pre, code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  border-radius: 0.375rem;
}

code {
  padding: 0.15rem 0.35rem;
  font-size: 0.9em;
}
pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.55;
  border: 1px solid var(--border);
}
pre code { padding: 0; background: transparent; border: none; font-size: 0.85rem; }

/* ===== Tags ===== */
.tag {
  display: inline-block;
  background: var(--code-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
  text-decoration: none;
  color: var(--muted);
}

.tag-list { list-style: none; padding: 0; }
.tag-list li { margin: 0.5rem 0; }
.tag-list .count { color: var(--muted); margin-left: 0.5rem; }

/* ===== Categories ===== */
.category-list { list-style: none; padding: 0; }
.category-list li { margin: 0.5rem 0; }
.category-list .count { color: var(--muted); margin-left: 0.5rem; }

/* ===== Post navigation ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.post-nav-prev { flex: 1; text-align: left; }
.post-nav-next { flex: 1; text-align: right; }

.post-category-link {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===== Search ===== */
.search-input {
  width: 100%;
  max-width: 40rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tag-chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.tag-chip.active,
.tag-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.search-status { color: var(--muted); }

/* ===== Imprint ===== */
.imprint h1 { margin-bottom: 1.5rem; }
.imprint h2 { margin-top: 2rem; font-size: 1.25rem; }
.imprint address {
  font-style: normal;
  line-height: 1.8;
}

/* ===== Dev theme picker ===== */
.dev-theme-picker {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.dev-theme-picker label { font-weight: 600; white-space: nowrap; }
.dev-theme-picker select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .site-nav { flex-wrap: wrap; justify-content: center; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .post-nav { flex-direction: column; }
}
