@media print {
    /* Ẩn tất cả elements trước */    
    body{
        visibility:visible;
    }
    .logo-print,.logo-print *{
        margin:2rem auto;
        visibility:visible;
        align-items: center;

    }
    footer,.hidden{
        display:none;
    }
    article div.flex.place-content-end.font-bold.text-lg{
        margin-right:1.5rem;
    }
    .logo-print picture img{        
        height: 100px;
        padding-left:7cm;
    }
    /* Chỉ hiện thị article-content và các phần tử con của nó */
    .article-content,
    .article-content * {
        visibility: visible;
        font-size: 18pt;
    }

    /* Đảm bảo article-content hiển thị đúng vị trí và không tràn trang */
    .article-content {        
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        padding: 7cm 2.5cm 1cm 2.5cm; /* Thêm padding cho trang in */
        box-sizing: border-box;
    }

    /* Cài đặt cỡ trang và margin */
    @page {
        size: A4;
        margin: 2cm 1.5cm; /* Margin cho trang in */
    }

    /* Đảm bảo font chữ đọc được */
    body {
        font-size: 18pt;
        line-height: 1.6;
    }

    /* Kiểm soát kích thước hình ảnh */
    img {
        max-width: 100%;
        height: auto !important;
        page-break-inside: avoid;
    }

    /* Tránh ngắt trang ở các phần quan trọng */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    p, blockquote, ul, ol, dl, table {
        page-break-inside: avoid;
        orphans: 3; /* Số dòng tối thiểu ở cuối trang */
        widows: 3;  /* Số dòng tối thiểu ở đầu trang */
    }

    /* Đảm bảo nội dung không bị cắt */
    * {
        overflow: visible !important;
    }
}