body {
    background-color: #f7f7f7;
    font-family: 'Segoe UI', sans-serif;
    color: #222;
    margin: 0;
}

.meal-gallery-container {
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 1200px;
}

/* === Header och sökfält === */
.meal-gallery-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .meal-gallery-header h1 {
        font-size: 2.2rem;
        font-weight: 600;
        margin: 0;
    }

/* Sökfält + checkbox */
.search-container {
    margin-top: 1rem;
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #e9eef3;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .search-container input[type="text"] {
        flex-grow: 1;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid #ccc;
        font-size: 1rem;
        box-sizing: border-box;
    }

    .search-container i {
        color: #888;
        font-size: 1rem;
    }

/* Checkboxdel */
.toggle-published {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #222;
    user-select: none;
    white-space: nowrap;
}

    .toggle-published input[type="checkbox"] {
        accent-color: #3399ff;
        transform: scale(1.1);
        cursor: pointer;
    }

/* === Grid layout === */
.meal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding-top: 16px;
}

/* === Kortstruktur === */
.meal-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

    .meal-card:hover {
        transform: scale(1.015);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .meal-card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }

.meal-card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

    .meal-card-content h3 {
        margin: 0 0 6px;
        font-size: 1.15rem;
        color: #111;
    }

    .meal-card-content p {
        flex-grow: 1;
        font-size: 0.95rem;
        color: #555;
        margin: 0;
    }

/* === Läs mer-knapp === */
.btn-readmore {
    align-self: flex-start;
    background: #007d36;
    color: white;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: auto;
    transition: background-color 0.2s ease;
}

    .btn-readmore:hover {
        background: #005c27;
    }

/* === Mobilanpassning === */
@media (max-width: 600px) {
    .meal-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .meal-gallery-header h1 {
        font-size: 1.6rem;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.75rem;
        max-width: 90%;
    }

        .search-container input[type="text"] {
            font-size: 0.95rem;
        }

    .toggle-published {
        justify-content: center;
    }

    .meal-card img {
        height: 130px;
    }

    .meal-card-content {
        padding: 10px;
    }

        .meal-card-content h3 {
            font-size: 1rem;
        }

        .meal-card-content p {
            font-size: 0.85rem;
        }

    .btn-readmore {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}


.btn-create-meal {
    background-color: #3399ff;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

    .btn-create-meal:hover {
        background-color: #2389e0;
    }

@media (max-width: 600px) {
    .btn-create-meal {
        width: 100%;
        text-align: center;
    }
}
