:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #0b4f8a;
  --primary-light: #e0f2fe;
  --border: #e2e8f0;
  --maxw: 920px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.2rem; color: var(--text); }
.brand img { height: 36px; width: auto; }
nav.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; font-size: 0.95rem; font-weight: 500; }
nav.main-nav a.nav-kb {
  padding: 0.25rem 0.65rem;
  border: 1.5px solid var(--primary);
  border-radius: 7px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
nav.main-nav a.nav-kb:hover {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

main.container { padding: 1rem 1.25rem 3rem; }

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
}
.hero h1 { margin: 0 0 0.4rem; font-size: 1.7rem; }
.hero p { margin: 0; color: var(--muted); }

.pill-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.post-list { display: flex; flex-direction: column; gap: 0.9rem; }
.kb-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.kb-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.kb-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(11, 79, 138, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}
.kb-tile h2 { margin: 0 0 0.4rem; font-size: 1.15rem; color: var(--primary); }
.kb-tile p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.kb-toc { margin-bottom: 1.1rem; }
.kb-toc h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.kb-toc ol {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.3rem 1.5rem;
  font-size: 0.92rem;
}
.kb-surname-pill {
  border-radius: 7px;
  background: var(--primary);
  color: #ffffff;
  transition: opacity 0.15s ease;
}
.kb-surname-pill:hover {
  opacity: 0.88;
  text-decoration: none;
}
.kb-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.35rem;
  scroll-margin-top: 1rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.post-card:target {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.post-card:target h2 a,
.post-card:target p,
.post-card:target .meta {
  color: #ffffff !important;
}
.post-card:target .badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.post-card h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.meta { font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.badge {
  background: #f1f5f9;
  color: #334155;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

article.single {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}
article.single h1 { margin-top: 0; font-size: 1.75rem; line-height: 1.25; }
article.single img { max-width: 100%; height: auto; }
.alignright { float: right; margin: 0 0 1rem 1.25rem; }
article.single table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.94rem; }
article.single th, article.single td { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.65rem 0.75rem; text-align: left; vertical-align: top; }
.nowrap { white-space: nowrap; }
article.single th { background: var(--bg); }
.kb-summary { background: var(--bg); border-left: 3px solid var(--primary); padding: 0.65rem 1rem; margin: 0 0 1.25rem; color: var(--muted); font-size: 0.96rem; }
.kb-refs { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.92rem; }
.kb-refs h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.kb-timeline { border-left: 3px solid var(--primary); margin: 1.25rem 0 1.25rem 0.5rem; padding-left: 1.25rem; }
.kb-timeline ul { list-style: none; padding: 0; margin: 0; }
.kb-timeline li { position: relative; margin-bottom: 1rem; }
.kb-timeline li::before { content: ""; position: absolute; left: -1.65rem; top: 0.45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }

.pagination { display: flex; gap: 1rem; margin-top: 1.5rem; font-weight: 500; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

