/* =============================================
   WANDERBITE — Print Styles
   Iteration 8: Final Polish & Review

   Optimized for printing recipes:
   - Clean, readable layout
   - No backgrounds or decorative elements
   - Efficient use of paper
   ============================================= */

@media print {
    /* Reset colors and backgrounds */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Page setup */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    @page :first {
        margin-top: 1cm;
    }

    /* Hide non-essential elements */
    .skip-link,
    .sr-only,
    #sr-announcements,
    .loading-overlay,
    .page-transition,
    .ambient-bg,
    .breadcrumb,
    .view-toggle,
    .map-wrapper,
    .region-list,
    .random-cta,
    .back-btn,
    .result-actions,
    .result-tabs,
    .tab-btn,
    .runner-ups,
    .result-ctas,
    .toast,
    .external-link-wrapper,
    .copy-btn,
    .shopping-header button,
    .screen-error,
    .screen-map,
    .screen-dietary,
    .screen-questions {
        display: none !important;
    }

    /* Show only results screen */
    .app {
        padding: 0 !important;
        max-width: none !important;
    }

    .screen {
        display: none !important;
    }

    .screen-results {
        display: block !important;
    }

    /* Typography adjustments */
    body {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 12pt;
        line-height: 1.5;
    }

    h1, h2, h3, h4 {
        font-family: Georgia, 'Times New Roman', serif;
        page-break-after: avoid;
        orphans: 3;
        widows: 3;
    }

    /* Result header */
    .result-header {
        margin-bottom: 0.5cm;
    }

    /* Hero image */
    .result-hero {
        max-height: 6cm;
        border-radius: 0 !important;
        margin-bottom: 0.5cm;
        page-break-inside: avoid;
    }

    .result-image {
        object-fit: contain !important;
    }

    .result-cuisine {
        position: static !important;
        display: inline-block;
        padding: 0 !important;
        font-size: 10pt;
        font-style: italic;
    }

    /* Result info */
    .result-info {
        text-align: left;
        margin-bottom: 0.5cm;
        border-bottom: 1pt solid #ccc;
        padding-bottom: 0.5cm;
    }

    .result-title {
        font-size: 18pt;
        margin-bottom: 0.25cm;
    }

    .result-description {
        font-size: 11pt;
        font-style: italic;
        margin-bottom: 0.25cm;
    }

    .result-meta {
        justify-content: flex-start;
        gap: 1cm;
        font-size: 10pt;
    }

    .meta-item svg {
        display: none;
    }

    .meta-item::before {
        font-weight: bold;
        margin-right: 0.25em;
    }

    .meta-item:nth-child(1)::before { content: 'Time:'; }
    .meta-item:nth-child(2)::before { content: 'Difficulty:'; }
    .meta-item:nth-child(3)::before { content: 'Cost:'; }

    /* Tab content - show all */
    .tab-content {
        display: block !important;
    }

    #tab-shopping {
        page-break-before: always;
    }

    /* Recipe sections */
    .recipe-section {
        margin-bottom: 0.5cm;
    }

    .recipe-heading {
        font-size: 14pt;
        border-bottom: 1pt solid #000;
        padding-bottom: 0.25cm;
        margin-bottom: 0.25cm;
    }

    .recipe-heading svg {
        display: none;
    }

    /* Ingredients */
    .ingredients-list {
        display: block;
        column-count: 2;
        column-gap: 1cm;
    }

    .ingredient-item {
        break-inside: avoid;
        padding: 0.15cm 0;
        background: none !important;
        border-bottom: 0.5pt dotted #ccc;
    }

    .ingredient-amount {
        font-weight: bold;
    }

    /* Instructions */
    .instructions-list {
        counter-reset: step;
    }

    .instruction-item {
        padding: 0.25cm 0 0.25cm 0.75cm;
        background: none !important;
        border-left: 2pt solid #000;
        margin-bottom: 0.25cm;
        page-break-inside: avoid;
    }

    .instruction-item::before {
        position: static;
        display: inline-block;
        background: none !important;
        color: #000 !important;
        width: auto;
        height: auto;
        margin-right: 0.25cm;
        font-weight: bold;
    }

    /* Shopping list */
    .shopping-header {
        border-bottom: 1pt solid #000;
        padding-bottom: 0.25cm;
        margin-bottom: 0.25cm;
    }

    .shopping-header h3 {
        font-size: 14pt;
    }

    .shopping-list {
        column-count: 2;
        column-gap: 1cm;
    }

    .shopping-item {
        break-inside: avoid;
        padding: 0.15cm 0;
        background: none !important;
    }

    .shopping-checkbox {
        width: 0.4cm;
        height: 0.4cm;
        border: 1pt solid #000;
        border-radius: 0 !important;
        margin-right: 0.25cm;
    }

    /* Links */
    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 9pt;
        color: #666 !important;
    }

    a[href^="javascript:"]::after,
    a[href^="#"]::after {
        content: '';
    }

    /* Footer with URL */
    .result-content::after {
        content: 'Recipe from Wanderbite — wanderbite.app';
        display: block;
        text-align: center;
        font-size: 9pt;
        color: #666 !important;
        margin-top: 1cm;
        padding-top: 0.25cm;
        border-top: 0.5pt solid #ccc;
    }
}

/* Specific print sizes */
@media print and (max-width: 5.5in) {
    /* Letter size adjustments */
    .ingredients-list,
    .shopping-list {
        column-count: 1;
    }
}
