/* Globale Stile */
body {
    max-width: 45em;
    margin: 1.2em auto;
    padding: 0.6em;
    background-color: #ece3d7; /* Hintergrundfarbe beibehalten */
    color: black;
}

p {
    font-size: 1em;
    text-align: justify;
    font-family: sans-serif, "Verdana";
    hyphens: auto;
}

cite {
    text-align: center;
}

h2 {
    font-size: 1.2em;
    hyphens: auto; /* Silbentrennung aktiviert */
}

li {
    margin-bottom: 0.3em;
    font-size: 1.2em;
}

ul.menu {
    padding: 0;
    list-style: none;
}

ul.menu li {
    display: inline;
}

ul.menu li a {
    margin: 10px;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Zusätzlicher CSS-Stil für das Rezept-Grid */
.recipe-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 10px;
}

.recipe-grid article {
    width: calc(50% - 20px);
    margin-bottom: 6px;
}

.recipe-grid article img {
    width: 100%;
    height: auto;
}

.recipe-grid article .description {
    margin-top: 9px;
}

.tags {
    font-size: 0.8em; /* Tags kleiner darstellen */
}

/* 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;
}

.recipe-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.recipe-list-item {
    width: calc(50% - 6px);
    box-sizing: border-box;
    padding: 0 2px;
    margin-bottom: 20px;
}

.recipe-title {
    font-size: 0.9em;
    margin-bottom: 0.2em;
}

.recipe-tags {
    font-size: 0.7em;
    color: #666;
    margin-bottom: -1em;
}

.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%;
}

.sort-container {
    margin-right: 0;
}

.filter-container label,
.sort-container label {
    margin-right: 0.3em;
}

/* Anpassung der Suchfeldbreite */
#searchInput,
#searchTagsInput {
    width: 12em;
}

/* Media query für Bildschirme bis 480px Breite */
@media screen and (max-width: 480px) {
    .search-container,
    .search-tags-container,
    .filter-container,
    .sort-container {
        margin-right: 0; /* Entfernt den seitlichen Abstand */
        margin-bottom: 1em; /* Fügt vertikalen Abstand hinzu */
    }

    .sort-container {
        margin-left: 0; /* Platziert den sort-container ganz links */
    }

    #searchInput,
    #searchTagsInput {
        width: auto; /* Lässt die Breite automatisch anpassen */
        max-width: 100%; /* Begrenzt die Breite auf den verfügbaren Platz */
    }

    /* Hier ändern wir die Anordnung der Rezepte */
    .recipe-list {
        flex-direction: column; /* Rezepte werden untereinander angeordnet */
    }

    .recipe-list-item {
        width: calc(100% - 6px);
        box-sizing: border-box;
        padding: 0 2px;
        margin-bottom: 20px;
    }

    /* Hier ändern wir die Anordnung der Suchfelder und Container */
    .search-filter-container {
        flex-direction: column; /* Suchfelder und Container werden untereinander angeordnet */
    }
}
