/* ==========================================================================
   Kulturdatenbank Region Trier – Stylesheet
   Ruhiger, redaktioneller Stil: Papierton, Serifenschrift, Haarlinien statt
   Kästen und Schatten, sparsame Farbe. Kein Framework.
   Aufbau: Tokens · Basis · Layout · Kopf · Suche · Formulare · Startseite ·
   Kacheln · Seitenkopf · Objektseite · Ergebnisse · Listen · Karte ·
   Lightbox · Fuß · Dienstprogramme · Druck
   ========================================================================== */

/* ---------- 1. Design-Tokens ---------- */
:root {
    color-scheme: light;

    --c-bg: #f8f6f1;
    --c-surface: #fdfcf9;
    --c-surface-2: #f0ece4;
    --c-surface-3: #e6e0d5;
    --c-text: #22201c;
    --c-muted: #6d675d;
    --c-border: #e2dcd1;
    --c-border-strong: #c7bfb1;

    --c-brand: #26403e;
    --c-brand-2: #3d5f5b;
    --c-brand-soft: #e7ebe6;
    --c-on-brand: #ffffff;
    --c-accent: #8c3b23;
    --c-accent-soft: #f3e8e1;
    --c-link: #26403e;
    --c-focus: #b5772b;
    --c-standort: #1a73e8; /* eigener Standort auf Karten (Kacheln bleiben auch dunkel hell) */
    --c-band: #26403e;
    --c-band-2: #2f4c49;
    --c-on-band: #f3efe6;
    --c-on-band-muted: rgb(243 239 230 / .72);
    --c-band-line: rgb(243 239 230 / .18);

    /* Bereiche: Bau/Kunst · Archäologie · Geschichte · Natur · Handwerk (gedeckt) */
    --tone-0: #9b5a3e;
    --tone-1: #93793a;
    --tone-2: #56658a;
    --tone-3: #5b7a5c;
    --tone-4: #7c5d7e;
    --tone-x: #8a8379;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
    --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

    --radius-lg: 3px;
    --radius: 2px;
    --radius-sm: 2px;
    --shadow-1: none;
    --shadow-2: 0 10px 30px rgb(34 32 28 / .10);
    --shadow-3: 0 10px 30px rgb(34 32 28 / .10);

    --container: 1240px;
    --measure: 68ch;
    --gutter: clamp(18px, 3.5vw, 40px);
    --header-h: 64px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --c-bg: #161513;
    --c-surface: #1c1b18;
    --c-surface-2: #23211d;
    --c-surface-3: #2d2a25;
    --c-text: #e9e4da;
    --c-muted: #a39b8e;
    --c-border: #34312b;
    --c-border-strong: #4b463e;
    --c-brand: #a9c2bb;
    --c-brand-2: #bcd0ca;
    --c-brand-soft: #222a28;
    --c-on-brand: #141615;
    --c-accent: #d59d80;
    --c-accent-soft: #33261f;
    --c-link: #bcd0ca;
    --c-band: #18221f;
    --c-band-2: #1f2c29;
    --tone-0: #c98c70;
    --tone-1: #c4a965;
    --tone-2: #95a3c6;
    --tone-3: #93b293;
    --tone-4: #b597b6;
    --tone-x: #a39b8e;
    --shadow-2: 0 10px 30px rgb(0 0 0 / .45);
    --shadow-3: 0 10px 30px rgb(0 0 0 / .45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --c-bg: #161513;
        --c-surface: #1c1b18;
        --c-surface-2: #23211d;
        --c-surface-3: #2d2a25;
        --c-text: #e9e4da;
        --c-muted: #a39b8e;
        --c-border: #34312b;
        --c-border-strong: #4b463e;
        --c-brand: #a9c2bb;
        --c-brand-2: #bcd0ca;
        --c-brand-soft: #222a28;
        --c-on-brand: #141615;
        --c-accent: #d59d80;
        --c-accent-soft: #33261f;
        --c-link: #bcd0ca;
        --c-band: #18221f;
        --c-band-2: #1f2c29;
        --tone-0: #c98c70;
        --tone-1: #c4a965;
        --tone-2: #95a3c6;
        --tone-3: #93b293;
        --tone-4: #b597b6;
        --tone-x: #a39b8e;
        --shadow-2: 0 10px 30px rgb(0 0 0 / .45);
        --shadow-3: 0 10px 30px rgb(0 0 0 / .45);
    }
}

.tone-0 { --tone: var(--tone-0); }
.tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); }
.tone-3 { --tone: var(--tone-3); }
.tone-4 { --tone: var(--tone-4); }
.tone-x { --tone: var(--tone-x); }

/* ---------- 2. Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    font-variant-numeric: lining-nums;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 .5em;
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.25rem + .6vw, 1.75rem); }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--c-link); text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { color: var(--c-accent); text-decoration-color: currentColor; }

:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 2px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

address { font-style: normal; }
dl, dd { margin: 0; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 32px 0; }

::selection { background: var(--c-accent-soft); color: var(--c-text); }

main { display: block; min-height: 60vh; }
main:focus { outline: none; }

/* Feine Linien-Piktogramme (Phosphor Light) – sparsam, in Dunkelgrün */
.pikto { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; color: var(--c-brand-2); }
.icon-btn .pikto { width: 1.3em; height: 1.3em; color: inherit; }

/* ---------- 3. Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container--narrow { max-width: 820px; }

.section { padding-block: clamp(28px, 4vw, 52px); }
.section--tight { padding-block: clamp(16px, 2.2vw, 28px); }
.section--alt { background: var(--c-surface-2); }

/* Abschnittskopf mit Linie darüber – trägt die Gliederung statt farbiger Flächen */
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 24px;
    margin-bottom: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--c-brand);
}
.section-head h2 { margin: 0; }

.grid { display: grid; gap: clamp(24px, 4vw, 56px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid--top { align-items: start; padding-bottom: 48px; }
.grid--feature { grid-template-columns: 1fr; }
.grid--about { grid-template-columns: 1fr; }
@media (min-width: 900px) {
    .grid--feature { grid-template-columns: 1.35fr 1fr; align-items: start; }
    .grid--about { grid-template-columns: 1.6fr 1fr; }
}

.stack { display: grid; gap: 20px; margin-bottom: 36px; }
.stack-lg { display: grid; gap: 48px; padding-bottom: 64px; }

/* ---------- 4. Kopfbereich ---------- */
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--c-on-band);
    color: var(--c-band);
}
.skip-link:focus { top: 12px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: var(--c-band);
    color: var(--c-on-band);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--c-text);
    flex-shrink: 0;
}
.brand:hover { color: var(--c-text); }
.site-header .brand, .site-header .brand:hover, .site-footer .brand { color: var(--c-on-band); }
.brand { gap: 12px; }
.logo { display: block; width: 40px; height: auto; flex-shrink: 0; }
.brand__text { display: grid; line-height: 1.1; }
.brand__name { font-family: var(--font-serif); font-size: 1.35rem; letter-spacing: .005em; }
.brand__region { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c-muted); margin-top: 2px; }
.site-header .brand__region, .site-footer .brand__region { color: var(--c-on-band-muted); }

.nav { margin-left: auto; }
.nav__list { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__link {
    display: inline-block;
    padding: 6px 0;
    color: var(--c-on-band-muted);
    text-decoration: none;
    font-size: .95rem;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
}
.nav__link:hover { color: var(--c-on-band); }
.nav__link[aria-current="page"] { color: var(--c-on-band); border-bottom-color: var(--c-on-band); }

.site-header__tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--c-on-band-muted);
    font-size: 1rem;
}
.icon-btn:hover { color: var(--c-on-band); }
.nav-toggle { display: none; }
.nav__list--neben { display: none; }   /* Impressum/Datenschutz nur im aufgeklappten Menü */
/* Sprachumschalter: DE · EN · FR · NL als dezente Kürzel, aktuelle Sprache unterstrichen */
.sprachwahl { display: inline-flex; align-items: center; gap: 2px; }
.sprachwahl__link {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 36px;
    padding: 0 3px;
    color: var(--c-on-band-muted);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-decoration: none;
}
a.sprachwahl__link:hover { color: var(--c-on-band); }
.sprachwahl__link[aria-current] { color: var(--c-on-band); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .45em; }

/* Textknopf (z. B. „Deutsches Original anzeigen“) */
.linkbutton { padding: 0; border: 0; background: none; color: var(--c-link); font: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; cursor: pointer; }
.linkbutton:hover { color: var(--c-text); }

/* Englische Objektseite: Hinweis und Knopf zur maschinellen Übersetzung der Beschreibung */
.uebersetzung { margin: 0 0 18px; padding: 12px 16px; border-left: 2px solid var(--c-brand); background: var(--c-surface-2); font-family: var(--font-sans); font-size: .92rem; }
.uebersetzung p, .prose .uebersetzung p { margin: 0; font-family: var(--font-sans); font-size: .92rem; line-height: 1.5; }
.uebersetzung__hinweis { color: var(--c-muted); }
.uebersetzung__aktion { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px !important; }
.uebersetzung__titel { margin-top: -4px; font-style: italic; color: var(--c-muted); }

