/* ============================================
   OSTFLANKE.COM — Editorial Intelligence Design
   Palantir-inspired: white, heavy type, minimal
   ============================================ */

/* Self-hosted fonts — no Google Fonts requests */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-surface: #fafafa;
  --bg-raised: #f4f4f4;
  --border: #e0e0e0;
  --border-subtle: #ebebeb;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-faint: #a3a3a3;
  --accent: #0a0a0a;
  --accent-hover: #333333;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 1280px;
  --article-w: 700px;
  --radius: 0px;
  --radius-lg: 2px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
  --transition: 0.12s ease;
  --header-h: 52px;
}

/* ============================================
   1. RESET + BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--text);
  text-decoration: none;
}

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

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

ul, ol {
  list-style: none;
}

/* ============================================
   2. SKIP LINK
   ============================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ============================================
   3. READING PROGRESS BAR
   ============================================ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: transparent;
  z-index: 1000;
  width: 100%;
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%;
  background: var(--text);
  width: 0;
  transition: width 100ms ease-out;
}

/* ============================================
   4. SITE HEADER
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.site-logo {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  font-family: var(--font);
  text-transform: uppercase;
}

.site-logo:hover {
  color: var(--text);
}

.logo-tld {
  color: var(--text-muted);
  font-weight: 400;
}

/* Nav */
.main-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.35rem 0.875rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  transition: color var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--text);
}

.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.875rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-left: 0.5rem;
}

.nav-search-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Mobile search toggle */
.search-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.search-shortcut {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: var(--mono);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-muted);
  transition: all 0.2s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================================
   5. HERO SECTION — Palantir split layout
   ============================================ */

.hero {
  padding: 5rem 2rem 5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem;
  align-items: end;
}

.hero-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
  font-family: var(--font);
}

.hero-title {
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.04em;
}

.hero-desc {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn,
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0;
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: #333;
  color: var(--bg);
  border-color: #333;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-stat-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font);
  font-weight: 400;
}

/* ============================================
   6. SECTION CONTAINERS
   ============================================ */

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-weight: 400;
}

/* ============================================
   7. ARTICLE CARDS — featured grid
   ============================================ */

.featured-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 2rem;
  border: 1px solid var(--border);
}

.featured-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}

.featured-card:last-child {
  border-right: none;
}

.featured-card:hover {
  background: var(--bg-surface);
}

.featured-card--foundational {
  background: var(--bg-surface);
}

.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.featured-card-category {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.featured-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.625rem;
  letter-spacing: -0.02em;
}

.featured-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.55;
  font-style: italic;
}

.featured-card-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.5rem;
}

.featured-card-read {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-top: auto;
  letter-spacing: 0.01em;
}

/* Importance badges */
.importance-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.importance-badge--major {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-color: var(--border);
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.175rem 0.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 400;
  border-radius: 2px;
}

/* ============================================
   8. CATEGORY GRID
   ============================================ */

.category-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 2rem;
  border: 1px solid var(--border);
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}

.category-card:nth-child(2n) {
  border-right: none;
}

.category-card:nth-child(n+3) {
  border-top: 1px solid var(--border);
}

.category-card:hover {
  background: var(--bg-surface);
}

.category-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.625rem;
  letter-spacing: -0.02em;
}

.category-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1rem;
  font-weight: 400;
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   9. ABOUT + RECENT SECTIONS
   ============================================ */

.about-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 400;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-nations h3 {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.nations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nations-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 400;
}

.nations-list li:first-child {
  border-top: 1px solid var(--border-subtle);
}

.recent-section {
  padding: 5rem 0;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.recent-item {
  display: block;
  padding: 1.375rem 0;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: opacity var(--transition);
}

.recent-item:hover {
  opacity: 0.7;
}

.recent-item:first-child {
  border-top: 1px solid var(--border-subtle);
}

.recent-item-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.recent-item-category {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.recent-item-time {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.recent-item-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.recent-item-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  font-weight: 400;
}

/* ============================================
   10. BREADCRUMB
   ============================================ */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-faint);
  font-weight: 400;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.25rem;
  color: var(--border);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-faint);
}

