/*
 * hub-legal.css - the app-owned legal documents (config/legal.php) and the
 * affiliate holding page IN THE HUB CHROME (docs/REDESIGN.md section 5).
 *
 * Loaded ONLY when the `legal` / `affiliate` family is in HUB_CHROME_LIVE
 * (App\Support\HubChromeSwitch), after hub.css, by LegalPageController and
 * AffiliateProgramPausedController. It replaces /css/legal.css on those pages
 * (which stays the sheet of the switched-off path, untouched). A page sheet
 * rather than hub.css rules: these selectors only ever match this markup, and
 * hub.css is held under its size cap.
 *
 * The markup is the hand-written views' own (`.legal-doc`, shared verbatim with
 * the switched-off path), so every rule is scoped `.hub .legal-doc`. hub.css's
 * element defaults already give the type, colours and links (ink on ground,
 * navy headings and links, electric focus ring); this sheet adds only a
 * readable measure, a document-sized heading scale and the classic-editor list
 * shapes of the ToS and the three agreements. Tokens only, no shadow, ASCII
 * only (hub.css rules 4, 5, 7). Every weight used (400 body, 700 headings and
 * <strong>/<b>, 800 h1) is one HubChrome::PRELOAD_FONTS preloads, so first
 * paint already has the real fonts (the CLS fix of config/legal.php, for this
 * type scale).
 */

.hub .legal-doc {
  max-width: calc(var(--hub-measure) + 2 * var(--hub-gutter));
  margin: 0 auto;
  padding: var(--hub-space-5) var(--hub-gutter) var(--hub-space-6);
}

/* A document title, not a marketing headline: one step below --hub-h1. */
.hub .legal-doc h1 {
  margin-bottom: var(--hub-space-3);
  font-size: clamp(28px, 4.2vw, 40px);
}

.hub .legal-doc h2 {
  margin: var(--hub-space-5) 0 var(--hub-space-1);
  font-size: clamp(21px, 2.4vw, 25px);
  line-height: 1.3;
}

.hub .legal-doc h3,
.hub .legal-doc h4 {
  margin: var(--hub-space-4) 0 var(--hub-space-1);
  font-size: 18px;
  line-height: 1.4;
}

.hub .legal-doc ol,
.hub .legal-doc ul {
  padding-left: var(--hub-space-3);
}

.hub .legal-doc li {
  margin-bottom: var(--hub-space-1);
}

/* Nested clauses read as one clause, not as separate sections. */
.hub .legal-doc li > ol,
.hub .legal-doc li > ul {
  margin: var(--hub-space-1) 0;
  padding-left: 22px;
}

/* WordPress's editor leaves spacer items (`<li style="list-style-type: none;">`)
   that only indent a nested list, and empty items: kept verbatim in the
   markup, they must not open a gap. */
.hub .legal-doc li[style*='list-style-type: none'] {
  margin-bottom: 0;
}

.hub .legal-doc li:empty {
  display: none;
}

.hub .legal-doc__updated,
.hub .legal-doc__lang,
.hub .legal-doc__prevalence {
  color: var(--hub-c-muted);
  font-size: var(--hub-small);
}

/* The bilingual jump link: the page's only navigation, 44px tall. */
.hub .legal-doc__lang {
  margin-bottom: var(--hub-space-4);
  font-weight: 700;
}

.hub .legal-doc__lang a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.hub .legal-doc__prevalence {
  padding-left: var(--hub-space-2);
  border-left: 4px solid var(--hub-electric);
}

.hub .legal-doc__divider {
  margin: var(--hub-space-6) 0;
  border: 0;
  border-top: 2px solid var(--hub-rule);
}

@media (max-width: 767.98px) {
  .hub .legal-doc {
    padding-top: var(--hub-space-4);
  }

  /* Four-level clauses at 375px: give the text the room, not the markers. */
  .hub .legal-doc ol,
  .hub .legal-doc ul {
    padding-left: 18px;
  }

  .hub .legal-doc li > ol,
  .hub .legal-doc li > ul {
    padding-left: 14px;
  }
}
