/* ---------------------------------------------------------------------------
   Industrial Automation & Connectivity — surface-aware text treatment.

   Two systemic contrast problems are corrected here, for ifm (ifm-/ifp-),
   Softing (sft-), NOVUS (nv-), CODESYS (cdy-/csp-) and the automation wing
   (aw-) pages.

   1. DARK SURFACES. css/homepage-palette.css enforces a light-background
      palette site-wide with !important on h1-h6, strong, p, li, dd and small.
      Every navy band therefore rendered its text at 1.02-3.27:1 — headings
      effectively invisible.

   2. BRAND-ORANGE TEXT ON LIGHT SURFACES. The partner accents are correct as
      fills, but as small bold text they measured 2.34-4.25:1. The site already
      defines a readable variant (--pm-brand-primary-readable, #c8420f) for
      exactly this: 4.95:1 on white, 4.69:1 on the soft grey.

   ORDER MATTERS. The light-surface rules come first; the dark-surface rules
   come last so that they win inside a dark container regardless of which
   partner prefix is involved. The global site header and footer are out of
   scope by design.
   --------------------------------------------------------------------------- */

/* ===========================================================================
   PART 1 — light surfaces: make the brand accent readable as text
   =========================================================================== */

.ifm-page :is(.ifm-kicker,.ifm-eyebrow,.ifm-card__meta),
.ifp-page :is(.ifp-eyebrow,.ifp-kicker),
.sft-page :is(.sft-eyebrow,.sft-kicker),
.nv-page :is(.nv-eyebrow,.nv-kicker),
.nv-product :is(.nv-eyebrow,.nv-kicker),
.nv-library :is(.nv-eyebrow,.nv-kicker),
.cdy-page :is(.cdy-eyebrow,.cdy-kicker),
.csp-page :is(.csp-eyebrow,.csp-kicker),
.automation-page :is(.aw-eyebrow,.aw-tech-label,.aw-area-card__tag),
.automation-page :is(.nv-eyebrow,.cdy-eyebrow,.sft-eyebrow,.ifm-kicker) { color: #c8420f !important; }

/* Card actions, flow arrows and inline accents at small sizes. */
.ifm-page :is(.ifm-card b,.ifm-flow i,.ifm-go),
.ifp-page :is(.ifp-flowline i,.ifp-info-path i,.ifp-card b),
.sft-page :is(.sft-product__body b,.sft-card b,.sft-flow i),
.nv-product :is(.nv-card b,.nv-flow i),
.cdy-page :is(.cdy-card b,.cdy-flow i),
.csp-page :is(.csp-card b,.csp-flow i),
.automation-page :is(.aw-card b,.aw-flow i) { color: #c8420f !important; }

/* Muted captions on tinted panels sat at 4.16-4.38:1. */
.ifm-page .ifm-card__icon,
.ifm-page .ifm-note small, .ifp-page .ifp-note small,
.sft-page .sft-note small, .nv-product .nv-note small,
.cdy-page .cdy-note small, .csp-page .csp-note small { color: #7a4a00 !important; }

/* Primary buttons: white on #e5551a is 3.72:1, failing AA at 14px bold. */
.ifm-page .ifm-btn--primary,
.ifp-page .ifp-button--primary,
.sft-page .sft-btn--primary,
.nv-product .nv-btn--primary,
.nv-library .nv-btn--primary,
.cdy-page .cdy-primary,
.csp-page .csp-button--primary,
.automation-page .aw-btn--primary {
  background: #c8420f !important;
  border-color: #c8420f !important;
  color: #fff !important;
}
.ifm-page .ifm-btn--primary:hover,
.ifp-page .ifp-button--primary:hover,
.sft-page .sft-btn--primary:hover,
.nv-product .nv-btn--primary:hover,
.cdy-page .cdy-primary:hover,
.csp-page .csp-button--primary:hover,
.automation-page .aw-btn--primary:hover {
  background: #a8350b !important;
  border-color: #a8350b !important;
}

/* ===========================================================================
   PART 2 — dark surfaces. Declared last so they win inside a dark container.
   Every selector below names a container verified to render dark.
   =========================================================================== */

.ifm-facts, .ifm-fact, .ifm-cta, .ifm-split__lead, .ifm-section--navy,
.ifp-cta,
.sft-cta, .sft-system-aside, .sft-section--navy,
.nv-facts, .nv-fact, .nv-cta, .nv-system-aside, .nv-section--navy,
.cdy-facts, .cdy-fact, .cdy-cta, .cdy-support-card, .cdy-section--navy,
.csp-section--navy, .csp-cta,
.aw-section--navy, .aw-cta {
  --das-head: #ffffff;
  --das-body: #ccd8e1;
  --das-muted: #a9bdce;
  --das-accent: #ffd866;
}

:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,
    .ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,
    .csp-section--navy,.csp-cta,.aw-section--navy,.aw-cta)
  :is(h1,h2,h3,h4,h5,h6,strong,b,th) { color: var(--das-head) !important; }

:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,
    .ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,
    .csp-section--navy,.csp-cta,.aw-section--navy,.aw-cta)
  :is(p,li,dd,td) { color: var(--das-body) !important; }

:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,
    .ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,
    .csp-section--navy,.csp-cta,.aw-section--navy,.aw-cta)
  :is(small,dt,span) { color: var(--das-muted) !important; }

