/*  Basic resets  */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    background-color: #f7f7f7;
    /* Light grey */
    color: #333;
    line-height: 1.5;
}

.page-container {
    display: flex;
    flex-direction: column;
    /* Use the full viewport height to push the footer down */
    min-height: 100vh;
}

.content-wrap {
    flex: 1;
}


header,
footer {
    background-color: #f2e6d8;
    /* Sand color */
    padding: 1rem;
}

.site-footer {
    background-color: #f2e6d8;
    /* or your sand color */
    padding: 1rem;
    text-align: center;
}

h2 {
    padding: 1rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 a {
    text-decoration: none;
    color: inherit;
}

h1 a:hover,
h1 a:active,
h1 a:visited {
    color: inherit;
    text-decoration: none;
}


nav h1 {
    margin: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

nav ul li a {
    text-decoration: none;
    color: #333;
}

.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.recipe-card a {
    text-decoration: none;
    /* Removes underline */
    color: inherit;
    /* Inherits text color from the parent element */
}

.recipe-card a:hover,
.recipe-card a:focus,
.recipe-card a:active,
.recipe-card a:visited {
    color: inherit;
    text-decoration: none;
}


/* Flash messages */
.flash-messages {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
}

.alert-success {
    background-color: #dff0d8;
}

.alert-danger {
    background-color: #f2dede;
}

.alert-warning {
    background-color: #fcf8e3;
}

.alert-info {
    background-color: #d9edf7;
}

/* Recipe grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background-color: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    border-radius: 8px;
    text-align: left;
}

.recipe-card img {
    width: 100%;
    height: auto;
    display: block;
}

.recipe-card h3 {
    padding: 0.5rem;
}

/* Recipe Detail */
.recipe-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe-image img {
    max-width: 100%;
    border-radius: 8px;
}

.recipe-info {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
}

.instructions-card {
    background-color: #fff;
    /* White card background */
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.instructions-card h3 {
    margin-top: 0;
    /* Remove default top margin so the heading is snug */
}

.multiline-text {
    white-space: pre-wrap;
    /* preserves line breaks in the instructions */
}


/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

label {
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 0.6rem 1.2rem;
    background-color: #ddd1c7;
    /* a slightly darker sand */
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #c9beb4;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background-color: #ddd1c7;
}

th,
td {
    padding: 0.5rem;
    border: 1px solid #ccc;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .recipe-details {
        flex-direction: column;
    }
}

.multiline-text {
    white-space: pre-wrap;
    /* Wrap text, respecting carriage returns (line breaks) */
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #ddd1c7;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}

.btn:hover {
    background-color: #c9beb4;
}