/* ============================================
   11. ARTICLE LAYOUT
   ============================================ */

.article {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.article-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.article-header-inner {
  max-width: var(--article-w);
}

.article-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.article-category-badge {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.article-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.article-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
  font-weight: 400;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.meta-sep {
  color: var(--border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
  width: 100%;
}

/* Mobile TOC */
.mobile-toc-container {
  margin-bottom: 2rem;
  display: none;
}

.mobile-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--transition);
}

.mobile-toc-toggle:hover {
  border-color: var(--text);
}

.mobile-toc-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.mobile-toc {
  display: none;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: none;
}

.mobile-toc.active {
  display: block;
}

/* Article layout — sidebar + content */
.article-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  align-items: start;
  margin-bottom: 5rem;
}

/* TOC sidebar */
.article-toc {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  max-height: calc(100vh - var(--header-h) - 4rem);
  overflow-y: auto;
}

.toc-title {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.toc a {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-faint);
  padding: 0.2rem 0;
  text-decoration: none;
  transition: color var(--transition);
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.75rem;
  margin-left: -0.75rem;
  font-weight: 400;
}

.toc a:hover,
.toc a.active {
  color: var(--text);
  border-left-color: var(--text);
}

.toc ul {
  list-style: none;
}

.toc ul ul a {
  padding-left: 1.5rem;
  font-size: 0.775rem;
}

/* ============================================
   12. PROSE STYLES
   ============================================ */

.prose {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text);
  max-width: var(--article-w);
  font-weight: 400;
}

.prose h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.prose h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.prose h4, .prose h5, .prose h6 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.prose p {
  margin-bottom: 1.375rem;
}

.prose ul, .prose ol {
  list-style: revert;
  padding-left: 1.5rem;
  margin-bottom: 1.375rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--text);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-style: italic;
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose code {
  background: var(--bg-raised);
  color: var(--text);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  font-size: 0.875em;
  font-family: var(--mono);
  border: 1px solid var(--border);
}

.prose pre {
  background: #0a0a0a;
  border: none;
  border-radius: 0;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.prose pre code {
  background: none;
  padding: 0;
  color: #e5e5e5;
  font-size: 0.875rem;
  border: none;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition);
}

.prose a:hover {
  text-decoration-color: var(--text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.875rem;
}

.prose th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

.prose td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.internal-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.broken-link {
  color: var(--text-faint);
  text-decoration: line-through;
  font-style: italic;
}

/* ============================================
   13. ARTICLE FOOTER (Related, Backlinks)
   ============================================ */

.article-footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 0;
  margin-bottom: 5rem;
}

.article-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.backlinks h2,
.related-articles h2 {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.backlink-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.backlink-group dt {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.25rem;
}

.backlink-group dd a {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: var(--border);
  transition: color var(--transition);
}

.backlink-group dd a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}

.related-card:last-child {
  border-right: none;
}

.related-card:hover {
  background: var(--bg-surface);
}

.related-category {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.related-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.related-summary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-weight: 400;
}

/* ============================================
   14. CATEGORY PAGES
   ============================================ */

.category-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem 3.5rem;
}

.category-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.category-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  margin-top: 1rem;
  line-height: 1.05;
}

.category-description {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.category-content {
  padding: 3.5rem 0;
}

.category-content-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Länder two-column layout with map */
.category-content-inner.laender-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
}

.category-articles {
  min-width: 0;
}

.laender-map-aside {
  display: block;
}

.laender-map-sticky {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}

.laender-map {
  width: 100%;
  height: auto;
}

/* Water bodies */
.map-water path {
  fill: #f0f4f8;
  stroke: none;
}

/* Context countries — faint outlines */
.map-context path {
  fill: var(--bg-raised);
  stroke: var(--border);
  stroke-width: 0.75;
  stroke-linejoin: round;
}

/* Interactive countries */
.map-country {
  cursor: pointer;
}