@media (max-width: 1100px) {
    .nav-toggle { display: inline-grid; }
    .nav {
        position: absolute;
        inset: 100% 0 auto 0;
        margin: 0;
        background: var(--c-band);
        border-top: 1px solid var(--c-band-line);
        display: none;
    }
    .nav.is-open { display: block; }
    .nav__list {
        flex-direction: column;
        max-width: var(--container);
        margin: 0 auto;
        padding: 8px var(--gutter) 20px;
        gap: 0;
    }
    .nav__link { display: block; padding: 12px 0; font-size: 1.05rem; color: var(--c-on-band); border-bottom: 1px solid var(--c-band-line); }
    .nav__link[aria-current="page"] { border-bottom-color: var(--c-band-line); font-weight: 600; }
    /* Pflichtangaben unter den Hauptpunkten: nebeneinander, kleiner, ohne Trennlinien */
    .nav__list--neben { display: flex; flex-direction: row; gap: 22px; margin-top: -8px; padding-top: 0; }
    .nav__list--neben .nav__link { padding: 10px 0; font-size: .9rem; border-bottom: 0; opacity: .8; }
    .nav__list--neben .nav__link:hover, .nav__list--neben .nav__link[aria-current="page"] { opacity: 1; }
    .site-header__tools { margin-left: auto; }
}
@media (max-width: 760px) {
    .site-header__inner { flex-wrap: wrap; padding-block: 10px; gap: 10px; }
    .site-header__tools { display: contents; }
    .site-header__tools [data-theme-toggle] { margin-left: auto; }
    .searchbox--header { order: 3; flex: 1 1 100%; width: auto; }
    .site-header .brand { flex: 1 1 0; min-width: 0; }
    .site-header .brand__text { min-width: 0; }
    .site-header .brand__name, .site-header .brand__region { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Handy: Logo, Sprachen, Hell/Dunkel und Menü in einer Zeile */
@media (max-width: 560px) {
    .site-header__inner { column-gap: 6px; }
    .site-header .brand { gap: 9px; }
    .site-header .logo { width: 34px; }
    .sprachwahl { margin-left: auto; gap: 0; }
    .sprachwahl__link { min-width: 22px; padding: 0 1px; letter-spacing: .04em; }
    .site-header__tools [data-theme-toggle] { margin-left: 0; }
    .site-header .icon-btn { width: 30px; }
}
@media (max-width: 430px) {
    .site-header .brand { gap: 7px; }
    .site-header .logo { width: 30px; }
    .site-header .brand__name { font-size: 1.12rem; }
    .site-header .brand__region { font-size: .6rem; letter-spacing: .16em; }
    .site-header .icon-btn { width: 28px; }
}
@media (max-width: 380px) {
    .site-header .brand__name { font-size: .98rem; }
    .site-header .brand__region { font-size: .55rem; letter-spacing: .12em; }
    .sprachwahl__link { min-width: 20px; }
}
@media (max-width: 330px) {
    .site-header .logo { width: 26px; }
    .site-header .brand__name { font-size: .9rem; }
}

/* ---------- 5. Suche ---------- */
.searchbox { position: relative; display: flex; align-items: center; }
.searchbox__input {
    width: 100%;
    border: 1px solid var(--c-border-strong);
    background: var(--c-surface);
    border-radius: var(--radius);
    padding: 6px 38px 6px 12px;
    min-height: 38px;
}
.searchbox__input:focus { outline: none; border-color: var(--c-text); }
.searchbox__input::-webkit-search-cancel-button { cursor: pointer; }
.searchbox__btn {
    position: absolute;
    right: 2px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--c-muted);
}
.searchbox__btn:hover { color: var(--c-text); }
.searchbox--header { width: clamp(180px, 20vw, 260px); }
/* Mittlere Breiten: engeres Menü und schmalere Suche, damit auch längere Bezeichnungen (fr) in eine Zeile passen */
@media (min-width: 1101px) and (max-width: 1340px) {
    .nav__list { gap: 16px; }
    .searchbox--header { width: 150px; }
}
.searchbox--header .searchbox__input { background: rgb(255 255 255 / .07); border-color: var(--c-band-line); color: var(--c-on-band); }
.searchbox--header .searchbox__input::placeholder { color: var(--c-on-band-muted); }
.searchbox--header .searchbox__input:focus { border-color: var(--c-on-band); background: rgb(255 255 255 / .12); }
.searchbox--header .searchbox__btn { color: var(--c-on-band-muted); }
.searchbox--header .searchbox__btn:hover { color: var(--c-on-band); }

.searchbox--large { max-width: 620px; }
.searchbox--large .searchbox__icon {
    position: absolute;
    left: 16px;
    color: var(--c-muted);
    pointer-events: none;
}
.searchbox--large .searchbox__input {
    min-height: 52px;
    padding: 10px 112px 10px 44px;
    font-size: 1.05rem;
}
.searchbox__submit { position: absolute; right: 5px; min-height: 42px; }

/* Autovervollständigung */
.ac-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 600;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--c-surface);
    color: var(--c-text);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    max-height: min(70vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;   /* Wischen in der Liste scrollt nicht die Seite mit */
    min-width: 280px;
    text-align: left;
}
.ac-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
}
.ac-item[aria-selected="true"], .ac-item:hover { background: var(--c-surface-2); }
.ac-item__img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    background: var(--c-surface-2);
    display: grid;
    place-items: center;
    color: var(--c-border-strong);
}
.ac-item__title { display: block; font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.25; }
.ac-item__title mark { background: none; color: inherit; font-weight: 700; }
.ac-item__meta { display: block; font-size: .84rem; color: var(--c-muted); }
.ac-all { display: block; padding: 10px 12px 6px; margin-top: 4px; border-top: 1px solid var(--c-border); font-size: .9rem; color: var(--c-link); }
.ac-empty { padding: 10px 12px; color: var(--c-muted); font-size: .92rem; }

/* ---------- 6. Buttons, Chips, Formulare ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .95rem;
    line-height: 1.2;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--c-brand); color: var(--c-on-brand); }
.btn--primary:hover { background: var(--c-text); color: var(--c-bg); }
.btn--ghost { background: transparent; border-color: var(--c-border-strong); color: var(--c-text); }
.btn--ghost:hover { border-color: var(--c-text); color: var(--c-text); }
.btn--light { background: transparent; color: inherit; border-color: currentColor; }
.btn--sm { min-height: 32px; padding: 5px 12px; font-size: .88rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row--center { justify-content: center; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--c-border-strong);
    background: transparent;
    color: var(--c-text);
    text-decoration: none;
    font-size: .88rem;
}
.chip:hover { border-color: var(--c-text); color: var(--c-text); }
.chip--filter { background: var(--c-surface-2); border-color: var(--c-border); }
.chip--filter i { font-size: .8em; color: var(--c-muted); }
.chip--light { color: inherit; }
.chip__label { color: var(--c-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 20px; padding: 0; }

/* Schlagworte als ruhiger Text, mit Punkt getrennt */
.tag { font-size: .85rem; color: var(--c-muted); }
.tag:has(+ .tag)::after { content: "\00a0· "; }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field__label { font-size: .8rem; color: var(--c-muted); }
.input, .select {
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    background: var(--c-surface);
}
textarea.input { min-height: 120px; line-height: 1.55; resize: vertical; }
.select {
    appearance: none;
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--c-muted) 50%), linear-gradient(135deg, var(--c-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}
.input:focus, .select:focus { outline: none; border-color: var(--c-text); box-shadow: 0 0 0 1px var(--c-text); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: .94rem; cursor: pointer; margin-top: 4px; }
.check input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--c-brand); flex-shrink: 0; }

.filter-input { position: relative; display: inline-flex; align-items: center; min-width: 240px; }
.filter-input i { position: absolute; left: 11px; color: var(--c-muted); font-size: .8rem; }
.filter-input .input { padding-left: 32px; }

/* ---------- 7. Startseite ---------- */
/* Merian-Kupferstich (1646) als Band unter dem Kopf, zweitönig in Seitenfarben */
.stich { margin-top: clamp(18px, 3vw, 32px); margin-bottom: 0; }
/* Bündig über die Inhaltsbreite mit festem Seitenverhältnis 4:1 (Bild 3,55:1): auf jedem Bildschirm derselbe
   Ausschnitt, es fallen nur etwa 8 % Höhe weg, überwiegend Hügelkamm oben – Stadt, Dom und Römerbrücke bleiben ganz. */
.stich__bild {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 1;
    object-fit: cover;
    object-position: 50% 70%;
}
.stich__bild--dunkel { display: none; }
:root[data-theme="dark"] .stich__bild--hell { display: none; }
:root[data-theme="dark"] .stich__bild--dunkel { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .stich__bild--hell { display: none; }
    :root:not([data-theme="light"]) .stich__bild--dunkel { display: block; }
}
.stich__text { margin-top: 6px; font-size: .74rem; color: var(--c-muted); }
@media (max-width: 700px) {
    .stich__bild { aspect-ratio: auto; }
}
.stich + .intro { padding-top: clamp(20px, 3vw, 36px); }
.intro { padding-block: clamp(36px, 6vw, 80px) clamp(28px, 4vw, 56px); }
.intro__inner { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (min-width: 980px) { .intro__inner { grid-template-columns: 1.4fr 1fr; } }
.intro__title { font-size: clamp(2.3rem, 1.6rem + 2.6vw, 3.6rem); line-height: 1.08; margin-bottom: .35em; }
.intro__lead { font-family: var(--font-serif); font-size: clamp(1.1rem, 1rem + .3vw, 1.25rem); line-height: 1.55; color: var(--c-muted); max-width: 46ch; margin-bottom: 28px; }
.intro__facts { margin: 18px 0 0; font-size: .9rem; color: var(--c-muted); }
.intro__links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; font-size: .95rem; }
.intro__feature { display: block; width: 100%; max-width: 420px; justify-self: end; color: inherit; text-decoration: none; }
.intro__feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--c-surface-3); }
.intro__caption { display: grid; gap: 2px; padding-top: 12px; }
.intro__caption .eyebrow { margin: 0 0 4px; }
.intro__feature-title { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.25; }
.intro__feature:hover .intro__feature-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

.eyebrow {
    margin: 0 0 12px;
    font-family: var(--font-sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--c-brand-2);
}
.eyebrow--light { color: inherit; }

/* Bereiche: Spalten mit Haarlinien, Farbe nur als kleine Marke */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tiles li { border-left: 1px solid var(--c-border); }
.tiles li:first-child { border-left: 0; }
.tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 4px 22px 6px;
    color: var(--c-text);
    text-decoration: none;
}
.tiles li:first-child .tile { padding-left: 0; }
.tile:hover { color: var(--c-text); }
.tile__icon { font-size: 1.9rem; line-height: 1; margin-bottom: 6px; }
.tile__icon .pikto { width: 1em; height: 1em; }
.tile__title { font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.25; }
.tile:hover .tile__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.tile__text { font-size: .88rem; color: var(--c-muted); flex: 1; line-height: 1.5; }
.tile__count { font-size: .85rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.tile__count::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    background: var(--tone, var(--c-muted));
    vertical-align: .08em;
}
@media (max-width: 700px) {
    .tiles li, .tiles li:first-child { border-left: 0; border-top: 1px solid var(--c-border); }
    .tiles li:first-child { border-top: 0; }
    .tile, .tiles li:first-child .tile { padding: 14px 0; }
}

.edition-line { color: var(--c-muted); margin-bottom: 28px; max-width: 90ch; }

.feature__link { display: block; color: inherit; text-decoration: none; }
.feature__link:hover { color: inherit; }
.feature__img { width: 100%; aspect-ratio: 16 / 9; max-height: 320px; object-fit: cover; margin-bottom: 14px; background: var(--c-surface-3); }
.feature__title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem); margin-bottom: .25em; }
.feature__link:hover .feature__title { text-decoration: underline; text-decoration-thickness: 1px; }
.feature__meta { color: var(--c-muted); }
.feature--card { padding: 0; }

.link-more { font-size: .9rem; color: var(--c-muted); text-decoration: none; white-space: nowrap; }
.link-more::after { content: " →"; }
.link-more:hover { color: var(--c-text); }

.callout {
    padding: 4px 0 4px 24px;
    border-left: 2px solid var(--c-brand);
    max-width: 80ch;
}
.callout__title { font-size: 1.45rem; }
.callout p:last-child { margin-bottom: 0; }
.callout__sign { font-style: italic; color: var(--c-muted); }

.note {
    padding-left: 16px;
    border-left: 1px solid var(--c-border-strong);
    font-size: .92rem;
    color: var(--c-muted);
}
.note i { display: none; }

.about-side { display: grid; gap: 28px; align-content: start; }
.region-map { margin: 0; }
.region-map figcaption { margin-top: 8px; color: var(--c-muted); font-size: .86rem; }

