/* ==========================================================================
   print.css (FINAL v8) - kolkatacustoms.gov.in
   <link rel="stylesheet" href="/front/assets/css/print.css" media="print">
   Include on EVERY layout (home, inner pages, e-helpline). Use with print.js v8.
   Chrome / Edge / Firefox / Safari. @page stays OUTSIDE @media print.
   ========================================================================== */

@page { size: A4 landscape; margin: 6mm; }

/* 1. Colors exact, no animation -------------------------------------------- */
*, *::before, *::after {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
  color-adjust: exact !important;
  animation: none !important;
  transition: none !important;
}
html, body {
  width: 100% !important; height: auto !important; min-height: 0 !important;
  overflow: visible !important; margin: 0 !important; padding-top: 0 !important;
}
main, #wrapper, .wrapper, .page-wrapper, .page-content { margin-top: 0 !important; padding-top: 0 !important; }
[class*="spacer"], [class*="header-space"], [class*="header-height"],
.preloader, #preloader, .loader { display: none !important; }

/* 2. Reveal / lazy elements visible ---------------------------------------- */
[data-aos], .aos-init, .aos-animate, .wow, .animated, .fadeIn, .fadeInUp,
.fadeInLeft, .fadeInRight, .reveal, .lazy, .lazyload, .lazyloaded, .lazyloading,
.owl-item, .slick-slide, .swiper-slide, picture, figure {
  opacity: 1 !important; visibility: visible !important; transform: none !important;
  filter: none !important; content-visibility: visible !important;
}

/* 3. HIDE ------------------------------------------------------------------ */
.scroll-top, .scroll-to-top, .scrollup, #scrollUp, #scroll-top, #back-to-top,
.back-to-top, .go-top, .progress-wrap, .scrollToTop,
.accessibility-widget, .accessibility-btn, .accessibility-toggle, .a11y,
#accessibility, [class*="accessib"],
[class*="pause"], [class*="play-btn"],
.navbar-toggler, [class*="hamburger"], [class*="menu-toggle"], [class*="mobile-menu"],
[class*="menu-btn"], [class*="nav-toggle"], [class*="sidebar-toggle"],
.slick-arrow, .slick-dots, .owl-nav, .owl-dots,
.swiper-button-next, .swiper-button-prev, .swiper-pagination,
.carousel-control-prev, .carousel-control-next, .carousel-indicators,
.cookie-banner, .skip-link, .skip-to-content, video, iframe,
.slick-cloned, .owl-item.cloned, .swiper-slide-duplicate,
[data-slick-index^="-"], .cloned,
.slider-nav, .slider-thumbs, [class*="thumbnail-slider"], [class*="thumb-slider"],
.print-hide, .print-dup, .print-off,
/* header menu (not useful on paper) */
.navbar-collapse, .navbar-nav, header ul, header nav ul,
.main-menu, [class*="main-menu"], [class*="nav-menu"], [class*="menu-list"],
.dropdown-menu, .sub-menu, .submenu, nav ul ul,
/* search / filters / table overlays */
header form, header [class*="search"], .top-bar [class*="search"], [class*="top-bar"] [class*="search"],
input[type="search"], [class*="search-box"], [class*="search-form"], [class*="search-bar"], [class*="search-input"],
.nav-tabs, .nav-pills,
.dataTables_processing, .dt-processing, [class*="processing"] {
  display: none !important;
}

/* 4. Fixed / sticky must not repeat ---------------------------------------- */
header, .header, .sticky-header, .is-sticky, .sticky-top, .fixed-top,
.navbar-fixed-top, [style*="position: fixed"], [style*="position:fixed"] {
  position: relative !important;
  top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
  transform: none !important;
}

/* 5. Page-break rules (small things only; big blocks are relaxed by print.js) */
h1, h2, h3, h4, h5, h6 { break-after: avoid; page-break-after: avoid; }
img, svg, picture, figure, tr, blockquote, li,
.card, [class*="card"], [class*="-box"], [class*="_box"], [class*="-item"], [class*="_item"],
[class*="service-"], [class*="officer"] {
  break-inside: avoid; page-break-inside: avoid;
}
section, .section { break-inside: auto; }
.pg-big { break-inside: auto !important; page-break-inside: auto !important; }

