/* Print Styles for Family Cookbook - Optimized for Single Page */

@media print {
    /* Reset for print */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    @page {
        margin: 0.5in 0.5in 0.5in 0.5in;
        size: letter;
    }

    body {
        font-size: 10pt;
        line-height: 1.3;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Hide navigation and UI elements for print */
    .navbar,
    .breadcrumb,
    .no-print,
    .recipe-actions,
    .ingredient-scaler,
    .recipe-metadata,
    .flash-messages,
    .footer,
    button,
    .btn {
        display: none !important;
    }

    /* Recipe title - compact */
    .recipe h1,
    .recipe-header h1 {
        font-size: 16pt;
        margin-bottom: 6pt;
        page-break-after: avoid;
        font-weight: bold;
    }

    .recipe-header {
        margin-bottom: 8pt;
    }

    .recipe-author {
        font-style: italic;
        font-size: 10pt;
        margin-bottom: 6pt;
    }

    /* Recipe metadata - very compact */
    .recipe-meta,
    .recipe-info {
        border: 1px solid #000;
        padding: 4pt;
        margin-bottom: 8pt;
        page-break-inside: avoid;
        font-size: 9pt;
        background: transparent !important;
    }

    .recipe-info {
        display: block !important;
    }

    .info-item {
        display: inline-block;
        margin-right: 12pt;
        margin-bottom: 2pt;
    }

    .recipe-meta table {
        margin-bottom: 0;
    }

    .recipe-meta table th {
        font-weight: bold;
        width: 100pt;
    }

    .recipe-meta table th,
    .recipe-meta table td {
        padding: 1pt 4pt;
        line-height: 1.2;
    }

    .description,
    .recipe-description {
        margin: 2pt 0 0 0;
        padding-top: 2pt;
        font-size: 9pt;
        font-style: italic;
    }

    /* Recipe content layout - single column for print */
    .recipe-content {
        display: block !important;
        grid-template-columns: none !important;
    }

    /* Section headings - compact */
    h2 {
        font-size: 13pt;
        margin-top: 8pt;
        margin-bottom: 4pt;
        border-bottom: 1.5pt solid #000;
        padding-bottom: 1pt;
        page-break-after: avoid;
        font-weight: bold;
    }

    h3 {
        font-size: 11pt;
        margin-top: 6pt;
        margin-bottom: 2pt;
        page-break-after: avoid;
        font-weight: bold;
    }

    /* Ingredients - very compact */
    .ingredients,
    .recipe-ingredients {
        margin-bottom: 8pt;
    }

    .ingredients ul,
    .ingredient-list {
        list-style: none !important;
        margin-left: 0 !important;
        margin-top: 2pt;
        margin-bottom: 4pt;
        padding-left: 0 !important;
    }

    .ingredients li,
    .ingredient-list li {
        padding-left: 12pt !important;
        margin-left: 0 !important;
        margin-bottom: 0;
        line-height: 1;
        position: relative !important;
    }

    .ingredients li:before,
    .ingredient-list li:before {
        content: "▪" !important;
        color: #3498db !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-weight: bold !important;
        position: absolute !important;
        left: 0 !important;
        display: inline !important;
    }

    .ingredient-section {
        font-size: 11pt;
        margin-top: 6pt;
        margin-bottom: 2pt;
        page-break-after: avoid;
        font-weight: bold;
    }

    /* Instructions - compact */
    .instructions,
    .recipe-instructions {
        margin-bottom: 6pt;
    }

    .instructions ol,
    .instruction-list {
        counter-reset: step-counter;
        list-style: none !important;
        margin-left: 0 !important;
        margin-top: 2pt;
        padding-left: 0 !important;
    }

    .instructions li,
    .instruction-list li {
        counter-increment: step-counter;
        padding-left: 32pt !important;
        margin-left: 0 !important;
        margin-bottom: 3pt;
        page-break-inside: avoid;
        line-height: 1.3;
        position: relative !important;
    }

    .instructions li:before,
    .instruction-list li:before {
        content: counter(step-counter) !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        background: #3498db !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: white !important;
        font-weight: bold !important;
        width: 18pt !important;
        height: 18pt !important;
        border-radius: 12pt !important;
        display: block !important;
        font-size: 10pt !important;
        text-align: center !important;
        line-height: 18pt !important;
    }

    /* Notes - compact */
    .notes,
    .recipe-notes {
        border: 1px solid #000;
        padding: 4pt;
        margin-top: 6pt;
        page-break-inside: avoid;
        font-size: 9pt;
        background: transparent !important;
    }

    .notes h3,
    .recipe-notes h3 {
        margin-top: 0;
        margin-bottom: 2pt;
        font-size: 10pt;
    }

    .notes ul,
    .recipe-notes ul {
        margin: 0;
        padding-left: 16pt;
    }

    .notes li,
    .recipe-notes li,
    .note-item {
        margin-bottom: 1pt;
        line-height: 1.25;
    }

    /* Prevent breaks in awkward places */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    ul, ol {
        page-break-before: avoid;
    }

    /* Sections should try to stay together */
    .ingredients,
    .recipe-ingredients,
    .instructions,
    .recipe-instructions {
        page-break-inside: avoid;
    }

    /* But allow breaks if necessary to fit on page */
    @media print and (max-height: 10in) {
        .ingredients,
        .recipe-ingredients,
        .instructions,
        .recipe-instructions {
            page-break-inside: auto;
        }
    }

    /* Index page - hide when printing individual recipes */
    .recipe-index {
        display: none;
    }

    /* Links - show URLs */
    a[href]:after {
        content: none;
    }
}
