/* Style shim for e-Laws-derived HTML class namespace.
 *
 * The HTML emitted by Ontario's e-Laws site (and mirrored into our
 * version content for mid-1997 through 2024 OBC editions) carries
 * semantic CSS class names but no stylesheet.  Without these rules the
 * markup collapses to default block flow — readable but flat.  These
 * declarations give each class a visual treatment that matches the
 * gazette source.
 *
 * Adding a class to bleach's allowlist (core/html_policy.py) requires a
 * matching rule here; otherwise the class survives sanitisation but
 * renders identically to plain text.
 */

/* Structural headings — Part / Section / Subsection.
 *
 * e-Laws conveys this hierarchy with WEIGHT and INDENT, never font-size: in
 * ontario.ca's own stylesheet (laws/static/css/main.*.css) every regulation
 * body class renders at one base size.  `.Psection-e`/`.Psubsection-e` are
 * just `font-weight:700` (the numbering in the text — "3.6.3.5." vs "(1)" —
 * and the indent of the sentences beneath carry the level), and a Part is
 * `partnum-e`: bold, centred, upper-cased.  Earlier this shim invented a
 * 1.5/1.25/1.1rem size ramp, which made an amending instruction line
 * ("91. Sentence … is amended by …", tagged Psection-e in source regs) read
 * as a giant heading.  Removed, to match the source.
 *
 * `.Ppart-e` is kept only as an alias of the real Part class — our ingested
 * HTML uses `partnum-e` (Parts are never tagged Ppart-e). */
.partnum-e,
.Ppart-e {
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.Psection-e,
.Psubsection-e {
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
.subsection-e {
  display: block;
  margin-top: 0.5rem;
  margin-left: 1.5rem;
}

/* Numbered hierarchy — progressive indent mirroring ontario.ca/e-Laws.
 * The HTML is flat (each level is a sibling <p>), so the nesting is
 * conveyed entirely by a left margin that steps in 1.5rem per level,
 * anchored to .subsection-e (the (1)/(2) sentence) above:
 *   (1) sentence      subsection-e    1.5rem
 *     (a) clause       clause-e        3.0rem
 *       (i) subclause   subclause-e     4.5rem
 *         (A) sub-sub    subsubclause-e  6.0rem
 * paragraph-e / subpara-e are rare alternants that sit at clause /
 * subclause depth respectively. */
/* `S`-prefixed siblings (Ssubsection-e, Sclause-e, …) are e-Laws'
 * "spaced / first-in-group" variants: same indent depth as the base
 * class, just extra space above.  `subection-e` is an upstream typo of
 * subsection-e in one source provision — aliased so it doesn't render
 * flat. */
.subection-e {
  display: block;
  margin-top: 0.5rem;
  margin-left: 1.5rem;
}
.Ssubsection-e {
  display: block;
  margin-top: 0.85rem;
  margin-left: 1.5rem;
}
.clause-e,
.paragraph-e {
  display: block;
  margin-top: 0.25rem;
  margin-left: 3rem;
}
.Sclause-e {
  display: block;
  margin-top: 0.6rem;
  margin-left: 3rem;
}
.subclause-e,
.subpara-e {
  display: block;
  margin-top: 0.25rem;
  margin-left: 4.5rem;
}
.subsubclause-e {
  display: block;
  margin-top: 0.25rem;
  margin-left: 6rem;
}

/* Body paragraph explicitly flagged "no indent" — pin it flush so it
 * never inherits a stray left margin. */
.paranoindt-e {
  display: block;
  margin-top: 0.5rem;
  margin-left: 0;
}

/* Definition lists carry their own clause variants at the same depths.
 * firstdef-e / Sdefinition-e are the first/spaced entries in a list. */
.definition-e,
.firstdef-e,
.Sdefinition-e {
  display: block;
  margin-top: 0.5rem;
  margin-left: 1.5rem;
}
.defclause-e {
  display: block;
  margin-top: 0.25rem;
  margin-left: 3rem;
}
.defsubclause-e {
  display: block;
  margin-top: 0.25rem;
  margin-left: 4.5rem;
}
.Pheading3-e,
.Pheading2-e,
.Pheading1-e {
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.heading3-e,
.heading2-e,
.heading1-e {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Defined-term marking */
.deftermsubsection-e,
.defterm-e {
  font-style: italic;
}

/* Tables — e-Laws emits Word-style MsoNormalTable */
.MsoNormalTable {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
}
.MsoNormalTable td,
.MsoNormalTable th {
  border: 1px solid #d4d4d4;
  padding: 0.4rem 0.6rem;
  vertical-align: top;
}
.table-e {
  margin: 0;
  padding: 0;
}

/* Equation paragraphs carrying inline <img> equation glyphs.
 * .equation-e is centred; the equationindN-e variants are left-indented
 * continuation lines stepping in with the clause hierarchy. */
.equation-e {
  text-align: center;
  margin: 0.75rem 0;
}
.equationind1-e {
  display: block;
  margin: 0.5rem 0 0.5rem 3rem;
}
.equationind2-e {
  display: block;
  margin: 0.5rem 0 0.5rem 4.5rem;
}
.equationind3-e {
  display: block;
  margin: 0.5rem 0 0.5rem 6rem;
}
.equation-e img,
.equationind1-e img,
.equationind2-e img,
.equationind3-e img {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

/* Headnote — a label introducing table notes ("Notes to Table …:"). */
.headnote-e {
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

/* Act / Form titles — centred headings in the e-Laws source. */
.act-e,
.form-e {
  text-align: center;
  font-weight: 600;
  margin: 0.75rem 0;
}

/* Scanned figures — a paragraph wrapping a single <img>. Centre it and
 * keep it responsive (source markup is occasionally malformed, so scope
 * the reset to the image only). */
.scanned-e {
  text-align: center;
  margin: 0.75rem 0;
}
.scanned-e img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* Footnotes / notes */
.footnote-e,
.note-e {
  font-size: 0.875rem;
  color: #525252;
  margin-top: 0.5rem;
}

/* Italic block — appears around regulation references in the gazette */
.italic-e {
  font-style: italic;
}

/* Dark-mode tweaks via the existing dark: variant chain */
@media (prefers-color-scheme: dark) {
  .MsoNormalTable td,
  .MsoNormalTable th {
    border-color: #404040;
  }
  .footnote-e,
  .note-e {
    color: #a3a3a3;
  }
}
