/* =====================================================================
   eula.css
   ---------------------------------------------------------------------
   The whole stylesheet for a standalone LibreOffice-exported document
   (the EULAs). A SITE-WIDE CUSTOM ASSET, like main.css beside it: it is
   uploaded to the site-assets container, shipped by digest-generator
   (lib/customAssets.js) and linked by every such document at the fixed
   path /custom/css/eula.css. Editing it is a re-upload of that blob --
   no conversion run, and no document's bytes change.

   It lived in format-converter (src/assets/eula.css) until 2026-09-21,
   copied into a css/ folder per version. That made an edit to it
   undeliverable: the converter skips a document whose own bytes have not
   changed, so nothing ever rewrote the copy. See eulaTitleFix.js's
   STYLESHEET_HREF.

   Every EULA page carries the site masthead and Paligo's theme (format-
   converter v9+), and main.css loads through layout-custom-style.css like
   on a topic page; this file only covers what a LibreOffice export needs
   on top. The rules for the old chrome-less pages went with them
   (2026-09-28).

   Contents:
     1. Paragraph rhythm (the empty-paragraph collapse)
     2. EULAs with the site masthead
     3. Print
   ===================================================================== */

/* --- 1. Paragraph rhythm -------------------------------------------- */
/* LibreOffice writes one empty <p><br/></p> per blank line in the source
   document -- about a hundred per EULA, 17% of every paragraph in the
   file -- and pins every real paragraph to `margin-bottom: 0in` inline.
   So all the vertical space comes from empty paragraphs and none from
   paragraph spacing, which reads as a page of stray line breaks.

   format-converter tags the empty ones .lo-blank; they are hidden here
   and ordinary spacing and leading replace them. !important because what
   is being overridden is LibreOffice's inline style attribute on each
   paragraph -- and only those two properties, so the inline margin-left
   that carries list indentation still applies. */
p.lo-blank { display: none; }
body p { margin-bottom: 0.7em !important; }
body p, body li, body dd, body td { line-height: 1.5 !important; }

/* --- 2. EULAs with the site masthead --------------------------------- */
/* Flat white like a Paligo topic: the column geometry comes from Paligo's own theme (body
   .theme1.page-toc + main > article, emitted by format-converter). Title and body type match
   a topic page, using layout-custom-style.css's --zdc-* tokens. */
html:has(> body > header.site-header) { background: #fff; }
body:has(> header.site-header) {
  max-width: none; margin: 0; border: 0; background: #fff;
  padding: var(--ms-chrome-h, 200px) 0 0;
}
/* LibreOffice pins sizes and faces on inline <font> tags (9pt body, 16pt title); let the
   topic-page rules below decide instead. */
body:has(> header.site-header) #topic-content font {
  font-size: inherit !important; font-family: inherit !important; color: inherit !important;
}
/* Paligo's h1.title on a topic page (layout-custom-style.css): 41px / 500, 41px below.
   !important: the export writes line-height and margins inline on the element. */
body:has(> header.site-header) h1[data-eula-title] {
  font-size: 41px !important; font-weight: 500 !important; line-height: 1.1 !important;
  color: var(--zdc-text, #323e48) !important; margin: 0 0 41px !important;
}
body:has(> header.site-header) h1[data-eula-title] b { font-weight: inherit; }
/* Section headings format-converter promotes (TCOM-1417): Paligo's topic h2.title / h3.title
   from layout-custom-style.css. !important: the export writes margins inline on the element. */
body:has(> header.site-header) #topic-content h2[data-eula-heading] {
  font-size: 34px !important; line-height: 40px !important; font-weight: 700 !important;
  color: var(--zdc-title, #323e48) !important; margin: 40px 0 24px !important;
}
body:has(> header.site-header) #topic-content h3[data-eula-heading] {
  font-size: 28px !important; line-height: 34px !important; font-weight: 600 !important;
  color: var(--zdc-text, #323e48) !important; margin: 28px 0 14px !important;
}
body:has(> header.site-header) #topic-content [data-eula-heading] b { font-weight: inherit; }
/* A translated EULA's appended original: an h2 (one h1 per page), drawn like the page title. */
body:has(> header.site-header) #topic-content h2[data-eula-original] {
  font-size: 41px !important; line-height: 1.1 !important; font-weight: 500 !important;
  color: var(--zdc-text, #323e48) !important; margin: 64px 0 41px !important;
}
@media (max-width: 767px) {
  body:has(> header.site-header) #topic-content h2[data-eula-heading] { font-size: 28px !important; line-height: 34px !important; }
  body:has(> header.site-header) #topic-content h3[data-eula-heading] { font-size: 24px !important; line-height: 30px !important; }
}
/* Topic-page body copy. Only the vertical margins are overridden, so LibreOffice's inline
   margin-left (list indentation) still applies. */
body:has(> header.site-header) #topic-content p {
  font-size: var(--zdc-font-size, 16px) !important;
  line-height: var(--zdc-line-height, 23px) !important;
  color: var(--zdc-text, #323e48);
  margin-top: 0 !important; margin-bottom: 16px !important;
}
body:has(> header.site-header) #topic-content li,
body:has(> header.site-header) #topic-content dd,
body:has(> header.site-header) #topic-content td {
  line-height: var(--zdc-line-height, 23px) !important;
}
/* Footer items side by side: Paligo's content-theme2.css / style-common.css rules, which the
   EULA doesn't load (both restyle body content). */
body:has(> header.site-header) .site-footer .copyright,
body:has(> header.site-header) .site-footer .date-modified { float: left; margin-right: 30px; }

/* Right-to-left EULAs: format-converter v15 writes <html dir="rtl"> from the language folder, and
   Paligo's theme mirrors the page chrome from it. The export's own <style> pins every paragraph
   and heading to direction: ltr; text-align: left, over their dir="rtl", so the text needs this. */
html[dir="rtl"] body:has(> header.site-header) #topic-content :is(p, h1, h2, h3, h4, li, dd, td, th) {
  direction: rtl; text-align: right;
}
/* ...except the appended original, which format-converter v16 wraps in its own lang/dir. */
html[dir="rtl"] body:has(> header.site-header) #topic-content [dir="ltr"] :is(p, h1, h2, h3, h4, li, dd, td, th) {
  direction: ltr; text-align: left;
}
html[dir="rtl"] body:has(> header.site-header) .site-footer .copyright,
html[dir="rtl"] body:has(> header.site-header) .site-footer .date-modified { float: right; margin-right: 0; margin-left: 30px; }

/* --- 3. Print -------------------------------------------------------- */
@media print {
  .pdf-btn { display: none; }
}
