/* Ensures padding and borders are included inside element width */
* {
    box-sizing: border-box;
}

/* CSS Styles for fonts, margins, and background-colors */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #fffaf3;
    margin: 0;
}

/* Header Styles */
header {
    background-color: #8b1a1a;
    color: white;
    text-align: center;
    padding: 20px;
    text-shadow: 2px 2px 4px #333;
}

/* Navigation bar Styles */
nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    background-color: #A44A3F;
}

nav ul li {
    flex: 1;
}

nav ul li a {
    display: block;
    padding: 12px;
    color: white;
    text-decoration: none;
    text-align: center;
}

nav ul li a:hover {
    background-color: #cd5c5c;
}

a:link { color: rgb(202, 65, 88); }
a:visited { color: #003899; }
a:hover { color: #ffd700; }
a:active { color: orange; }

.content {
    padding: 20px;
}

.framed {
    border: 4px solid;
    padding: 10px;
    background-color: #f4f4f4;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.5);
}

/* Caption section using Flexbox layout */
.caption {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.caption-image {
    flex: 1;
    min-width: 280px;
}

.caption-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.caption-text {
    flex: 1;
    min-width: 280px;
    text-align: center;
}

.category-list ul {
    list-style-type: square;
    padding-left: 25px;
}

.category-list li {
    margin-bottom: 6px;
}

/* Recipe grid using CSS Grid layout */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.recipe-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.recipe-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.recipe-card h3 {
    font-size: 16px;
    padding: 10px;
    margin: 0;
    text-align: center;
}

.recipe-card p {
    font-size: 14px;
    padding: 0 10px;
    color: gray;
}

/* Reference Table Styles */
.table-container {
    background-color: #fff8f0;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

th {
    background-color: #b22222;
    color: white;
    padding: 12px;
    text-align: center;
}

td {
    padding: 10px;
}

tr:nth-child(even) {
    background-color: #fdecea;
}

tr:hover {
    background-color: #f8d7d4;
}

/* Form using CSS Grid layout */
form {
    background-color: #fff3ec;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin-top: 20px;
}

input, textarea, select {
    margin: 8px 0;
    padding: 8px;
    width: 100%;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
}

button {
    background-color: #b22222;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.center-button {
    text-align: center;
    margin-top: 10px;
}

#spiceValue {
    margin: 5px;
    margin-bottom: 0;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 15px;
    background-color: #8b1a1a;
    color: white;
    margin-top: 10px;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    color: #ffd700;
}

/* Responsive web design for tablets and mobile devices */
@media (max-width: 992px) {
    .caption {
        flex-direction: column;
    }
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}