/* Shared optional photograph for dark section and card surfaces.
   Only the decorative layer clips to the existing surface radius. */
.el-section-background {
  position: relative;
  isolation: isolate;
}

.el-section-background > .el-section-background__media {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.el-section-background > .el-section-background__media > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 35%;
}

.el-section-background > .el-section-background__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      ellipse 900px 161px at 50% 49.7%,
      color-mix(in srgb, var(--el-surface-dark-blue) 8%, transparent),
      color-mix(in srgb, var(--el-surface-dark-blue) 42%, transparent)
    ),
    color-mix(in srgb, var(--el-surface-dark-blue) 85%, transparent);
  pointer-events: none;
}

/* A photograph replaces the surface decoration, not content images or icons.
   The explicit list also covers fixed dark surfaces using the same helper. */
.el-section-background :is(
  .el-main-hero__decoration,
  .el-main-hero__background,
  .el-main-hero__symbol,
  .el-media-banner__decoration,
  .el-event-hero__symbol,
  .el-agenda__watermark,
  .el-people__watermark,
  .el-client-logos__symbol,
  .el-ebook-download__decoration,
  .el-contact__decoration,
  .el-comparison-table__decoration,
  .el-stepped-process__decoration,
  .el-solutions-paths__gallery-symbol,
  .el-opinions__symbol,
  .el-quote-strip__symbol,
  .el-quote-strip__divider,
  .el-content-media__background,
  .el-event-hero__image,
  .el-cta-banner__background,
  .el-consultation-cta__signet,
  .el-solutions-hero__symbol,
  .el-solutions-hero__glow,
  .el-vertical-solutions__symbol,
  .el-history-timeline__decoration,
  .el-case-banner__decoration,
  .el-scope-exclusions__decoration,
  .el-testimonial__symbol
) {
  display: none !important;
}

/* The event hero's original photo overlay must not darken the shared one twice. */
.el-event-hero.el-event-hero--dark.el-section-background::before {
  display: none;
}

/* The quotation mark and divider occupied their own columns in the old layout. */
.el-quote-strip.el-section-background {
  grid-template-columns: minmax(0, 1fr);
}

.el-quote-strip.el-section-background > blockquote {
  grid-column: 1;
  grid-row: 1;
}

.el-quote-strip.el-section-background > figcaption {
  grid-column: 1;
  grid-row: 2;
}

/* White tints must not accumulate on a bright photograph. Flatten nested
   surfaces onto the original navy so blue captions retain their AA contrast.
   Keep these guards out of forced-colors; native block palette rules apply there. */
@media (forced-colors: none) {
  .el-section-background {
    --el-focus-ring: var(--el-brand-blue-300);
    --el-section-background-card-8: color-mix(in srgb, var(--el-text-inverse) 8%, var(--el-surface-dark-blue));
    --el-section-background-card-10: color-mix(in srgb, var(--el-text-inverse) 10%, var(--el-surface-dark-blue));
    --el-section-background-card-12: color-mix(in srgb, var(--el-text-inverse) 12%, var(--el-surface-dark-blue));
  }

  /* Native links/summary/scroll regions need a light ring on the photograph.
     White ticket/form surfaces and input interiors retain their dark blue ring. */
  .el-section-background :is(.on-light, .el-contact__card, .el-input) {
    --el-focus-ring: var(--el-brand-blue-600);
  }

  .el-people.el-section-background .el-people__card {
    background: var(--el-people-card-background);
  }

  .el-agenda.el-agenda--cards.el-section-background .el-agenda__entry {
    background: var(--el-agenda-card-background);
  }

  .el-scope-grid.el-section-background .el-scope-grid__card,
  .el-content-media-cards.el-section-background .el-content-media-cards__cards > li,
  .el-scope-exclusions.el-section-background .el-scope-exclusions__card,
  .el-history-timeline.el-section-background .el-history-timeline__card,
  .el-case-banner.el-section-background .el-case-banner__client,
  .el-project-schedule.el-section-background .el-project-schedule__card:not(.el-project-schedule__card--featured) {
    background: var(--el-section-background-card-8);
  }

  .el-process-stages__panel.el-section-background .el-process-stages__media-panel {
    background: var(--el-section-background-card-10);
  }

  .el-process-stages__panel.el-section-background .el-process-stages__stage:not(.el-process-stages__stage--featured),
  .el-project-schedule.el-section-background .el-project-schedule__row:not(.el-project-schedule__row--featured) .el-project-schedule__bar {
    background: var(--el-section-background-card-12);
  }
}

@media (forced-colors: active) {
  .el-section-background > .el-section-background__media {
    display: none !important;
  }
}