/* Gebietskarte im Stil einer alten, handkolorierten Landkarte (SVG aus den Objektstandorten) */
.gebietskarte { display: block; width: 100%; max-width: 360px; height: auto; font-family: var(--font-serif); }
.gk-rahmen { fill: none; stroke: var(--c-brand); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.gk-rahmen--innen { stroke-width: .6; }
.gk-land { fill: color-mix(in srgb, var(--c-brand) 55%, var(--c-bg)); stroke: var(--c-brand); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gk-kreis { stroke: var(--c-brand); stroke-width: .9; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gk-kreis--a { fill: color-mix(in srgb, var(--tone-3) 16%, var(--c-bg)); }
.gk-kreis--b { fill: color-mix(in srgb, var(--tone-1) 18%, var(--c-bg)); }
.gk-kreis--c { fill: color-mix(in srgb, var(--tone-0) 14%, var(--c-bg)); }
.gk-kreis--d { fill: color-mix(in srgb, var(--tone-2) 14%, var(--c-bg)); }
.gk-kreis--e { fill: color-mix(in srgb, var(--tone-4) 22%, var(--c-bg)); }
.gk-vg path { fill: none; stroke: var(--c-brand); stroke-width: .6; stroke-dasharray: 1.5 2.5; stroke-linecap: round; opacity: .55; vector-effect: non-scaling-stroke; }
.gk-ort circle { fill: var(--c-bg); stroke: var(--c-brand); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gk-ort--haupt circle { fill: var(--c-brand); }
.gk-ort text { font-size: 4300px; font-style: italic; fill: var(--c-text); paint-order: stroke; stroke: color-mix(in srgb, var(--c-bg) 70%, transparent); stroke-width: 1100px; stroke-linejoin: round; }
.gk-ort--haupt text { font-size: 5000px; font-style: normal; letter-spacing: 300px; }
.gk-nord path { fill: var(--c-brand); }
.gk-nord text { font-size: 3200px; fill: var(--c-brand); }
.gk-massstab path { fill: none; stroke: var(--c-brand); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gk-massstab text { font-size: 3200px; font-style: italic; fill: var(--c-muted); }
.contribute { border-top: 1px solid var(--c-border); padding-top: 16px; }
.contribute h3 { margin-bottom: .4em; }
.contribute p { margin-bottom: .5em; }

.disclosure { border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.disclosure + .disclosure { border-top: 0; }
.disclosure > summary {
    cursor: pointer;
    padding: 14px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: "+"; margin-left: auto; color: var(--c-muted); }
.disclosure[open] > summary::after { content: "–"; }
.disclosure > summary i { display: none; }
.disclosure--small > summary { padding: 10px 0; font-size: .92rem; }

/* Danksagungen */
.credits-box { padding: 0; }
.credits-box h2 { font-size: 1.3rem; }
.credits-box__more, .credits-more { margin: 18px 0 0; max-width: 90ch; }
.credits { columns: 3 260px; column-gap: 40px; list-style: none; margin: 0; padding: 0; }
.credits__item { break-inside: avoid; margin-bottom: 10px; font-size: .9rem; line-height: 1.45; }
.credits__name { display: block; font-weight: 600; color: var(--c-text); }
.credits__text { display: block; color: var(--c-muted); }
.edition .credits { columns: 3 220px; }
.edition .credits__item { font-size: .86rem; }

.list-columns { columns: 2 320px; column-gap: 40px; padding: 0 0 16px 18px; margin: 0; }
.list-columns li { break-inside: avoid; margin-bottom: 6px; }

/* ---------- 8. Objektkacheln ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 36px 28px; }
.cards--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.card { background: none; }
.card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card__link:hover { color: inherit; }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--c-surface-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__badge {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 2px 8px;
    background: rgb(20 18 15 / .72);
    color: #fff;
    font-size: .78rem;
}
.card__body { padding: 10px 0 0; }
.card__eyebrow { margin: 0 0 2px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-brand-2); }
.card__title { font-size: 1.1rem; line-height: 1.3; margin: 0 0 2px; font-weight: 400; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.card__meta { margin: 0; color: var(--c-muted); font-size: .88rem; }
/* Historische Karten auf /kartendienste: Card öffnet /karte?ebene=<id> */
.karten-intro { max-width: var(--measure); margin: 0 0 24px; color: var(--c-muted); }
.karten-card { display: flex; flex-direction: column; }
.karten-card .card__link { height: auto; flex: 1; }
.cards--karten { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.karten-card .card__media { aspect-ratio: 3 / 2; background: var(--c-bg); border: 1px solid var(--c-border); }
.karten-card .card__media img { object-fit: contain; }
.karten-card .card__meta { margin-top: 4px; }
.karten-card__los { display: inline-block; margin-top: 6px; color: var(--c-link); font-size: .88rem; }
.card__link:hover .karten-card__los { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.karten-card__fuss { margin: 6px 0 0; color: var(--c-muted); font-size: .78rem; }
.karten-card__fuss span { display: block; }
.karten-card__fuss a { display: inline-block; margin-bottom: 4px; color: var(--c-link); font-size: .86rem; }
.karten-card__fuss code { font-size: .95em; overflow-wrap: anywhere; }
/* Einzelblätter der geologischen Karte: Liste klappt über dem Inhalt auf (die Reihe der Cards bleibt gleich hoch) */
.karten-card__blaetter { position: relative; margin-top: 6px; font-size: .86rem; }
.karten-card__blaetter summary { cursor: pointer; color: var(--c-link); }
.karten-card__blaetter ul {
    position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px 12px; list-style: none;
    max-height: 340px; overflow-y: auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius, 6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.karten-card__blaetter li { padding: 3px 0; }
.karten-card__blaetter a { color: var(--c-link); }

/* Platzhalter ohne Abbildung: feine Schraffur wie im Kupferstich, Doppelrahmen, Bereichssymbol im Bereichston */
.platzhalter {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    background-color: var(--c-surface-2);
    background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--tone, var(--tone-x)) 13%, transparent) 7px 8px);
    color: var(--tone, var(--tone-x));
}
.platzhalter::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid color-mix(in srgb, var(--tone, var(--tone-x)) 35%, transparent);
    pointer-events: none;
}
.platzhalter__symbol {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 8px;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    line-height: 1;
    background: var(--c-surface-2);
    border-radius: 50%;
}
.platzhalter__symbol .pikto { width: 1em; height: 1em; vertical-align: 0; color: inherit; opacity: .8; }
.platzhalter__text {
    position: relative;
    z-index: 1;
    padding: 1px 8px;
    background: var(--c-surface-2);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.result__media .platzhalter__symbol { font-size: 1.7rem; padding: 5px; }
.result__media .platzhalter__text { display: none; }
.result__media .platzhalter::after { inset: 6px; }
.intro__platzhalter { display: block; aspect-ratio: 4 / 3; }

/* Objektseite ohne Bilder: schmales Band mit Hinweis statt Galerie */
.ohne-bild { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 14px 24px; align-items: center; margin-bottom: 8px; }
.ohne-bild__flaeche { aspect-ratio: 4 / 3; }
.ohne-bild__text { margin: 0; max-width: 46ch; color: var(--c-muted); font-size: .95rem; }
@media (max-width: 560px) {
    .ohne-bild { grid-template-columns: 1fr; }
    .ohne-bild__flaeche { aspect-ratio: 16 / 7; }
}
/* Historischer Kartenausschnitt statt Foto (liegt über dem Platzhalter; fehlt das Bild, bleibt der Platzhalter) */
.ohne-bild--karte { grid-template-columns: minmax(0, 420px) 1fr; }
.ohne-bild__figur { margin: 0; }
.ohne-bild--karte .ohne-bild__flaeche { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); }
.ohne-bild__karte { position: absolute; inset: 0; z-index: 3; background-size: cover; background-position: center; transition: transform .4s ease; }
.ohne-bild--karte .ohne-bild__flaeche:hover .ohne-bild__karte { transform: scale(1.02); }
.ohne-bild__figur figcaption { margin-top: 6px; font-size: .78rem; color: var(--c-muted); }
:root[data-theme="dark"] .ohne-bild__karte { filter: brightness(.85) contrast(1.05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ohne-bild__karte { filter: brightness(.85) contrast(1.05); } }
/* zwei Karten nebeneinander, Quellenangabe einmal darunter */
.ohne-bild--karten { grid-template-columns: minmax(0, 760px) 1fr; }
.ohne-bild__karten { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 6px; }
.ohne-bild--karten .ohne-bild__karten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ohne-bild__quelle { grid-column: 1 / -1; margin: 0; font-size: .72rem; color: var(--c-muted); }
@media (max-width: 900px) { .ohne-bild--karten { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ohne-bild--karte { grid-template-columns: 1fr; } .ohne-bild--karte .ohne-bild__flaeche { aspect-ratio: 3 / 2; } }
@media (prefers-reduced-motion: reduce) { .ohne-bild__karte { transition: none; } }

.panel { padding: 16px 0 0; border-top: 1px solid var(--c-border); }
.panel__title {
    font-family: var(--font-sans);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 10px;
}
.panel--edition .panel__title { font-size: .72rem; }
.panel--map { padding: 0; border: 1px solid var(--c-border); overflow: hidden; }
.panel--link { display: block; color: var(--c-link); text-decoration: none; padding-bottom: 4px; }
.panel--link::after { content: " →"; }
.panel--link:hover { color: var(--c-accent); }
.panel--contribute p { font-size: .92rem; color: var(--c-muted); }

/* ---------- 9. Seitenkopf ---------- */
.page-head { padding-block: clamp(22px, 3.5vw, 40px) clamp(12px, 2vw, 20px); }
.page-head__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.page-title { margin-bottom: .2em; }
.lead { font-family: var(--font-serif); font-size: clamp(1.08rem, 1rem + .3vw, 1.22rem); color: var(--c-muted); max-width: 60ch; margin-bottom: .6em; }

.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0 0 14px; padding: 0; font-size: .84rem; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 4px; color: var(--c-muted); }
.breadcrumb li + li::before { content: "/"; margin: 0 4px; color: var(--c-border-strong); }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-text); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--c-text); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toc { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: .92rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- 10. Objektseite ---------- */
.page-head--objekt .page-title { font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem); line-height: 1.1; }
/* Angaben mit Trennpunkt am Zeilenende (nie am Anfang einer umbrochenen Zeile) */
.meta-line { list-style: none; padding: 0; margin: 10px 0 0; color: var(--c-muted); }
.meta-line li { display: inline; }
.meta-line li:not(:last-child)::after { content: "\00a0\00a0·\00a0 "; color: var(--c-border-strong); }
.meta-line i { display: none; }
.meta-line--piktos { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.meta-line--piktos li { display: inline-flex; align-items: baseline; gap: 7px; }
.meta-line--piktos li::after { content: none !important; }
.meta-line--piktos .pikto { align-self: center; }
/* Objekt-ID in der Kopfzeile der Objektseite: als Knopf, kopiert die Nummer */
.objekt-id button { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.objekt-id strong { color: var(--c-text); font-weight: 600; }
.meta-line .objekt-id i { display: inline-block; font-size: .8em; opacity: .6; }
.objekt-id button:hover, .objekt-id button:hover strong { color: var(--c-link); }
.objekt-id button:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.meta-line--head { margin: 0 0 8px; }
.meta-line--head a { text-decoration: none; }
.meta-line--head a:hover { text-decoration: underline; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.badge {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    font-size: .8rem;
    color: var(--c-muted);
}
.badge--unesco { border-color: var(--c-brand); color: var(--c-brand); }

/* Raster: Hauptbild 2×2 + bis zu 4 Bilder; weitere nur in der Lightbox (+N) */
.gallery {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, clamp(110px, 12vw, 210px));
    margin-bottom: 8px;
}
.gallery__item { position: relative; margin: 0; overflow: hidden; background: var(--c-surface-3); }
.gallery__item--main { grid-column: span 2; grid-row: span 2; }
.gallery__item:nth-child(n+6) { display: none; }
.gallery__item[data-more]::after {
    content: attr(data-more);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(20 18 15 / .5);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1.6rem;
    pointer-events: none;
}
.gallery:has(.gallery__item:nth-child(4):last-child) { grid-template-columns: 2fr 1fr 1fr; }
.gallery:has(.gallery__item:nth-child(4):last-child) .gallery__item--main { grid-column: span 1; }
.gallery:has(.gallery__item:nth-child(4):last-child) .gallery__item:nth-child(4) { grid-column: span 2; }
.gallery__item a { display: block; height: 100%; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item figcaption {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 100%;
    padding: 3px 8px;
    font-size: .72rem;
    color: #fff;
    background: rgb(20 18 15 / .55);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery__item figcaption i { display: none; }
/* Kleine oder stark abweichende Bilder ganz zeigen (lightbox.js setzt .is-passepartout, --nw/--nh = Bildgröße,
   --hg = Bild): höchstens 25 % vergrößert, vor einem unscharfen Hintergrund aus demselben Bild */
.gallery__item.is-passepartout::before {
    content: "";
    position: absolute;
    inset: -30px;
    background: var(--hg) center / cover no-repeat;
    filter: blur(22px) saturate(.8) brightness(.78);
}
.gallery__item.is-passepartout a { position: relative; display: flex; align-items: center; justify-content: center; }
.gallery__item.is-passepartout img {
    width: min(100%, calc(var(--nw) * 1.25px));
    height: min(100%, calc(var(--nh) * 1.25px));
    object-fit: contain;
}
.gallery__item--karte img { filter: saturate(.9); }
.gallery:has(.gallery__item:nth-child(2):last-child) { grid-template-columns: 2fr 1fr; }
.gallery:has(.gallery__item:nth-child(2):last-child) .gallery__item--main { grid-column: span 1; }
.gallery:has(.gallery__item:nth-child(2):last-child) .gallery__item:nth-child(2) { grid-row: span 2; }
.gallery:has(.gallery__item:nth-child(3):last-child) { grid-template-columns: 2fr 1fr; }
.gallery:has(.gallery__item:nth-child(3):last-child) .gallery__item--main { grid-column: span 1; }
.gallery--single { grid-template-columns: 1fr; grid-template-rows: auto; }
.gallery--single .gallery__item--main { grid-column: auto; grid-row: auto; max-width: 960px; background: none; }
.gallery--single .gallery__item img { height: auto; max-height: 640px; width: auto; max-width: 100%; object-fit: contain; }

@media (max-width: 760px) {
    .gallery, .gallery:has(.gallery__item:nth-child(2):last-child), .gallery:has(.gallery__item:nth-child(3):last-child) {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-inline: var(--gutter);
        margin-inline: 0;
        scrollbar-width: none;
    }
    .gallery::-webkit-scrollbar { display: none; }
    .gallery__item, .gallery__item:nth-child(n+6) { display: block; flex: 0 0 86%; scroll-snap-align: center; aspect-ratio: 4 / 3; }
    .gallery__item[data-more]::after { display: none; }
    .gallery--single .gallery__item { flex-basis: 100%; aspect-ratio: auto; }
}

.objekt-layout {
    display: grid;
    gap: clamp(28px, 5vw, 72px);
    padding-block: 28px 56px;
}
@media (min-width: 1000px) {
    .objekt-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .objekt-side { position: sticky; top: calc(var(--header-h) + 20px); }
}
.objekt-main > section { margin-bottom: 36px; }
.objekt-main h2 { font-size: 1.4rem; padding-top: 12px; border-top: 1px solid var(--c-brand); margin-bottom: .7em; }
.objekt-side { display: grid; gap: 24px; align-content: start; }

/* Lesetext in Serifenschrift mit begrenzter Zeilenlänge */
.prose > p, .prose > ul, .prose > ol { max-width: var(--measure); }
.prose p, .prose li { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.7; }
.prose--narrow { max-width: 74ch; padding-bottom: 64px; }
.grid--about .prose { max-width: var(--measure); }
.prose--narrow h2 { margin-top: 1.6em; font-size: 1.45rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.fn { font-family: var(--font-sans); font-size: .72em; vertical-align: super; line-height: 0; text-decoration: none; }

.facts > div {
    display: grid;
    grid-template-columns: minmax(150px, 32%) 1fr;
    gap: 16px;
    padding: 7px 0;
    border-bottom: 1px solid var(--c-border);
}
.facts > div:first-child { border-top: 1px solid var(--c-border); }
.objekt-main .facts > div:first-child { border-top: 0; }
.facts dt { color: var(--c-muted); font-size: .9rem; }
.facts--compact > div { grid-template-columns: 1fr auto; padding: 6px 0; }
.facts--compact dd { text-align: right; }
@media (max-width: 520px) {
    .facts > div { grid-template-columns: 1fr; gap: 2px; }
    .facts--compact > div { grid-template-columns: 1fr auto; }
}

.h-small {
    font-family: var(--font-sans);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--c-brand-2);
    margin: 24px 0 10px;
}
.sources { padding-left: 1.2em; margin: 0; }
.sources li { margin-bottom: 6px; font-size: .94rem; }
.sources li:target { background: var(--c-accent-soft); }

.record { font-size: .86rem; color: var(--c-muted); padding-top: 14px; border-top: 1px solid var(--c-border); }
.record p { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; }
.record__link { margin-top: 6px !important; word-break: break-all; }

.action-list { list-style: none; margin: 0; padding: 0; display: grid; }
.action-list a, .action-list button {
    display: block;
    width: 100%;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid var(--c-border);
    background: none;
    color: var(--c-text);
    text-decoration: none;
    text-align: left;
    font-size: .95rem;
}
.action-list a, .action-list button { display: flex; align-items: center; gap: 10px; }
.action-list li:last-child a, .action-list li:last-child button { border-bottom: 0; }
.action-list a:hover, .action-list button:hover { color: var(--c-accent); }

/* In der Umgebung: Umkreis-Auswahl als ruhige Textreiter */
.umkreis { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border); }
.umkreis__btn {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
    color: var(--c-muted);
    text-decoration: none;
    font-size: .92rem;
    border-bottom: 1px solid transparent;
}
.umkreis__btn .count { font-size: .78rem; font-weight: 400; }
a.umkreis__btn:hover { color: var(--c-text); }
.umkreis__btn[aria-current] { color: var(--c-text); border-bottom-color: var(--c-text); }
.umkreis__btn.is-leer { opacity: .45; }
.umgebung__info { margin: 0 0 14px; color: var(--c-muted); }
.umgebung__mehr { margin: 22px 0 0; }
.umgebung.is-loading [data-umgebung-liste] { opacity: .5; transition: opacity .2s; }
/* Kartenansicht: Karte statt Karten-Kacheln, Hinweiszeile bleibt */
.umgebung.is-karte [data-umgebung-cards], .umgebung.is-karte [data-umgebung-mehr] { display: none; }
.map--umgebung { height: clamp(360px, 62vh, 600px); border: 1px solid var(--c-border); }
.map-popup__route { margin-left: 14px; }

/* 3D / externe Inhalte */
.embed { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    padding: 24px;
}
.embed__title { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 4px; }
.embed__note { font-size: .86rem; color: var(--c-muted); max-width: 46ch; }
.model__title a { text-decoration: none; color: var(--c-text); }
.model__title a::after { content: " →"; color: var(--c-muted); }
.model__title a:hover { text-decoration: underline; }

/* ---------- 11. Suche & Ergebnisse ---------- */
.results-page { padding-bottom: 56px; }

.filterbar {
    padding: 14px 0;
    margin-bottom: 18px;
    border-top: 1px solid var(--c-border-strong);
    border-bottom: 1px solid var(--c-border);
}
.filterbar__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.filterbar__q { position: relative; flex: 1 1 260px; }
.filterbar__q .input { padding-left: 34px; min-height: 40px; }
.filterbar__q-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); font-size: .85rem; pointer-events: none; }
.filterbar__actions { display: flex; gap: 8px; margin-left: auto; }
.filterbar__fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
    gap: 8px 14px;
    margin-top: 14px;
}
.filterbar .field { margin: 0; }
.filterbar .field.is-active .field__label { color: var(--c-text); font-weight: 600; }
.filterbar .field.is-active .select, .filterbar .field.is-active .input { border-color: var(--c-text); }
.filterbar__toggle { display: none; }
.check--inline { margin: 0; white-space: nowrap; font-size: .92rem; align-items: center; }
.check--inline input { margin: 0; }
.filterbar.is-busy { opacity: .6; pointer-events: none; }
@media (max-width: 760px) {
    .filterbar__toggle { display: inline-flex; }
    .js .filterbar__fields:not(.is-open) { display: none; }
    .filterbar__actions { margin-left: 0; width: 100%; }
    .filterbar__actions .btn--primary { flex: 1; }
    .hide-sm { display: none; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.notice {
    padding: 8px 0 8px 14px;
    margin: 0 0 16px;
    border-left: 2px solid var(--c-accent);
    font-size: .92rem;
}
.notice i { display: none; }
.toolbar--plain { margin-top: 14px; }
.toolbar__count { font-family: var(--font-sans); font-size: .95rem; margin: 0; color: var(--c-muted); }
.toolbar__count strong { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 400; color: var(--c-text); }

.view-switch { display: inline-flex; border: 1px solid var(--c-border-strong); border-radius: var(--radius); }
.view-switch__btn { border: 0; background: transparent; padding: 6px 16px; font-size: .9rem; color: var(--c-muted); }
.view-switch__btn + .view-switch__btn { border-left: 1px solid var(--c-border-strong); }
.view-switch__btn.is-active { background: var(--c-text); color: var(--c-bg); }
.view-switch__btn i { display: none; }

/* Trefferliste: Zeilen mit Haarlinien */
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-border); }
.result {
    position: relative;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--c-border);
}
.result__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-surface-2); }
.result__media img { width: 100%; height: 100%; object-fit: cover; }
.result__body { min-width: 0; align-self: center; }
.result__title { font-size: 1.2rem; font-weight: 400; margin: 0 0 2px; line-height: 1.3; }
.result__title a { color: var(--c-text); text-decoration: none; }
.result__title a::after { content: ""; position: absolute; inset: 0; }
.result:hover .result__title a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.result__sub { margin: 0 0 2px; color: var(--c-muted); font-family: var(--font-serif); }
.result__meta { margin: 0 0 2px; font-size: .9rem; color: var(--c-muted); }
.result__meta > span:not(:last-child)::after { content: "\00a0· "; }
.result__meta i { display: none; }
.result__cats { margin: 0; }
.result__id { float: right; margin-left: 12px; font-size: .76rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
    .result { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px 0; }
    .result__title { font-size: 1.08rem; }
    .result__id { display: none; }
}

.results-map { margin-bottom: 18px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 32px; }
.pagination__item {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    color: var(--c-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    font-variant-numeric: tabular-nums;
}
.pagination__item:hover { color: var(--c-text); }
.pagination__item.is-current { color: var(--c-text); border-bottom-color: var(--c-text); font-weight: 600; }
.pagination__gap { display: inline-grid; place-items: center; min-width: 24px; color: var(--c-muted); }

.empty { padding: 48px 0; text-align: center; color: var(--c-muted); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.empty ul { display: inline-block; text-align: left; margin: 0; }

/* ---------- 12. Kategorien, Orte, Archiv ---------- */
.category-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 40px 48px; align-items: start; }
.category-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 8px;
    border-top: 1px solid var(--c-border-strong);
    text-decoration: none;
    color: var(--c-text);
}
.category-group__head:hover { color: var(--c-text); }
.category-group__head:hover .category-group__title { text-decoration: underline; text-decoration-thickness: 1px; }
.category-group__title { display: block; font-family: var(--font-serif); font-size: 1.35rem; }
.category-group__title .pikto { margin-right: 4px; }
.category-group__count { display: block; font-size: .85rem; color: var(--c-muted); white-space: nowrap; }
.category-group .link-list { font-size: .95rem; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list a, .link-list > li > span {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid var(--c-border);
    text-decoration: none;
    color: var(--c-text);
}
.link-list a:hover { color: var(--c-accent); }
.link-list--columns { columns: 2 300px; column-gap: 40px; }
.link-list--columns li { break-inside: avoid; }
.link-list--rich a { justify-content: flex-start; align-items: baseline; gap: 14px; padding: 12px 0; }
.link-list--rich small { display: block; color: var(--c-muted); font-size: .86rem; }
.link-list__icon { display: none; }
.count { font-size: .82rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-border); }
.timeline__item a {
    display: grid;
    grid-template-columns: minmax(150px, 260px) 1fr 70px;
    align-items: center;
    gap: 18px;
    padding: 7px 0;
    border-bottom: 1px solid var(--c-border);
    text-decoration: none;
    color: var(--c-text);
}
.timeline__item a:hover .timeline__label { text-decoration: underline; }
.timeline__label { font-family: var(--font-serif); font-size: 1.05rem; }
.timeline__bar { height: 3px; background: var(--c-surface-3); }
.timeline__bar span { display: block; height: 100%; width: var(--w); background: var(--c-brand); }
.timeline .count { text-align: right; }
@media (max-width: 560px) { .timeline__item a { grid-template-columns: 1fr 60px; } .timeline__bar { grid-column: 1 / -1; grid-row: 2; } }

.az-nav { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 28px; font-family: var(--font-serif); font-size: 1.15rem; }
.az-nav a { text-decoration: none; color: var(--c-link); }
.az-nav a:hover { text-decoration: underline; }
.az-groups { columns: 3 280px; column-gap: 40px; }
.az-group { break-inside: avoid; margin-bottom: 24px; }
.az-group__letter { font-size: 1.7rem; color: var(--c-muted); margin: 0 0 4px; }

.region { margin-bottom: 40px; }
.region__title { font-size: 1.6rem; padding-top: 12px; margin-bottom: 18px; border-top: 1px solid var(--c-border-strong); }
.region__title a { color: var(--c-text); text-decoration: none; }
.region__title a:hover { text-decoration: underline; }
.region__title i { display: none; }

.region__grid { columns: 4 240px; column-gap: 36px; }
.vg { break-inside: avoid; margin-bottom: 22px; }
.vg__title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: .9rem;
    font-weight: 600;
    margin: 0 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--c-border);
}
.vg__title a { color: var(--c-text); text-decoration: none; }
.vg__title a:hover { text-decoration: underline; }

