MediaWiki:Print.css

From softwear.directory
Revision as of 14:25, 2 September 2025 by Admin (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* ===========================
   Softwear — A4 Narrow Print (compact, cleaned)
   =========================== */

/* 1) Font face */
@font-face {
  font-family: 'HALColant-TextRegular';
  src: url('/fonts/HALColant-TextRegular.woff2?v=20250820') format('woff2'),
       url('/fonts/HALColant-TextRegular.woff?v=20250820') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 2) Print color fidelity */
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* 3) Base visibility & typography */
.print-only { display: block !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'HALColant-TextRegular', Georgia, "Times New Roman", serif;
  color: #292828 !important;
  background: #fff !important;
}

/* 4) Page & narrow column — A4 portrait; 12mm outer margin; 93mm column */
@page { size: A4 portrait; margin: 12mm; }

.entry-wrapper.print-a4-narrow {
  box-sizing: border-box;
  width: 93mm;
  margin: 0 auto;
  padding: 3mm;
}

/* 5) Titles & people (compact) */
.article-title {
  font-size: 16px;
  line-height: 18px;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0;
}
.article-people {
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0.4px;
  text-align: center;
  text-decoration: underline;
  margin: 0;
  padding-top: 6px;
}
.article-people a { text-decoration: underline; color: #292828 !important; }

/* 6) Entry number row */
.article-entry-number { font-size: 12px; line-height: 16px; margin: 0; }

/* 7) Centered link row */
.link-pdf {
  text-align: center;
  color: #292828 !important;
  text-decoration: none;
  margin: 2px 0 0 0;
  padding-top: 0;
}
.link-pdf a, .link-pdf p {
  display: inline-block;
  text-decoration: none;
  color: #292828 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 8) Type line */
.article-type {
  font-size: 12px;
  line-height: 1.1;
  margin: 0;
  padding-top: 4px;
  color: #292828 !important;
}
.article-type a { text-decoration: none; color: #292828 !important; }

/* 9) Metadata grid (compact) */
.article-metadata,
.article-metadata * { margin: 0 !important; border: none; background: none; }

.article-metadata {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5mm;
  padding-top: 6px;
  line-height: 1.05 !important;
}
.article-metadata-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.article-metadata-value { font-size: 11px; text-transform: capitalize; }
.article-metadata-value a { color: #292828 !important; text-decoration: none; }

/* 10) Images (shorter to favor text) */
.article-metadata + .article-images { margin-top: 0 !important; padding-top: 0 !important; }
.article-images { margin: 0 !important; padding-top: 0 !important; }

.article-images .image-container {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 !important;
  padding: 0 !important;
}
.article-images .image-container img,
.image-container img {
  display: block;
  max-height: 60mm;
  height: auto;
  width: auto;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
  line-height: 0;
}
.caption-image1 {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.1 !important;
  font-size: 8px;
  color: #555;
  text-align: left;
  width: 100%;
}
.caption-image1:empty { display: none; }

/* 11) Labels & bodies (compact) */
.article-label-description,
.article-label-reflection,
.article-label-external-reference,
.article-label-quote,
.article-label-modification-date {
  text-transform: uppercase;
  margin: 6px 0 0 0 !important;
  padding: 0 !important;
  text-indent: 20px;
  line-height: 1.05;
  font-size: 10px;
  letter-spacing: 0.4px;
}

.article-metadata + .article-label-description,
.article-images + .article-label-description,
.article-description + .article-label-reflection,
.article-reflection + .article-label-external-reference,
.article-external-reference + .article-label-quote,
.article-quote + .article-label-modification-date { margin-top: 6px !important; }

.article-description,
.article-reflection,
.article-external-reference,
.article-quote,
.article-mod-line {
  text-indent: 20px;
  line-height: 1.15;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 12) Quote */
.article-quote { font-size: 13px; line-height: 1.2; font-style: italic; }

/* 13) Mod line */
.article-mod-line {
  white-space: nowrap;
  color: grey;
  line-height: 1.05;
  font-size: 10px;
  letter-spacing: 0.3px;
  margin: 5px 0 0 0 !important;
  padding-top: 0 !important;
}
.article-mod-line > span { display: inline; margin: 0; padding: 0; }
.article-mod-line > span + span { margin-left: 4px; }
.article-modification-date { font-size: 11px; letter-spacing: 0.3px; }

/* 14) Vector resets */
.vector-body p { margin: 0 !important; padding: 0 !important; }

/* 15) Links */
a[href]:after { content: none !important; }
.article-external-reference a {
  word-break: break-word;
  overflow-wrap: anywhere;
  text-decoration: none;
  color: #292828 !important;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0;
}

/* 16) Page control defaults */
#article-content { orphans: 2; widows: 2; }

/* 17) Avoid really bad splits for a few blocks */
#article-title,
.article-title-link,
.article-metadata,
.article-images { break-inside: avoid; page-break-inside: avoid; }

/* 18) Print-only column enforcement + border toggle */
@media print {
  /* Column width + centering */
  .entry-wrapper.print-a4-narrow,
  .print-only.entry-wrapper,
  .print-only .entry-wrapper {
    width: 93mm !important;
    max-width: 93mm !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  .print-only {
    width: 93mm !important;
    max-width: 93mm !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  .print-only *, .entry-wrapper.print-a4-narrow * { max-width: 100% !important; }
  .print-only .mw-body,
  .print-only .vector-body,
  .print-only .content,
  .print-only .list-container,
  .print-only table { width: auto !important; max-width: 100% !important; }
  .print-only img { width: auto !important; max-width: 100% !important; height: auto !important; }

  /* Border: default WITH; disable by adding .print-no-border on <html> in the iframe */
  html:not(.print-no-border) .print-only .entry-wrapper,
  html:not(.print-no-border) .entry-wrapper.print-a4-narrow,
  html:not(.print-no-border) .entry-wrapper.print-a5 {
    border: 0.5pt solid #292828 !important;
    box-sizing: border-box !important;
    background-clip: padding-box;
    padding: 3mm;
  }
  html.print-no-border .print-only .entry-wrapper,
  html.print-no-border .entry-wrapper.print-a4-narrow,
  html.print-no-border .entry-wrapper.print-a5 {
    border: 0 !important;
    padding: 0 !important;
  }
}

/* 19) Section rules: ONE consistent line under rows/bodies (no ::after tricks) */
@media print {
  /* Lines under these “rows” */
  .article-entry-number,
  .link-pdf,
  .article-type,
  .article-metadata,
  .article-images,
  .article-description,
  .article-reflection,
  .article-external-reference,
  .article-quote,
  .article-mod-line {
    border-bottom: 0.5pt solid #292828 !important;
    padding-bottom: 6px !important;
  }

  /* Labels show no line (prevents double lines) */
  .article-label-description,
  .article-label-reflection,
  .article-label-external-reference,
  .article-label-quote,
  .article-label-modification-date {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Don’t draw a line under the last item */
  #article-content > :last-child { border-bottom: 0 !important; }
}

/* 20) Paragraph fragmentation (single, consolidated block) */
@media print {
  .article-description p,
  .article-reflection p,
  .article-external-reference p,
  .article-quote p {
    break-inside: auto !important;
    page-break-inside: auto !important;
    orphans: 2 !important;
    widows: 2 !important;
    margin: 0 0 1.2mm !important;
  }
  .article-description p:last-child,
  .article-reflection p:last-child,
  .article-external-reference p:last-child,
  .article-quote p:last-child {
    margin-bottom: 0 !important;
  }
}

/* 21) Entry page: unblock pagination + hide UI */
@media print {
  html, body,
  #show-article-wrapper-entry,
  #show-article,
  #article-content,
  #content, .mw-body, .vector-body, #mw-content-text {
    display: block !important;
    overflow: visible !important;
    contain: none !important;
    max-height: none !important;
  }
  /* Ensure children can fragment; prevents “big white gap then push to next page” */
  #article-content > * {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
  /* Hide print UI chrome */
  #print-chooser, #print-options { display: none !important; }
}

/* 22) Firefox: real thin borders (kept simple; still consistent with 0.5pt) */
@-moz-document url-prefix() {
  @media print {
    .article-entry-number,
    .link-pdf,
    .article-type,
    .article-metadata,
    .article-images,
    .article-description,
    .article-reflection,
    .article-external-reference,
    .article-quote,
    .article-mod-line {
      border-bottom: 0.5pt solid #292828 !important;
    }
    #article-content > :last-child { border-bottom: 0 !important; }
  }
}