/* Kartenatlas (karten.php) – Rot/Schwarz-Design der Website, Pixelbilder scharf */
.km { max-width: 1180px; margin: 0 auto; padding: 24px var(--side) 48px; }
.km h1 { font-family: var(--font-display); margin: 8px 0 8px; }
.km-lead { color: var(--muted2); max-width: 66ch; margin: 0 0 8px; line-height: 1.55; }
.km-nav { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; margin: 14px 0 4px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--border); }
.km-nav a { color: var(--text); text-decoration: none; font-size: .8rem; padding: 4px 10px; border: 1px solid var(--border2); border-radius: 999px; }
.km-nav a:hover, .km-nav a:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.km section { padding-top: 26px; scroll-margin-top: 56px; }
.km section header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.km h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.km section header p { margin: 0; color: var(--muted2); font-size: .85rem; }
.km-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.km-card { margin: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.km button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: zoom-in; }
.km-main { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--bg); padding: 8px; }
.km-main img { max-height: 100%; width: auto; max-width: 100%; image-rendering: pixelated; object-fit: contain; }
.km button:focus-visible, #km-c:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.km-card figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.km-hint { color: var(--muted2); font-size: .78rem; }
.km-ths { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.km-th { width: 64px; height: 48px; background: var(--bg); border: 1px solid var(--border2) !important; border-radius: 4px; display: grid; place-items: center; overflow: hidden; }
.km-th img { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.km-th:hover { border-color: var(--accent) !important; }
#km-d { border: 1px solid var(--border2); background: var(--bg); color: var(--text); padding: 0; max-width: 96vw; max-height: 94vh; border-radius: var(--r); }
#km-d::backdrop { background: rgba(0, 0, 0, .86); }
#km-d img { display: block; max-width: 94vw; max-height: 84vh; width: auto; image-rendering: pixelated; }
.km-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted2); }
#km-c { cursor: pointer; color: var(--text); border: 1px solid var(--border2); border-radius: 6px; padding: 3px 12px; background: none; font: inherit; }