/* Orte als fließende Textlinks */
.pill-list { display: flex; flex-wrap: wrap; gap: 0 12px; list-style: none; margin: 0; padding: 0; font-size: .9rem; line-height: 1.8; }
.pill { color: var(--c-link); text-decoration: none; }
.pill .count { font-size: .74rem; margin-left: 2px; }
.pill:hover { text-decoration: underline; }
.pill--gross { font-weight: 600; }

.editions { list-style: none; margin: 0; padding: 0 0 48px; }
.edition { padding: 22px 0; border-top: 1px solid var(--c-border-strong); }
.edition__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 10px; }
.edition__title { margin: 0; font-size: 1.5rem; }
.edition__stats { list-style: none; margin: 0; padding: 0; color: var(--c-muted); font-size: .9rem; }
.edition__stats li { display: inline; }
.edition__stats li:not(:last-child)::after { content: "\00a0· "; }
.edition__stats i { display: none; }

/* Galerie */
.photo-wrap { position: relative; min-height: 320px; }
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.photo { aspect-ratio: 4 / 3; }
.photo.is-broken { display: none; }
.photo a { position: relative; display: block; height: 100%; overflow: hidden; background: var(--c-surface-3); color: #fff; text-decoration: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 6px 10px;
    background: rgb(20 18 15 / .7);
    display: grid;
    font-size: .82rem;
    line-height: 1.3;
    opacity: 0;
    transition: opacity .2s;
}
.photo a:hover .photo__caption, .photo a:focus-visible .photo__caption { opacity: 1; }
@media (hover: none) { .photo__caption { opacity: 1; } }
.photo__caption strong { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo__caption span { opacity: .8; font-size: .74rem; }

.preloader { display: none; }
.js [data-preload]:not(.is-ready) .preloader {
    position: absolute;
    inset: 0 0 auto 0;
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 80px 16px;
    z-index: 2;
    color: var(--c-muted);
}
.preloader__text { margin: 0; }
.preloader__bar { width: min(240px, 80%); height: 2px; background: var(--c-surface-3); overflow: hidden; }
.preloader__bar span { display: block; width: 0; height: 100%; background: var(--c-text); transition: width .2s; }
.spinner { display: none; }

.js [data-preload]:not(.is-ready) .photo-grid { opacity: 0; animation: reveal-fallback 0s 10s forwards; }
.js [data-preload].is-ready .photo-grid { animation: fade-in .4s ease both; }
@keyframes reveal-fallback { to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.person { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; padding-top: 16px; border-top: 1px solid var(--c-border); }
.person__img { width: 96px; height: 128px; object-fit: cover; filter: grayscale(.2); }
.person__name { margin: 0; font-size: 1.25rem; }
.person__role { margin: 0 0 6px; color: var(--c-muted); font-size: .88rem; }
.supporter { display: inline-flex; align-items: center; gap: 12px; }
.supporter img { background: #fff; padding: 4px; }

.error-page__code { font-family: var(--font-serif); font-size: clamp(4rem, 3rem + 6vw, 7rem); line-height: 1; margin: 0; color: var(--c-border-strong); }
.error-page .searchbox--large { margin: 28px auto 8px; }

/* API-Dokumentation, Tabellen, Code */
.api-doc { padding-bottom: 48px; }
.api-doc > section { margin-bottom: 36px; }
.api-doc h2 { font-size: 1.45rem; padding-top: 12px; border-top: 1px solid var(--c-border-strong); }
.api-doc h3 { font-size: 1rem; margin: 18px 0 6px; }
.endpoint { padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.endpoint p { margin-bottom: 6px; }
.endpoint__title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px !important; font-family: var(--font-sans); font-size: 1rem; }
.endpoint__method { padding: 0 6px; border: 1px solid var(--c-border-strong); font-size: .72rem; font-weight: 600; letter-spacing: .06em; color: var(--c-muted); }
.endpoint__examples { font-size: .86rem; margin: 0 !important; }
.api-link { word-break: break-all; }
code { font-family: var(--font-mono); font-size: .88em; padding: 1px 4px; background: var(--c-surface-2); }
.code {
    margin: 0 0 14px;
    padding: 14px 16px;
    overflow-x: auto;
    background: #1f1d1a;
    color: #e2ddd3;
    font-size: .84rem;
    line-height: 1.55;
}
.code code { padding: 0; background: none; font-size: inherit; color: inherit; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 12px; }
.table th, .table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--c-muted); border-bottom-color: var(--c-border-strong); }
.table td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .table td:nth-child(2) { display: none; } .table th:nth-child(2) { display: none; } }

