/* ---------------------------------------------------------
   Lokale Raleway-Fonts
--------------------------------------------------------- */

@font-face {
  font-family: 'Raleway';
  src: url('/fonts/Raleway-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Raleway';
  src: url('/fonts/Raleway-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Raleway';
  src: url('/fonts/Raleway-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ---------------------------------------------------------
   Grundlayout
--------------------------------------------------------- */

body {
    margin: 0;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    background: #ffffff;
    color: #222;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: #2a6f97;
    font-weight: 700;
}

h1 { font-size: 1.6em; margin-top: 0.8em; margin-bottom: 0.4em; }
h2 { font-size: 1.4em; margin-top: 1.2em; margin-bottom: 0.4em; }
h3 { font-size: 1.2em; margin-top: 1.1em; margin-bottom: 0.3em; }
h4 { font-size: 1.05em; margin-top: 1em; margin-bottom: 0.2em; }

/* ---------------------------------------------------------
  Top-Button
--------------------------------------------------------- */

#rm-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2a6f97;
    color: #fff;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 10050; /* WICHTIG */
}


/* ---------------------------------------------------------
  Header + Navigation
--------------------------------------------------------- */

#header {
    background: #2a6f97;
    color: #fff;
    padding: 1em 0;
    position: relative;
    z-index: 9000; /* WICHTIG: unter dem Menü */
}

#header .container {
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logo {
    font-size: 1.6em;
    font-weight: 700;
}

#logo a {
    text-decoration: none;
    color: inherit;
}

/* Navigation Desktop */
#nav {
    display: flex;
    overflow: visible; /* max-height:none entfernt */
    z-index: 10001; /* über dem Header */
}

#nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.2em;
}

#nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

#nav a:hover {
    text-decoration: underline;
}

/* Burger Menü (Desktop: unsichtbar) */
#burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 10002; /* über dem Menü */
}

#burger span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Burger Animation */
#burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#burger.open span:nth-child(2) {
    opacity: 0;
}
#burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay für Mobile Menü */
#nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10003; /* ganz oben */
}

#nav-overlay.show {
    display: block;
}


/* ---------------------------------------------------------
   Dropdown-Grundstruktur (Desktop + Mobil)
--------------------------------------------------------- */

#nav ul li {
    position: relative;
}

#nav ul li .dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: #fff;
    padding: 0;
    margin: 0;
    list-style: none;
    border: 1px solid #ccc;
    z-index: 9999;
}

/* Sichtbare Links im Dropdown */
#nav ul li .dropdown li a {
    display: block;
    padding: 8px 12px;
    white-space: nowrap;
    color: #000 !important;   /* überschreibt #nav a { color:#fff } */
    background: #fff;
    text-decoration: none;
    font-weight: 400;
}

#nav ul li .dropdown li a:hover {
    background: #f0f0f0;
}

/* Dropdown per Klick öffnen (Desktop + Mobil) */
#nav ul li.has-dropdown.open > .dropdown {
    display: block;
}

/* Hover für Desktop (optional, bleibt erhalten) */
#nav ul li.has-dropdown:hover > .dropdown {
    display: block;
}

/* Pfeil-Icon für Dropdown */
#nav .dropdown-toggle {
    position: relative;
    padding-right: 18px; /* Platz für den Pfeil */
}

/* Pfeil selbst */
#nav .dropdown-toggle::after {
    content: "▼";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 0.7em;
    transition: transform 0.25s ease;
}

/* Pfeil dreht sich beim Öffnen */
#nav li.has-dropdown.open > .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}


/* ---------------------------------------------------------
   Navigation mobil
--------------------------------------------------------- */

@media (max-width: 1200px) {

    /* Burger sichtbar */
    #burger {
        display: flex;
        cursor: pointer;
    }

    /* Navigation mobil geschlossen */
    #nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2a6f97;
        padding: 1em;
        max-height: 0;
        overflow: hidden;          /* schneidet zu, wenn geschlossen */
        transition: max-height 0.35s ease;
        z-index: 9999;
    }

    /* Navigation mobil geöffnet */
    #nav.open {
        max-height: none;          /* unbegrenzt hoch */
        overflow: visible;         /* Dropdown darf herausragen */
    }

    #nav ul {
        display: flex;
        flex-direction: column;
        gap: 0.8em;
        margin: 0;
        padding: 0;
    }

    /* Dropdown mobil: NICHT absolut positionieren */
    #nav ul li .dropdown {
        position: static;
        border: none;
        background: #2a6f97;
        padding-left: 1em;
    }

    /* Dropdown-Links mobil sichtbar */
    #nav ul li .dropdown li a {
        color: #fff !important;
        background: none;
        padding: 6px 0;
    }
}

