/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #fcfcfc;
    color: #333;
    line-height: 1.6;
}

/* HEADER */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-weight: 800; color: #e65100; font-size: 1.25rem; }
.back-link { color: #555; font-weight: 600; text-decoration: none; }
.back-link:hover { color: #e65100; }

/* MAIN CONTAINER */
.recipe-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* HERO SECTION (Mobile: Column, Desktop: Row) */
.recipe-hero {
    display: flex;
    flex-direction: column-reverse; /* Text below image on mobile */
    gap: 2rem;
    margin-bottom: 3rem;
}
.hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.recipe-title { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; color: #111; }
.recipe-desc { font-size: 1.1rem; color: #555; margin-bottom: 1.5rem; }

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.meta-box {
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #444;
}
.btn-print {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-print:hover { background: #eee; }

.hero-image { flex: 1; }
.hero-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* RECIPE CONTENT GRID (Ingredients + Instructions) */
.recipe-content-grid {
    display: flex;
    flex-direction: column; /* Stacked on mobile */
    gap: 3rem;
}
h2 { font-size: 1.5rem; border-bottom: 2px solid #e65100; padding-bottom: 0.5rem; margin-bottom: 1.5rem; color: #111; }

/* INGREDIENTS UX */
.ingredients-list { list-style: none; }
.ingredient-item { margin-bottom: 0.75rem; font-size: 1.05rem; }
.ingredient-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}
.ing-checkbox { margin-top: 6px; transform: scale(1.2); cursor: pointer; }
.ing-text { transition: color 0.2s, text-decoration 0.2s; }
/* Applied via JS or pure CSS state */
.ing-checkbox:checked + .ing-text {
    text-decoration: line-through;
    color: #999;
}

/* INSTRUCTIONS */
.instructions-list {
    padding-left: 1.2rem;
    font-size: 1.1rem;
    color: #222;
}
.instruction-step { margin-bottom: 1.5rem; padding-left: 0.5rem; }
.instruction-step::marker { font-weight: bold; color: #e65100; font-size: 1.2rem; }

footer { text-align: center; padding: 2rem; color: #888; border-top: 1px solid #eee; margin-top: 3rem; }
footer a { color: #e65100; }

/* =========================================
   DESKTOP MEDIA QUERY
   ========================================= */
@media (min-width: 800px) {
    .recipe-hero {
        flex-direction: row; /* Side by side */
        align-items: center;
    }
    .recipe-title { font-size: 3rem; }
    
    .recipe-content-grid {
        display: grid;
        grid-template-columns: 1fr 2fr; /* Ingredients take 1/3, Instructions 2/3 */
        align-items: start;
    }
}

/* PRINT MEDIA STYLES (Clean output for paper) */
@media print {
    .site-header, .btn-print, footer, .recipe-desc { display: none !important; }
    body { background: #fff; color: #000; }
    .recipe-hero { display: block; }
    .hero-image img { max-width: 400px; aspect-ratio: auto; margin-bottom: 1rem; }
    .recipe-content-grid { display: flex; flex-direction: column; gap: 1rem; }
}