// Card module's mixin definitions are here. For the module itself
// check `_card.scss`.
// Mixin for alternate card sizes.
// Variables:
// - $card-alt-size-name : The name of the class used for the alternate size card.
// - $card-alt-size-width : The width of the alternate size card.
@mixin make-card-alt-size ($card-alt-size-name, $card-alt-size-width) {
  @if type-of($card-alt-size-width) == 'number' and unit($card-alt-size-width) == '%' {
    .#{$card-name}.#{$card-alt-size-name} {
      max-width: $card-alt-size-width;
      width: auto;
    }
  }
  @else {
    @media screen and (min-width: #{$card-alt-size-width}) {
      .#{$card-name}.#{$card-alt-size-name} {
        max-width: $card-alt-size-width;
      }
    }
  }
}
// Mixin for alternate cards (card color variants).
// Variables:
// - $card-alt-name : The name of the class used for the alternate card.
// - $card-alt-back-color : The background color of the alternate card.
// - $card-alt-fore-color : The text color of the alternate card.
// - $card-alt-border-style : (Optional) The border style of the alternate card. Defaults to the value
//  of $card-border-style.
// - $card-alt-border-radius : (Optional) The border radius of the alternate card. Defaults to the value
//  of $card-border-radius.
// - $card-alt-section-border-style : (Optional) The border style of the alternate card's sections. Defaults to
//  the value of $card-section-border-style.
@mixin make-card-alt-color ($card-alt-name, $card-alt-back-color, $card-alt-fore-color,
  $card-alt-border-style : $card-border-style, $card-alt-border-radius : $card-border-radius,
  $card-alt-section-border-style : $card-section-border-style) {
  .#{$card-name}.#{$card-alt-name} {
    @if $card-alt-back-color != $card-back-color {
      background: $card-alt-back-color;
    }
    @if $card-alt-fore-color != $card-fore-color {
      color: $card-alt-fore-color;
    }
    @if $card-alt-border-style != $card-border-style {
      border: $card-alt-border-style;
    }
    @if $card-alt-border-radius != $card-border-radius {
      border-radius: $card-alt-border-radius;
    }
    @if $card-alt-section-border-style != $card-section-border-style{
      & > .#{$card-section-name} {
        border-bottom: $card-alt-section-border-style;
      }
      & > .#{$card-section-name}:last-child {
        border-bottom: 0;  // Clean the extra border for last section
      }
    }
  }
}
// Mixin for alternate card sections (card section color variants).
// Variables:
// - $card-section-alt-name : The name of the class used for the alternate card section.
// - $card-section-alt-back-color : The background color of the alternate card section.
// - $card-section-alt-fore-color : The text color of the alternate card section.
// - $card-section-alt-border-style : (Optional) The border style of the alternate card section. Defaults to
//  the value of $card-section-border-style.
@mixin make-card-section-alt-color ($card-section-alt-name, $card-section-alt-back-color,
  $card-section-alt-fore-color, $card-section-alt-border-style : $card-section-border-style) {
  .#{$card-name} > .#{$card-section-name}.#{$card-section-alt-name} {
    @if $card-section-alt-back-color != $card-back-color {
      background: $card-section-alt-back-color;
    }
    @if $card-section-alt-fore-color != $card-fore-color {
      color: $card-section-alt-fore-color;
    }
    @if $card-section-alt-border-style != $card-section-border-style {
      border: $card-section-alt-border-style;
    }
  }
}
// Mixin for alternate card sections (card section padding variants).
// Variables:
// - $card-section-alt-name : The name of the class used for the alternate card section.
// - $card-section-alt-padding : The padding of the alternate card section.
@mixin make-card-section-alt-style ($card-section-alt-name, $card-section-alt-padding) {
  .#{$card-name} > .#{$card-section-name}.#{$card-section-alt-name} {
    padding: $card-section-alt-padding;
  }
}
