body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #d8e1ea;
    color: #333333;
}

body, html {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.css_body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    flex-shrink: 0;
    background-color: #497f84;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

nav {
    display: flex;
    align-items: center;
}

nav ion-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    cursor: pointer;
}

nav a {
    text-decoration: none;
    color: #ffffff;
    margin-right: 20px;
    font-weight: bold;
}

main {
    padding: 20px;
    text-align: center;
    flex: 1;
}

main h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

#maintitle {
    font-size: 3rem; /* Increase font size */
    color: #ffffff; /* Change text color to white for better contrast */
    background-color: #497f84; /* Add background color */
    padding: 20px; /* Add padding for spacing around the text */
    border-radius: 10px; /* Slight rounding for a polished look */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Add subtle shadow for depth */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Add box-shadow for additional contrast */
    display: inline-block; /* Shrinks the background to fit text width */
    margin-bottom: 30px; /* Add spacing below the title */
}

main img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 20px;
}

article section {
    box-sizing: border-box;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: inline-block;
    width: 700px;
    text-align: left;
    margin: 5px auto;
}

.description {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    align-self: center;
    margin: 0 0 20px;
}

.frontpage {
    justify-content: space-between;
    box-sizing: border-box;
    float: left;
    width: calc(50% - 10px);
}

.frontpage-1 {
    margin: 0;
}

.frontpage-2 {
    margin: 0 0 0 20px;
}

.frontpage a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #497f84;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
}

.frontpage a:hover {
    background-color: #355d60;
}

.frontpage img {
    box-sizing: border-box;
    width: 50%;
    float: right;
    margin: 5px;
}

.img_train {
    width: 100%;
    height: auto;
}

.content-container {
    align-items: center;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

article section h2 {
    font-size: 1.5rem;
    margin-top: 15px;
    margin-bottom: 15px;
}

footer {
    background-color: #497f84;
    color: #ffffff;
    padding: 10px 20px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

footer a {
    text-decoration: none;
    color: #ffffff;
    font-size: 0.9rem;
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 9999;
}

.close-btn {
    font-size: 1.8rem;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #ffffff;
}

.sidebar-content {
    margin-top: 50px;
    padding: 20px;
}

.sidebar-content a {
    text-decoration: none;
    color: #ffffff;
    margin: 15px 0;
    font-size: 1.2rem;
    display: block;
}

.sidebar-top {
    margin-top: 50px;
}

.sidebar a {
    padding: 15px;
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    transition: background-color 0.3s;
}

.sidebar a:hover {
    background-color: #497f84;
}

@media (max-width: 768px) {
    header {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    nav a {
        margin-right: 10px;
        font-size: 15rem;
    }

    article section {
        width: 100%;
    }

    footer {
        height: auto;
    }

    .text .text-title {
        width: 100%
    }
}

@media screen and (max-width: 768px) {
    p {
        font-size: 20px;
    }
}

/* Further increase font size for very small screens (e.g., extra small mobile devices) */
@media screen and (max-width: 480px) {
    p {
        font-size: 16px;
    }
}

.contact-list {
    flex-wrap: wrap;
    align-items: center;
    box-sizing: border-box;
    display: flex;
    margin: 0 auto;
    position: relative;
    justify-content: center;
}

.contact-item {
    display: flex;
    flex-basis: calc(33.33% - 20px);
    align-items: center;
    flex-direction: column;
    position: relative;
    margin: 0 auto;
    box-sizing: border-box;
}

.contact-link img {
    border-radius: 50%;
    width: 215px;
    height: 215px;
    object-fit: cover;
    margin: 0 auto;
}

.contact-name {
    text-align: center;
    margin-bottom: 20px;
}

.contact-link {
    border-radius: 50%;
    width: 215px;
    height: 215px;
    position: relative;
    overflow: hidden;
    flex-basis: calc(100% / 3 - 20px);
    justify-content: center;
    margin: 0 auto;
    align-items: center;
    aspect-ratio: 1 / 1;
    display: flex;
    box-sizing: border-box;
    color: white;
}

.contact-link .icon {
    font-family: 'Ionicons', sans-serif;
    font-size: 1.2rem;
    position: absolute;
    text-align: center;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    display: flex;
    width: 150px;
    top: 50%;
    left: 150%;
    transform: translate(-50%, -50%);
    transition: left 0.5s ease-in-out;
    z-index: 1;
}

.contact-link:hover .icon {
    left: 50%;
}

.contact-link::before {
    content: "";
    background-color: rgba(0, 0, 0, 0.6);
    position: absolute;
    top: 0;
    left: 100%;
    width: 215px;
    height: 215px;
    clip-path: circle(50%);
    transition: left 0.5s ease-in-out;
    z-index: 0;
}

.contact-link:hover::before {
    left: 0;
}

#map {
    height: 60vh;
    width: 100%;
}

.content_section {
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

.time_section {
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

.impressum {
    flex-wrap: wrap;
    align-items: center;
    box-sizing: border-box;
    display: flex;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    justify-content: center;
}

.impressum p {
    font-size: 0.8rem;
}

.impressum-item {
    display: flex;
    flex-basis: calc(100% / 3 - 20px);
    align-items: center;
    flex-direction: column;
    position: relative;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
    padding: 5px
}

.buttons {
    background-color: lightgray;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

@media (max-width: 768px) {
    #maintitle {
        font-size: 2rem;
        padding: 15px;
    }

    main h1 {
        font-size: 1.8rem;
    }

    p {
        font-size: 1rem;
    }

    article section {
        margin: 10px auto;
    }

    .text {
        width: 100%;
    }

    .frontpage img {
        width: 100%; /* Full width on small screens */
        float: none; /* Remove floating for better stackin */
        margin: auto;
    }

    .frontpage {
        margin-bottom: 20px;
    }

    .frontpage {
        width: 100%;
    }

    .text {
        width: 100%;
    }

    .frontpage-2 {
        margin: 0;
    }
}

@media (max-width: 480px) {
    #maintitle {
        font-size: 1.5rem;
        padding: 10px;
    }

    p {
        font-size: 0.9rem;
    }

    nav ion-icon {
        font-size: 1.2rem;
    }
}


/* Container für die Legende und den Button */
#legend-container {
    position: fixed;
    top: 70%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;
}

/* Legende */
#legend {
    position: fixed;
    top: 0;
    right: -300px; /* Startet ausserhalb des Bildschirms */
    height: 100%;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-left: 1px solid #ccc;
    transition: right 0.3s ease;
    overflow-y: auto;
}

#legend.active {
    right: 0; /* Schiebt die Legende ins Bild */
}

