/* Print stylesheet for recipe pages */

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

body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    max-width: 8.5in;
    margin: 0 auto;
    padding: 0.5in;
}

h1 {
    font-size: 24pt;
    margin-bottom: 0.25em;
    border-bottom: 2px solid #333;
    padding-bottom: 0.25em;
}

h2 {
    font-size: 14pt;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #333;
}

/* Recipe meta info */
.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid #ccc;
    font-size: 10pt;
    color: #444;
}

.recipe-meta span {
    white-space: nowrap;
}

.source-attribution {
    font-style: italic;
    font-size: 10pt;
    color: #666;
    margin-bottom: 1em;
}

/* Substitutions note */
.substitutions-note {
    margin: 1em 0;
    padding: 0.75em;
    background: #f0f9ff;
    border: 1px solid #0284c7;
    border-left: 4px solid #0284c7;
    font-size: 10pt;
}

.substitutions-note ul {
    margin: 0.5em 0 0 1.5em;
    padding: 0;
}

.substitutions-note li {
    margin: 0.25em 0;
}

/* Ingredient substitution note (inline) */
.ingredient-sub-note {
    display: block;
    color: #0369a1;
    font-size: 9pt;
    margin-left: 1.5em;
}

/* Two column layout for ingredients and instructions */
.recipe-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5em;
    margin-top: 1em;
}

/* Ingredients */
.ingredients-section {
    break-inside: avoid;
}

.ingredients-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 0.25em 0;
    padding-left: 1.5em;
    position: relative;
    border-bottom: 1px dotted #ddd;
}

.ingredients-list li::before {
    content: "\2610"; /* Empty checkbox */
    position: absolute;
    left: 0;
    font-size: 10pt;
}

/* Instructions */
.instructions-section {
    break-inside: avoid-page;
}

.instructions-list {
    list-style: decimal;
    padding-left: 1.5em;
}

.instructions-list li {
    padding: 0.5em 0;
    page-break-inside: avoid;
}

/* Notes section */
.notes-section {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #ccc;
    grid-column: 1 / -1;
}

.notes-section p {
    margin-bottom: 0.5em;
}

/* Story section */
.story-section {
    margin-top: 1em;
    padding: 0.75em;
    background: #f9f9f9;
    border-left: 3px solid #ccc;
    font-style: italic;
    font-size: 10pt;
    grid-column: 1 / -1;
}

/* Footer with site attribution */
.print-footer {
    margin-top: 2em;
    padding-top: 0.5em;
    border-top: 1px solid #ccc;
    font-size: 9pt;
    color: #666;
    text-align: center;
}

/* Print-specific rules */
@media print {
    body {
        padding: 0;
    }

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

    /* Ensure page breaks don't happen in bad places */
    h1, h2 {
        page-break-after: avoid;
    }

    .ingredients-section,
    .instructions-list li {
        page-break-inside: avoid;
    }

    /* Show URLs after links in print */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
}

/* Fallback for narrower paper or single column preference */
@media print and (max-width: 6in) {
    .recipe-content {
        grid-template-columns: 1fr;
    }
}
