/*--------------------------------------------------------------
Block Widgets
--------------------------------------------------------------*/


// Add width-100 classes to block img if class is added to the figure
figure.w-100 {
  img {
    width: 100%;
  }
}

// Add rounded-* classes to block img if class is added to the figure
figure.rounded {

  img {
    border-radius: var(--#{$prefix}border-radius);
  }

  &-lg img {
    border-radius: var(--#{$prefix}border-radius-lg);
  }

  &-xl img {
    border-radius: var(--#{$prefix}border-radius-xl);
  }

  &-xxl img {
    border-radius: var(--#{$prefix}border-radius-xxl);
  }

  &-circle img {
    border-radius: 50%;
  }
}

// Add card-img-top to block img if class added to the figure
figure.card-img-top {
  img {
    border-top-left-radius: $card-inner-border-radius;
    border-top-right-radius: $card-inner-border-radius;
  }
}


// Separator
.wp-block-separator {
  border-top: var(--#{$prefix}border-width) solid;
}


// List-groups
.bs-list-group {
  .list-group-item-action {
    a {
      color: $list-group-color;
    }

    &:hover {
      a {
        color: $list-group-action-hover-color;
      }
    }

    &.active {
      a {
        color: $list-group-active-color;
      }
    }
  }
}

// List-group in card
.card {
  .bs-list-group.list-group-flush {
    .list-group-item:last-child {
      border-bottom-left-radius: $card-inner-border-radius;
      border-bottom-right-radius: $card-inner-border-radius;
    }
  }
}


// Add dark mode support to gallery/img block lightbox
.wp-lightbox-overlay {
  .scrim {
    // Override inline-style 
    background-color: var(--#{$prefix}body-bg) !important;
  }
}

[data-bs-theme="dark"] .close-button {
  filter: invert(1);
}


// Blockquote
.blockquote p:last-of-type {
  margin-bottom: 0;
}


// Fix category dropdown label if 'Show label' is switched off
.wp-block-categories .wp-block-categories__label {
  width: auto;
}