/* ---------- 13. Karte ---------- */
.map { width: 100%; background: var(--c-surface-3); z-index: 0; }
.map--objekt { height: 260px; }
.map--results { height: clamp(380px, 62vh, 680px); border: 1px solid var(--c-border); }
.mapview { position: relative; }
.map--full { height: calc(100dvh - var(--header-h)); min-height: 420px; }
/* Gesamtkarte am Desktop: Seite endet am unteren Kartenrand (kein Scrollen) – Kopf oben, die Karte füllt den Rest,
   unabhängig von der Kopfhöhe. Statt der Fußzeile Impressum/Datenschutz klein in der Karte (.karte-recht). */
/* Auch auf dem Handy: eine feste Kopfhöhe passte nicht, wenn der Kopf (z. B. auf dem iPhone) umbricht – der untere
   Kartenrand mit dem Kartenwähler lag dann unter der Browserleiste. Impressum/Datenschutz stehen dort im Menü. */
.page-karte { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.page-karte .site-header { flex: none; }
.page-karte main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-karte .mapview { flex: 1; min-height: 0; }
.page-karte .map--full { height: 100%; min-height: 0; }
.page-karte .site-footer { display: none; }
@media (min-width: 761px) {
    .page-karte .site-header { flex: none; }
    .page-karte main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .page-karte .mapview { flex: 1; min-height: 0; }
    .page-karte .map--full { height: 100%; min-height: 0; }
    .page-karte .site-footer { display: none; }
}
.karte-recht { display: none; }
@media (min-width: 761px) {
    .karte-recht {
        display: block; position: absolute; left: 10px; bottom: 10px; z-index: 400; margin: 0; padding: 2px 8px;
        background: rgb(255 255 255 / .8); border-radius: 12px; font-size: 11px; line-height: 18px; color: #333;
    }
    .karte-recht a { color: inherit; }
}

/* Punktfarben der Karten: kräftig und gut unterscheidbar (Okabe-Ito-Palette, auch bei Farbsehschwäche).
   Gelten in beiden Farbschemata – die Karte bleibt auch im Dunkelmodus hell. Reihenfolge wie --tone-0…4. */
:root {
    --marker-0: #d55e00;   /* Bau- und Kunstdenkmale */
    --marker-1: #e69f00;   /* Archäologische Denkmale */
    --marker-2: #0072b2;   /* Geschichte */
    --marker-3: #009e73;   /* Naturobjekte */
    --marker-4: #cc79a7;   /* Handwerk */
    --marker-x: #6b6760;
}
.kdb-marker.tone-0, .map-legend .tone-0 { --tone: var(--marker-0); }
.kdb-marker.tone-1, .map-legend .tone-1 { --tone: var(--marker-1); }
.kdb-marker.tone-2, .map-legend .tone-2 { --tone: var(--marker-2); }
.kdb-marker.tone-3, .map-legend .tone-3 { --tone: var(--marker-3); }
.kdb-marker.tone-4, .map-legend .tone-4 { --tone: var(--marker-4); }
.kdb-marker.tone-x, .map-legend .tone-x { --tone: var(--marker-x); }

.map-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 400;
    max-width: min(320px, calc(100% - 70px));
    max-height: calc(100% - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    box-shadow: var(--shadow-2);
}
.map-legend summary { padding: 10px 16px; cursor: pointer; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--c-muted); }
.map-legend summary i { display: none; }
.map-legend ul { list-style: none; margin: 0; padding: 0 16px; }
.map-legend li { padding: 4px 0; }
.map-legend .check { align-items: center; margin: 0; }
.map-legend .count { margin-left: auto; }
.map-legend p { padding: 8px 16px 12px; margin: 0; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--tone); flex-shrink: 0; }
/* Kategorien je Bereich (aufklappbar, eingerückt unter dem Bereich) */
.map-legend__kategorien { margin: 2px 0 2px 27px; }
.map-legend__kategorien summary { padding: 2px 0; font-size: .8rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.map-legend__kategorien summary .count { margin-left: 2px; }
.map-legend__kategorien ul { padding: 2px 0 4px; }
.map-legend__kategorien li { padding: 2px 0; }
.map-legend__kategorien .check { font-size: .84rem; gap: 8px; }
.map-legend__kategorien .check input { width: 15px; height: 15px; }
/* Handy: Legende startet zugeklappt (karten.js) – bis dahin nur die Überschrift zeigen, damit nichts aufblitzt */
@media (max-width: 760px) { .js .map-legend:not(.is-ready) > details > :not(summary) { display: none; } }

/* Marker: sichtbarer Punkt mittig in einer größeren, unsichtbaren Trefferfläche (Größe in karten.js) */
.kdb-marker { display: grid; place-items: center; background: none; border: 0; }
.kdb-marker span {
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--tone, var(--c-brand));
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / .3);
    transition: transform .12s ease-out;
}
.kdb-marker:hover span { transform: scale(1.4); box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 1px 4px rgb(0 0 0 / .35); }
.kdb-marker--big span { width: 22px; height: 22px; border-width: 3px; }
.kdb-marker--big:hover span { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .kdb-marker span { transition: none; } }
/* Gesuchtes Objekt auf der Gesamtkarte (/karte?objekt=ID): Ring in Dunkelgrün, sanft pulsierend */
.kdb-marker--fokus span {
    position: relative;
    box-shadow: 0 0 0 3px var(--c-brand), 0 2px 8px rgb(0 0 0 / .35);
}
.kdb-marker--fokus span::after {
    content: "";
    position: absolute;
    inset: -12px;
    border: 2px solid var(--c-brand);
    border-radius: 50%;
    animation: fokus-ring 1.8s ease-out infinite;
}
@keyframes fokus-ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kdb-marker--fokus span::after { animation: none; opacity: .5; } }
/* Gefundene Adresse: schlichte Stecknadel in Dunkelgrün */
.kdb-adresse { background: none; border: 0; }
.kdb-adresse span {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--c-brand);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}

