MediaWiki:Print.css

From softwear.directory
Revision as of 13:42, 26 August 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 — Print stylesheet (A4, narrow column)
   One-column ~half A4 width, compact type to fit on 1 page
   ============================ */

/* 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;
  font-size: 10.5pt;     /* compact base */
  line-height: 1.2;
}

/* 4) Page + narrow container (A4 portrait) */
@page { size: A4 portrait; margin: 10mm; }

/* Keep selector name for compatibility with your HTML */
.entry-wrapper.print-a5 {
  width: 100mm;          /* ≈ half of printable A4 width (after margins) */
  box-sizing: border-box;
  margin: 0 auto;        /* center column on page */
  padding: 3mm;
}

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

/* === Hairline rules via pseudo-element (Chrome/Edge) === */
.article-entry-number,
.link-pdf,
.article-type,
.article-metadata,
.article-images,
.article-description,
.article-reflection,
.article-external-reference,
.article-quote,
.article-mod-line {
  position: relative;
  padding-bottom: 5px;          /* was 7px */
  border-bottom: none !important;/* clear any old borders */
}

.article-entry-number::after,
.link-pdf::after,
.article-type::after,
.article-metadata::after,
.article-images::after,
.article-description::after,
.article-reflection::after,
.article-external-reference::after,
.article-quote::after,
.article-mod-line::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;                  /* device pixel */
  background: #292828;          /* match your ink */
  transform: scaleY(0.5);       /* render as ~0.5px hairline */
  transform-origin: 50% 100%;
}

/* === Firefox-only fallback (pseudo hairline can be too thin/missing) === */
@-moz-document url-prefix() {
  .article-entry-number::after,
  .link-pdf::after,
  .article-type::after,
  .article-metadata::after,
  .article-images::after,
  .article-description::after,
  .article-reflection::after,
  .article-external-reference::after,
  .article-quote::after,
  .article-mod-line::after {
    content: none !important;   /* turn off the pseudo line in Firefox */
  }

  .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;  /* override earlier “none” */
  }

  /* no rule on very last block in Firefox */
  #article-content > :last-child { border-bottom: 0 !important; }
}

/* 7) Entry number row */
.article-entry-number {
  font-size: 12px;       /* was 16px */
  line-height: 16px;     /* was 23px */
  letter-spacing: 0;
  margin: 0;
}

/* 8) Centered link row ([PDF⤴] [WEB⤴]) */
.link-pdf {
  text-align: center;
  color: #292828 !important;
  text-decoration: none;
  margin: 2px 0 0 0;     /* was 4px */
  padding-top: 0;
}
.link-pdf a, .link-pdf p {
  display: inline-block;
  text-decoration: none;
  color: #292828 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 9) Type line */
.article-type {
  font-size: 12px;       /* was 16px */
  line-height: 1;
  letter-spacing: 0;
  margin: 0;
  padding-top: 4px;      /* was 7px */
  color: #292828 !important;
}
.article-type a { text-decoration: none; color: #292828 !important; }

/* 10) Metadata grid */
.article-metadata,
.article-metadata * {
  margin: 0 !important;
  border: none;
  background: none;
}
.article-metadata {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5mm;                /* was 2mm */
  padding-top: 6px;          /* was 11px */
  line-height: 1 !important;
}
.article-metadata-label {
  font-size: 10px;           /* was 13px */
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.article-metadata-value {
  font-size: 12px;           /* was 15px */
  text-transform: capitalize;
}
.article-metadata-value a {
  color: #292828 !important;
  text-decoration: none;
}

/* 11) Images */
.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: 45mm;          /* was 85mm */
  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 !important;
  font-size: 9pt;
  color: #555;
  text-align: left;
  width: 100%;
}
.caption-image1:empty { display: none; }

/* 12) Labels & bodies */
.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; /* was 10px */
  padding: 0 !important;
  text-indent: 28px;            /* was 35px */
  line-height: 1;
  font-size: 11px;              /* was 14px */
  letter-spacing: 0.3px;
  break-after: avoid; page-break-after: avoid;
}
.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: 8px !important;   /* was 10px */
}
.article-description,
.article-reflection,
.article-external-reference,
.article-quote,
.article-mod-line {
  text-indent: 28px;            /* was 35px */
  line-height: 1.2;             /* was 1.3 */
  font-size: 14px;              /* was 20px */
  letter-spacing: 0.4px;        /* was 0.8px */
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.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 + .article-modification-date {
  break-before: avoid; page-break-before: avoid;
}

/* 13) Quote */
.article-quote {
  font-size: 16px;            /* was 26px */
  line-height: 1.1;
  letter-spacing: 0.6px;
  font-style: italic;
}

/* 14) Mod line */
.article-mod-line {
  white-space: nowrap;
  color: grey;
  line-height: 1;
  font-size: 11px;            /* was 14px */
  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: 6px; }
.article-modification-date { font-size: 11px; letter-spacing: 0.3px; }

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

/* 16) 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: 13px;            /* was 17px */
  line-height: 1.1;           /* was 1 */
  letter-spacing: 0;
}

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

/* 18) Prevent bad splits */
#article-title,
.article-title-link,
.article-metadata,
.article-images { break-inside: avoid; page-break-inside: avoid; }

/* === Chrome/Blink-specific print overrides === */
@media print and (-webkit-min-device-pixel-ratio:0) {
  /* Let Chrome break more naturally — prevent giant gaps */
  .article-label-description,
  .article-label-reflection,
  .article-label-external-reference,
  .article-label-quote,
  .article-label-modification-date {
    break-after: auto !important;
    page-break-after: auto !important;
  }

  .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 + .article-modification-date {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  /* Help reduce awkward splits inside paragraphs */
  .article-description p,
  .article-reflection p,
  .article-external-reference p,
  .article-quote p {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Optional emergency shrink for extreme cases (non‑standard) */
  /* .entry-wrapper.print-a5 { zoom: 0.95; } */
}