/* ==========================================================================
   6. IMAGES
   ========================================================================== */
img:not([src*="bg-hover"]), picture img:not([src*="bg-hover"]) {
  display: block; max-width: 100% !important; max-height: 180mm; height: auto;
  object-fit: contain; opacity: 1 !important; visibility: visible !important;
  background: none; color: transparent; font-size: 0;
}
img[loading="lazy"], img[data-src], img[data-lazy-src] { min-height: 8mm; }
.img-broken { display: none !important; }
header img, footer img, [class*="logo"] img, [class*="icon"] img { width: auto; max-height: 22mm; }

[style*="background-image"], [data-background], [data-bg] {
  background-repeat: no-repeat !important; background-position: center center !important;
  background-size: cover !important; min-height: 30mm;
}
[class*="team"] img, [class*="officer"] img, [class*="commissioner"] img, .about img, [class*="about"] img {
  width: 100% !important; height: auto !important; max-height: 70mm;
  object-fit: cover; object-position: center top;
}

/* ==========================================================================
   7. LAYOUT FALLBACK (desktop-like even on narrow print width)
   ========================================================================== */
.container, .container-fluid, .container-lg, .container-xl, .container-xxl {
  width: 100% !important; max-width: 100% !important; padding-left: 4mm !important; padding-right: 4mm !important;
}
.row { display: flex !important; flex-wrap: wrap !important; }
.row > [class*="col"] { float: none !important; }
[class*="col-lg-12"], [class*="col-md-12"], [class*="col-xl-12"] { flex: 0 0 100% !important; max-width: 100% !important; }
[class*="col-lg-9"],  [class*="col-md-9"],  [class*="col-xl-9"]  { flex: 0 0 75% !important;  max-width: 75% !important; }
[class*="col-lg-8"],  [class*="col-md-8"],  [class*="col-xl-8"]  { flex: 0 0 66.666% !important; max-width: 66.666% !important; }
[class*="col-lg-6"],  [class*="col-md-6"],  [class*="col-xl-6"]  { flex: 0 0 50% !important;  max-width: 50% !important; }
[class*="col-lg-4"],  [class*="col-md-4"],  [class*="col-xl-4"]  { flex: 0 0 33.333% !important; max-width: 33.333% !important; }
[class*="col-lg-3"],  [class*="col-md-3"],  [class*="col-xl-3"]  { flex: 0 0 25% !important;  max-width: 25% !important; }
[class*="col-lg-2"],  [class*="col-md-2"],  [class*="col-xl-2"]  { flex: 0 0 16.666% !important; max-width: 16.666% !important; }