/* Suche über der Gesamtkarte (Adressen über Geoportal RLP, Objekte) */
.kartensuche {
    position: absolute;
    top: 10px;
    left: 56px;
    z-index: 500;
    width: min(400px, calc(100% - 68px));
    display: flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    box-shadow: var(--shadow-2);
}
.kartensuche__input {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--c-text);
    font: inherit;
    font-size: 1rem;
}
.kartensuche__input:focus { outline: 2px solid var(--c-focus); outline-offset: -2px; }
.kartensuche__knopf { width: 44px; border: 0; border-left: 1px solid var(--c-border); background: transparent; color: var(--c-muted); }
.kartensuche__knopf:hover { color: var(--c-text); }
.kartensuche.is-busy .kartensuche__knopf { opacity: .45; }
.kartensuche__liste { top: calc(100% + 2px); }
.kartensuche__eintrag { grid-template-columns: 1fr; padding: 6px 14px; }
.kartensuche__gruppe { padding: 10px 14px 4px; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.kartensuche__gruppe:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--c-border); }
.kartensuche__quelle { padding: 8px 14px 4px; font-size: .74rem; color: var(--c-muted); border-top: 1px solid var(--c-border); }
@media (max-width: 900px) {
    /* Legende unter das Suchfeld, damit sich beide nicht überdecken */
    .mapview .map-legend { top: 62px; max-height: calc(100% - 74px); }
}
.kdb-cluster { background: none; border: 0; }
.kdb-cluster div {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #26403e;
    color: #fff;
    font-size: 12px;
    font-family: var(--font-sans);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / .2);
}
.kdb-cluster--m div { background: #34504d; }
.kdb-cluster--l div { background: #1c302e; font-size: 13px; }
/* Nahansicht: mehrere Objekte auf demselben Punkt – kleiner Stapel in Markergröße (zweite Scheibe angedeutet) */
.kdb-cluster--stapel div {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    border-width: 1.5px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / .25), 3px -3px 0 -1px #fff, 3px -3px 0 0 rgb(0 0 0 / .25);
}

.map-popup img { width: 100%; height: 120px; object-fit: cover; margin-bottom: 8px; background: var(--c-surface-2); }
.map-popup__title { display: block; font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.25; margin-bottom: 2px; color: var(--c-text); text-decoration: none; }
.map-popup__meta { display: block; color: var(--c-muted); font-size: .85rem; margin-bottom: 6px; }
/* Karten (MapLibre, karten.js): Knöpfe, Popups und Namensschild. Getönte Grundkarten, Dunkelmodus und Fläche ohne
   Kacheln färbt karten.js selbst (Rasterfarben bzw. Farben der Vektorkarte) – MapLibre zeichnet alles in eine Fläche. */
.maplibregl-map { font-family: var(--font-sans); font-size: .9rem; }
/* Knopfspalte: jede Gruppe so breit wie ihre Knöpfe (gestreckt säßen die Symbole links), Karten-Knopf (Ebenen) hervorgehoben ganz oben */
.maplibregl-ctrl-top-left { display: flex; flex-direction: column; align-items: flex-start; }
.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; }
.maplibregl-ctrl-group { background: var(--c-surface); border-radius: 4px; box-shadow: 0 0 0 2px rgb(0 0 0 / .2); }
.maplibregl-ctrl-group button { width: 30px; height: 30px; color: var(--c-text); font-size: .95rem; cursor: pointer; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--c-border); }
.maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--c-surface-2); }
.maplibregl-ctrl-group button:focus-visible { box-shadow: inset 0 0 0 2px var(--c-focus); }
.kdb-leiste i { line-height: 30px; }
.kartenwahl-knopf { order: -1; }
.kartenwahl-knopf button { position: relative; width: 40px; height: 40px; border-radius: 4px; background: var(--c-brand); color: var(--c-on-brand); font-size: 1.25rem; }
.kartenwahl-knopf button:not(:disabled):hover { background: var(--c-brand); filter: brightness(1.12); }
.kartenwahl-knopf i { line-height: 40px; }
/* Kompass: Nadel zeigt nach Norden; gedreht = hervorgehoben, Klick richtet aus */
.map-kompass svg { display: block; width: 20px; height: 20px; margin: auto; transition: transform .15s ease-out; }
.map-kompass.is-gedreht { background-color: var(--c-brand-soft); }
@media (prefers-reduced-motion: reduce) { .map-kompass svg { transition: none; } }
.maplibregl-ctrl-attrib { font-size: 11px; }
.kdb-cluster { cursor: pointer; }
.kdb-cluster:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 50%; }
.maplibregl-marker.kdb-marker, .maplibregl-marker.kdb-adresse { cursor: pointer; }
/* Objekt, Fokus und Adresse immer über den Gruppen (die kommen als spätere HTML-Marker sonst obenauf) */
.maplibregl-marker.kdb-marker--big, .maplibregl-marker.kdb-adresse { z-index: 2; }
.kdb-popup .maplibregl-popup-content {
    min-width: 200px; padding: 12px 14px;
    border-radius: var(--radius); background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-2);
}
.kdb-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.kdb-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.kdb-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--c-surface); }
.kdb-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.kdb-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.kdb-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--c-surface); }
.kdb-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--c-surface); }
.kdb-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--c-surface); }
.kdb-popup .maplibregl-popup-close-button { width: 28px; height: 28px; color: var(--c-muted); font-size: 1.25rem; }
.kdb-popup .map-popup__title { padding-right: 18px; }
/* Mehrere Objekte am selben Ort: Liste */
.map-popup__objekte { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.map-popup__objekte li { padding: 5px 0; border-top: 1px solid var(--c-border); line-height: 1.3; }
.map-popup__objekte a { color: var(--c-link); }
.maplibregl-popup.kdb-tooltip { pointer-events: none; }
.kdb-tooltip .maplibregl-popup-content {
    padding: 4px 9px; background: var(--c-surface); color: var(--c-text);
    border: 1px solid var(--c-border-strong); border-radius: var(--radius); box-shadow: var(--shadow-2);
    font-size: .86rem; line-height: 1.3;
}
.kdb-tooltip.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--c-border-strong); }
/* Kartenvergleich: zweite Karte für die linke Seite, zugeschnitten (karten.js) */
.maplibregl-map.vergleich-karte { position: absolute; inset: 0; pointer-events: none; }
.karte-hinweis {
    position: absolute; top: 40%; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 32px)); margin: 0;
    padding: 14px 18px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); text-align: center;
}
/* Eigener Standort: blauer Punkt, pulsiert nach dem Finden einige Male; Genauigkeit als gestrichelter Kreis (karten.js) */
.kdb-standort { background: none; border: 0; }
.kdb-standort span {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-standort);
    border: 2.5px solid #fff;
    box-shadow: 0 1px 4px rgb(0 0 0 / .4);
}
.kdb-standort span::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: var(--c-standort);
    opacity: 0;
    animation: standort-puls 1.6s ease-out 5;
}
@keyframes standort-puls { from { transform: scale(.4); opacity: .45; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kdb-standort span::after { animation: none; } }

/* Kartensteuerung (karten.js kartensteuerung): Knopf + Bedienfeld „Karten“  */
.kartenwahl-knopf__zahl {
    position: absolute; top: -6px; right: -6px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--c-accent); color: #fff;
    font: 600 .68rem/17px var(--font-sans); text-align: center;
}
.kartenwahl {
    position: absolute; z-index: 1000; top: 10px; left: 54px;
    width: min(400px, calc(100% - 64px)); max-height: calc(100% - 20px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--c-surface); color: var(--c-text);
    border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-2);
    font: .92rem/1.35 var(--font-sans); cursor: auto;
}
.kartenwahl[hidden] { display: none; }
.map--full .kartenwahl { top: 66px; max-height: calc(100% - 76px); }   /* unter dem Suchfeld der Gesamtkarte */
.kartenwahl__auswahl { display: block; width: calc(100% - 32px); margin: 6px 16px 4px; }
.kartenwahl__kopf {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 8px 8px 16px; background: var(--c-surface); border-bottom: 1px solid var(--c-border);
}
.kartenwahl__titel { margin: 0; font: 600 .74rem/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.kartenwahl__zu { width: 34px; height: 34px; border: 0; background: none; color: var(--c-muted); font-size: 1rem; cursor: pointer; }
.kartenwahl__zu:hover { color: var(--c-text); }
.kartenwahl__gruppe { margin: 0; padding: 4px 0 8px; border: 0; border-bottom: 1px solid var(--c-border); }
.kartenwahl__gruppe:last-child { border-bottom: 0; }
.kartenwahl__legende { padding: 10px 16px 2px; font: 400 1.02rem/1.3 var(--font-serif); color: var(--c-text); }
.kartenwahl__untertitel { margin: 8px 16px 2px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-brand-2); }
/* Gruppe mit Sammelschalter in der Überschrift (Straßennetz) und Legendenstrich je Ebene */
.kartenwahl__alle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.kartenwahl__alle input { flex: none; margin: 0; accent-color: var(--c-brand); }
.kartenwahl__strich { flex: none; width: 20px; height: 4px; border-radius: 2px; }
/* Zugeklappte Untergruppe (viele Einträge, z. B. geologische Einzelblätter) */
.kartenwahl__klapp > summary { cursor: pointer; padding: 4px 0; }
.kartenwahl__klapp > summary:hover { color: var(--c-brand); }
.kartenwahl__klapp[open] { padding-bottom: 4px; }
.kartenwahl__wahl { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 2px 16px; cursor: pointer; }
.kartenwahl__wahl input { flex: none; margin: 0; accent-color: var(--c-brand); }
/* Namen einzeilig, zu lange enden mit „…“ (voller Name als Tooltip, karten.js) – mehrzeilige Einträge wirkten unruhig */
.kartenwahl__wahl { min-width: 0; }
.kartenwahl__wahl span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartenwahl__wahl:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.kartenwahl__ebene { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.kartenwahl__ebene .kartenwahl__wahl { padding-right: 4px; }
.kartenwahl__zoom {
    width: 36px; height: 34px; margin-right: 8px; border: 0; border-radius: var(--radius);
    background: none; color: var(--c-brand-2); cursor: pointer;
}
.kartenwahl__zoom:hover { background: var(--c-surface-2); color: var(--c-text); }
.kartenwahl__zusatz { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 16px 8px 39px; font-size: .84rem; color: var(--c-muted); }
.kartenwahl__zusatz[hidden] { display: none; }
.kartenwahl__regler { display: flex; align-items: center; gap: 8px; }
.kartenwahl__regler input { width: 110px; accent-color: var(--c-brand); }
.kartenwahl__hinweis { flex-basis: 100%; color: var(--c-accent); }
.kartenwahl__hinweis[hidden] { display: none; }
.kartenwahl__info { color: var(--c-link); }
.kartenwahl__vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 16px 2px; }
.kartenwahl__seite { min-width: 0; }
.kartenwahl__seite span { display: block; margin-bottom: 2px; font-size: .76rem; letter-spacing: .06em; color: var(--c-muted); }
.kartenwahl__seite .select { width: 100%; }
.kartenwahl .select { text-overflow: ellipsis; }
.kartenwahl__vergleichen { margin: 8px 16px 6px; }
.kartenwahl__gruppe[hidden] { display: none; }
/* Legende: alle Bereiche aus/an */
.map-legend__knoepfe { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 2px 16px 6px; }
.map-legend__alle { display: block; font-size: .82rem; }
.map-legend__alle[hidden] { display: none; }

