/* Readability baseline for the legacy FrontPage/Word pages. legacy-inject.mjs puts it right
   after <head>, so the page's own css/<font>/style="" come later and win on equal specificity;
   !important marks where the page must lose. Colours, faces, images stay. ASCII only. */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0 auto; padding: 0 12px; max-width: 60rem; overflow-x: hidden; }
img, iframe, object { max-width: 100%; }
img { height: auto; }
/* 1-2px spacers and rules keep their authored height: height:auto scales a 1x1 gif to its width
   (educ/everhart.htm: blank.gif width=425 became a 425px blank square, line.gif a 9px bar;
   geser.net schriften.html: a broken clear.htm spacer width=527 became a 527px hole). */
img[height="1"] { height: 1px; }
img[height="2"] { height: 2px; }
/* FrontPage hit counters (_vti_bin/fpcount.exe, 16 pages) never answer on static hosting and
   showed as a broken-image icon */
img[src*="fpcount.exe"] { display: none; }
pre { white-space: pre-wrap; }
p, div, ul, ol, dl, blockquote, center, form { max-width: 100%; box-sizing: border-box; }
table { max-width: 100% !important; height: auto !important; }
/* not 'anywhere': it let desktop table columns shrink to one letter a line */
td, th { overflow-wrap: break-word; }

@media (max-width: 40em) {
  /* Text carriers to 16px, <font> too (size 1/2/-1 = 10-13px; 4-7 = titles). Title classes
     and inline 2x pt sizes go relative to the text; inline wrappers in headings, titles and
     sup inherit (:where keeps the font rule weak). */
  body, td, th, caption, p, li, dd, dt, blockquote, div, span, a, small, label,
  font:where(:not([size="4"], [size="5"], [size="6"], [size="7"], [size^="+"]))
    { font-size: 16px !important; line-height: 1.45 !important; }
  [class*="itel" i], [class*="itle" i], [class*="heading" i], [class*="berschrift"],
  [style*="font-size: 2"], [style*="font-size:2"]
    { font-size: 1.25em !important; line-height: 1.3 !important; }
  h4, h5, h6 { font-size: 1.1em !important; }
  :is(h1, h2, h3, h4, h5, h6, sup, sub, font[size], [class*="itel" i], [class*="itle" i],
      [class*="heading" i], [class*="berschrift"], [style*="font-size: 2"], [style*="font-size:2"])
    :is(span, a, font, b, i, u, em, strong, small)
    { font-size: inherit !important; line-height: inherit !important; }
  /* Tables: everything stacks (cells become blocks in source order, a sidebar lands above or
     below the text) except content tables, which get their UA display back inside their own
     overflow-x:auto scroll box. Content = border>0 or Word Mso* class, no nested table
     (checked site-wide; 49 of 495 numeric tables are borderless and still stack).
     Without :has() (pre-2024) everything stacks. */
  table, tbody, tr, td, th { display: block !important; width: auto !important; height: auto !important; }
  :is(table[border]:not([border="0"]), table[class*="Mso"]):not(:has(table)) { overflow-x: auto; }
  :is(table[border]:not([border="0"]), table[class*="Mso"]):not(:has(table)) :is(tbody, tr, td, th)
    { display: revert !important; }
  /* width:auto, not max-width: a 400pt paragraph with a 20pt margin must fit */
  p, div, ul, ol, dl, blockquote, center, form, pre { width: auto !important; }
  [nowrap] { white-space: normal !important; }
  [align="justify"], [style*="justify"] { text-align: left !important; }
  img[hspace] { margin-left: 0; margin-right: 0.3em; }
  ul, ol { padding-left: 1.5em; }
  blockquote { margin-left: 1em; margin-right: 0; }
}

/* PDF links: a small document glyph after the link text, in the link's own colour (an SVG mask
   filled with currentColor: navy, black or oxblood as the page decides). The pseudo is a plain
   inline box holding a word joiner (U+2060, zero width, no break before it), the glyph sits in its
   left padding: it never wraps onto a line of its own, and underlines skip padding. Image links
   get none; ?query and #page forms are covered. FrontPage and Word often colour the text with an
   inner <font color>, a styled span or a span.auto-styleN: when such a carrier ends the link (up
   to three levels deep) the glyph goes inside the innermost one and takes that colour. Guarded so
   that a browser without masks adds nothing rather than a coloured square. ASCII only. */
@supports (mask-image: none) or (-webkit-mask-image: none) {
  :is(a[href$=".pdf" i], a[href$=".PDF"], a[href*=".pdf?" i], a[href*=".pdf#" i]):not(:has(
      > :is(font[color], [style*="color" i], span[class]):last-child,
      > :last-child > :is(font[color], [style*="color" i], span[class]):last-child,
      > :last-child > :last-child > :is(font[color], [style*="color" i], span[class]):last-child))::after,
  :is(a[href$=".pdf" i], a[href$=".PDF"], a[href*=".pdf?" i], a[href*=".pdf#" i])
    :is(font[color], [style*="color" i], span[class]):is(
      a > :last-child, a > :last-child > :last-child, a > :last-child > :last-child > :last-child):not(:has(
      > :is(font[color], [style*="color" i], span[class]):last-child,
      > :last-child > :is(font[color], [style*="color" i], span[class]):last-child))::after {
    content: "\2060";
    display: inline;
    padding-left: 0.85em;
    margin-left: 0.3em;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M3.5 1.5h7l4 4v9h-11z'/%3E%3Cpath d='M10.5 1.5v4h4'/%3E%3Cpath d='M6 8.75h6M6 11.5h6'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat; -webkit-mask-position: right center; -webkit-mask-size: 0.85em 0.85em;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M3.5 1.5h7l4 4v9h-11z'/%3E%3Cpath d='M10.5 1.5v4h4'/%3E%3Cpath d='M6 8.75h6M6 11.5h6'/%3E%3C/svg%3E");
    mask-repeat: no-repeat; mask-position: right center; mask-size: 0.85em 0.85em;
  }
  a:has(img)::after, a:has(img) ::after { content: none; }
}
