/* ============================================================
   1. TYPOGRAFISCHE BASIS & DESIGN SYSTEM
============================================================ */

:root {
    --color-primary: #b97b4e;
    --color-primary-dark: #8a5a34;
    --color-text: #222222;
    --color-text-muted: #666666;
    --color-bg: #f8f9fa;
    --color-border: #dddddd;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Standard-Fließtext */
p {
    margin: 0 0 0.7rem;
}

li,
dt,
dd,
td,
th {
    font-size: 0.92rem;
    line-height: 1.55;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

small,
.text-muted,
.meta {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--color-text-muted);
}

/* ============================================================
   2. ÜBERSCHRIFTEN (Hierarchie & Dekoration)
============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: #111111;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 1.45rem;
    line-height: 1.2;
    margin: 0 0 0.8rem;
}

h2,
h3,
h4,
h5,
h6 {
    position: relative;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.35rem;
}

h2 {
    font-size: 1.12rem;
    line-height: 1.3;
    margin: 1.3rem 0 0.6rem;
    color: #1f1f1f;
}

h3 {
    font-size: 0.98rem;
    line-height: 1.35;
    margin: 1.1rem 0 0.45rem;
    color: #333333;
}

h4 {
    font-size: 0.88rem;
    line-height: 1.35;
    margin: 0.9rem 0 0.35rem;
    color: #444444;
}

h5,
h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0.7rem 0 0.3rem;
    color: #555555;
}

/* ============================================================
   3. LINKS & INTERAKTIONEN
============================================================ */

a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s ease-in-out;
}

a:hover,
a:focus {
    color: var(--color-primary-dark);
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Listen */
ul,
ol {
    padding-left: 1.1rem;
    margin-bottom: 0.8rem;
}

li {
    margin-bottom: 0.25rem;
}

/* ============================================================
   4. LAYOUT COMPONENTS & HEADER / NAVIGATION
============================================================ */

.fullwidth-section,
.card-body,
main,
table {
    font-size: 0.92rem;
}

table {
    font-size: 0.88rem;
}

/* Header */
.header-block {
    background: var(--color-bg);
    position: relative;
    z-index: 5000;
}

@media (min-width: 768px) {
    .header-block {
        position: sticky;
        top: 0;
        background: #ffffff;
    }
}

.header-logo-img {
    max-height: 95px;
    /* Von 70px angehoben, damit das Logo größer wird */
    width: auto;
    object-fit: contain;
    /* Verhindert Verzerrungen */
    margin-right: 14px;
    display: inline-block;
    /* Stabilisiert die Darstellung */
}

.header-title-group {
    line-height: 1;
}

.header-title {
    font-size: 2.2rem;
    font-weight: 400;
}

.header-title-accent {
    color: var(--color-primary);
}

.header-subtitle {
    font-size: 1.2rem;
}

.header-login-menu {
    min-width: 260px;
    z-index: 6000;
}

/* Navigation */
.navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-primary);
    padding: .5rem 0;
    position: relative;
    z-index: 3000;
}

.navbar .nav-link {
    padding: .75rem 1rem;
    color: #333333 !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.nav-active {
    color: var(--color-primary) !important;
    font-weight: 600;
}

/* Dropdowns & Mega Menu */
.navbar .dropdown-menu {
    border: none;
    padding: 1.5rem 2rem;
    z-index: 4000;
}

.nav-item.position-static .dropdown-menu {
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    background: var(--color-bg);
    border-top: 2px solid var(--color-primary);
}

.mega-columns-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.mega-columns-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.mega-menu-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: .75rem;
}

.dropdown-item {
    padding: .35rem 0;
    font-size: .95rem;
}

.dropdown-item:hover {
    color: var(--color-primary) !important;
    background: transparent;
}

.mobile-link {
    display: block;
    padding: .75rem 0;
    text-decoration: none;
    color: #333333;
    border-bottom: 1px solid #eeeeee;
}

.mobile-link:hover {
    color: #8f0000;
}

/* Page Title & Breadcrumbs */
.page-title-box {
    background: var(--color-primary);
    padding: 1.4rem;
    color: #ffffff;
    border-radius: 2px;
    margin-top: 1rem;
}

.page-title-box h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #ffffff;
    border: none;
    padding: 0;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-white *,
.breadcrumb-white .breadcrumb-item+.breadcrumb-item::before {
    color: #ffffff !important;
}