/* Kartenvergleich: Trennlinie über der Karte (karten.js), Ebenen links/rechts per clip zugeschnitten */
.vergleich { position: absolute; inset: 0; z-index: 640; pointer-events: none; --vergleich-x: 50%; }
.vergleich[hidden] { display: none; }
.vergleich__linie {
    position: absolute; top: 0; bottom: 0; left: var(--vergleich-x); width: 28px; margin-left: -14px;
    cursor: ew-resize; pointer-events: auto; touch-action: none;
}
.vergleich__linie::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px;
    background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .3), 0 0 8px rgb(0 0 0 / .25);
}
.vergleich__griff {
    position: absolute; top: 50%; left: 50%; display: grid; place-items: center;
    width: 42px; height: 42px; margin: -21px 0 0 -21px; padding: 0;
    border: 2px solid #fff; border-radius: 50%; background: var(--c-brand); color: var(--c-on-brand);
    box-shadow: 0 2px 8px rgb(0 0 0 / .35); cursor: ew-resize; font-size: 1rem;
}
.vergleich__griff:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.vergleich__name {
    position: absolute; bottom: 26px; max-width: calc(50% - 30px); padding: 4px 10px;
    background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); border-radius: var(--radius);
    font-size: .8rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vergleich__name--links { left: 10px; }
