/* =========================================================
   MasterPalm Patch 284 — Header image visibility and footer
   quality-badge contrast

   Loaded after Patch 283. This file prevents the light-theme
   cascade from washing image headers to white and guarantees
   white text on the footer ISO / CE / Export badges.
========================================================= */

/* ---------------------------------------------------------
   Shared CMS inner headers with a real image
   --------------------------------------------------------- */
body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"],
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] {
  background-color: #242a30 !important;
  background-image: var(--ses-hero-image, none) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"],
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] {
  background-color: #242a30 !important;
  background-image: var(--ses-hero-gradient, none), var(--ses-hero-image, none) !important;
  background-size: cover, cover !important;
  background-position: center center, center center !important;
  background-repeat: no-repeat, no-repeat !important;
}

/* Replace the previous nearly-white shade with a subtle dark
   readability layer so the photograph remains visible. */
body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image > .ses-inner-hero__shade,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] > .ses-inner-hero__shade,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] > .ses-inner-hero__shade,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image > .ses-inner-hero__shade,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] > .ses-inner-hero__shade,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] > .ses-inner-hero__shade {
  display: block !important;
  content: "" !important;
  background: linear-gradient(90deg, rgba(8, 11, 14, .62) 0%, rgba(8, 11, 14, .30) 48%, rgba(8, 11, 14, .08) 100%) !important;
  background-image: linear-gradient(90deg, rgba(8, 11, 14, .62) 0%, rgba(8, 11, 14, .30) 48%, rgba(8, 11, 14, .08) 100%) !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image::after,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"]::after,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"]::after,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image::after,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"]::after,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"]::after {
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, .26) 100%) !important;
}

body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"],
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"],
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"],
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] {
  --ses-inner-hero-text-color: #ffffff !important;
  color: #ffffff !important;
}

body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro),
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro),
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro),
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro),
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro),
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] :is(.ses-inner-breadcrumb, .ses-inner-breadcrumb a, .ses-inner-breadcrumb span, .ses-inner-breadcrumb strong, .ses-inner-hero__label, .ses-inner-hero__title, .ses-inner-hero__subtitle, .ses-inner-hero__intro) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .74) !important;
}

body.site-masterpalm:not(.home) #site-main .ses-inner-hero.has-image .ses-inner-hero__label,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] .ses-inner-hero__label,
body.site-masterpalm:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] .ses-inner-hero__label,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero.has-image .ses-inner-hero__label,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image"] .ses-inner-hero__label,
body.masterpalm-theme:not(.home) #site-main .ses-inner-hero[data-bg-type="image_gradient"] .ses-inner-hero__label {
  background: rgba(8, 11, 14, .56) !important;
  border-color: rgba(255, 255, 255, .36) !important;
}

/* ---------------------------------------------------------
   Legacy MasterPalm image headers
   --------------------------------------------------------- */
body.site-masterpalm:not(.home) #site-main .mp-page-hero.has-image,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.has-image {
  background-color: #242a30 !important;
  background-image: var(--mp-bg, none) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  color: #ffffff !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.has-image::before,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.has-image::before {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(90deg, rgba(8, 11, 14, .62) 0%, rgba(8, 11, 14, .28) 50%, rgba(8, 11, 14, .08) 100%) !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  pointer-events: none !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.has-image::after,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.has-image::after {
  display: none !important;
  content: none !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.has-image .mp-page-hero-inner,
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.has-image .mp-page-hero-inner {
  position: relative !important;
  z-index: 2 !important;
}

body.site-masterpalm:not(.home) #site-main .mp-page-hero.has-image :is(h1, p, .mp-breadcrumb, .mp-breadcrumb a, .mp-breadcrumb span),
body.masterpalm-theme:not(.home) #site-main .mp-page-hero.has-image :is(h1, p, .mp-breadcrumb, .mp-breadcrumb a, .mp-breadcrumb span) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .74) !important;
}

/* ---------------------------------------------------------
   Footer quality badges
   White footer requires dark/red badge surfaces for white copy.
   --------------------------------------------------------- */
body.site-masterpalm footer.mp-industrial-footer.mp-footer-light .mp-footer-badges span,
body.masterpalm-theme footer.mp-industrial-footer.mp-footer-light .mp-footer-badges span {
  background: #242a30 !important;
  background-image: none !important;
  border-color: #242a30 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

body.site-masterpalm footer.mp-industrial-footer.mp-footer-light .mp-footer-badges span:first-child,
body.masterpalm-theme footer.mp-industrial-footer.mp-footer-light .mp-footer-badges span:first-child {
  background: #B8001F !important;
  border-color: #B8001F !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
