/* Ripple framework — print stylesheet
 * Strips chrome, switches to ink-on-paper, makes notes/reflections actually
 * usable when a user prints (or saves as PDF) a step from their journal.
 */

@media print {
    /* Reset the dark editorial theme to printable ink-on-paper. */
    body, body::before {
        background: #fff !important;
    }
    body::before { display: none !important; }

    body {
        color: #111 !important;
        font-family: 'Saira Condensed', system-ui, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.55 !important;
    }

    /* Hide all non-content chrome. */
    nav, .navigation, .nav-groups, .view-toggle.sub-nav,
    .progress-bar, footer, .skip-link,
    .password-overlay,
    #adminBadge, .admin-nav-badge,
    #session-timeout-toast, #email-verification-toast, #email-verification-banner,
    .save-note-btn, .note-status, .back-btn,
    .password-toggle, .pw-toggle-btn,
    .photo-controls, .modal-close, .app-modal-overlay {
        display: none !important;
    }

    /* The header for each step. */
    .step-content h3, .step-title, .glossary-term, .notes-title {
        font-family: 'Saira Condensed', system-ui, sans-serif !important;
        color: #111 !important;
        font-weight: 600 !important;
        page-break-after: avoid;
    }

    /* Note textareas: ink, no border, the saved value should print. */
    .step-content textarea,
    textarea[id^="notes-"] {
        background: transparent !important;
        color: #111 !important;
        border: none !important;
        border-top: 1px solid #aaa !important;
        padding: 12px 0 0 !important;
        margin: 12px 0 !important;
        font-family: 'Saira Condensed', system-ui, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.6 !important;
        resize: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        page-break-inside: avoid;
    }

    /* Inline rendered note blocks (the journal view). */
    .notes-section {
        background: transparent !important;
        border: none !important;
        border-top: 1px solid #aaa !important;
        padding: 12px 0 !important;
        margin: 18px 0 !important;
        page-break-inside: avoid;
    }

    /* Reflections in the AI-history list. */
    .step-content p, .notes-section p {
        color: #222 !important;
    }

    /* Show link URLs after link text for printed reference. */
    a[href]:not([href^="#"]):not([href^="mailto:"]):not([href^="javascript:"])::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
        word-break: break-all;
    }

    /* Make sure cards and overview grids stay readable on paper. */
    .overview-grid, #stepCards {
        display: block !important;
    }
    .step-card, .stat-card {
        background: transparent !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }

    @page {
        margin: 1.8cm 2cm;
    }
}
