/**
 * Wikibin Print Stylesheet
 * Optimized for printing articles
 */

@media print {
    /* ============================================
       HIDE NON-ESSENTIAL ELEMENTS
       ============================================ */
    .sp-header,
    .sp-megamenu-wrapper,
    .sp-sticky-header,
    .offcanvas-menu,
    .breadcrumb,
    .wiki-sidebar,
    .sidebar-right,
    .leaderboard-row,
    .bottom1,
    .sp-footer,
    footer,
    .sp-scroll-up,
    .sp-reading-progress-bar,
    .related-articles,
    .social-share,
    .social-share-block,
    .adsense-module,
    .adsbygoogle,
    ins.adsbygoogle,
    .ad-container,
    .advertisement,
    nav,
    .offcanvas-menu,
    .article-can-edit,
    .article-ratings-social-share,
    .featured-article-badge,
    #wikibin-theme-toggle,
    .wiki-toc .toc-toggle,
    .comment-form,
    .comments-section,
    .module-title,
    .sp-module,
    button,
    .btn {
        display: none !important;
    }

    /* ============================================
       LAYOUT RESET
       ============================================ */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000 !important;
        background: #fff !important;
        margin: 0;
        padding: 0;
    }

    .article-details,
    .com-content-article,
    .sp-column,
    .container,
    .container-fluid,
    .row,
    [class*="col-"] {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        display: block !important;
    }

    /* ============================================
       TYPOGRAPHY
       ============================================ */
    h1 {
        font-size: 20pt;
        margin-bottom: 0.5em;
        page-break-after: avoid;
    }

    h2 {
        font-size: 16pt;
        margin-top: 1em;
        margin-bottom: 0.5em;
        page-break-after: avoid;
        border-bottom: 1px solid #000;
        padding-bottom: 0.2em;
    }

    h3 {
        font-size: 13pt;
        margin-top: 0.8em;
        page-break-after: avoid;
    }

    h4, h5, h6 {
        font-size: 12pt;
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }

    /* ============================================
       LINKS
       ============================================ */
    a {
        color: #000 !important;
        text-decoration: underline;
    }

    /* Show URLs after external links */
    a[href^="http"]:after,
    a[href^="https"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        word-wrap: break-word;
    }

    /* Don't show URL for internal anchors */
    a[href^="#"]:after {
        content: "";
    }

    /* Don't show URL for very long URLs */
    a[href*="wikipedia.org"]:after,
    a[href*="archive.org"]:after {
        content: " [external link]";
    }

    /* ============================================
       IMAGES
       ============================================ */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    figure {
        page-break-inside: avoid;
    }

    /* ============================================
       TABLES
       ============================================ */
    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    th, td {
        border: 1px solid #000;
        padding: 0.3em;
    }

    thead {
        display: table-header-group;
    }

    /* ============================================
       TABLE OF CONTENTS (Print version)
       ============================================ */
    .wiki-toc {
        border: 1px solid #000;
        padding: 10px;
        margin: 1em 0;
        page-break-inside: avoid;
        background: #f5f5f5 !important;
    }

    .wiki-toc .toc-header {
        font-weight: bold;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    .wiki-toc .toc-list {
        display: block !important;
    }

    .wiki-toc a {
        text-decoration: none;
    }

    .wiki-toc a:after {
        content: "";
    }

    /* ============================================
       DELETION INFO BOX (Print version)
       ============================================ */
    .deletion-info-box {
        border: 2px solid #000;
        padding: 10px;
        margin: 1em 0;
        page-break-inside: avoid;
        background: #fff !important;
    }

    .deletion-info-box .deletion-header {
        font-weight: bold;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        margin-bottom: 10px;
        color: #000 !important;
    }

    /* ============================================
       CODE BLOCKS
       ============================================ */
    pre, code {
        background: #f5f5f5 !important;
        border: 1px solid #ccc;
        page-break-inside: avoid;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    /* ============================================
       PRINT HEADER
       ============================================ */
    .article-details:before,
    .com-content-article:before {
        content: "Wikibin.org - Archive of Deleted Wikipedia Articles";
        display: block;
        font-size: 10pt;
        color: #666;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        margin-bottom: 1em;
    }

    /* ============================================
       PAGE BREAKS
       ============================================ */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    p, blockquote, ul, ol, dl, table, figure {
        page-break-inside: avoid;
    }

    /* ============================================
       PRINT FOOTER
       ============================================ */
    @page {
        margin: 2cm;
    }

    @page :first {
        margin-top: 3cm;
    }
}
