@import "./item-divider";
@import "./item-divider.ios.vars";

// iOS Item Divider
// --------------------------------------------------

:host {
  --background: #{$item-divider-ios-background};
  --color: #{$item-divider-ios-color};
  --padding-start: #{$item-divider-ios-padding-start};
  --inner-padding-end: #{$item-divider-ios-padding-end * 0.5};

  @include border-radius(0);

  position: relative;

  min-height: $item-divider-ios-min-height;

  font-size: $item-divider-ios-font-size;

  font-weight: $item-divider-ios-font-weight;
}

// iOS Item Divider Slots
// --------------------------------------------------

:host([slot="start"]) {
  @include margin(
    $item-ios-slot-start-margin-top,
    $item-ios-slot-start-margin-end,
    $item-ios-slot-start-margin-bottom,
    $item-ios-slot-start-margin-start
  );
}

:host([slot="end"]) {
  @include margin(
    $item-ios-slot-end-margin-top,
    $item-ios-slot-end-margin-end,
    $item-ios-slot-end-margin-bottom,
    $item-ios-slot-end-margin-start
  );
}

::slotted(ion-icon[slot="start"]),
::slotted(ion-icon[slot="end"]) {
  @include margin(
    $item-ios-icon-slot-margin-top,
    $item-ios-icon-slot-margin-end,
    $item-ios-icon-slot-margin-bottom,
    $item-ios-icon-slot-margin-start
  );
}

// iOS Item Divider Content
// --------------------------------------------------

::slotted(h1) {
  @include margin(0, 0, 2px);
}

::slotted(h2) {
  @include margin(0, 0, 2px);
}

::slotted(h3),
::slotted(h4),
::slotted(h5),
::slotted(h6) {
  @include margin(0, 0, 3px);
}

::slotted(p) {
  @include margin(
    $item-ios-paragraph-margin-top,
    $item-ios-paragraph-margin-end,
    $item-ios-paragraph-margin-bottom,
    $item-ios-paragraph-margin-start
  );

  color: $item-ios-paragraph-text-color;

  font-size: $item-ios-paragraph-font-size;

  line-height: normal;

  text-overflow: inherit;

  overflow: inherit;
}

::slotted(h2:last-child) ::slotted(h3:last-child),
::slotted(h4:last-child),
::slotted(h5:last-child),
::slotted(h6:last-child),
::slotted(p:last-child) {
  @include margin(null, null, 0, null);
}
