/* Print stylesheet (feature 032). When a user prints a Help article (/help/{slug}), drop the
   app chrome and secondary panels, expand collapsed sections, and surface link targets so the
   page prints as a clean, self-contained document. Only active in print. */

@media print {
    /* App chrome that should never print. */
    .sidebar,
    .topbar,
    .sidebar-overlay,
    .environment-banner,
    .help-drawer-root,
    .global-search-overlay,
    .toast-container {
        display: none !important;
    }

    /* Let the content use the full page width once the sidebar is gone. */
    .main-content-wrapper,
    .main-content-wrapper.sidebar-collapsed,
    .main-content-wrapper.sidebar-expanded {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Help article: hide the interactive/secondary rails, keep the body. */
    .topic-sidebar,
    .feedback-section,
    .topic-navigation,
    .topic-toc {
        display: none !important;
    }

    .topic-content-wrapper {
        display: block !important;
    }

    .help-topic-page {
        padding: 0 !important;
    }

    /* Expand collapsible sections so nothing is hidden on paper. */
    details.help-details,
    details {
        display: block !important;
    }

    details[open],
    details:not([open]) > *,
    details.help-details > * {
        display: revert !important;
    }

    /* Show the destination of links inline (skip in-page anchors and mailto noise). */
    .topic-article-body a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
        word-break: break-all;
    }

    /* Avoid clipped colors / shadows on paper. */
    .topic-article-body,
    .topic-main-content {
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
    }

    a {
        text-decoration: none;
        color: #000 !important;
    }
}
