/**
 * Site page banners: always full-bleed 100vw, height by image aspect,
 * never crop / distort. Applies to image-only and composite heroes.
 */

html {
  overflow-x: clip;
}

/* Pre-JS defaults for known page heroes (avoid cropped flash) */
.page-banner-hero,
.insights-hero,
.sbi-hero,
.em-hero,
.om-hero,
section.hero.paragraph--type--hero:not(.hero--no-image),
.hero.hero--with-image,
.component__banner--hero,
.wo-banner,
[data-component-id="lutron:hero"]:not(.hero--no-image) {
  position: relative !important;
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  transform: none !important;
}

.page-banner-hero,
.insights-hero,
.sbi-hero,
.em-hero,
.om-hero {
  background-size: 100% auto !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
}

/* WSCIT hero uses fixed aspect-ratio + object-fit:cover (crops on small screens) */
section.hero.paragraph--type--hero .hero__media,
.hero.hero--with-image .hero__media,
[data-component-id="lutron:hero"] .hero__media {
  aspect-ratio: auto !important;
  block-size: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  inline-size: 100% !important;
  width: 100% !important;
  inset-inline-start: auto !important;
  transform: none !important;
  position: relative !important;
}

section.hero.paragraph--type--hero .hero__media picture,
section.hero.paragraph--type--hero .hero__media img,
.hero.hero--with-image .hero__media picture,
.hero.hero--with-image .hero__media img,
[data-component-id="lutron:hero"] .hero__media picture,
[data-component-id="lutron:hero"] .hero__media img,
.component__banner--hero img,
.component__banner--wrapper img {
  width: 100% !important;
  inline-size: 100% !important;
  height: auto !important;
  block-size: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  -o-object-fit: contain !important;
}

/*
 * cm-hero detail pages: 100vw + natural image height + bottom copy overlay.
 * Do not force absolute cover media (that crops).
 */
.cm-hero,
.cm-hero.wscit-banner-overlay {
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  transform: none !important;
  line-height: 0 !important;
}

.cm-hero .cm-hero__media {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  transform: none !important;
  line-height: 0 !important;
}

.cm-hero .cm-hero__media img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.cm-hero .cm-hero__band {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  margin-top: 0 !important;
  line-height: normal !important;
}

/* Non-cm overlay heroes (support/contact/etc.) keep prior overlay helpers */
.wscit-banner-overlay:not(.cm-hero) {
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

/*
 * doc / training / services: ::before-painted band heroes.
 * JS inserts <img.wscit-banner-img> and hides ::before; keep copy band on the image.
 */
.doc-hero.wscit-banner-band,
.trn-hero.wscit-banner-band,
.svc-hero.wscit-banner-band {
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  line-height: 0 !important;
  background-image: none !important;
}

.doc-hero.wscit-banner-band > img.wscit-banner-img,
.trn-hero.wscit-banner-band > img.wscit-banner-img,
.svc-hero.wscit-banner-band > img.wscit-banner-img {
  display: block !important;
  position: relative !important;
  z-index: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain !important;
}

.doc-hero.wscit-banner-band .doc-hero__band,
.trn-hero.wscit-banner-band .trn-hero__band,
.svc-hero.wscit-banner-band .svc-hero__band {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  margin: 0 !important;
  line-height: normal !important;
}

.wscit-banner-overlay-media::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* Full-bleed host — image-only / non-overlay composites */
.wscit-banner-root,
.wscit-banner-root.wscit-banner-image-only,
.wscit-banner-root.wscit-banner-composite {
  box-sizing: border-box;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  overflow: visible !important;
  background-image: none !important;
  line-height: 0;
}

.wscit-banner-root.wscit-banner-image-only:has(> img.wscit-banner-img)::before,
.wscit-banner-root.wscit-banner-fit::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* Direct / nested banner images — full width, natural height, no crop */
.wscit-banner-root > img.wscit-banner-img,
.wscit-banner-root img.wscit-banner-img,
.wscit-banner-root .hero__media img,
.wscit-banner-root .component__banner--wrapper img,
.wscit-banner-root .hero__media picture img,
.wscit-banner-root picture img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  aspect-ratio: auto !important;
}

/* Media shells follow the image, not a fixed crop box (non-overlay only) */
.wscit-banner-root:not(.wscit-banner-overlay) .hero__media,
.wscit-banner-root:not(.wscit-banner-overlay) .hero__media picture,
.wscit-banner-root:not(.wscit-banner-overlay) .component__banner--wrapper,
.wscit-banner-root:not(.wscit-banner-overlay)
  .component__banner--wrapper
  picture,
.wscit-banner-root:not(.wscit-banner-overlay) picture {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
}

