﻿/* =========================================================
   print.css  -  A4 print stylesheet (GIGW 3.0 5.1.20)
   Save as: wwwroot/css/print.css
   Link it LAST in <head> (after layout.css and accessibility.css):
   <link rel="stylesheet" href="~/css/print.css?v=3" media="print" />
   ========================================================= */

@page {
    size: A4 portrait;
    margin: 12mm;
}

@media print {

    /* ---------- 1. Page width: remove fixed / min widths ---------- */
    html, html body {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.4;
    }

        /* "html body" prefix raises specificity so it beats layout.css / bootstrap.css */
        html body .container,
        html body .container-fluid,
        html body .container-xxl,
        html body .common-container,
        html body main,
        html body .footer-bs footer {
            width: 100% !important;
            min-width: 0 !important; /* this removes the 992px min-width */
            max-width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        html body .row {
            display: block !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        html body [class*="col-"] {
            position: static !important;
            float: none !important;
            flex: 0 0 100% !important;
            width: 100% !important;
            max-width: 100% !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        /* Inline widths such as style="width:600px" */
        html body [style*="width"] {
            max-width: 100% !important;
        }

    /* ---------- 2. Hide interactive / non-content parts ---------- */
    .b-acc-icons,
    .globalnav-bg,
    .b-mobile-backdrop,
    .skip-link,
    .b-header-search,
    .bhashini-plugin-container,
    #demo,
    .carousel-control-prev,
    .carousel-control-next,
    .b-logo-nav,
    .b-logo-pause,
    .b-social,
    .backtotop,
    .modal,
    .modal-backdrop,
    button,
    .btn {
        display: none !important;
    }

    /* ---------- 3. Header: keep emblem, title and NIC logo ---------- */
    html body #b-header {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #000;
        margin-bottom: 8mm !important;
        padding-bottom: 3mm !important;
    }

    .b-header-brand {
        display: flex !important;
        align-items: center;
        flex: 1 1 auto;
        min-width: 0;
    }

    .b-emblem-image {
        float: none !important;
        position: static !important;
        height: 18mm !important;
        width: auto !important;
        margin-right: 4mm;
    }

    .b-header-text,
    .b-header-title,
    .b-title-a {
        white-space: normal !important;
        color: #000 !important;
    }

    .b-header-logo img {
        height: 12mm !important;
        width: auto !important;
    }

    /* ---------- 3a. Government of India bar (flag + name), tools hidden ---------- */
    html body #b-accessibility {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
        border-bottom: 1px solid #000;
        margin-bottom: 3mm !important;
        padding-bottom: 2mm !important;
    }

    .b-ministryname {
        display: flex !important;
        align-items: center;
    }

        .b-ministryname * {
            color: #000 !important;
        }

    .b-acc-goi img {
        height: 8mm !important;
        width: auto !important;
        margin-right: 2mm;
    }

    /* ---------- 3b. Footer logos: static row instead of slider ---------- */
    html body .footer-carousal {
        display: block !important;
        background: #fff !important;
        margin-top: 8mm !important;
        border-top: 1px solid #000;
        padding-top: 3mm !important;
    }

    html body .b-logo-slider {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .b-logo-viewport {
        overflow: visible !important;
        width: 100% !important;
    }

    .b-logo-track {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6mm;
        width: auto !important;
        transform: none !important;
    }

    .f-logo {
        flex: 0 0 auto !important;
        width: auto !important;
    }

        .f-logo img {
            height: 12mm !important;
            width: auto !important;
        }

    /* ---------- 4. Media, tables, code ---------- */
    img, svg, video, canvas, iframe, figure {
        max-width: 100% !important;
        height: auto !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: auto !important;
        border-collapse: collapse;
    }

    .text-nowrap, th, td {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    thead {
        display: table-header-group;
    }

    tr, img, .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    pre, code {
        white-space: pre-wrap !important;
        word-break: break-word;
    }

    /* Anything positioned out of flow can push the width out */
    .fixed-top, .fixed-bottom, .sticky-top,
    [style*="position: fixed"], [style*="position:fixed"] {
        position: static !important;
    }

    /* ---------- 5. Text, links, colours ---------- */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
        page-break-after: avoid;
        color: #000 !important;
    }

    p, blockquote {
        orphans: 3;
        widows: 3;
    }

    a, a:visited {
        color: #000 !important;
        text-decoration: underline;
    }

    /* Show the address of external links only */
    main a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        overflow-wrap: anywhere;
    }

    main a[href^="#"]::after,
    main a[href^="javascript"]::after {
        content: "";
    }

    /* Dashboard cards: white background, black text (saves ink, stays readable) */
    .b-dbcard, .b-dbcard .card-body {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        min-height: 0 !important;
    }

    .b-card-title, .b-card-count {
        color: #000 !important;
    }

    /* ---------- 6. Footer: readable black text ---------- */
    html body .footer-bs,
    html body .footer-bs * {
        background: #fff !important;
        color: #000 !important; /* also beats style="color:yellow" */
    }

    html body .footer-bs {
        border-top: 1px solid #000;
        margin-top: 8mm !important;
        padding-top: 3mm !important;
    }

    .b-footer-list {
        list-style: none;
        margin: 0 0 3mm !important;
        padding: 0 !important;
    }

        .b-footer-list li {
            display: inline-block;
            margin-right: 4mm;
        }

    .b-footer-title {
        font-size: 12pt;
        font-weight: 700;
        margin-bottom: 2mm;
    }
}
