/* Print Stylesheet - Optimized for A4 Paper */

@media print {
    /* Page Setup */
    @page {
        size: A4 portrait;
        margin: 2cm;
    }

    /* Reset colors for B&W printing */
    * {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide navigation and interactive elements */
    .no-print,
    header,
    nav,
    footer,
    .video-container {
        display: none !important;
    }

    /* Show print-only content */
    .print-only {
        display: block !important;
    }

    /* Body */
    body {
        font-size: 11pt;
        line-height: 1.4;
        font-family: 'Times New Roman', serif;
    }

    /* Main container */
    main {
        display: block;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Sections */
    section {
        margin-bottom: 1.5cm;
        padding: 0;
        background: none !important;
        border-radius: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }

    /* Headings */
    h1 {
        font-size: 24pt;
        margin-bottom: 0.5cm;
        border-bottom: 2pt solid #000;
        padding-bottom: 0.2cm;
    }

    h2 {
        font-size: 18pt;
        margin-top: 1cm;
        margin-bottom: 0.5cm;
        border-bottom: 1pt solid #000;
        padding-bottom: 0.1cm;
        page-break-after: avoid;
    }

    h3 {
        font-size: 14pt;
        margin-top: 0.5cm;
        margin-bottom: 0.3cm;
        page-break-after: avoid;
    }

    /* Paragraphs */
    p {
        margin-bottom: 0.3cm;
        orphans: 3;
        widows: 3;
    }

    /* Links - show URL in print */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
    }

    /* But don't show for anchor links */
    a[href^="#"]:after {
        content: "";
    }

    /* Portfolio & Lecture Items */
    .portfolio-item,
    .lecture-item {
        margin-bottom: 1cm;
        padding-bottom: 0.5cm;
        border-bottom: 1pt solid #ccc;
        page-break-inside: avoid;
    }

    .portfolio-item:last-child,
    .lecture-item:last-child {
        border-bottom: none;
    }

    .role,
    .event {
        font-weight: bold;
        margin: 0.2cm 0;
    }

    .platform {
        font-style: italic;
        margin-bottom: 0.3cm;
    }

    /* QR Codes */
    .qr-code {
        margin: 0.5cm 0;
        padding: 0.3cm;
        border: 1pt solid #000;
        page-break-inside: avoid;
    }

    .qr-code img {
        max-width: 3cm;
        height: auto;
    }

    .small-url {
        font-size: 9pt;
        font-family: 'Courier New', monospace;
        margin-top: 0.2cm;
    }

    /* Skills List */
    .skills-list {
        margin-left: 0.5cm;
    }

    .skills-list li {
        padding: 0.2cm 0;
        border-bottom: 1pt dotted #ccc;
    }

    /* Summary box */
    .summary {
        padding: 0.5cm;
        border-left: 3pt solid #000;
        margin: 0.5cm 0;
    }

    /* Contact section */
    #contact {
        page-break-inside: avoid;
    }

    #contact p {
        margin-bottom: 0.2cm;
    }

    /* Page breaks */
    h1, h2 {
        page-break-after: avoid;
    }

    .portfolio-item,
    .lecture-item,
    section {
        page-break-inside: avoid;
    }

    /* Ensure first section starts on first page */
    #about {
        page-break-before: avoid;
    }

    /* Force page break before contact if needed */
    /* Uncomment if you want contact on separate page */
    /* #contact {
        page-break-before: always;
    } */
}