/* Eyebrows, kickers and fact labels take the warm accent on dark. */
:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,
    .ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,
    .csp-section--navy,.csp-cta,.aw-section--navy,.aw-cta)
  :is(.ifm-kicker,.ifm-eyebrow,.ifp-eyebrow,.ifp-kicker,.sft-eyebrow,.sft-kicker,
      .nv-eyebrow,.nv-kicker,.cdy-eyebrow,.cdy-kicker,.csp-eyebrow,.aw-eyebrow)
  { color: var(--das-accent) !important; }

:is(.ifm-fact,.nv-fact,.cdy-fact) small { color: var(--das-accent) !important; }

/* Links and hairlines on dark surfaces. */
:is(.ifm-cta,.sft-cta,.nv-cta,.cdy-cta,.csp-cta,.aw-cta,
    .ifm-section--navy,.sft-section--navy,.nv-section--navy,
    .cdy-section--navy,.csp-section--navy,.aw-section--navy) a:not([class]) {
  color: var(--das-accent) !important; text-decoration: underline;
}
.ifm-fact + .ifm-fact, .nv-fact + .nv-fact,
.cdy-fact + .cdy-fact { border-color: rgba(255,255,255,.16); }

/* ---------------------------------------------------------------------------
   Final pass: specific elements measured below AA after the rules above.
   --------------------------------------------------------------------------- */