@media (min-width: 761px) { .map--full .vergleich__name { bottom: 40px; } }   /* über „Impressum · Datenschutz“ (.karte-recht) */
.vergleich__name--rechts { right: 10px; }
.vergleich__ende {
    position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%); pointer-events: auto;
    padding: 6px 12px; border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-surface); color: var(--c-text); font: .82rem var(--font-sans); cursor: pointer; box-shadow: var(--shadow-2);
}
.vergleich__ende:hover { color: var(--c-accent); }
/* Route: Bedienfeld wie die Kartenwahl, Liste der Objekte in Streckenreihenfolge */
.map-route button.is-active { color: var(--c-accent); }
.routenfeld__start { padding: 12px 16px 16px; }
.routenfeld__start p { margin: 0 0 12px; }
.routenfeld__waehlen { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.routenfeld__start input:focus-visible + .routenfeld__waehlen { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.routenfeld .routenfeld__klein { margin: 10px 0 0; font-size: .8rem; color: var(--c-muted); }
.routenfeld__inhalt[hidden], .routenfeld__start[hidden] { display: none; }
.routenfeld__kennung { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 16px 4px; }
.routenfeld__kennung > div { min-width: 0; }
.routenfeld__kennung .btn { flex: none; }
.routenfeld__kennung strong { display: block; font: 400 1.05rem/1.3 var(--font-serif); overflow-wrap: anywhere; }
.routenfeld__kennung span { font-size: .84rem; color: var(--c-muted); }
.routenfeld__regler { display: block; padding: 8px 16px 6px; font-size: .88rem; }
.routenfeld__regler label { display: block; margin-bottom: 4px; font-weight: 600; }
.routenfeld__regler input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--c-accent); }
.routenfeld__summe { display: flex; align-items: center; gap: 8px; margin: 2px 16px; font-weight: 600; font-size: .9rem; }
.routenfeld__liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-border); }
.routenfeld__liste li { border-bottom: 1px solid var(--c-border); }
.routenfeld__objekt {
    display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 48px; padding: 8px 16px;
    border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.routenfeld__objekt:hover { background: var(--c-surface-2); }
.routenfeld__punkt { flex: none; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0, 0, 0, .25); }
.routenfeld__objekt strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.routenfeld__objekt small { display: block; margin-top: 1px; color: var(--c-muted); font-size: .78rem; }
.routenfeld__klappteil > .routenfeld__klein { margin: 8px 16px 0; }
.routenfeld__klappteil > .routenfeld__klein:empty { display: none; }
.routenfeld__klappteil[hidden] { display: none; }
.routenfeld__klapper { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.routenfeld__klapper::before { content: '▾'; flex: none; }
.routenfeld__klapper[aria-expanded="false"]::before { rotate: -90deg; }
.routenfeld__klapper:disabled { cursor: default; }
.routenfeld__klapper:disabled::before { content: none; }
.routenfeld__klapper:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.routenfeld__aktionen { display: flex; gap: 6px; padding: 6px 16px; }
.routenfeld__aktionen label { cursor: pointer; }
.kartenwahl.routenfeld.kartenwahl--blatt { max-height: 60vh; }
/* Standort: Richtungspfeil am Punkt, Knopf-Zustände, „Wieder folgen“, Einstellungen */
.kdb-standort__kurs {
    position: absolute; left: 50%; top: -13px; width: 0; height: 0; margin-left: -8px;
    border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 13px solid var(--c-standort);
    filter: drop-shadow(0 0 1px #fff);
}
.kdb-standort__kurs[hidden] { display: none; }
.map-locate button.is-aktiv { color: var(--c-standort); }
.map-locate button.is-folgt { background: var(--c-standort); color: #fff; }
.map-locate button.is-folgt:not(:disabled):hover { background: var(--c-standort); }
.map-locate button.is-sucht i { animation: standort-sucht 1s ease-in-out infinite; }
@keyframes standort-sucht { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .map-locate button.is-sucht i { animation: none; } }
.standort-pille {
    position: absolute; z-index: 5; left: 50%; bottom: 44px; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px;
    background: var(--c-standort); color: #fff; font: 600 .95rem var(--font-sans); white-space: nowrap; cursor: pointer; box-shadow: var(--shadow-2);
}
@media (max-width: 760px) { .standort-pille { bottom: 17px; } }   /* auf Höhe des Kartenwählers; der Quellenvermerk startet zugeklappt */
.standort-pille[hidden] { display: none; }
.standort-pille:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.standortfeld__start { display: block; width: calc(100% - 32px); min-height: 44px; margin: 12px 16px 8px; }
.standortfeld__wahl { align-items: flex-start; padding-block: 8px; }
.standortfeld__wahl input { margin-top: 3px; }
.standortfeld__wahl span { white-space: normal; overflow: visible; }
.standortfeld__wahl:hover span { text-decoration: none; }
.standortfeld__wahl strong { display: block; font-weight: 500; }
.standortfeld__wahl small { display: block; margin-top: 2px; font-size: .8rem; color: var(--c-muted); }
.standortfeld__wahl.is-aus { opacity: .5; cursor: default; }
.standortfeld .standortfeld__fuss { margin: 4px 16px 14px; font-size: .8rem; color: var(--c-muted); }
/* Strecke aufzeichnen: Marke (auf jeder Seite, solange es läuft) und Liste im Standort-Feld */
.aufnahme-marke {
    position: fixed; z-index: 950; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 14px; border-radius: 20px; background: #d81b60; color: #fff; box-shadow: var(--shadow-2);
    font: 600 .86rem var(--font-sans); text-decoration: none; white-space: nowrap;
}
.aufnahme-marke:hover { color: #fff; }
.aufnahme-marke::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: standort-sucht 1.4s ease-in-out infinite; }
.aufnahme-marke.is-pause { background: #6b6760; }
.aufnahme-marke.is-pause::before { animation: none; }
.aufnahme-marke--karte { bottom: 108px; }   /* über dem Kartenwähler */
@media (max-width: 760px) { .aufnahme-marke--karte { bottom: 78px; } }
@media (prefers-reduced-motion: reduce) { .aufnahme-marke::before { animation: none; } }
.standortfeld__start.is-aufnahme { background: #d81b60; border-color: #d81b60; color: #fff; }
.standortfeld__mass { margin: 0 16px 8px; font-weight: 600; font-size: .9rem; }
.standortfeld__mass[hidden], .standortfeld .kartenwahl__untertitel[hidden], .standortfeld__strecken[hidden] { display: none; }
.standortfeld__strecken { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--c-border); }
.standortfeld__strecken li { padding: 6px 16px 8px; border-bottom: 1px solid var(--c-border); }
.standortfeld__strecken strong { display: block; font-weight: 500; }
.standortfeld__strecken small { display: block; color: var(--c-muted); font-size: .8rem; }
.standortfeld__knoepfe { display: flex; gap: 4px; margin-top: 6px; }
/* Route: feiner Regler, Knöpfe im Kopf */
.routenfeld__reglerzeile { display: flex; align-items: center; gap: 8px; }
.routenfeld__reglerzeile input { flex: 1; min-width: 0; }
.routenfeld__schritt { flex: none; width: 40px; height: 40px; border: 1px solid var(--c-border-strong); border-radius: var(--radius); background: var(--c-surface); color: var(--c-text); font: 600 1.2rem/1 var(--font-sans); cursor: pointer; }
.routenfeld__schritt:hover { background: var(--c-surface-2); }
.routenfeld__oben { flex: none; display: flex; gap: 6px; }
.routenfeld__oben [hidden], .routenfeld__aktionen [hidden] { display: none; }
/* Strecken: an/aus, Farbe */
.standortfeld__farben { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.standortfeld > .standortfeld__farben { margin: 0 16px 10px; }
.standortfeld__farben[hidden] { display: none; }
.standortfeld__farbe { width: 30px; height: 30px; padding: 0; border: 2px solid var(--c-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--c-border-strong); cursor: pointer; }
.standortfeld__farbe[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c-text); }
.standortfeld__farbe:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
/* Höhenprofil (hoehenprofil.js) im Reiter Route */
.hoehenprofil[hidden], .hoehenprofil [hidden] { display: none; }
.hoehenprofil__werte { margin-left: auto; padding-left: 8px; font-weight: 400; font-size: .8rem; color: var(--c-muted); white-space: nowrap; }
.hoehenprofil__flaeche { position: relative; height: 92px; margin: 2px 16px 8px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.hoehenprofil__flaeche svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hoehenprofil__flaechenpfad { fill-opacity: .2; }
.hoehenprofil__linie { fill: none; stroke-width: 2; stroke-linejoin: round; }
.hoehenprofil__marke { position: absolute; padding: 0 3px; border-radius: 3px; background: var(--c-surface); opacity: .9; color: var(--c-muted); font-size: .7rem; line-height: 1.4; pointer-events: none; }
.hoehenprofil__max { top: 0; left: 0; }
.hoehenprofil__min { bottom: 0; left: 0; }
.hoehenprofil__laenge { bottom: 0; right: 0; }
.hoehenprofil__objekt { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; box-shadow: 0 0 0 1px #fff; pointer-events: none; }
.hoehenprofil__zeiger { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--c-text); pointer-events: none; }
.hoehenprofil__punkt { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--c-text); border-radius: 50%; background: var(--c-surface); pointer-events: none; }
.hoehenprofil__info { position: absolute; top: 0; transform: translateX(-50%); padding: 1px 6px; border-radius: 4px; background: var(--c-text); color: var(--c-surface); font-size: .74rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
/* Kompakt: Knöpfe bleiben in einer Reihe, zu lange Texte werden gekürzt statt umzubrechen */
.routenfeld__aktionen .btn, .routenfeld__oben .btn, .routenfeld__summe .btn, .standortfeld__knoepfe .btn {
    display: block; min-height: 30px; padding: 3px 8px; font-size: .78rem; white-space: nowrap;
}
.routenfeld__aktionen .btn, .standortfeld__knoepfe .btn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.routenfeld__summe .btn { flex: none; }
.standortfeld__knoepfe .is-warnung { flex: none; }
.routenfeld .kartenwahl__wahl { min-height: 30px; }
.routenfeld .kartenwahl__wahl span { white-space: normal; }
.routenfeld .routenfeld__farben { margin: 2px 16px 4px; }
.routenfeld .standortfeld__farben { gap: 6px; }
.routenfeld .standortfeld__strecken .standortfeld__farben { margin: 2px 0 0; }
.routenfeld .standortfeld__farbe { width: 22px; height: 22px; }
.routenfeld .standortfeld__wahl { padding-block: 2px; }
.routenfeld .standortfeld__wahl span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.routenfeld .standortfeld__wahl small { margin-top: 0; }
@media (max-width: 760px), (pointer: coarse) {
    .routenfeld__aktionen .btn, .routenfeld__oben .btn, .routenfeld__summe .btn, .standortfeld__knoepfe .btn { min-height: 36px; }
    .routenfeld .kartenwahl__wahl { min-height: 38px; }
    .routenfeld .standortfeld__farbe { width: 26px; height: 26px; }
}
@media (max-width: 400px) {
    .routenfeld__aktionen .btn, .routenfeld__summe .btn, .standortfeld__knoepfe .btn { padding-inline: 4px; }
}
.standortfeld__strecke { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; margin: -4px -4px 0 -16px; }
.standort-tempo { background: var(--c-standort); }
.standort-tempo::before { display: none; }
.standort-tempo[hidden] { display: none; }
/* Handy und Touch: größere Knöpfe, Karten-Knopf (Ebenen) groß ganz oben */
@media (max-width: 760px), (pointer: coarse) {
    .maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 8px 0 0 8px; }
    .maplibregl-ctrl-group button { width: 42px; height: 42px; font-size: 1.15rem; }
    .kdb-leiste i { line-height: 42px; }
    .map-kompass svg { width: 28px; height: 28px; }
    .kartenwahl-knopf button { width: 48px; height: 48px; font-size: 1.4rem; }
    .kartenwahl-knopf i { line-height: 48px; }
    .kartensuche { left: 64px; width: calc(100% - 76px); }
    .kartenwahl { left: 64px; width: min(400px, calc(100% - 74px)); }
}
/* Tour zeichnen: Leiste unten, Punkte und Griffe auf der Karte */
.routenfeld__zeichnen { margin-left: 6px; }
.ist-planung .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.ist-planung .kdb-cluster, .ist-planung .kdb-marker--big { pointer-events: none; }
.planleiste {
    position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--c-surface); color: var(--c-text); border-top: 1px solid var(--c-border); box-shadow: var(--shadow-2); font: .92rem/1.35 var(--font-sans);
}
@media (min-width: 761px) {
    .planleiste { left: 50%; right: auto; bottom: 16px; width: min(460px, 100%); padding-bottom: 12px; transform: translateX(-50%); border: 1px solid var(--c-border); border-radius: var(--radius); }
}
.planleiste__stand { margin: 0; font-weight: 600; }
.planleiste__hinweis { margin: 2px 0 0; color: var(--c-muted); font-size: .82rem; }
.planleiste__hinweis[hidden], .planleiste__knoepfe[hidden], .planleiste__name[hidden] { display: none; }
.planleiste__knoepfe { display: flex; gap: 8px; margin-top: 10px; }
.planleiste__knoepfe .btn { flex: 1; min-height: 44px; padding-inline: 6px; }
.planleiste__knoepfe .btn:disabled { opacity: .45; cursor: default; }
.planleiste__name label { display: block; margin: 8px 0 4px; font-size: .84rem; color: var(--c-muted); }
.planleiste__name .input { width: 100%; }
.plan-punkt, .plan-mitte { display: grid; place-items: center; width: 36px; height: 36px; cursor: grab; touch-action: none; }
.plan-punkt span { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #0b7285; box-shadow: 0 1px 3px rgb(0 0 0 / .4); }
.plan-punkt--start span { background: #2e7d32; border-color: #fff; }
.plan-punkt--ziel span { background: #b71c1c; border-color: #fff; }
.plan-mitte span { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #0b7285; opacity: .85; }
/* Routen-Fenster: Reiter */
.routenfeld__oberkante { position: sticky; top: 0; z-index: 2; background: var(--c-surface); }
.routenfeld__reiter { display: flex; border-bottom: 1px solid var(--c-border); }
.routenfeld__reiterknopf { flex: 1; min-height: 44px; padding: 4px 6px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--c-muted); font: 600 .84rem var(--font-sans); cursor: pointer; }
.routenfeld__reiterknopf:hover { color: var(--c-text); }
.routenfeld__reiterknopf[aria-selected="true"] { color: var(--c-text); border-bottom-color: var(--c-brand); }
.routenfeld__reiterknopf:focus-visible { outline: 2px solid var(--c-focus); outline-offset: -2px; }
.routenfeld__oberkante ~ div[hidden] { display: none; }
.streckenreiter { padding-bottom: 14px; }
.streckenreiter .streckenreiter__text { margin: 12px 16px 0; }
.streckenreiter .standortfeld__start { margin-top: 14px; }
.streckenreiter > .standortfeld__farben { margin: 0 16px 10px; }
.streckenreiter .standortfeld__strecken[hidden], .streckenreiter__text[hidden] { display: none; }
/* Kartenwähler unten links */
.grundwahl { position: absolute; z-index: 5; left: 10px; bottom: 40px; max-width: calc(100% - 20px); }
.grundwahl__knopf, .grundwahl__karte { position: relative; display: block; padding: 0; border: 2px solid #fff; border-radius: 6px; overflow: hidden; background: var(--c-surface-2); cursor: pointer; box-shadow: var(--shadow-2); }
.grundwahl__knopf { width: 72px; height: 58px; }
.grundwahl__knopf[hidden] { display: none; }
.grundwahl__knopf img, .grundwahl__karte img { display: block; width: 100%; height: 100%; object-fit: cover; }
.grundwahl__knopf span, .grundwahl__karte span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 3px 2px; color: #fff; font: 600 .66rem/1.1 var(--font-sans); text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(transparent, rgb(0 0 0 / .68));
}
.grundwahl__liste { display: flex; gap: 8px; padding: 6px; border-radius: 8px; background: var(--c-surface); box-shadow: var(--shadow-2); overflow-x: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.grundwahl__liste[hidden] { display: none; }
.grundwahl__karte { flex: none; width: 84px; height: 64px; box-shadow: none; border-color: transparent; }
.grundwahl__karte[aria-pressed="true"] { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.grundwahl__knopf:focus-visible, .grundwahl__karte:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 1px; }
.ist-planung .grundwahl { display: none; }
@media (max-width: 760px) { .grundwahl { left: 8px; bottom: 10px; max-width: calc(100% - 16px); } }
/* Als Blatt von unten (Handy, kleine Karten wie auf der Objektseite): an der Seite statt in der Karte */
.kartenwahl.kartenwahl--blatt {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh;
    border-radius: 8px 8px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 761px) {
    .kartenwahl.kartenwahl--blatt { left: 50%; right: auto; width: min(440px, 100%); transform: translateX(-50%); border-width: 1px 1px 0; }
}
/* Handy: größere Tippflächen */
@media (max-width: 760px) {
    .kartenwahl__wahl { min-height: 44px; }
    .kartenwahl__zoom { width: 44px; height: 44px; }
    .kartenwahl__zu { width: 44px; height: 44px; }
}

/* ---------- Ladeanzeige ---------- */
.ladeanzeige {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--c-bg) 55%, transparent);
    animation: fade-in .25s ease both;
}
.ladeanzeige--eingebettet { position: absolute; z-index: 1000; }
.ladeanzeige__karte {
    min-width: 250px;
    max-width: calc(100% - 32px);
    padding: 18px 24px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    box-shadow: var(--shadow-2);
    text-align: center;
}
.ladeanzeige__text { display: block; margin-bottom: 14px; font-family: var(--font-serif); font-size: 1.12rem; color: var(--c-text); }
.ladeanzeige__linie { position: relative; display: block; height: 2px; overflow: hidden; background: var(--c-surface-3); }
.ladeanzeige__linie::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    background: var(--c-brand);
    animation: lade-linie 1.2s ease-in-out infinite;
}
@keyframes lade-linie { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- 14. Lightbox ---------- */
.lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(14 13 11 / .97);
    color: #fff;
}
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox__stage { position: absolute; inset: 56px 16px 96px; display: grid; place-items: center; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Unter dem Bild: Objektname (Serifen) mit Ort, darunter Bildnummer und Quelle */
.lightbox__unterschrift { position: absolute; left: 16px; right: 16px; bottom: 16px; text-align: center; }
.lightbox__titel { margin: 0 0 4px; font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.3; color: #fff; }
.lightbox__ort { font-family: var(--font-sans); font-size: .85rem; color: rgb(255 255 255 / .6); }
.lightbox__ort:not(:empty)::before { content: "· "; }
.lightbox__caption { margin: 0; font-size: .85rem; color: rgb(255 255 255 / .72); }
.lightbox__counter { position: absolute; left: 20px; top: 18px; font-size: .88rem; color: rgb(255 255 255 / .6); font-variant-numeric: tabular-nums; }
.lightbox__btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: rgb(255 255 255 / .75);
    font-size: 1.2rem;
}
.lightbox__btn:hover { color: #fff; }
.lightbox__close { top: 8px; right: 12px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- 15. Fußbereich ---------- */
.site-footer { background: var(--c-band); color: var(--c-on-band-muted); margin-top: 48px; }
.footer-grid { display: grid; gap: 32px; padding-block: 48px 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.site-footer a { color: var(--c-on-band); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .94rem; }
.footer-title { font-family: var(--font-sans); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--c-on-band-muted); margin-bottom: 14px; }
.footer-about p { font-size: .94rem; max-width: 48ch; margin: 14px 0; }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 18px 28px; font-size: .84rem; }
.footer-bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--c-band-line); }
.footer-bottom p { margin: 0; }
.footer-admin { white-space: nowrap; }
/* „Als App installieren“ (PWA) – erscheint nur, wenn der Browser die Installation anbietet */
.footer-app { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; padding: 4px 12px; border: 1px solid var(--c-band-line); border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer-app:hover { border-color: currentColor; }
.footer-app[hidden] { display: none; }
/* Offline-Seite */
.offline__liste { margin: 28px auto 8px; max-width: 34rem; }
.offline__titel { font-size: 1.1rem; margin-bottom: 8px; }
.footer-admin .pikto { color: var(--c-on-band-muted); }

.to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 450;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--c-border-strong);
    background: var(--c-bg);
    color: var(--c-muted);
}
.to-top:hover { color: var(--c-text); border-color: var(--c-text); }
.page-karte .to-top { display: none; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 900;
    transform: translateX(-50%);
    padding: 10px 18px;
    background: var(--c-text);
    color: var(--c-bg);
    font-size: .92rem;
    box-shadow: var(--shadow-2);
}

/* ---------- 16. Dienstprogramme ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.muted { color: var(--c-muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); font-size: .9em; }
/* Zahlen in der Fließschrift, aber mit gleich breiten Ziffern (z. B. Koordinaten) */
.ziffern { font-variant-numeric: tabular-nums; }
/* Koordinaten auf der Objektseite: Dezimalgrad (kopierbar), Grad/Minuten/Sekunden, UTM 32 */
.koordinaten__zeile { display: block; }
.koordinaten__system { color: var(--c-muted); font-size: .85em; }
.koordinaten__zeile + .koordinaten__zeile { margin-top: 2px; font-size: .9em; color: var(--c-muted); }
.koordinaten__kopieren { margin: 0 4px; padding: 2px 4px; border: 0; background: none; color: var(--c-muted); cursor: pointer; vertical-align: baseline; }
.koordinaten__kopieren:hover, .koordinaten__kopieren:focus-visible { color: var(--c-link); }
[hidden] { display: none !important; }
[data-filter-item].is-hidden, [data-filter-group].is-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 17. Druck ---------- */
@media print {
    .site-header, .site-footer, .to-top, .objekt-side, .filters, .view-switch, .pagination, .breadcrumb, .btn, .intro__links { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .objekt-layout { display: block; }
    .gallery { display: block; max-height: none; }
    .gallery__item { display: inline-block; width: 32%; height: auto; margin: 0 1% 1% 0; }
    .gallery__item--main { width: 100%; }
    a { color: #000; }
    .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
