/* ==========================================================================
   WorldAutoSteel – print.css
   Loaded by the theme as worldautosteel-style-print-css (media="print"),
   so no @media print wrapper is needed.
   Built against the Bootstrap 4 markup of /why-steel/lightweight-design/.
   ========================================================================== */

@page {
  size: A4;
  margin: 15mm 14mm 18mm;
}

/* Bootstrap 4's own print styles force a 992px min-width and A3 pages.
   Undo that so the content scales to the paper. */
html,
body,
.container {
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 10.5pt;
  line-height: 1.45;
  color: #000;
  background: #fff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.container {
  /*padding-left: 0 !important;
  padding-right: 0 !important;*/
}



/* --------------------------------------------------------------------------
   1. Hide site chrome, plugins and interactive bits
   -------------------------------------------------------------------------- */
#wpadminbar,
.skip-link,
.cky-overlay,
.cky-btn-revisit-wrapper,
.cky-consent-container,
.cky-modal,
.a2a_kit,
#addtoany,
#wfboxOverlay,
#wordfenceBox,
.gl-modal-overlay,
.gl-play-icon,

/* header: everything except the logo */
#masthead .header-nav,
#masthead .navbar-toggler,
#masthead .navbar-lang,
#masthead .members-login,
#masthead .col-sm-auto.col-auto,

/* footers: opt-in programmes carousel + worldsteel address footer */
.top-footer,
.site-footer,
.pb-5:empty,

/* carousel controls anywhere */
.carousel-indicators,
.carousel-control-prev,
.carousel-control-next,
.slider-controls,

/* white icons on coloured teaser cards would print invisible */
.announcement_icon,

/* empty caption scaffolding */
.caption-bg,
.caption-text:empty,
figcaption:has(.caption-text:empty),

/* utility class for anything else */
.no-print {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. Header: logo only, with a rule underneath
   -------------------------------------------------------------------------- */
#masthead .site-header {
  display: block !important;
  background: none !important;
  padding: 0 0 4mm !important;
  margin: 0 0 4mm !important;
  border-bottom: 0.75pt solid #0056a7;
}

#masthead .header-logo {
  display: block;
  height: 12mm;
  width: auto;
}

#masthead .row {
  margin: 0 !important;
}

/* Breadcrumbs: keep as small context line */
.site-breadcrumbs .breadcrumb {
  background: none !important;
  padding: 0 !important;
  margin: 0 0 3mm !important;
  font-size: 8pt;
  color: #555;
}

.site-breadcrumbs a {
  color: #555 !important;
  text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   3. Keep the Bootstrap grid working on paper
   (A4 is narrower than the md breakpoint, so columns would otherwise stack)
   -------------------------------------------------------------------------- */
.main-content .row {
  display: flex !important;
  flex-wrap: wrap !important;
}

.main-content .col-md-6 {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

.main-content .col-md-12,
.main-content .col {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* Empty spacer columns */
.main-content [class*="col-"]:empty {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. Banner carousel → plain page title
   -------------------------------------------------------------------------- */
   
#main-carousel, .banner-carousel {
  margin-bottom: 4mm !important;
  --caption-width: auto;
  --banner-height: auto;
  --banner-tab-height: auto;
  --banner-mobile-height: auto;
}

.banner-carousel .carousel-item {
  display: none !important;
}

.banner-carousel .carousel-item.active {
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Hide the banner photo. Delete this rule to print it. */
.banner-carousel .embed-responsive {
  display: none !important;
}

.banner-carousel .carousel-caption {
  position: static !important;
  padding: 0 !important;
  background: none !important;
  text-align: left !important;
  color: #000 !important;
}

.banner-carousel .carousel-caption h3 {
  font-size: 22pt;
  line-height: 1.15;
  margin: 0 0 2mm;
  color: #0056a7 !important;
  border: 0 !important;
}

.banner-carousel .carousel-caption hr {
  border-top: 0.75pt solid #0056a7;
  margin: 0;
  width: 25mm;
}

/* --------------------------------------------------------------------------
   5. Teaser cards (bg-azure + text-white): make them readable
   -------------------------------------------------------------------------- */
.announcement_teaser {
  background: #eef4fa !important;
  border: 0 !important;
  border-left: 3pt solid #0056a7 !important;
  border-radius: 0 !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

.announcement_teaser,
.announcement_teaser *,
.main-content .text-white {
  color: #000 !important;
}

.announcement_teaser .card-body {
  padding: 3mm 4mm !important;
}

.announcement_teaser .row {
  margin: 0 !important;
}

.announcement_teaser [class*="col"] {
  padding: 0 !important;
}

.announcement_teaser h3,
.announcement_teaser .h5 {
  font-size: 11pt;
  line-height: 1.4;
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5 {
  break-after: avoid;
  page-break-after: avoid;
  break-inside: avoid;
  page-break-inside: avoid;
}

.main-content h2,
.main-content .h2 { font-size: 15pt; }

.main-content h3,
.main-content .h3 { font-size: 13pt; }

.heading-style-1 {
  color: #0056a7 !important;
}

.main-text p,
.main-text li {
  orphans: 3;
  widows: 3;
}

.mb-4 {
  margin-bottom: 4mm !important;
}

/* --------------------------------------------------------------------------
   7. Links: underline, and show the address of links in body text
   -------------------------------------------------------------------------- */
.main-content a {
  color: #0056a7 !important;
  text-decoration: underline;
}

.main-text a[href^="http"]::after,
.announcement_teaser a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 7.5pt;
  color: #555;
  word-break: break-all;
}

/* Buttons inside content print as plain links */
.main-content .btn {
  display: inline !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  color: #0056a7 !important;
  text-decoration: underline !important;
}

/* --------------------------------------------------------------------------
   8. Images, figures, galleries, tables
   -------------------------------------------------------------------------- */
img {
  max-width: 100% !important;
  height: auto !important;
}

figure,
.figure-image {
  margin: 0 0 4mm !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* stop a half-column image from towering over its text */
.figure-image img {
  max-height: 80mm;
  width: auto !important;
  object-fit: contain;
}

.gl-gallery {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 3mm !important;
}

.gl-item {
  box-shadow: none !important;
  break-inside: avoid;
}

table {
  width: 100% !important;
  border-collapse: collapse;
  font-size: 9pt;
}

thead {
  display: table-header-group;
}

tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

th,
td {
  border: 0.5pt solid #999 !important;
  padding: 1.5mm 2mm !important;
}

/* --------------------------------------------------------------------------
   9. Page-break helpers you can add as extra CSS classes in the editor
   -------------------------------------------------------------------------- */
.page-break-before { break-before: page; page-break-before: always; }
.page-break-after  { break-after: page;  page-break-after: always; }
.avoid-break       { break-inside: avoid; page-break-inside: avoid; }