/* Route and measure links carry the accent as small bold text (3.53-3.72:1). */
.ifp-route b span, .ifp-measures a span span,
.ifp-route b, .ifp-measures a span { color: #c8420f !important; }

/* Application-card labels sat at 4.37-4.38:1 on the pale tinted panels. */
.sft-app small, .nv-application small, .cdy-app small,
.ifm-app small, .csp-app small { color: #4f6480 !important; }

/* Body-level breadcrumb on the ifm portfolio pages: 3.88:1. */
.ifp-breadcrumb span, .ifp-breadcrumb a { color: #4f6480 !important; }

/* ---------------------------------------------------------------------------
   Automation-wing elements. These sit outside the partner page roots and are
   already claimed by product-catalogue-v2.css with
   `body.product-catalogue-v2.automation-page .aw-eyebrow` — specificity (0,3,1)
   plus !important. The class is therefore repeated to reach (0,4,0) and win on
   specificity rather than on source order, which is not guaranteed here.
   --------------------------------------------------------------------------- */

/* Eyebrows: #e5551a measured 3.53:1 on the tinted band, 3.72:1 on white. */
.aw-eyebrow.aw-eyebrow.aw-eyebrow.aw-eyebrow,
.aw-tech-label.aw-tech-label.aw-tech-label.aw-tech-label,
.aw-area-card__tag.aw-area-card__tag.aw-area-card__tag.aw-area-card__tag,
.aw-section__index.aw-section__index.aw-section__index.aw-section__index {
  color: #c8420f !important;
}

/* ...but the warm accent still takes precedence inside a dark band. */
:is(.aw-section--navy,.aw-cta) .aw-eyebrow.aw-eyebrow.aw-eyebrow.aw-eyebrow,
:is(.aw-section--navy,.aw-cta) .aw-section__index.aw-section__index.aw-section__index.aw-section__index {
  color: #ffd866 !important;
}

/* Primary buttons: white on #e5551a is 3.72:1. */
.aw-btn.aw-btn--primary.aw-btn--primary.aw-btn--primary,
.pc-final-cta__button.pc-final-cta__button.pc-final-cta__button {
  background: #c8420f !important;
  background-image: none !important;
  border-color: #c8420f !important;
  color: #fff !important;
}
.aw-btn.aw-btn--primary.aw-btn--primary.aw-btn--primary:hover,
.pc-final-cta__button.pc-final-cta__button.pc-final-cta__button:hover {
  background: #a8350b !important; border-color: #a8350b !important;
}

/* Signal-chain captions: #6b7e8e on white is 4.2:1, just short of AA.
   automation-elegant-v3.css claims these at (0,2,1) !important, so match+1. */
.aw-signal-chain__item.aw-signal-chain__item.aw-signal-chain__item p,
.aw-signal-chain__item.aw-signal-chain__item.aw-signal-chain__item small,
.aw-btn--back.aw-btn--back.aw-btn--back,
.aw-btn--back.aw-btn--back.aw-btn--back span { color: #4f6480 !important; }

/* Shared conversion panel, as it renders on these pages: the resource icon sat
   at 1.97:1 on the peach tint and its sub-label at 2.87:1 on the navy card. */
.conversion-resource__icon.conversion-resource__icon.conversion-resource__icon {
  color: #b1470f !important;
}
.conversion-panel .conversion-resource span span,
.conversion-panel__side .conversion-resource span span { color: #b9c9d8 !important; }

/* ---------------------------------------------------------------------------
   Dark hero variant. The discriminator is body.aw-elegant. Scoping on
   body.aw-detail was wrong: remote-io-... is aw-detail but its hero is white,
   which turned that page's eyebrow and chips gold on white (1.38:1).
   The rules above correctly darken the eyebrow for light heroes, so the dark
   case is re-inverted here rather than left to a blanket rule.
   --------------------------------------------------------------------------- */
body.aw-elegant .aw-hero .aw-eyebrow.aw-eyebrow.aw-eyebrow.aw-eyebrow,
body.aw-elegant .aw-hero .aw-chip { color: #ffd866 !important; }

/* The hero primary is re-skinned white by a script-injected style block after
   this sheet loads, so it is matched at a higher specificity than source order.
   White-on-white measured 1:1; the inverted treatment is kept and given its
   proper dark label instead of being flattened back to orange. */
body.aw-elegant .aw-hero .aw-btn.aw-btn--primary.aw-btn--primary.aw-btn--primary {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #ffffff !important;
  color: #0f2238 !important;
}
body.aw-elegant .aw-hero .aw-btn.aw-btn--primary.aw-btn--primary.aw-btn--primary:hover {
  background: #ffd866 !important; border-color: #ffd866 !important; color: #0f2238 !important;
}

/* ===========================================================================
   PART 3 — Pilz (pz-). pilz-safety.css is loaded on the hub and the product
   pages; primionics-pilz-body-pages.css only on the new body pages. These
   corrections live here because this sheet is the one linked on all of them.
   =========================================================================== */

/* .pz-eyebrow #cf4617 measured 4.38:1 on the #f7f9fc band. */
.pz-eyebrow.pz-eyebrow { color: #c8420f !important; }

/* .pz-darkband is a near-black band (#101820) carrying the related-systems and
   cross-reference blocks; it takes the same treatment as the navy bands. */
.pz-darkband :is(h1,h2,h3,h4,h5,h6,strong,b) { color: #ffffff !important; }
.pz-darkband :is(p,li,dd) { color: #ccd8e1 !important; }
.pz-darkband :is(small,dt,span):not(.pz-kicker) { color: #a9bdce !important; }
.pz-darkband a:not([class]) { color: #ffd866 !important; }

/* ...but pilz-safety.css already inverts the eyebrow on its dark bands at the
   same specificity, and this sheet loads later, so those are re-asserted. */
.pz-section--navy .pz-eyebrow.pz-eyebrow,
.pz-darkband .pz-eyebrow.pz-eyebrow,
.pz-family-hero .pz-eyebrow.pz-eyebrow,
.pz-hero--dark .pz-eyebrow.pz-eyebrow { color: #ffd866 !important; }

/* Pilz red #d9292f on a navy/near-black band is 3.67:1. Lightened to hold the
   brand hue at 8.1:1. Light-section kickers keep the brand red (4.87:1). */
.pz-darkband .pz-kicker,
.pz-family-hero .pz-kicker, .pz-hero--dark .pz-kicker { color: #ff8f7f !important; }

/* Hub primary button: white on the generic #e5551a is 3.72:1. The Pilz-red
   .pz-btn--primary used on the body pages is 4.87:1 and is left untouched so
   the brand colour is preserved. */
.pz-button.pz-button--primary.pz-button--primary {
  background: #c8420f !important;
  background-image: none !important;
  border-color: #c8420f !important;
  color: #fff !important;
}
.pz-button.pz-button--primary.pz-button--primary:hover {
  background: #a8350b !important; border-color: #a8350b !important;
}

/* ---------------------------------------------------------------------------
   Light cards nested inside dark sections.

   The partner pages place a pale "note" card (#fff8ef) inside the dark
   gradient sections. The dark-surface rules above are descendant selectors, so
   they whitened that card's text onto a cream background (1.05:1). Dark text
   is re-asserted for the nested light cards specifically.
   --------------------------------------------------------------------------- */
:is(.ifm-note,.ifm-safety-note,.ifm-card,.ifp-note,.sft-note,.nv-note,.cdy-note)
  :is(h1,h2,h3,h4,h5,h6,strong,b) { color: #0f2238 !important; }
:is(.ifm-note,.ifm-safety-note,.ifm-card,.ifp-note,.sft-note,.nv-note,.cdy-note)
  :is(p,li,dd,span):not(.ifm-badge) { color: #3d4d5c !important; }
:is(.ifm-note,.ifm-safety-note,.ifm-card,.ifp-note,.sft-note,.nv-note,.cdy-note)
  small { color: #7a4a00 !important; }

/* .ifm-badge is a pale pill (183 .ifm-card / 20 .ifm-badge instances measured,
   none of them dark) that also sits inside the dark sections. */
.ifm-badge, .ifm-card .ifm-badge { color: #a8350b !important; }

/* Card sub-labels measured 4.48:1 on the pale panel — just short of AA. */
.nv-card__body small, .ifm-card__body small,
.sft-card__body small, .cdy-card__body small,
.ifm-architecture__node small, .ifp-architecture__node small,
.nv-architecture__node small, .sft-architecture__node small { color: #4f6480 !important; }

/* ...the same node labels also run inside the navy sections on most ifm pages,
   where that value is 2.77:1. */
:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,.ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,.pz-darkband)
  :is(.ifm-architecture__node,.ifp-architecture__node,
      .nv-architecture__node,.sft-architecture__node) small { color: #a9bdce !important; }

/* Flow arrows carry a light gold that is 1.77:1 on white — but the same arrows
   also appear inside the dark bands, where the readable orange is only 3.39:1.
   Each surface therefore gets its own value. */
.ifm-arrow, .ifp-arrow, .nv-arrow, .sft-arrow, .cdy-arrow { color: #c8420f !important; }
:is(.ifm-facts,.ifm-fact,.ifm-cta,.ifm-split__lead,.ifm-section--navy,.ifp-cta,
    .sft-cta,.sft-system-aside,.sft-section--navy,
    .nv-facts,.nv-fact,.nv-cta,.nv-system-aside,.nv-section--navy,
    .cdy-facts,.cdy-fact,.cdy-cta,.cdy-support-card,.cdy-section--navy,.pz-darkband)
  :is(.ifm-arrow,.ifp-arrow,.nv-arrow,.sft-arrow,.cdy-arrow) { color: #ffd866 !important; }

/* The catalogue component's action label is #e5551a on white (3.72:1).
   body.product-catalogue-v2 .pc-similar-v2 .sim-explore is (0,3,1) !important,
   so three repeats (0,3,0) still lost on element count — four are needed. */
.sim-explore.sim-explore.sim-explore.sim-explore,
.sim-brand-link.sim-brand-link.sim-brand-link.sim-brand-link { color: #c8420f !important; }