.map-country path {
  fill: var(--bg-surface);
  stroke: var(--border);
  stroke-width: 1;
  stroke-linejoin: round;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.map-country:hover path,
.map-country.map-country-active path {
  fill: #e8e8e8;
  stroke: var(--text);
  stroke-width: 1.25;
}

.map-country:hover .map-label,
.map-country.map-country-active .map-label {
  fill: var(--text);
  font-weight: 600;
}

.map-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-muted);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  letter-spacing: 0.05em;
  transition: fill 0.15s ease;
}

.map-sea-label {
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 400;
  font-style: italic;
  fill: var(--text-faint);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  letter-spacing: 0.03em;
}

/* Article highlight when hovering map country */
.list-article.nation-highlight {
  background: var(--bg-raised);
}

.list-article.nation-highlight .list-title {
  color: var(--text);
}

.article-group {
  margin-bottom: 3.5rem;
}

.group-title {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-article {
  border-bottom: 1px solid var(--border-subtle);
}

.list-article:first-child {
  border-top: 1px solid var(--border-subtle);
}

.list-article a {
  display: block;
  padding: 1.375rem 0;
  text-decoration: none;
  transition: opacity var(--transition);
}

.list-article a:hover {
  opacity: 0.7;
}

.list-article a:hover .list-title {
  color: var(--text);
}

.list-article-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.list-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.35rem;
  transition: color var(--transition);
  letter-spacing: -0.015em;
}

.list-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-style: italic;
  font-weight: 400;
}

.list-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.list-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 400;
}

/* ============================================
   15. SEARCH MODAL
   ============================================ */

.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5vh 1rem;
}

.search-modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.search-modal-inner {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color var(--transition);
}

.search-close:hover {
  color: var(--text);
}

.search-input {
  display: block;
  width: 100%;
  padding: 1rem 3rem 1rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  font-weight: 400;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-count {
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 0.5rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-result {
  display: block;
  padding: 0.875rem;
  text-decoration: none;
  transition: background 0.1s;
  border-radius: 0;
}

.search-result:hover,
.search-result.selected {
  background: var(--bg-surface);
}

.search-result-category {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.25rem;
}

.search-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.search-result-snippet {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-weight: 400;
}

.search-result mark {
  background: #f5f5f5;
  color: var(--text);
  border-radius: 0;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}

.search-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-empty-state {
  padding: 1rem 0.5rem;
}

.search-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.search-pill:hover {
  border-color: var(--text);
  color: var(--text);
}

.search-recent {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.search-recent-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.search-recent-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-weight: 400;
}

.search-recent-item:hover {
  background: var(--bg-surface);
  color: var(--text);
}

/* ============================================
   16. FOOTER
   ============================================ */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-brand {
  margin-bottom: 3rem;
}

.footer-logo {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.footer-about {
  font-size: 0.8125rem;
  color: var(--text-faint);
  max-width: 480px;
  line-height: 1.7;
  font-weight: 400;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-section a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  font-weight: 400;
}

.footer-section a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 400;
}

/* ============================================
   17. 404 PAGE
   ============================================ */

.page-not-found {
  padding: 7rem 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.page-not-found h1 {
  font-size: 6rem;
  font-weight: 900;
  color: var(--bg-raised);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.06em;
}

.page-not-found h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.page-not-found p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  font-weight: 400;
}

/* Not-found fallback */
.not-found {
  padding: 5rem 2rem;
}

.not-found-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.not-found-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--bg-raised);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.06em;
}

.not-found-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.not-found-message {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-weight: 400;
}

.not-found-categories {
  margin-top: 3rem;
  text-align: left;
}

.not-found-categories h2 {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.not-found-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--border);
}

.not-found-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}

.not-found-card:nth-child(2n) {
  border-right: none;
}

.not-found-card:nth-child(n+3) {
  border-top: 1px solid var(--border);
}

.not-found-card:hover {
  background: var(--bg-surface);
}

.not-found-card strong {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.not-found-card span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 400;
}

