.blog { padding-top: 48px; padding-bottom: 72px; }
.blog h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; }
.blog-hero p { margin: 0 0 20px; color: var(--muted); max-width: 60ch; }
.crumb { margin: 0 0 20px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }

nav a[aria-current='page'] { color: var(--text); }

/* Suche */
.search { display: flex; gap: 10px; max-width: 460px; margin-bottom: 20px; }
.search input { flex: 1; min-width: 0; }

input[type='text'], input[type='url'], input[type='password'], input[type='search'], textarea {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.95rem; }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
button.btn.ghost { border: 1px solid var(--border); }

/* Tags */
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tag:hover, .tag.active { color: var(--accent); border-color: var(--accent); }
.tag small { opacity: 0.7; }

/* Beiträge */
.posts { display: grid; gap: 20px; }
.post {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.post h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.25; }
.post h2 a { text-decoration: none; }
.post h2 a:hover { color: var(--accent); }
.meta { margin: 0 0 14px; color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.excerpt { margin: 0 0 16px; color: var(--muted); }
.body { margin-bottom: 18px; overflow-wrap: anywhere; }
.body p { margin: 0 0 1em; }
.body a { color: var(--accent); }
.body code, .excerpt code {
  padding: 1px 6px;
  font-size: 0.9em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.body pre {
  margin: 0 0 1em;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.body pre code { padding: 0; border: 0; background: none; }

.post-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-foot .more { margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 600; }
.like { margin: 0; }
.like-btn {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s ease;
}
.like-btn:hover:not(:disabled) { border-color: var(--accent); }
.like-btn.on { border-color: var(--accent); color: var(--accent); cursor: default; }

.empty { color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 32px; color: var(--muted); }

.notice {
  padding: 10px 14px;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
}
.notice.err { border-left-color: #e5484d; }

/* Admin */
.admin-box { max-width: 420px; }
.form { display: grid; gap: 18px; max-width: 760px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form .btn { justify-self: start; }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.row-actions .btn { padding: 6px 12px; font-size: 0.85rem; }
.btn.danger { color: #e5484d; }

@media (max-width: 640px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .admin-table td { border: 0; padding: 4px 14px; }
  .row-actions { justify-content: flex-start; }
  .post { padding: 20px; }
}

/* Titelbild */
.cover { margin: -24px -26px 18px; overflow: hidden; border-radius: 18px 18px 0 0; background: var(--bg); }
.cover img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cover a { display: block; }
.post:not(.has-cover) .cover { display: none; }
@media (max-width: 640px) { .cover { margin: -20px -20px 16px; } }

/* Bilder im Text */
.body img { max-width: 100%; height: auto; border-radius: 12px; }
.body h2, .body h3, .body h4 { margin: 1.4em 0 0.5em; line-height: 1.25; letter-spacing: -0.02em; }
.body ul, .body ol { margin: 0 0 1em; padding-left: 1.5em; }
.body blockquote {
  margin: 0 0 1em;
  padding: 2px 16px;
  color: var(--muted);
  border-left: 4px solid var(--border);
}
.body hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }

/* Editor */
.field { display: grid; gap: 6px; }
.field > .label { font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
.cover-current { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cover-current img { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
input[type='file'] { font: inherit; color: var(--muted); }

.editor { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.editor textarea { border: 0; border-radius: 0; min-height: 320px; background: transparent; }
.editor textarea:focus-visible { outline-offset: -2px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.toolbar button {
  padding: 5px 10px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.toolbar button:hover:not(:disabled) { border-color: var(--accent); }
.toolbar button:disabled { opacity: 0.45; cursor: default; }
.toolbar .tab.on { color: var(--accent); border-color: var(--accent); }
.toolbar .spacer { flex: 1; }
.preview { min-height: 320px; padding: 14px 16px; overflow-wrap: anywhere; }
.preview[hidden], .editor textarea[hidden] { display: none; }
.editor-status { margin: 0; padding: 6px 12px; min-height: 2em; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border); }
.editor-status.err { color: #e5484d; }
