/*
 * Approved typography for source-bound enterprise fact rails.
 *
 * User revision 2026-08-22: ordinary values inside the rail use the shared
 * report body role (Roboto 16/24, 400). Labels remain the approved Good Pro
 * fact-label role. Source-emphasised employee numbers and ownership
 * percentages keep the approved larger Roboto emphasis role.
 */

:root {
  --enterprise-fact-label-family: var(--font-report-display);
  --enterprise-fact-label-weight: 500;
  --enterprise-fact-label-size: var(--approved-type-body-size);
  --enterprise-fact-label-leading: 1.25;
  --enterprise-fact-copy-family: var(--approved-type-body-family);
  --enterprise-fact-copy-weight: var(--approved-type-body-weight);
  --enterprise-fact-copy-size: var(--approved-type-body-size);
  --enterprise-fact-copy-leading: var(--approved-type-body-leading);
  --enterprise-fact-emphasis-family: var(--approved-type-body-family);
  --enterprise-fact-emphasis-weight: var(--approved-type-subsection-heading-weight);
  --enterprise-fact-emphasis-size: var(--approved-type-subsection-heading-size);
  --enterprise-fact-emphasis-leading: var(--approved-type-subsection-heading-leading);
}

[data-component$="fact-rail"] [class*="fact"] dt {
  margin-block-end: 0.25rem;
  font-family: var(--enterprise-fact-label-family);
  font-size: var(--enterprise-fact-label-size);
  font-weight: var(--enterprise-fact-label-weight);
  line-height: var(--enterprise-fact-label-leading);
}

[data-component$="fact-rail"] [class*="fact"] dd,
[data-component$="fact-rail"] [class*="fact"] address,
[data-component$="fact-rail"] [class*="fact"] :is(dd, address)[data-source-key] {
  font-family: var(--enterprise-fact-copy-family);
  font-size: var(--enterprise-fact-copy-size);
  font-weight: var(--enterprise-fact-copy-weight);
  line-height: var(--enterprise-fact-copy-leading);
}

/*
 * Values are split into source-keyed spans/strong elements.  Assign the body
 * role to the actual text owners so segment-local strong/point-size rules
 * cannot reintroduce mixed families, weights or sizes.
 */
[data-component$="fact-rail"] :is(dd, address) [data-source-key],
[data-component$="fact-rail"] :is(dd, address) :is(strong, b, .source-bold) {
  font-family: var(--enterprise-fact-copy-family);
  font-size: var(--enterprise-fact-copy-size);
  font-weight: var(--enterprise-fact-copy-weight);
  line-height: var(--enterprise-fact-copy-leading);
}

[data-component$="fact-rail"] :is(dd, address) [data-source-key][data-source-point-size] {
  font-family: var(--enterprise-fact-copy-family);
  font-size: var(--enterprise-fact-copy-size);
  font-weight: var(--enterprise-fact-copy-weight);
  line-height: var(--enterprise-fact-copy-leading);
}

[data-component$="fact-rail"] [class*="fact--employees"] dd > [data-source-key]:first-child,
[data-component$="fact-rail"] [class*="fact--ownership"] [class*="ownership-value"][data-source-key],
[data-component$="fact-rail"] [class*="fact--ownership"] [class*="ownership-line"] > [data-source-key]:last-child,
[data-component$="fact-rail"] [class*="fact--ownership"] [class*="ownership-stack"] > span > [data-source-key]:last-child,
[data-component$="fact-rail"] [class*="fact--ownership"] dd > [data-source-key][data-source-point-size="14"],
[data-component$="fact-rail"] .re-s08__fact--ownership dd > strong[data-source-key]:nth-of-type(even) {
  color: #3c3c3b;
  font-family: var(--enterprise-fact-emphasis-family);
  font-size: var(--enterprise-fact-emphasis-size);
  font-weight: var(--enterprise-fact-emphasis-weight);
  line-height: var(--enterprise-fact-emphasis-leading);
}

[data-component$="fact-rail"] [class*="fact--ownership"] :is(
  [class*="ownership-value"],
  [class*="ownership-line"] > :last-child,
  [class*="ownership-stack"] > span > :last-child,
  dd > [data-source-point-size="14"]
) {
  white-space: nowrap;
}

[data-component$="fact-rail"] .re-s08__fact--ownership dd > strong:nth-of-type(even) {
  white-space: nowrap;
}

[data-component$="fact-rail"] [class*="fact--ownership"] :is(
  [class*="ownership-value"],
  [class*="ownership-line"] > :last-child,
  [class*="ownership-stack"] > span > :last-child,
  dd > [data-source-point-size="14"]:last-child
) {
  margin-inline-start: 0.4rem;
}

[data-component$="fact-rail"] .re-s08__fact--ownership dd > strong:nth-of-type(even) {
  margin-inline-start: 0.4rem;
}

/* Every ownership-line middle fragment is a source-exact spacer. */
[data-component$="fact-rail"] [class*="fact--ownership"] [class*="ownership-line"] > :not(:first-child):not(:last-child),
[data-component$="fact-rail"] [class*="fact--ownership"] dd:has(> [data-source-key][data-source-point-size="14"]:last-child) > [data-source-key]:not(:first-child):not(:last-child) {
  display: inline-block;
  flex: 0 0 0;
  width: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

[data-component$="fact-rail"] [class*="fact--employees"] dd > :not(:first-child) {
  font-family: var(--enterprise-fact-copy-family);
  font-size: var(--enterprise-fact-copy-size);
  font-weight: var(--enterprise-fact-copy-weight);
  line-height: var(--enterprise-fact-copy-leading);
}

/* Coal has one long ownership narrative; it follows the same body role. */
[data-component="coal-company-fact-rail"] .coal-profile-fact--ownership dd {
  font-size: var(--enterprise-fact-copy-size);
  line-height: var(--enterprise-fact-copy-leading);
}

/*
 * Keep one deliberate gap between the enlarged count and its body-size unit.
 * Several source fragments carry the separator as a dedicated keyed node;
 * collapse only that visual spacer while retaining the exact DOM text/key.
 */
[data-component$="fact-rail"] [class*="fact--employees"] dd {
  column-gap: 0;
  row-gap: 0.15rem;
}

[data-component$="fact-rail"] [class*="fact--employees"] dd > [data-source-key]:first-child {
  margin-inline-end: 0.4rem;
}

[data-component$="fact-rail"] [class*="fact--employees"] dd > :nth-child(2):not(:last-child) {
  flex: 0 0 0;
  width: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

/*
 * Ownership is read as owner -> percentage.  Never distribute the percentage
 * to the remote edge of the rail; source spaces remain the exact separator and
 * long pairs wrap together naturally.
 */
[data-component$="fact-rail"] [class*="fact--ownership"] dd {
  display: block;
}

[data-component$="fact-rail"] [class*="ownership-line"],
[data-component$="fact-rail"] [class*="ownership-stack"] > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
}

/* Keep the source black address treatment while using the body role. */
[data-component$="fact-rail"] address {
  color: #000;
  font-style: normal;
}

/* Official-site values keep the approved body role and gain link semantics. */
.enterprise-official-site-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 160ms ease;
}

.enterprise-official-site-link:is(:hover, :focus-visible) {
  text-decoration-color: currentColor;
}

.enterprise-official-site-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
