@import "./card";
@import "./card.ios.vars";

// iOS Card
// --------------------------------------------------

.card-ios {
  @include margin($card-ios-margin-top, $card-ios-margin-end, $card-ios-margin-bottom, $card-ios-margin-start);
  @include border-radius($card-ios-border-radius);

  width: calc(100% - #{($card-ios-margin-end + $card-ios-margin-start)});

  font-family: $card-ios-font-family;
  font-size: $card-ios-font-size;
  color: $card-ios-text-color;
  background-color: $card-ios-background-color;
  box-shadow: $card-ios-box-shadow;

  transform: translateZ(0);
}

.card-ios ion-list {
  @include margin(null, null, 0, null);
}

.card-ios > .item:last-child,
.card-ios > .item:last-child .item-inner,
.card-ios > .item-sliding:last-child .item {
  border-bottom: 0;
}

.card-ios .item-ios .item-inner {
  border: 0;
}

.card .note-ios {
  font-size: 13px;
}

.card-ios h1 {
  @include margin(0, 0, 2px);

  font-size: 24px;
  font-weight: normal;
}

.card-ios h2 {
  @include margin(2px, 0);

  font-size: 16px;
  font-weight: normal;
}

.card-ios h3,
.card-ios h4,
.card-ios h5,
.card-ios h6 {
  @include margin(2px, 0);

  font-size: 14px;
  font-weight: normal;
}

.card-ios p {
  @include margin(0, 0, 2px);

  font-size: 14px;
  color: $card-ios-text-color;
}

// .card-ios + ion-card {
//   @include margin(0, null, null, null);
// }

// Generate iOS Card Colors
// --------------------------------------------------

@each $color-name, $color-value in $colors-ios {
  $color-base: ion-color($colors-ios, $color-name, base, ios);
  $color-contrast: ion-color($colors-ios, $color-name, contrast, ios);

  .card-ios .text-ios-#{$color-name} {
    color: $color-base;
  }

  .card-ios-#{$color-name} {
    color: $color-contrast;
    background-color: $color-base;

    p {
      color: $color-contrast;
    }

    @each $color-name, $color-value in $colors-ios {
      $color-base: ion-color($colors-ios, $color-name, base, ios);

      .text-ios-#{$color-name} {
        color: $color-base;
      }
    }
  }
}
