/* Hide the heading only when the immediately following Elementor loop has no items. */
.bns-hide-if-next-loop-empty:has(+ .elementor-widget-loop-grid):not(:has(+ .elementor-widget-loop-grid .e-loop-item)) {
  display: none;
}

/* Match the existing B&S image-lightbox marker on image and video previews. */
.bns-media-lightbox.elementor-widget-image a[data-elementor-open-lightbox="yes"] {
  position: relative;
  display: inline-block;
}

.bns-media-lightbox.elementor-widget-image a[data-elementor-open-lightbox="yes"]::after,
.bns-media-lightbox.elementor-widget-video .elementor-custom-embed-image-overlay::after {
  content: "";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0.7rem;
  border: 0;
  border-radius: 1rem;
  background: #ffffff33 url("/wp-content/plugins/bns-settings/inc/mu-plugins/assets/icons/lupe.svg") center / 0.9rem no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* Align a left-hand icon with its heading, independently of description length. */
.bns-icon-box-heading-aligned .elementor-icon-box-wrapper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--icon-box-icon-margin, 1rem);
  row-gap: var(--space-1, 1rem);
  align-items: center;
}

.bns-icon-box-heading-aligned .elementor-icon-box-content {
  display: contents;
}

.bns-icon-box-heading-aligned .elementor-icon-box-icon {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  align-self: center;
}

.bns-icon-box-heading-aligned .elementor-icon-box-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.bns-icon-box-heading-aligned .elementor-icon-box-description {
  grid-column: 2;
  grid-row: 2;
}
