/**
 * Copyright IBM Corp. 2016, 2024
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

@use 'sass:list';

@use '@carbon/styles/scss/breakpoint' as *;
@use '@carbon/styles/scss/config' as *;
@use '@carbon/styles/scss/spacing' as *;
@use '@carbon/styles/scss/theme' as *;
@use '../../globals/vars' as *;
@use '../../globals/imports' as *;
@use '../../internal/content-group';
@use '../link-with-icon';
@use '../card';

@mixin themed-items {
  background: $background;
  color: $text-primary;
}

@mixin content-group-cards {
  :host(#{$c4d-prefix}-content-group-cards),
  .#{$prefix}--content-group-cards {
    ::slotted([slot='copy']),
    .#{$prefix}--content-group__copy {
      margin-block-end: $spacing-09;

      @include breakpoint(md) {
        margin-block-end: $spacing-10;
      }
    }

    @include themed-items;
  }

  .#{$prefix}--content-group-cards__row {
    display: grid;

    @include breakpoint(md) {
      grid-auto-rows: 1fr;
      grid-template-columns: 1fr 1fr;
    }
  }

  :host(#{$c4d-prefix}-content-group-cards-item),
  .#{$prefix}--content-group-cards-item__col {
    margin-block: list.slash($grid-gutter, 2);
    padding-inline: list.slash($grid-gutter, 2);

    &:focus {
      outline: none;
    }
  }

  :host(#{$c4d-prefix}-content-group-cards-item) {
    padding: list.slash($grid-gutter, 2);
    background: none;
  }
}