#legend h4 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.legend-item img {
    margin-right: 10px;
    vertical-align: middle;
}


#legend-container {
    position: fixed;
    top: 12.5%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;
}

/* Runder Fragezeichen-Button */
.round-button {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #497f84;
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 1100; /* Höher als die Legende */
}

.round-button:hover {
    background-color: #355d60;
}

/* Legende */
#legend {
    position: fixed;
    right: -400px; /* Startet ausserhalb des Bildschirms */
    height: auto; /* Passt die Höhe automatisch an */
    width: 300px;
    background-color: white; /* Vollständig deckendes Weiss */
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-left: 1px solid #ccc;
    transition: right 0.3s ease;
    z-index: 1050; /* Hinter dem Button */
}

#legend.active {
    right: 60px; /* Legende fährt hinter den Knopf ein */
}

#legend h4 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.95);
}

.legend-item img {
    margin-right: 10px;
    vertical-align: middle;
}

.legend-item span {
    font-size: 16px;
    color: #333;
}

.legend-line {
    width: 20px;
    height: 4px;
    border-radius: 2px;
    margin-right: 10px;
}

@media screen and (max-width: 768px) {
    #legend {
        top: 0; /* Startet oben auf dem Bildschirm */
        right: -400px; /* Komplett außerhalb des Bildschirms */
        max-height: none; /* Entfernt maximale Höhe */
        width: 150px;
        padding: 15px; /* Etwas geringerer Innenabstand */
        border-left: none; /* Kein Rand auf kleinen Bildschirmen */
    }

    #legend.active {
        right: 5%; /* Schiebt die Legende ins Bild */
    }

    #toggle-legend {
        top: 10px; /* Positioniert den Button oben rechts */
        right: 10px;
    }
}

/* Für sehr kleine Geräte (z.B. Smartphones) */
@media screen and (max-width: 480px) {
    #legend {
        font-size: 14px; /* Kleinere Schriftgröße */
        padding: 10px; /* Weniger Abstand */
    }

    .legend-item span {
        font-size: 14px; /* Kleinere Schrift für die Legendentexte */
    }

    .round-button {
        width: 40px; /* Kleinere Größe für den Button */
        height: 40px;
        font-size: 18px; /* Kleinere Schriftgröße */
    }
}


.content.hidden {
    display: none;
}

#intro-text {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
}

.text {
    width: 50%;
}

@media screen and (max-width: 786px) {
    .text {
        width: 100%;
    }
}

.map-container {
    width: 60%
}

@media screen and (max-width: 786px) {
    .map-container {
        width: 90%
    }
}

.img_history {
    display: block;
    width: 35%;
    height: 35%;
    border: black solid 1px;
    margin-top: 35px;
}

.history_img_text {
    display: block;
    text-align: center;
}

.timeline-section {
    display: block;
    float: left;
    width: 62.5%;
    margin-right: 20px;
}

.map-section {
    display: block;
    float: left;
    width: 100%
}

.img_map {
    display: block;
    width: 100%;
    height: 100%;
    border: black solid 1px;
    margin-top: 35px;
}

@media screen and (max-width: 786px) {
    .img_history {
        width: 100%
    }

    .timeline-section {
        width: 100%;
        margin-right: 0;
    }

    .img_map {
        margin-left: 0;
        width: 100%
    }
}

.home-button {
    width: 50px;
    height: auto;
    float: right;
}

