/* ============================================
   PRINT STYLESHEET — A4 Landscape PDF
   Tran Van Manh Portfolio

   Page map:
     p1  → Who am I?  (#about)
     p2  → Background (#resume)
     p3  → Work header + Local Planning & Behavior Trees
     p4  → ATC-Mapless Navigation
     p5  → KIST Sub-project — Industrial AMR
     p6  → PMSM Motor Optimization
     p7  → IVASTBot — Smart Human-Form Robot
     p8  → Achievements / News
============================================ */

@media print {

    /* ── PAGE FORMAT ── */
    @page {
        size: A4 landscape;
        margin: 1.4cm 2cm;
    }

    html { zoom: 0.85; }

    /* force colors & backgrounds through */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* ── HIDE NON-PRINT ELEMENTS ── */
    #navbar,
    #contact,
    footer,
    .scroll-down,
    .filter-bar,
    .nav-toggle,
    .video-yt-link,
    .btn,
    .hero-greeting,
    .hero-btns {
        display: none !important;
    }

    /* hide live players, show static thumbnails instead */
    .proj-videos iframe,
    .proj-videos video { display: none !important; }
    .print-thumb {
        display: block !important;
        width: 100% !important;
        aspect-ratio: 16/9 !important;
        object-fit: cover !important;
        border-radius: 6px !important;
    }

    /* ── RESET ANIMATION / EFFECTS ── */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .fade-in { opacity: 1 !important; }

    /* ── HERO COVER PAGE ── */
    #hero {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
        background: #0d1b2a !important;
        color: #fff !important;
        text-align: center !important;
        break-after: page !important;
        padding: 2rem !important;
    }
    .hero-bg { display: none !important; }
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.6rem !important;
    }
    .hero-avatar {
        width: 120px !important;
        height: 120px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        border: 3px solid #4a9eff !important;
        margin-bottom: 0.5rem !important;
    }
    .hero-name {
        font-size: 2.4rem !important;
        color: #fff !important;
        margin: 0 !important;
    }
    .hero-title {
        font-size: 1rem !important;
        color: #a0b8d0 !important;
        margin: 0 !important;
    }
    .print-url {
        display: block !important;
        margin-top: 1rem !important;
        font-size: 0.95rem !important;
        color: #4a9eff !important;
        letter-spacing: 0.02em !important;
    }
    .print-url i { margin-right: 0.4rem !important; }

    /* ── BASE ── */
    body {
        background: #fff !important;
        color: #1a1a1a !important;
        font-size: 11.5px;
        line-height: 1.55;
    }

    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }

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

    /* ── SECTION PADDING ── */
    .section {
        padding: 0.8rem 0 1rem !important;
    }
    .section-alt {
        background: #f0eeea !important;
    }
    .section-header {
        margin-bottom: 1.25rem !important;
    }

    /* ═══════════════════════════════════════
       PAGE BREAKS
       p1 → #about   (first printed section)
       p2 → #resume
       p3 → #projects + first proj-card (share the page)
       p4–p7 → each subsequent proj-card
       p8 → #news
    ═══════════════════════════════════════ */
    #about    { break-before: page; }
    #resume   { break-before: page; }
    #projects { break-before: page; }

    /* every proj-card after the first starts a new page */
    .proj-card + .proj-card { break-before: page; }

    #news { break-before: page; }

    /* keep these intact — no split across pages */
    .proj-card,
    .news-item,
    .tl-item,
    .exp-card,
    .pubs-section,
    .conf-section { break-inside: avoid; }

    /* ── ABOUT SECTION ── */
    .about-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem !important;
        margin-bottom: 2rem !important;
    }
    .expertise-cards {
        grid-template-columns: 1fr 1fr !important;
    }
    .exp-card {
        padding: 0.85rem !important;
    }
    .stats-row {
        grid-template-columns: repeat(4, 1fr) !important;
        padding: 1rem 1.5rem !important;
        gap: 1rem !important;
    }
    .stat-num { font-size: 2rem !important; }

    /* ── RESUME / BACKGROUND ── */
    .resume-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2.5rem !important;
    }
    .tl-dot { border-color: #f0eeea !important; }

    /* ── PROJECTS ── */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .proj-card {
        border: 1px solid #e0ddd8 !important;
        border-radius: 8px !important;
        padding: 1.1rem 1.4rem !important;
        gap: 0.55rem !important;
    }
    .proj-tasks {
        margin: 0.3rem 0 !important;
        padding-left: 1.2rem !important;
    }
    .proj-tasks li {
        margin-bottom: 0.2rem !important;
    }
    .proj-images {
        /* let each card's inline grid-template-columns take effect */
        gap: 0.6rem !important;
        align-items: center !important;
        justify-items: center !important;
    }
    .proj-images img {
        width: 100% !important;
        max-height: 210px !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
        border-radius: 4px !important;
    }
    .print-hide { display: none !important; }
    .pmsm-images img { max-height: 351px !important; }
    .atc-images {
        grid-template-columns: repeat(2, 45%) !important;
        justify-content: center !important;
    }
    .atc-images img {
        max-height: 239px !important;
    }
    .atc-videos {
        grid-template-columns: repeat(2, 40%) !important;
        justify-content: center !important;
    }

    .kist-images {
        grid-template-columns: repeat(2, 1fr) !important;
        justify-items: stretch !important;
    }
    .kist-images img {
        width: 100% !important;
        max-height: 252px !important;
    }
    .kist-videos {
        grid-template-columns: repeat(2, 40%) !important;
        justify-content: center !important;
    }
    .ivasbot-videos {
        grid-template-columns: repeat(2, 35%) !important;
        justify-content: center !important;
    }

    /* ── NEWS / HIGHLIGHTS ── */
    .news-list { gap: 0.65rem !important; margin-bottom: 1.5rem !important; }
    .news-item  { padding: 0.75rem 1.1rem !important; }

    .conf-section { padding: 1.25rem !important; margin-bottom: 1rem !important; }
    .conf-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 0.6rem !important; }
    .conf-img-wrap img { max-height: 186px !important; object-fit: cover !important; }

    .pubs-section { padding: 1.25rem !important; }
    .pubs-list { gap: 0.6rem !important; }
}
