@use "sass:map";
@use "../../wc";
@use "../../../scss/mixins";


:host {
  display: block;
  --zn-sp-padding: var(--zn-base-gap, var(--zn-divide-gap, var(--zn-spacing-medium)));
  --zn-sp-gap: var(--zn-base-gap, var(--zn-divide-gap, var(--zn-spacing-medium)));
}

:host([grow]) {
  display: flex;
  flex-grow: 1;
  height: 100%;
}

:host([max-full]) {
  max-height: 100%;
  overflow: hidden;
}

:host([scroll]) {
  max-height: 100%;
  overflow: auto;
}

.sp {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  padding: var(--zn-sp-padding);
  gap: var(--zn-sp-gap);
  width: 100%;
  height: 100%;
  margin: var(--zn-default-margin, 0 auto);

  &--divide.sp--no-gap {
    ::slotted(*:not(:last-child)) {
      border-bottom: 1px solid rgb(var(--zn-border-color)) !important;
    }
  }

  &--divide:not(.sp--no-gap) {
    ::slotted(*:not(:last-child)) {
      position: relative;

      &:after {
        content: "";
        position: absolute;
        display: block;
        height: 1px;
        left: 0;
        width: 100%;
        max-width: 100%;
        bottom: calc((var(--zn-sp-gap) / 2) * -1);
        background-color: rgb(var(--zn-border-color));
      }
    }
  }

  &--row {
    flex-direction: row;
  }

  &--no-pos {
    position: unset;
  }

  &--no-gap {
    gap: 0;
  }

  &--grow {
    flex-grow: 1;
  }

  &--flush {
    padding: 0;
  }

  &--flush-y {
    padding-top: 0;
    padding-bottom: 0;
  }

  &--flush-x {
    padding-left: 0;
    padding-right: 0;
  }


  &--flush-t {
    padding-top: 0;
  }

  &--flush-b {
    padding-bottom: 0;
  }

  &--flush-l {
    padding-left: 0;
  }

  &--flush-r {
    padding-right: 0;
  }
}

:host([align="start"]) .sp {
  align-items: flex-start;
}

:host([align="center"]) .sp {
  align-items: center;
}

:host([align="end"]) .sp {
  align-items: flex-end;
}

:host([align="stretch"]) .sp {
  align-items: stretch;
}

:host([align="baseline"]) .sp {
  align-items: baseline;
}

:host([justify="start"]) .sp {
  justify-content: flex-start;
}

:host([justify="center"]) .sp {
  justify-content: center;
}

:host([justify="end"]) .sp {
  justify-content: flex-end;
}

:host([justify="between"]) .sp {
  justify-content: space-between;
}

:host([justify="around"]) .sp {
  justify-content: space-around;
}

:host([justify="evenly"]) .sp {
  justify-content: space-evenly;
}