/* ============================================
   18. RESPONSIVE — 1024px
   ============================================ */

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-desc {
    max-width: 540px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured-card:nth-child(2) {
    border-right: none;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .article-layout {
    grid-template-columns: 180px 1fr;
    gap: 3rem;
  }
}

/* ============================================
   19. RESPONSIVE — 768px
   ============================================ */

@media (max-width: 768px) {
  /* Header */
  .header-inner {
    padding: 0 1.25rem;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    z-index: 190;
  }

  .main-nav.active {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-search-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
    margin-left: 0;
  }

  .search-toggle {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  /* Hero */
  .hero {
    padding: 3rem 1.25rem 3rem;
  }

  .hero-inner {
    gap: 2rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  /* Section inner */
  .section-inner {
    padding: 0 1.25rem;
  }

  /* Featured grid */
  .featured-section {
    padding: 3.5rem 0;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .featured-card:last-child {
    border-bottom: none;
  }

  /* Category grid */
  .category-section {
    padding: 3.5rem 0;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .category-card:last-child {
    border-bottom: none;
  }

  .category-card:nth-child(n+3) {
    border-top: none;
  }

  /* About section */
  .about-section {
    padding: 3.5rem 0;
  }

  /* Recent section */
  .recent-section {
    padding: 3.5rem 0;
  }

  .recent-item-meta {
    gap: 0.75rem;
  }

  /* Article layout — remove sidebar */
  .article {
    padding: 0 1.25rem;
  }

  .article-layout {
    grid-template-columns: 1fr;
    margin-bottom: 3rem;
  }

  .article-toc {
    display: none;
  }

  .mobile-toc-container {
    display: block;
  }

  /* Article header */
  .article-header {
    padding: 2.5rem 0 2rem;
    margin-bottom: 2rem;
  }

  /* Category header */
  .category-header {
    padding: 2.5rem 1.25rem 2rem;
  }

  .category-content-inner {
    padding: 0 1.25rem;
  }

  .category-content-inner.laender-layout {
    grid-template-columns: 1fr;
  }

  .laender-map-aside {
    display: none;
  }

  /* Footer */
  .footer-inner {
    padding: 0 1.25rem;
  }

  .footer-nav {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  /* Not found */
  .not-found-grid {
    grid-template-columns: 1fr;
  }

  .not-found-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .not-found-card:last-child {
    border-bottom: none;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .related-card:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    text-align: center;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

/* ============================================
   20. MAP PAGE
   ============================================ */

.map-page {
  display: flex;
  flex-direction: column;
}

/* Page header */
.map-page-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.map-page-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.map-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-top: 0.25rem;
}

.map-page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin-top: 0.1rem;
  font-weight: 400;
}

/* Stats row */
.map-page-stats {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.map-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.5rem 1.25rem;
  border-right: 1px solid var(--border);
  gap: 0.1rem;
}

.map-stat-item:last-child {
  border-right: none;
}

.map-stat-num {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1;
}

.map-stat-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
}

/* Map + Panel split */
/* --map-h is the concrete pixel height Leaflet reads from offsetHeight */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  /* height set inline so both CSS and Leaflet agree */
}

/* Leaflet container — explicit height, independent of grid parent */
.map-container {
  background: #f5f5f5;
  position: relative;
  height: clamp(420px, calc(100vh - 190px), 900px);
}

.map-panel {
  height: clamp(420px, calc(100vh - 190px), 900px);
}

/* Override Leaflet defaults to match site */
.leaflet-container {
  font-family: var(--font) !important;
  font-size: 0.875rem !important;
  background: #f5f5f5;
}

.leaflet-control-zoom a {
  color: var(--text) !important;
  border-color: var(--border) !important;
  font-size: 16px !important;
  line-height: 26px !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.leaflet-control-attribution {
  font-size: 0.65rem !important;
  background: rgba(255,255,255,0.85) !important;
  color: var(--text-faint) !important;
  border-radius: 0 !important;
  padding: 2px 6px !important;
}

.leaflet-control-attribution a {
  color: var(--text-faint) !important;
}

/* Custom tooltip */
.map-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.map-tooltip .leaflet-tooltip-top::before,
.map-tooltip::before {
  display: none !important;
}

.map-tt {
  background: var(--text);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-family: var(--font);
  white-space: nowrap;
  pointer-events: none;
}

.map-tt strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.map-tt span {
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

.map-tt-sm strong {
  display: inline;
  margin-bottom: 0;
}

/* ── Info panel */
.map-panel {
  border-left: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
}

.map-panel-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.25rem 1.5rem 0;
  font-weight: 400;
}

.map-panel-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.875rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  text-align: left;
  transition: color var(--transition);
  font-weight: 400;
}

.map-panel-back:hover {
  color: var(--text);
}

/* Legend */
.map-legend {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.map-legend-header {
  margin-bottom: 0.875rem;
}

.map-legend-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.map-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-legend-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}

.map-legend-row:first-child {
  border-top: 1px solid var(--border-subtle);
}

.map-legend-row:hover {
  background: var(--bg-surface);
}

.map-legend-row.active {
  background: var(--bg-raised);
}

.map-legend-swatch {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.map-legend-name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text);
  font-weight: 500;
}

.map-legend-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.map-legend-bud {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* Marker legend */
.map-marker-legend {
  padding: 1.25rem 1.5rem;
}

.map-source-note {
  padding: 0.75rem 1.5rem 1rem;
  font-size: 0.7rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  line-height: 1.5;
  font-style: italic;
}

.map-marker-legend-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.map-marker-legend-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.map-ml-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Country detail panel */
.map-detail {
  padding: 0;
}

.map-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.map-detail-flag {
  font-size: 2rem;
  line-height: 1;
}

.map-detail-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.map-detail-badges {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.map-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.map-badge-efp {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.map-badge-year {
  color: var(--text-faint);
  border-color: var(--border);
  font-weight: 400;
}

.map-detail-summary {
  padding: 1.125rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}

/* Metrics grid */
.map-detail-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.map-metric {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.map-metric:nth-child(2n) {
  border-right: none;
}

.map-metric:nth-last-child(-n+2) {
  border-bottom: none;
}

.map-metric-val {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.map-metric-key {
  display: block;
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  font-weight: 400;
}

/* Spending bar */
.map-spending-bar {
  height: 2px;
  background: var(--border);
  margin-top: 0.5rem;
}

.map-spending-fill {
  height: 100%;
  background: var(--text);
  transition: width 0.4s ease;
}

/* Sections */
.map-detail-section {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.map-detail-section:last-child {
  border-bottom: none;
}

.map-detail-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.map-systems-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-systems-list li {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.325rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 400;
}

.map-systems-list li:first-child {
  border-top: 1px solid var(--border-subtle);
}

/* Article links */
.map-article-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-article-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: opacity var(--transition);
}

.map-article-link:first-child {
  border-top: 1px solid var(--border-subtle);
}

.map-article-link:hover {
  opacity: 0.65;
}

.map-article-arrow {
  color: var(--text-faint);
  font-style: normal;
  flex-shrink: 0;
}

/* ── Leaflet custom markers ── */

.micon {
  width: 10px;
  height: 10px;
}

.micon-efp {
  background: #0a0a0a;
  transform: rotate(45deg);
}

.micon-airbase {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #0a0a0a;
}

.micon-defense {
  background: none;
  border: 2px solid #0a0a0a;
  border-radius: 50%;
  width: 10px;
  height: 10px;
}

/* Marker legend icons */
.map-ml-efp {
  width: 10px;
  height: 10px;
  background: var(--text);
  transform: rotate(45deg);
  display: inline-block;
}

.map-ml-airbase {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--text);
  display: inline-block;
}

.map-ml-defense {
  width: 10px;
  height: 10px;
  border: 2px solid var(--text);
  border-radius: 50%;
  display: inline-block;
}

/* ── Map responsive ── */

@media (max-width: 1024px) {
  .map-layout {
    grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 768px) {
  .map-page {
    height: auto;
    overflow: visible;
  }

  .map-page-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 1rem;
  }

  .map-page-stats {
    width: 100%;
    overflow-x: auto;
  }

  .map-stat-item {
    align-items: flex-start;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
  }

  .map-layout {
    grid-template-columns: 1fr;
    height: auto !important;
  }

  .map-container {
    height: 60vh !important;
  }

  .map-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    height: auto !important;
    max-height: none;
  }
}
