/* 
 * JNU Website - A4 Print View Stylesheet (Refined Design)
 * 
 * Optimized for exact matching with screen design:
 * - Dark blue title bars
 * - Colored table headers
 * - Distinctive "S.No." column
 * - Preserved metadata colors (Red/Blue)
 * - Removed link expansion (URLs)
 */

@page {
  size: A4;
  margin: 10mm;
}

/* General Page Reset */
body {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #333 !important;
  background: #fff !important;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
  font-size: 10.5pt !important;
  line-height: 1.4 !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* --- Layout Constraints & Positioning (RESET STICKY) --- */
.container, 
.container-fluid, 
.row, 
.col-md-12, 
.col-md-9, 
.col-md-4, 
.col-md-3,
.main-container,
header,
.topstrip,
nav,
.stellarnav {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  float: none !important;
  position: static !important; /* Forces sticky/fixed headers to stay at top of first page */
}

/* --- Elements to Hide (Navigation/Interactive/Metadata) --- */
.stellarnav,
.primary_menu,
.searchlt,
#backLink,
.sliderrsec,
.footertopsec,
.footersec,
#toolbar,
.tabs,
.shortcut-action,
.contextual-region,
.contextual,
.breadcrumb, /* Hide duplicate "Notices" titles from breadcrumbs */
.links,
.more-link,
#toggleTextSpace,
#header_icon_1,
#header_icon_2,
#header_icon_3,
.topstripright ul,
.topstrip,
.region-content-top,
.url,
#scrollTopBtn,
#back-to-top,
.back-link,
button.close,
.modal-backdrop {
  display: none !important;
  height: 0 !important;
  visibility: hidden !important;
  overflow: hidden !important;
}

/* --- Branding & Titles (Exact Match) --- */
.logo {
  display: block !important;
  margin-bottom: 20px !important;
  padding: 10px 0 !important;
  border-bottom: 1px solid #eee !important;
  position: static !important;
}

.logo img {
  max-width: 250px !important;
  height: auto !important;
}

/* Page Title with Dark Blue Bar */
.page_title, 
.region-page-titles, 
#block-jnu-page-title,
h1.page-title {
  background-color: #1b374c !important; 
  color: #fff !important;
  padding: 10px 15px !important;
  margin: 20px 0 10px 0 !important;
  font-size: 18pt !important;
  font-weight: bold !important;
  text-align: left !important;
  display: block !important;
  width: 100% !important;
  position: static !important;
  clear: both !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* --- Table Styling (Exact Match) --- */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-top: 20px !important;
  border: 1px solid #ccc !important;
  table-layout: auto !important;
}

/* Header styling */
table thead th,
table.views-table thead th {
  background-color: #bdc3c7 !important; 
  color: #000 !important;
  font-weight: bold !important;
  padding: 12px 8px !important;
  border: 1px solid #ccc !important;
  text-align: left !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* S.No. Column Styling (First column) */
table tbody td:first-child,
table.views-table tbody td.views-field-counter,
table.views-table thead th:first-child {
  background-color: #1b374c !important; 
  color: #fff !important;
  font-weight: bold !important;
  text-align: center !important;
  width: 45px !important;
  padding: 10px 5px !important;
  border: 1px solid #1b374c !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Row Content & Zebra Striping */
table td {
  padding: 10px 8px !important;
  border: 1px solid #eee !important;
  vertical-align: top !important;
  background-color: transparent !important; /* Neutralize weird highlights */
}

/* Lighter zebra striping for print economy */
table tr.even, table tr:nth-child(even) {
  background-color: #f9f9f9 !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Ensure NO active/hover row is dark blue */
table tr.active, 
table tr:hover, 
table tr.selected {
  background-color: transparent !important;
  color: inherit !important;
}

/* --- Content Metadata (Preserve Colors) --- */
a {
  text-decoration: none !important;
  color: #0051A8 !important; 
  font-weight: bold !important;
}

/* AGGRESSIVE STOP for Link Expansion (URLs/node names) */
a:after, 
a[href]:after, 
a[title]:after {
  content: "" !important;
  display: none !important;
  visibility: hidden !important;
}

/* Red text for Format/Size */
.file-info,
.format-info,
.size-info,
[class*="format"],
[class*="size"] {
  color: #d1123a !important; 
  font-size: 9pt !important;
  font-weight: normal !important;
  display: block !important;
  margin-top: 4px !important;
}

/* --- Page Content Fixes --- */
.homesec2, 
.sec2bx1, 
.main-content,
.region-content {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
  page-break-after: avoid !important;
  margin-top: 15px !important;
  margin-bottom: 10px !important;
}

p, blockquote, ul, ol, table, tr, pre {
  page-break-inside: avoid !important;
}

/* --- Front Page Specifics --- */
.path-frontpage .homesec2,
.path-frontpage .homesec3,
.path-frontpage .homesec4 {
  width: 100% !important;
  display: block !important;
  margin-bottom: 25px !important;
}

.path-frontpage .homesec2 .row .col-md-4 {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
  margin-bottom: 20px !important;
}