/* Keep overlay copy usable above the natural-height image */
.wscit-banner-root.wscit-banner-composite {
  position: relative !important;
  line-height: normal;
}

/*
 * myRoom XC / hero+basic banner: keep the content wrapper over the image,
 * aligned to the bottom (do not push copy below the banner).
 */
.component__banner.wscit-banner-overlay,
.component__banner--hero.wscit-banner-overlay {
  position: relative !important;
  line-height: 0 !important;
}

.component__banner.wscit-banner-overlay > .coh-container,
.component__banner--hero.wscit-banner-overlay > .coh-container {
  display: block !important;
  line-height: 0 !important;
}

.component__banner.wscit-banner-overlay .component__banner--wrapper,
.component__banner--hero.wscit-banner-overlay .component__banner--wrapper {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 2 !important;
  margin: 0 !important;
  transform: none !important;
  line-height: normal !important;
}

.component__banner.wscit-banner-overlay .component__banner--content,
.component__banner--hero.wscit-banner-overlay .component__banner--content {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  align-items: flex-end !important;
  justify-content: center !important;
  line-height: normal !important;
  box-sizing: border-box !important;
  transform: none !important;
}

.wscit-banner-root .hero__content,
.wscit-banner-root .component__banner--content,
.wscit-banner-root .ca-hero__content,
.wscit-banner-root .cu-hero__content,
.wscit-banner-root .cj-hero__content,
.wscit-banner-root .support-hero__copy,
.wscit-banner-root .case_study_hero-container,
.wscit-banner-root .case_study_hero-details,
.wscit-banner-root .case_study_hero-info {
  line-height: normal;
}

/*
 * Placeholder height before API image hydrates.
 * Must beat the global min-height:0 rules above via :not(.is-hydrated).
 */
.wscit-banner-host:not(.is-hydrated),
.wscit-banner-swap:not(.is-hydrated),
.component__banner--hero:not(.is-hydrated),
.component__banner:not(.is-hydrated),
.page-banner-hero:not(.is-hydrated),
.page-intro.support-hero:not(.is-hydrated),
.support-hero:not(.is-hydrated),
.cm-hero:not(.is-hydrated),
.insights-hero:not(.is-hydrated),
.about-hero:not(.is-hydrated),
.om-hero:not(.is-hydrated),
.sus-hero:not(.is-hydrated),
.laa-hero:not(.is-hydrated),
.ca-hero:not(.is-hydrated),
.cu-hero:not(.is-hydrated),
.cj-hero:not(.is-hydrated),
.svc-hero:not(.is-hydrated),
.trn-hero:not(.is-hydrated),
.doc-hero:not(.is-hydrated),
.sbi-hero:not(.is-hydrated),
.em-hero:not(.is-hydrated),
.wo-banner:not(.is-hydrated),
.hero.hero--with-image:not(.is-hydrated),
section.hero.paragraph--type--hero:not(.hero--no-image):not(.is-hydrated),
.case-study-hero:not(.is-hydrated) {
  min-height: clamp(220px, 40vw, 560px) !important;
  background-color: #1a1a1a;
}

.cm-hero:not(.is-hydrated) {
  min-height: clamp(240px, 38vw, 520px) !important;
}

.page-banner-hero:not(.is-hydrated),
.insights-hero:not(.is-hydrated),
.om-hero:not(.is-hydrated),
.em-hero:not(.is-hydrated),
.sbi-hero:not(.is-hydrated) {
  min-height: clamp(200px, 32vw, 420px) !important;
}

/* After hydrate: keep a soft floor so layout never collapses mid-image paint.
   JS may also lock an inline min-height from the real image aspect. */
.wscit-banner-host.is-hydrated,
.wscit-banner-swap.is-hydrated,
.component__banner--hero.is-hydrated,
.component__banner.is-hydrated,
.page-banner-hero.is-hydrated,
.support-hero.is-hydrated,
.cm-hero.is-hydrated,
.insights-hero.is-hydrated,
.about-hero.is-hydrated,
.om-hero.is-hydrated,
.sus-hero.is-hydrated,
.laa-hero.is-hydrated,
.ca-hero.is-hydrated,
.cu-hero.is-hydrated,
.cj-hero.is-hydrated,
.svc-hero.is-hydrated,
.trn-hero.is-hydrated,
.doc-hero.is-hydrated,
.sbi-hero.is-hydrated,
.em-hero.is-hydrated,
.wo-banner.is-hydrated,
.hero.hero--with-image.is-hydrated,
section.hero.paragraph--type--hero:not(.hero--no-image).is-hydrated,
.case-study-hero.is-hydrated {
  background-color: transparent;
}
