@use "sass:list";
@use "../partials/palette";

.Card {
  padding: 3rem;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  width: 100%;
  position: relative;
  display: block;
  &.hidden {
    display: none;
  }

  img {
    max-width: 100%;
    width: 100%;
    display: block;
  }

  section {
    & > h5 {
      margin-top: 0;
    }
  }

  &.Card--UpperHalf {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: 2rem;
  }

  &.Card--Mid {
    border-radius: 0;
  }

  &.Card--Contiguous {
    margin-top: -0.1875rem;
    padding-top: 0;
    h5 {
      margin-top: 0;
      padding-top: 0;
    }
  }

  &.Card--LowerHalf {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  h4 {
    width: 100%;
    padding: 0 0 1.5rem;
    margin: 0 0 2rem;
    border-bottom: 0.1875rem solid;
  }
  &.bg-purple-10 {
    h4 {
      border-bottom-color: list.nth(palette.$purple, 2);
    }
  }
  &.bg-neutral {
    h4 {
      border-bottom-color: palette.$borderNeutral;
    }
  }

  h5 {
    margin-top: 2rem;
  }

  p {
    &:last-child {
      margin-bottom: 0;
    }
  }
}

.Card.Card--UpperHalf + .Card.Card--LowerHalf,
.Card.Card--UpperHalf + .Card.Card--Mid,
.Card.Card--Mid + .Card.Card--Mid,
.Card.Card--Mid + .Card.Card--LowerHalf {
  margin-top: 0.1875rem;
}
