.animated-feature {
  margin-block: 0;
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);

  @media screen and (min-width: 768px) {
    padding: var(--wp--preset--spacing--80);
  }
}

/* Vertical padding only exists to make room for the accent SVG. */
.animated-feature--no-accent {
  padding-block: 0;
}

.animated-feature-container {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: var(--wp--style--global--content-size);
  width: 100%;

  @media screen and (min-width: 768px) {
    flex-direction: row;
  }
}

/* Image Styling */

.animated-feature-image-container {
  order: 2;
  position: relative;
  width: 100%;

  @media screen and (min-width: 768px) {
    order: 1;
    width: 55%;
  }
}

.animated-feature--right .animated-feature-image-container {
  @media screen and (min-width: 768px) {
    order: 2;
  }
}

.animated-feature-figure {
  height: 100%;
  margin: 0;
  min-height: 20rem;
  opacity: 0;
  overflow: hidden;
  transform: translateY(50px) scale(0.95);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  width: 100%;
}
.animated-feature-figure.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.animated-feature-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.animated-feature-slash-square {
  bottom: 0;
  display: none;
  opacity: 0;
  position: absolute;
  transform: translateY(100%);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;

  @media screen and (min-width: 768px) {
    display: block;
  }
}
.animated-feature-slash-square.is-visible {
  opacity: 1;
  transform: translateY(50%);
}

.animated-feature-slash-rectangle {
  display: none;
  position: absolute;
  left: 50%;
  opacity: 0;
  top: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;

  @media screen and (min-width: 768px) {
    display: block;
  }
}
.animated-feature-slash-rectangle.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.animated-feature-mobile-slash {
  display: block;
  opacity: 0;
  position: absolute;
  top: 0;
  transform: translateY(-100%);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;

  @media screen and (min-width: 768px) {
    display: none;
  }
}
.animated-feature-mobile-slash.is-visible {
  opacity: 1;
  transform: translateY(-50%);
}

/* Content Styling */

.animated-feature-content {
  background-color: var(--wp--custom--color--primary);
  padding: var(--wp--preset--spacing--50);
  transform: translateY(50px);
  opacity: 0;
  order: 1;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  width: 100%;

  @media screen and (min-width: 768px) {
    order: 2;
    padding: var(--wp--preset--spacing--80);
    width: 45%;
  }
}
.animated-feature-content.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.animated-feature--right .animated-feature-content {
  @media screen and (min-width: 768px) {
    order: 1;
  }
}


.animated-feature-content .acf-innerblocks-container {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--50);
  opacity: 0;
  transform: translateY(50%);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.animated-feature-content .acf-innerblocks-container.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animated-feature-content .acf-innerblocks-container > * {
  margin: 0;
  text-align: center;

  @media screen and (min-width: 768px) {
    text-align: left;
  }
}

/* Buttons are a flex row, so text-align above doesn't move them. */
@media screen and (max-width: 767px) {
  .animated-feature-content .acf-innerblocks-container .wp-block-buttons {
    justify-content: center;
  }

  /* Centered list text strands the bullets at the left edge. Keep items
     left-aligned and center the list itself instead. */
  .animated-feature-content .acf-innerblocks-container > .wp-block-list {
    margin-inline: auto;
    text-align: left;
    width: fit-content;
  }
}

.animated-feature-heading {
  color: var(--wp--custom--color--white);
  font-size: 3.6rem;

  @media screen and (min-width: 768px) {
    font-size: 4.8rem;
  }
}

.animated-feature-paragraph {
  color: var(--wp--custom--color--white);
  font-size: 1.2rem;

  @media screen and (min-width: 768px) {
    font-size: 1.8rem;
  }
}

.acf-block-preview {
  .animated-feature-figure,
  .animated-feature-content,
  .animated-feature-content .acf-innerblocks-container {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .animated-feature-slash-rectangle {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  .animated-feature-slash-square {
    opacity: 1;
    transform: translateY(50%);
  }
}