/* Screen and general styles */
.no-print {
    display: block;
}

header {
    background-color: var(--accent);
    color: var(--bg);
    padding: 20px;
    text-align: center;
    margin-bottom: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-align: center;
    color: var(--bg);
    font-family: var(--serif);
    font-weight: 700;
}

h2 {
    color: var(--fg);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-family: var(--serif);
    font-weight: 600;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding: 15px;
    background-color: var(--hl_bg);
    border-radius: 8px;
    border: 1px solid var(--hover);
}

.recipe-meta div {
    text-align: center;
}

.recipe-meta strong {
    display: block;
    font-size: 1.1em;
    color: var(--fg);
}

.recipe-meta span {
    color: var(--dim);
}

img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid var(--hover);
}

.recipe-content {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    align-items: flex-start;
}

.ingredients-section {
    background-color: var(--hl_bg);
    padding: 20px;
    border-radius: 8px;
    flex: 0 0 35%;
    border: 1px solid var(--hover);
}

.ingredients-section h2 {
    margin-top: 0;
    font-weight: 600 !important;
    font-family: var(--serif) !important;
    color: var(--fg);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.instructions-section {
    flex: 1;
    padding-top: 20px;
}

.instructions-section h2 {
    margin-top: 0;
    font-weight: 600 !important;
    font-family: var(--serif) !important;
    color: var(--fg);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

ul {
    margin: 0;
    padding-left: 20px;
    color: var(--fg);
}

li {
    margin-bottom: 8px;
    color: var(--fg);
}

ol {
    margin: 0;
    padding-left: 20px;
    color: var(--fg);
}

ol li {
    margin-bottom: 15px;
    padding-left: 5px;
}

p {
    margin-bottom: 15px;
    color: var(--fg);
}

.tips-section, .notes-section {
    background-color: var(--hl_bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid var(--hover);
}

.tips-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tips-section li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.notes-section p {
    line-height: 1.6;
}

.rating {
    background-color: var(--hl_bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid var(--hover);
    color: var(--fg);
}

.action-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.action-button {
    background-color: #7b64c0;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: var(--sans);
}

.action-button:hover {
    background-color: #6a52ad;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    header {
        position: relative;
        padding: 60px 10px 15px 10px;
    }

    h1 {
        font-size: 1.5em;
    }

    .action-buttons {
        position: absolute;
        top: 10px;
        right: 10px;
        left: 10px;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        z-index: 10;
    }

    .action-button {
        padding: 8px 12px;
        font-size: 14px;
        flex: 1;
        min-width: 90px;
    }

    .recipe-content {
        flex-direction: column;
        gap: 20px;
    }

    .ingredients-section {
        flex: 1;
    }

    .recipe-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .recipe-meta div {
        flex: 1 1 45%;
        min-width: 120px;
    }
}

/* Print-specific styles - basic and minimal */
@media print {
    .no-print, img, .rating, .description, .tips-section, .notes-section {
        display: none !important;
    }

    @page {
        margin: 10mm;
        size: letter;
    }

    body {
        font-size: 9pt;
        line-height: 1.25;
        margin: 0;
        background: white;
        color: black;
    }

    /* Prevent unnecessary page breaks */
    h1, h2, .recipe-content {
        page-break-after: avoid;
        break-after: avoid;
    }

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

    li {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    header {
        background: none !important;
        padding: 0 !important;
        margin-bottom: 5mm;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    h1 {
        font-size: 16pt;
        font-weight: bold;
        margin-bottom: 3mm;
        text-align: center;
        color: black;
    }

    header p {
        text-align: center;
        margin-bottom: 2mm;
        color: black;
    }

    .recipe-meta {
        display: flex !important;
        justify-content: center;
        gap: 3mm;
        margin: 2mm 0 4mm 0;
        padding: 0;
        background: none !important;
        border: none !important;
        border-radius: 0;
        font-size: 8pt;
        text-align: center;
    }

    .recipe-meta div {
        flex: none;
        text-align: center;
    }

    .recipe-meta div:not(:last-child)::after {
        content: " | ";
        margin: 0 1mm;
        color: black;
    }

    .recipe-meta strong {
        display: inline;
        font-size: 8pt;
        font-weight: normal;
        color: black;
    }

    .recipe-meta strong::after {
        content: ": ";
    }

    .recipe-meta span {
        color: black;
        font-size: 8pt;
    }

    h2 {
        font-size: 11pt;
        font-weight: bold;
        margin-top: 0;
        margin-bottom: 2mm;
        color: black;
        border-bottom: 1pt solid black;
        padding-bottom: 1mm;
    }

    .recipe-content {
        display: flex !important;
        gap: 4mm !important;
        margin: 2mm 0 !important;
    }

    .ingredients-section {
        flex: 0 0 35% !important;
        margin-right: 5mm !important;
        padding: 0 !important;
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .ingredients-section h2 {
        margin-top: 0 !important;
    }

    .instructions-section {
        flex: 1 !important;
        padding: 0 !important;
    }

    .instructions-section h2 {
        margin-top: 0 !important;
    }

    ul, ol {
        margin-left: 3mm;
        padding-left: 3mm;
        margin-top: 0;
    }

    li {
        margin-bottom: 1.5mm;
        font-size: 9pt;
        line-height: 1.3;
        color: black;
    }

    p {
        font-size: 9pt;
        margin: 0.5mm 0;
        color: black;
    }
}