/* Header = top bar + logo row only */
header .container, header .row, .top-bar .container {
  display: flex !important; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
html { font-size: 14px; }
p, li { orphans: 3; widows: 3; }
.text-center { text-align: center !important; }
[class*="title"]::after, [class*="heading"]::after { display: block; }

/* ==========================================================================
   8. TABLES - all data, readable columns
   ========================================================================== */
.table-responsive, [class*="table-responsive"], [class*="table-wrap"], [class*="table-container"],
.dataTables_wrapper, .dataTables_scroll, .dataTables_scrollBody, .dt-container, .dt-scroll, .dt-scroll-body,
.overflow-auto, .overflow-x-auto, .overflow-y-auto, .overflow-scroll,
[style*="overflow-x"], [style*="overflow-y"], [style*="overflow: auto"], [style*="overflow:auto"],
[style*="overflow: scroll"], [style*="overflow:scroll"] {
  overflow: visible !important; height: auto !important; max-height: none !important;
  width: 100% !important; max-width: 100% !important;
}
table, .table, [class*="table"], .dataTables_wrapper { break-inside: auto !important; page-break-inside: auto !important; }
table, .table, table.dataTable {
  width: 100% !important; max-width: 100% !important; table-layout: auto !important;
  border-collapse: collapse !important; font-size: 9pt; margin: 0 0 4mm !important;
}
/* NOTE: overflow-wrap:break-word (not "anywhere") - "anywhere" shrinks columns to 1 letter */
th, td, table.dataTable th, table.dataTable td {
  white-space: normal !important; word-break: normal !important; overflow-wrap: break-word !important;
  overflow: visible !important; text-overflow: clip !important; max-width: none !important; height: auto !important;
  padding: 1.5mm 2mm !important; border: 0.25mm solid #888; vertical-align: top;
}
/* Sl. No., dates, short codes: one line (print.js adds .pg-short to cells with <= 14 characters) */
th.pg-short, td.pg-short { white-space: nowrap !important; width: 1%; }
thead { display: table-header-group !important; }
tfoot { display: table-footer-group !important; }
tr { break-inside: avoid !important; page-break-inside: avoid !important; }
tbody tr, table.dataTable tbody tr { display: table-row !important; }
td[class*="d-none"], th[class*="d-none"], td.dtr-hidden, th.dtr-hidden, td.hidden, th.hidden,
td[class*="hidden-xs"], th[class*="hidden-xs"], td[class*="hidden-sm"], th[class*="hidden-sm"] { display: table-cell !important; }
tr.child, .dtr-control::before { display: none !important; }
.dataTables_length, .dataTables_filter, .dataTables_paginate, .dataTables_info,
.dt-buttons, .dt-search, .dt-length, .dt-paging, .dt-info,
.pagination, nav[aria-label*="agination"], .page-item { display: none !important; }
table.dataTable thead .sorting::before, table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before, table.dataTable thead .sorting_desc::after { display: none !important; }

/* ==========================================================================
   9. NO-JS FALLBACK for sliders (print.js normally replaces them with .pg-wrap lists)
   ========================================================================== */
.slick-track, .owl-stage, .swiper-wrapper {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4mm;
  width: 100% !important; height: auto !important; transform: none !important;
}
.slick-slide, .owl-item, .swiper-slide {
  display: block !important; width: 100% !important; height: auto !important; float: none !important; margin: 0 !important;
}
.slick-list, .owl-stage-outer { height: auto !important; overflow: visible !important; }
[class*="news"] :is(.slick-track, .owl-stage, .swiper-wrapper) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important; align-items: start !important;
}
[class*="news"], [class*="news"] * { min-width: 0; text-overflow: clip !important; overflow-wrap: break-word; }
[class*="news"] :is(p, a, span, div, h3, h4, h5, h6, li) {
  white-space: normal !important; max-width: 100% !important;
  -webkit-line-clamp: unset !important; line-clamp: unset !important; max-height: none !important;
}
[class*="news"] :is(p, div) { -webkit-box-orient: initial !important; }
[class*="news"] [class*="date"] { white-space: nowrap !important; }

/* ==========================================================================
   10. PAGE BREAKS for big containers
   ========================================================================== */
section, .section, .row, main, .container, .container-fluid,
[class*="services"], [class*="-area"], [class*="-wrapper"], [class*="-section"],
[class*="slider"], [class*="carousel"], [class*="list"], [class*="grid"] {
  break-inside: auto !important; page-break-inside: auto !important;
}
.row > [class*="col"] { break-inside: auto; }
h1, h2, h3, h4 { break-after: avoid !important; page-break-after: avoid !important; }
/* no forced page breaks coming from the site's own CSS */
* { break-before: auto !important; page-break-before: auto !important; }
.pg-keep-next { break-after: avoid !important; page-break-after: avoid !important; }

/* ==========================================================================
   11. LISTS BUILT BY print.js (float layout = fragments correctly in every browser)
       .pg-c2 banners / news, .pg-c4 boxes / gallery, .pg-c6 logo strips
       (kept near the end so they win over site-class rules)
   ========================================================================== */