/* ---------------------------------------------------------
   Layout: Sidebar links, Content rechts
--------------------------------------------------------- */

#layout {
    width: 90%;
    margin: 2em auto;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2em;
    align-items: start;
}

#sidebar {
    position: sticky;
    top: 120px;
    align-self: start;
}

#sidebar h3, #sidebar h4 {
    margin-top: 1.5em;
    color: #2a6f97;
}

#sidebar a {
    display: block;
    margin: 0.3em 0;
    text-decoration: none;
    color: #2a6f97;
}

#sidebar a:hover {
    text-decoration: underline;
}

#content {
    max-width: 100%;
}


/* ---------------------------------------------------------
   Bilder
--------------------------------------------------------- */

figure {
    margin: 1em 0;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

figcaption {
    font-size: 0.9em;
    color: #555;
    margin-top: 0.3em;
}

.rm-image-right {
    float: right;
    margin-left: 1em;
    width: 40%;
}

.rm-image-right img {
    max-width: 100%;
    max-height: 320px;
    height: auto;
}

.rm-image-left {
    float: left;
    margin-right: 1em;
    width: 40%;
}

.literaturseite .rm-image-left {
    float: left;
    margin-right: 1em;
    width: auto;
    max-width: 260px;
}

.literaturseite .rm-image-right {
    float: right;
    margin-left: 1em;
    margin-right: 0;
    width: auto;
    max-width: 260px;
}

.literaturseite figure img {
    max-height: 360px;
    width: auto;
}


/* ---------------------------------------------------------
   Timeline
--------------------------------------------------------- */

.it-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.4em;
    margin-top: 1.5em;
}

.it-item {
    display: flex;
    gap: 1em;
}

.it-date {
    width: 120px;
    font-weight: bold;
    color: #444;
    flex-shrink: 0;
}

.it-text {
    flex: 1;
}

@media (max-width: 600px) {
    .it-item { flex-direction: column; }
    .it-date { width: auto; }
}


/* ---------------------------------------------------------
   Hero-Banner
--------------------------------------------------------- */

#hero {
    width: 100%;
    height: 300px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-bottom: 4px solid #2a6f97;
}


/* ---------------------------------------------------------
   Galerie (Bilder)
--------------------------------------------------------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
    margin: 30px 0;
}

.gallery-grid figure {
    margin: 0;
    padding: 0;
    text-align: center;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.gallery-grid figcaption {
    font-size: 0.85em;
    margin-top: 6px;
    color: #444;
}

/* ---------------------------------------------------------
   Linkblöcke
--------------------------------------------------------- */

.link-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2em;
    margin: 2em 0;
}

.link-block h2 {
    color: #2a6f97;
    margin-bottom: 0.5em;
}

.link-block a {
    display: block;
    margin: 0.25em 0;
    color: #2a6f97;
    text-decoration: none;
}

.link-block a:hover {
    text-decoration: underline;
}


/* ---------------------------------------------------------
   Video
--------------------------------------------------------- */

.video-fixed-absolute {
    width: 560px;
    height: 315px;
    margin: 1.5em auto;
}

.video-fixed-absolute iframe {
    width: 560px;
    height: 315px;
    display: block;
}


/* ---------------------------------------------------------
   Clearfix
--------------------------------------------------------- */

.rm-clear {
    clear: both;
}


/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */

#footer {
    text-align: center;
    padding: 2em 0;
    margin-top: 3em;
    background: #f2f2f2;
    color: #444;
}


/* ---------------------------------------------------------
   Navigation
--------------------------------------------------------- */

@media (max-width: 1200px) {

    /* Burger sichtbar */
    #burger {
        display: flex;
        cursor: pointer;
    }

    /* Navigation mobil geschlossen */
    #nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2a6f97;
        padding: 1em;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        z-index: 9999;
    }

    /* Navigation mobil geöffnet */
    #nav.open {
        max-height: 500px;
    }

    #nav ul {
        display: flex;
        flex-direction: column;
        gap: 0.8em;
        margin: 0;
        padding: 0;
    }

    /* Layout mobil */
    #layout {
        grid-template-columns: 1fr;
    }

    #content {
        order: 1;
    }

    #sidebar {
        order: 2;
        position: static;
        margin-top: 2em;
    }

    #header {
        height: 80px;
        padding: 0;
        display: flex;
        align-items: center;
    }
}