/* CSS-Anpassungen für Suche und Sortierung */
.search-container {
    display: flex;
    align-items: center;
    margin-bottom: 30px; /* Mehr Abstand zwischen den Suchfeldern */
}

.search-container input[type="text"] {
    width: 40%; /* Relative Breite des linken Suchfelds */
    min-width: 10em; /* Mindestbreite in em */
    max-width: 20em; /* Maximale Breite in em */
    margin-right: 1em; /* Abstand zwischen den Suchfeldern in em */
    box-sizing: border-box; /* Box-Modell so einstellen, dass die Breite einschließlich der Polsterung und des Rahmens berechnet wird */
}

#searchInputTags {
    width: 40%; /* Relative Breite des rechten Suchfelds */
    min-width: 10em; /* Mindestbreite in em */
    max-width: 20em; /* Maximale Breite in em */
    box-sizing: border-box; /* Box-Modell so einstellen, dass die Breite einschließlich der Polsterung und des Rahmens berechnet wird */
}

.sort-container {
    margin-left: auto;
    margin-right: 0;
}

.search-filter-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: -2em;
}

.filter-container,
.search-container,
.search-tags-container,
.sort-container {
    margin-right: 2em;
}

.filter-container {
    display: inline-block;
    vertical-align: top;
    height: 1.4em;
    padding: 0 0.1em;
}

.filter-container select {
    height: 100%;
}

.filter-container label,
.sort-container label {
    margin-right: 0.3em;
}

/* Anpassung der Suchfeldbreite */
#searchInput,
#searchTagsInput {
    width: 12em;
}

/* Zusätzlicher CSS-Stil für das Grid */

.event-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.event-list-item {
    width: calc(98% - 6px);
    box-sizing: border-box;
    padding: 0 2px;
    margin-bottom: 20px;
}

.event-title {
    font-size: 1.2em;
    margin-bottom: 0.2em;
}

.event-tags {
    font-size: 0.8em;
    color: #666;
    margin-bottom: -3rem;
    text-align: left;
}

/* Bild bleibt unverändert, Text fließt daneben */
.event-list-item img {
    width: 30%;
    margin-top: 40px; /* Abstand vom oberen Rand */
    margin-left: 0.1px;
    margin-right: 8px; /* Abstand zwischen Bild und Text */
    border-style: solid;
    border-width: 3px;
    border-color: white;
    height: auto; /* Auto für die Höhe, um das Seitenverhältnis zu wahren */
    float: left; /* Bild links vom Text positionieren */
}


@media (max-width: 768px) {
    body {
        background-color: tan;
        color: white;
        padding: 0.5rem;
    }
    .header {
        padding: 0.5rem;
        justify-content: flex-start; /* Sicherstellen, dass der Inhalt am linken Rand ausgerichtet wird */
    }

    .header h1 {
        font-size: 1.5rem;
    }
    ul.menu li a {
        margin-right: 30px;
        text-decoration: none;
        line-height: 270%;
    }
    .search-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-container,
    .search-container,
    .search-tags-container {
        margin-right: 0;
        margin-bottom: 1em;
    }
    .sort-container {
        margin-left: 0;
        margin-bottom: 1em;
    }
    #searchInput,
    #searchTagsInput {
        width: auto;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    body {
        background-color: tan;
        color: white;
        padding: 0.5rem;
    }

    .header {
        flex-direction: row; /* Stelle sicher, dass die Flexbox-Richtung horizontal bleibt */
        align-items: center; /* Zentriere die Elemente vertikal innerhalb des Headers */
        text-align: left; /* Textausrichtung auf der linken Seite */
        padding: 0.5rem;
        height: auto; /* Höhe automatisch anpassen, um den Inhalt zu passen */
    }

    .header img {
        margin-bottom: 0.5rem; /* Abstand zum Text */
        margin-left: 0; /* Sicherstellen, dass das Logo am linken Rand bleibt */
    }

    .header h1 {
        font-size: 1.25rem;
        margin-left: 1rem; /* Abstand zum Logo */
        white-space: normal; /* Erlaube Umbrüche, wenn nötig */
        overflow-wrap: break-word; /* Verhindert, dass der Titel außerhalb des Containers geht */
    }

    p {
        font-size: 0.8rem;
    }

    ul.menu li a {
        margin-right: 30px;
        text-decoration: none;
        line-height: 270%;
    }
    .search-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-container,
    .search-container,
    .search-tags-container {
        margin-right: 0;
        margin-bottom: 1em;
    }
    .sort-container {
        margin-left: 0;
        margin-bottom: 1em;
    }
    #searchInput,
    #searchTagsInput {
        width: auto;
        max-width: 100%;
    }
}