.pg-wrap {
  display: block !important; position: static !important; width: 100% !important;
  height: auto !important; min-height: 0 !important; max-height: none !important;
  overflow: visible !important; transform: none !important;
  padding: 3mm 4mm !important; box-sizing: border-box;
  break-inside: auto !important; page-break-inside: auto !important;
}
.pg-wrap::after { content: ""; display: block; clear: both; }
.pg-wrap > .pg-cell, .pg-wrap > .pn-cell {
  float: left !important; clear: none; min-width: 0 !important; height: auto !important;
  box-sizing: border-box; position: relative !important;
  opacity: 1 !important; visibility: visible !important; transform: none !important;
  margin: 0 2% 3mm 0 !important;
  break-inside: avoid !important; page-break-inside: avoid !important;
}
.pg-c2 > .pg-cell, .pg-c2 > .pn-cell { width: 49% !important; max-width: 49% !important; }
.pg-c2 > :nth-child(2n+1) { clear: left !important; }
.pg-c2 > :nth-child(2n)   { margin-right: 0 !important; }
.pg-c4 > .pg-cell, .pg-c4 > .pn-cell { width: 23.5% !important; max-width: 23.5% !important; }
.pg-c4 > :nth-child(4n+1) { clear: left !important; }
.pg-c4 > :nth-child(4n)   { margin-right: 0 !important; }
.pg-c6 > .pg-cell, .pg-c6 > .pn-cell { width: 15% !important; max-width: 15% !important; }
.pg-c6 > :nth-child(6n+1) { clear: left !important; }
.pg-c6 > :nth-child(6n)   { margin-right: 0 !important; }

.pg-cell { border: 0.3mm solid #ddd; background: #fff; }
.pg-cell img.pg-img {
  display: block; position: static !important; width: 100% !important; height: auto !important;
  max-width: 100% !important; max-height: none !important; font-size: 0;
}
.pg-wrap [class*="gallery"] img, .pg-wrap img[class*="gallery"] { width: 100% !important; height: 55mm !important; object-fit: cover; }

/* Full-screen sections (100vh) must not force blank gaps / jump to the next page.
   Generic reset first; elements with an inline background image keep their own min-height (rule above). */
main, section, article, .section, [class*="-section"], [class*="-area"], [class*="-wrapper"],
[class*="content"], [class*="page-"] { min-height: 0 !important; }
/* print.js adds .pg-novh to any block it finds with min-height / height ~ 100vh */
.pg-novh { min-height: 0 !important; height: auto !important; }
.pg-nopad { margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 5mm !important; padding-bottom: 5mm !important; }
[style*="background-image"], [data-background], [data-bg] { min-height: 30mm !important; }

/* Tighter section spacing on paper (screen paddings of 60-100px create blank bands).
   Banners / hero / breadcrumbs / inline-background blocks keep their own height. */
section:not([class*="banner"]):not([class*="hero"]):not([class*="breadcrumb"]):not([style*="background-image"]),
.section:not([class*="banner"]):not([class*="hero"]):not([class*="breadcrumb"]):not([style*="background-image"]),
[class*="-section"]:not([class*="banner"]):not([class*="hero"]):not([class*="breadcrumb"]):not([style*="background-image"]),
[class*="_section"]:not([class*="banner"]):not([class*="hero"]):not([class*="breadcrumb"]):not([style*="background-image"]),
[class*="-area"]:not([class*="banner"]):not([class*="hero"]):not([class*="breadcrumb"]):not([style*="background-image"]) {
  padding-top: 5mm !important; padding-bottom: 5mm !important;
  margin-top: 0 !important; margin-bottom: 0 !important;
}

/* ==========================================================================
   12. DUPLICATE / HIDDEN ITEMS - most specific selector, always wins
   ========================================================================== */
html body .print-dup.print-dup,
html body .print-hide.print-hide,
html body .print-off.print-off,
html body .pg-orig.pg-orig,
html body .img-broken.img-broken,
html body .slick-cloned.slick-cloned,
html body .owl-item.cloned.cloned,
html body .swiper-slide-duplicate.swiper-slide-duplicate {
  display: none !important; visibility: hidden !important; height: 0 !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important;
}

/* 13. Footer / links / end -------------------------------------------------- */
footer, .footer, .site-footer { break-inside: avoid; page-break-inside: avoid; }
a[href]::after { content: none !important; }
body > *:last-child { margin-bottom: 0 !important; padding-bottom: 0 !important; }