/* Alphabetical Bar */
.alphabet-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.alphabet-bar .btn {
    min-width: 30px;
    padding: .20rem .40rem;
}

.alphabet-bar .btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* Three Column List (Lexicon) */
.liste_spalten {
    column-count: 3;
    column-gap: 2rem;
}

.liste-entry {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: .4rem;
}

/* ============================================================
   5. MEDIEN & PLACES (Figures, Cards, Maps)
============================================================ */

/* Figures */
figure {
    margin: 0 0 12px;
    text-align: center;
}

figure a {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 6px;
    text-decoration: none;
    transition: box-shadow .25s ease, transform .25s ease;
}

figure img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 5px;
    background: #e9ecef;
    transition: transform .25s ease;
}

figure:hover a {
    box-shadow: 0 8px 18px rgba(0, 0, 0, .15);
    transform: translateY(-2px);
}

figure:hover img {
    transform: scale(1.02);
}

figure figcaption {
    font-size: .5rem;
    line-height: 1.4;
    color: #6c757d;
}

figure figcaption strong {
    font-size: .6rem;
    color: #212529;
}

figure figcaption span {
    opacity: .9;
    font-size: .6rem;
}

/* Image Cards - Archive */
.bild-card {
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    transition: transform .25s ease, box-shadow .25s ease;
}

.bild-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.bild-box {
    width: 100%;
}

.bild-box img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.bild-caption {
    padding: .6rem .7rem;
    font-size: .8rem;
    background: #ffffff;
}

.bild-caption .titel {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: .15rem;
    color: #222222;
}

.bild-caption .meta {
    color: #777777;
    font-size: .75rem;
}

.bild-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.bild-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Maps & Leaflet Popups */
.map {
    width: 100%;
    height: 70vh;
    border: 1px solid #aaaaaa;
    border-radius: 6px;
}

.popup-card {
    font-size: .9rem;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

.popup-card img {
    width: 100%;
    border-bottom: 1px solid #cccccc;
}

.popup-card .p-body {
    padding: .5rem .7rem;
}

/* Blockquotes & Text Nodes */
blockquote {
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--color-primary);
    background: #fdfdfd;
    color: #444444;
}

/* ============================================================
   6. LESETEXT SYSTEM (.reading-text)
============================================================ */

.reading-text {
    max-width: 72ch;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text);
}

.reading-text p {
    margin: 0 0 1.1rem;
}

.reading-text h2 {
    font-size: 1.15rem;
    margin-top: 2.2rem;
    margin-bottom: 0.7rem;
}

.reading-text h3 {
    font-size: 1.0rem;
    margin-top: 1.6rem;
    margin-bottom: 0.5rem;
}

.reading-text ul,
.reading-text ol {
    margin: 0 0 1.1rem 1.2rem;
}

.reading-text li {
    margin-bottom: 0.35rem;
}

.reading-text strong {
    font-weight: 600;
}

.reading-text em {
    font-style: italic;
}

.reading-text blockquote {
    margin: 1.4rem 0;
    padding: 0.6rem 1.2rem;
    font-size: 0.92rem;
    line-height: 1.6;
}

.reading-text .quelle,
.reading-text .footnote {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #555555;
    margin-top: 1.2rem;
}

.reading-text figure {
    margin: 1.5rem auto;
}

.reading-text img {
    max-width: 100%;
    height: auto;
}

.reading-text a {
    color: #8a6a55;
    font-weight: 500;
}

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

/* Linien-Strukturen (Stammbäume / Hierarchien) */
.linien-wrapper {
    padding-left: 1rem;
}

.linie {
    position: relative;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid #0d6efd;
    margin-bottom: 1.5rem;
}

.linie::before {
    content: "";
    position: absolute;
    top: 1.2rem;
    left: -3px;
    width: 1.5rem;
    height: 2px;
    background: #0d6efd;
}

.linie-box {
    background: var(--color-bg);
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    max-width: 480px;
}

.linie-children {
    margin-top: 1rem;
}

