/* ============================================
   KODA Documentation Website - Print Styles
   For PDF Generation & Printing
   ============================================ */

@media print {
    /* Reset */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Page Setup */
    @page {
        margin: 2cm;
        size: A4;
    }

    /* Hide UI Elements */
    .site-header,
    .sidebar,
    .language-switcher,
    .document-actions,
    .document-navigation,
    .back-to-top,
    .sidebar-toggle,
    .breadcrumb,
    nav,
    button {
        display: none !important;
    }

    /* Content */
    .content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .document-content {
        padding: 0 !important;
    }

    /* Typography */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1 {
        font-size: 24pt;
        margin-top: 0;
        page-break-after: avoid;
    }

    h2 {
        font-size: 18pt;
        page-break-after: avoid;
        margin-top: 1cm;
    }

    h3 {
        font-size: 14pt;
        page-break-after: avoid;
    }

    h4, h5, h6 {
        font-size: 12pt;
        page-break-after: avoid;
    }

    /* Prevent Breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-inside: avoid;
    }

    img, table, figure {
        page-break-inside: avoid;
    }

    ul, ol {
        page-break-inside: avoid;
    }

    /* Links */
    a {
        text-decoration: underline;
        color: black !important;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666 !important;
    }

    /* Tables */
    table {
        border-collapse: collapse;
        width: 100%;
        margin: 1em 0;
    }

    table th,
    table td {
        border: 1px solid #000 !important;
        padding: 0.5em;
    }

    table th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
    }

    /* Code Blocks */
    pre {
        border: 1px solid #000 !important;
        padding: 1em;
        page-break-inside: avoid;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    code {
        background-color: #f5f5f5 !important;
        padding: 0.2em 0.4em;
        border: 1px solid #ddd !important;
    }

    /* Lists */
    ul, ol {
        margin-left: 2em;
    }

    /* Document Header */
    .document-header h1 {
        border-bottom: 2px solid #000 !important;
        padding-bottom: 0.5cm;
    }

    /* Document Meta */
    .document-meta {
        display: block !important;
        margin-bottom: 1cm;
        padding-bottom: 0.5cm;
        border-bottom: 1px solid #ddd !important;
    }

    .meta-item {
        display: inline-block;
        margin-right: 1cm;
    }

    /* Blockquotes */
    blockquote {
        border-left: 4px solid #000 !important;
        padding-left: 1em;
        margin: 1em 0;
        font-style: italic;
    }

    [dir="rtl"] blockquote {
        border-left: none !important;
        border-right: 4px solid #000 !important;
        padding-left: 0;
        padding-right: 1em;
    }

    /* Page Numbers */
    .content::after {
        content: counter(page);
        position: fixed;
        bottom: 1cm;
        right: 1cm;
    }

    /* Orphans and Widows */
    p {
        orphans: 3;
        widows: 3;
    }
}