/* === Header === */
header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
header h1 {
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}
header h1 a { color: inherit; text-decoration: none; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* Refined board header: no rule under the wordmark — the tab row below carries
   the border instead. */
#board-view header {
  padding: 44px 0 24px;
  border-bottom: none;
  margin-bottom: 0;
}
#board-view header .container { align-items: center; }
#board-view .header-actions { gap: 6px; }
#board-view .tip-pill { margin-right: 6px; }
.icon-btn {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1;
  transition: background-color 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--bg-surface); color: var(--ink); }
.icon-btn:active { background: var(--surface-hover); }
.icon-btn::before { content: ""; position: absolute; inset: -6px; }

/* === Category tabs === */
/* One horizontally scrolling row per tab, sharing a bottom border the active
   tab's thicker underline sits on top of. */
.cat-nav {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  /* Descendants are clipped at the padding box, so the tabs' -1px overlap can't
     reach the border area. This 1px lets each tab's underline land exactly on
     the padding edge — flush with the row border, nothing clipped. */
  padding-bottom: 1px;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none;
  display: flex;
  gap: 5px;
  align-items: baseline;
  padding: 12px 0 11px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 1.5px solid transparent;
  color: var(--ink-dim);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
  text-transform: lowercase;
}
.cat-tab:hover { color: var(--ink); }
.cat-tab.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}
.cat-count {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
.cat-tab.active .cat-count { opacity: 1; }

/* === Search === */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.search-prefix { flex: none; font-size: 0.8rem; color: var(--ink-dim); }
.search-input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}
.search-input::placeholder { color: var(--ink-dim); }
/* "#tag ✕" — appears at the right end of the search row while a tag filter is on. */
.tag-pill {
  flex: none;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.75rem;
  text-decoration: none;
  transition: border-color 0.2s;
}
.tag-pill span { color: var(--ink-dim); }
.tag-pill:hover { border-color: var(--ink-dim); }

/* === Post List === */
.post-list { display: flex; flex-direction: column; }
.load-more-btn { align-self: center; margin-top: 24px; }

.month-heading {
  padding: 32px 0 6px;
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-dim);
}

.post-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  color: inherit;
}
.post-card:hover { opacity: 0.75; }
.post-card-main { flex: 1; min-width: 0; }

.post-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
}
.post-meta .cat-badge {
  color: var(--ink);
  font-weight: 600;
  text-transform: lowercase;
}
.post-title {
  font-size: 1.45rem;
  margin-bottom: 6px;
  line-height: 1.22;
  text-wrap: pretty;
}
.post-excerpt {
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.card-tag {
  font-size: 0.75rem;
  color: var(--ink-dim);
  white-space: nowrap;
}
/* 88px thumbnail (image) or media glyph tile (audio/video) on the row's right. */
.post-card .post-thumb {
  flex: none;
  width: 88px;
  height: 88px;
  margin-top: 4px;
  border-radius: 6px;
  object-fit: cover;
}
.post-card .media-type-icon {
  flex: none;
  width: 88px;
  height: 88px;
  margin-top: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--ink-dim);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.tag-chip {
  font-size: 0.75rem;
  color: var(--ink-dim);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15em 0.7em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
a.tag-chip:hover { color: var(--ink); border-color: var(--ink-dim); }

.empty-msg {
  text-align: center;
  color: var(--ink-dim);
  padding: 80px 20px;
  font-size: 1.3rem;
  font-style: italic;
}

/* === Footer === */
/* The wordmark in the footer is the hidden entry point to the admin panel. */
.footer-link { color: inherit; text-decoration: none; }
.footer-link:hover { color: var(--ink); }

/* Responsive: header */
@media (max-width: 600px) {
  header { padding: 32px 0 24px; }
  header h1 { font-size: 1.4rem; }
  #board-view header { padding: 28px 0 18px; }
  .header-actions, #board-view .header-actions, .post-topbar-actions { gap: 12px; }
}