/* Matomo & Forms */
.matomo-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.stat-block {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-block strong {
    color: #555555;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-block span {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1a1a1a;
}

.stat-block.optout a {
    color: #0066cc;
    font-size: 0.85rem;
}

/* =====================================================
   FOOTER - Elegant Black Edition
===================================================== */

.footer-sg {
    background: linear-gradient(180deg, #181818 0%, #0c0c0c 100%);
    border-top: 3px solid #8B0000; /* Edles Dunkelrot */
    color: #f0f0f0;
    font-family: inherit;
}

/* Edle Boxen mit subtle Glassmorphism */
.footer-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 1.75rem;
    height: 100%;
    backdrop-filter: blur(8px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.footer-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Titel mit weißer Schrift und rotem Akzent */
.footer-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-title i {
    color: #8B0000;
    margin-right: 0.5rem;
}

/* Listen & Links */
.footer-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-list li {
    margin-bottom: 0.75rem;
}

.footer-link {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    transition: all 0.25s ease-in-out;
}

.footer-link:hover {
    color: #ffffff;
    transform: translateX(4px); /* Sanfter Einrück-Effekt beim Hovern */
}

.footer-link i {
    color: #8B0000;
    width: 24px;
    transition: color 0.25s ease;
}

.footer-link:hover i {
    color: #b30000;
}

/* Statistik-Zeilen */
.footer-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #cccccc;
}

.footer-stat-item:last-child {
    border-bottom: none;
}

.footer-stat-item strong {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Social Media Sektion */
.footer-social-wrapper {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-social {
    color: #ffffff;
    font-size: 1.6rem;
    margin: 0 0.6rem;
    display: inline-block;
    transition: all 0.25s ease;
    opacity: 0.8;
}

.footer-social:hover {
    color: #8B0000;
    transform: translateY(-3px);
    opacity: 1;
}

/* Copyright & Rechtliches */
.footer-copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #888888;
    font-size: 0.875rem;
}

.footer-copyright a {
    color: #bbbbbb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-copyright a:hover {
    color: #ffffff;
}

/* Platzhalter in Formularfeldern im Footer */
.form-control::placeholder {
    color: #999999 !important;
    font-style: italic;
    font-weight: 300;
    opacity: 1;
}

/* =====================================================
   RESPONSIVE DESIGN (Mobile)
===================================================== */
@media (max-width: 767.98px) {
    .footer-sg {
        text-align: center;
    }

    .footer-box {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .footer-stat-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .footer-title {
        font-size: 1.2rem;
    }

    .footer-social {
        font-size: 1.9rem;
        margin: 0 0.75rem;
    }

    footer img.img-fluid {
        max-width: 220px;
        margin-inline: auto;
        display: block;
    }
}
/* ============================================================
   7. RESPONSIVE DESIGN (Mobile Feinschliff)
============================================================ */

@media (max-width: 768px) {
    .header-title {
        font-size: 1.3rem;
        text-align: center;
    }

    .header-subtitle {
        display: none;
    }

    .header-title-group {
        margin-left: .75rem !important;
    }

    #headerSearchBox .input-group {
        flex-direction: column;
        gap: .5rem;
    }

    #headerSearchBox .btn {
        width: 100%;
    }

    .reading-text {
        max-width: 100%;
        font-size: 0.92rem;
        padding: 0 .5rem;
    }

    .reading-text h2 {
        font-size: 1.08rem;
    }

    .reading-text h3 {
        font-size: 0.96rem;
    }

    /* Grid Fallback für Tablets */
    .mega-columns-4,
    .mega-columns-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {

    body,
    p,
    li {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.05rem;
    }

    h3 {
        font-size: 0.95rem;
    }

    /* Korrigierter und optimierter CSS-Klassenaufruf für Mobilgeräte */
    .header-logo-img {
        max-height: 60px;
        /* Verhindert, dass das Logo auf kleinen Bildschirmen das Layout sprengt */
        margin-inline: auto;
        /* Zentriert das Logo auf Handys falls nötig */
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* ============================================================
   8. DRUCK-OPTIMIERUNG (Print-Styles)
============================================================ */

@media print {

    body,
    .reading-text {
        font-size: 11pt;
        line-height: 1.5;
        color: #000000;
        background: #ffffff;
    }

    h1 {
        font-size: 16pt;
    }

    h2,
    .reading-text h2 {
        font-size: 14pt;
        border: none;
    }

    h3,
    .reading-text h3 {
        font-size: 12pt;
        border: none;
    }

    header,
    nav,
    footer,
    .page-title-box,
    .btn,
    .alphabet-bar {
        display: none !important;
    }

    .container,
    .container-fluid {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .liste_spalten {
        column-count: 2;
    }

    .reading-text blockquote {
        border-left: 2pt solid #000000;
        background: transparent;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
    }
}