/* Shared A4 output. Screen layout and interactive state are left unchanged. */
@page {
    size: A4;
    margin: 12mm;
}

@media print {
    html, body {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        font-size: 11pt;
        scroll-behavior: auto !important;
    }

    *, *::before, *::after {
        color: #111 !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
        transition: none !important;
        backdrop-filter: none !important;
        -webkit-text-fill-color: currentColor !important;
    }

    /* Reveal scroll-animated content, without exposing hidden menus/form states. */
    .wow, .scroll-reveal {
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    [class*="z-[-"], [class*="-z-"] { z-index: 0 !important; }
    [class*="-mt-"] { margin-top: 0 !important; }
    [class*="!text-"] { color: #111 !important; }
    [class*="bg-gradient"], [style*="linear-gradient"], .vibrant-gradient-text {
        background-image: none !important;
    }

    #main-header {
        position: static !important;
        margin: 0 0 5mm !important;
        padding: 0 !important;
    }
    #main-header .rgu-header-row, #main-header .container, #main-header .topbar {
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #main-header .rgu-header-brand { gap: 3mm; }
    #main-header .rgu-header-brand img { height: 14mm !important; width: auto !important; }

    .rgu-utility-row, .header-divider, .header-gradient, .rgu-nav-slot,
    #main-header .rgu-header-row > :not(.rgu-header-brand),
    .navbar-container, .mobile-menu-overlay, .sm_menu_outer, .rgu-skip-link,
    .rgu-footer, #mobile-search-popup, #rgu-external-dialog, .no-print,
    #computer-centre-menu, #department-menu, #about-dropdown, #downloads-dropdown,
    #cookie-notice, #aw-toggle, #aw-panel, #aw-widget-container,
    #bhashini-translation, .bhashini-plugin-container, .bhashini-feedback-button,
    .bhashini-pdf-translate-btn, zapier-interfaces-chatbot-embed,
    .owl-nav, .owl-dots, .swiper-button-next, .swiper-button-prev, .swiper-pagination,
    .rgu-home button[data-modal-target], .multistep-progress, .step-navigation,
    button[type="submit"], .btn-submit {
        display: none !important;
    }

    /* Keep the translation notice once in document flow, not over every page. */
    .bhashini-toast {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        margin: 5mm 0 0 !important;
        padding: 3mm 0 !important;
        font-size: 9pt !important;
        break-inside: avoid;
    }

    .container, .help-container, .form-container {
        width: 100% !important;
        max-width: none !important;
        margin-inline: 0 !important;
        padding-inline: 0 !important;
    }
    section, main, .form-container, .form-card {
        min-height: 0 !important;
        height: auto !important;
        padding-block: 3mm !important;
    }
    .form-card { padding: 0 !important; }

    /* Inner-page banners retain their title without the screen-sized empty hero. */
    :is(.institute-bg, .facility-bg, .cell-bg, .page-bg) {
        padding: 0 !important;
        margin: 0 0 5mm !important;
    }
    :is(.institute-bg, .facility-bg, .cell-bg, .page-bg) > :not(:has(h1)) { display: none !important; }
    :is(.institute-bg, .facility-bg, .cell-bg, .page-bg) > :has(h1) {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .dean-card { margin-top: 0 !important; }

    /* Keep the active homepage slide and its text in normal print flow. */
    #hero-slider { overflow: visible !important; }
    #hero-slider .slide { display: none !important; }
    #hero-slider .slide.active {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
    }
    #hero-slider .slide > .flex, #hero-slider .slide > .flex > div {
        position: static !important;
        margin: 0 !important;
    }
    #hero-slider .slide-content { opacity: 1 !important; transform: none !important; }
    #hero-slider .slide > [style*="background-image"] {
        position: static !important;
        height: 55mm !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    #hero-slider > button, #hero-slider .slide > .absolute:has(video),
    .rgu-home .fixed, .rgu-home .animate-pulse,
    section > .absolute:empty { display: none !important; }
    #visualSide .absolute:not(:empty) { position: static !important; transform: none !important; }
    #visualSide .absolute:empty { display: none !important; }
    #visualSide img { height: auto !important; max-height: 70mm !important; }
    .rgu-home .snap-x {
        display: block !important;
    }
    .rgu-home .snap-center { display: flow-root; break-inside: avoid; margin-bottom: 4mm; }
    .rgu-home .snap-center .aspect-square {
        float: left;
        width: 35mm;
        height: 35mm !important;
        margin-right: 4mm;
        aspect-ratio: auto !important;
    }
    .notice-card, .rgu-home :is(.news-item-sm, .news-item-lg, .recruitment-item) {
        break-inside: avoid;
    }
    .grid:has(> .notice-card), .wrapper .grid:has(> div > h4) { display: block !important; }
    .notice-card, .wrapper .grid > div:has(> h4) { margin-bottom: 4mm; }
    .wrapper .grid > div:has(> h4) { break-inside: avoid; padding: 4mm !important; }
    .recruitment-img { display: none !important; }
    .recruitment-img + div {
        position: static !important;
        transform: none !important;
        margin-bottom: 4mm;
    }

    /* Lay out the existing carousel items on paper without the moving track. */
    .rgu-home .swiper, .rgu-home .swiper-wrapper, .owl-stage-outer, .owl-stage {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
    }
    .rgu-home .swiper-slide, .owl-item {
        display: inline-block !important;
        vertical-align: top;
        width: 46% !important;
        height: auto !important;
        margin: 0 1% 4mm !important;
        break-inside: avoid;
    }
    .owl-item.cloned { display: none !important; }
    .rgu-home .folio-card { height: auto !important; border-radius: 3mm; }
    .rgu-home .card-header-block { display: none; }
    .rgu-home .institutional-seal { margin-top: 3mm; }
    .rgu-home .logoSwiper .swiper-slide { width: 30% !important; }
    .rgu-home .logo-pedestal { width: auto; height: 25mm; padding: 2mm; }
    .rgu-home .container { padding-block: 3mm !important; }
    .rgu-home .affiliated-college-bg, .rgu-home .affiliated-college-bg .relative {
        padding-block: 3mm !important;
    }
    .rgu-home .affiliated-college-bg a { position: static !important; }
    .rgu-home .grid:has(> .news-item-lg) { display: block !important; }
    .rgu-home .news-item-lg [style*="background-image"] {
        height: 40mm !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .grid:has(> .event-card) { display: block !important; }
    .event-card { display: flow-root; height: auto !important; break-inside: avoid; margin-bottom: 4mm; }
    .event-card > div:first-child { float: left; width: 35mm; margin-right: 3mm; }
    .event-card img { height: auto !important; max-height: 35mm !important; }
    .event-card > div:last-child { padding: 3mm !important; }
    .event-card .date-col { flex-shrink: 0; }

    h1 { font-size: 22pt !important; line-height: 1.2 !important; }
    h2 { font-size: 17pt !important; line-height: 1.3 !important; }
    h3 { font-size: 13pt !important; line-height: 1.3 !important; }
    h4 { font-size: 11pt !important; line-height: 1.3 !important; }
    h1, h2, h3, h4 { letter-spacing: normal !important; overflow-wrap: anywhere; }
    h1, h2, h3, h4, summary, label { break-after: avoid; break-inside: avoid; }
    p, li { orphans: 3; widows: 3; }
    a, p, li, td, th { overflow-wrap: anywhere; }
    img, svg { max-width: 100% !important; }
    img { object-fit: contain !important; filter: none !important; break-inside: avoid; }
    img[class*="min-h-"] { min-height: 0 !important; height: auto !important; max-height: 150mm; }

    /* Screen columns and horizontal scrolling cannot paginate reliably. */
    [class~="columns-1"] {
        columns: auto !important;
        width: 100% !important;
    }
    [class~="columns-1"] > div { break-inside: avoid; margin-bottom: 5mm !important; }
    [class~="columns-1"] img { width: auto !important; max-height: 45mm !important; }
    [class~="overflow-x-auto"], .table-responsive {
        display: block !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    [class~="overflow-x-auto"] > * { min-width: 0 !important; }
    .help-grid { display: block !important; }
    .help-panel { break-inside: avoid; }

    :root table, :root .text-content-block table, :root .accordion-content table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }
    :root table :is(th, td), :root .text-content-block table :is(th, td),
    :root .accordion-content table :is(th, td) {
        width: auto !important;
        min-width: 0 !important;
        padding: 2mm !important;
        font-size: 9.5pt !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        border: 1px solid #777 !important;
        color: #111 !important;
        -webkit-text-fill-color: #111 !important;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { break-inside: avoid; }

    form div:has(> label[for]), #dynamic-form .row > [class*="col-"] {
        break-inside: avoid;
    }
    #dynamic-form .row { display: block !important; }
    #dynamic-form .row > [class*="col-"] { width: 100% !important; }
    input:not([type="hidden"]), select, textarea {
        max-width: 100% !important;
        border-color: #777 !important;
    }
    #helpdesk [class~="p-8"] { padding: 4mm !important; }
    #create-support-ticket > * + * { margin-top: 4mm !important; }
}
