/* ==========================================================================
   Aidem Motion Text Widget
   Scoped styles for .aidem-motion-text-* and sliced reveal output.
   ========================================================================== */

.aidem-motion-text-widget {
  display: block;
}

.aidem-motion-text-stack,
.aidem-motion-text-content {
  --aidem-text-line-gap: 8px;
}

.aidem-motion-text-content {
  margin: 0;
  display: block;
  line-height: inherit;
  will-change: transform, opacity;
}

.aidem-motion-text-stack {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
}

.aidem-motion-text-stack.aidem-motion-text-layout-vertical {
  flex-direction: column;
}

.aidem-motion-text-stack.aidem-motion-text-layout-vertical .aidem-motion-text-content {
  width: 100%;
  margin-bottom: var(--aidem-text-line-gap);
}

.aidem-motion-text-stack.aidem-motion-text-layout-vertical .aidem-motion-text-content:last-child {
  margin-bottom: 0;
}

.aidem-motion-text-stack.aidem-motion-text-layout-horizontal {
  flex-direction: row;
  align-items: baseline;
}

.aidem-motion-text-stack.aidem-motion-text-layout-horizontal .aidem-motion-text-content {
  flex: none;
  margin-right: var(--aidem-text-line-gap);
}

.aidem-motion-text-stack.aidem-motion-text-layout-horizontal .aidem-motion-text-content:last-child {
  margin-right: 0;
}

.aidem-motion-text-split-reveal .split-char,
.aidem-motion-text-split-reveal .split-word,
.aidem-motion-text-split-reveal .split-sentence,
.aidem-motion-text-split-reveal .split-line {
  display: inline-block;
  will-change: opacity, transform;
}

.aidem-motion-text-split-reveal.aidem-motion-text-layout-vertical .split-sentence,
.aidem-motion-text-split-reveal.aidem-motion-text-layout-vertical .split-line {
  display: block;
  margin-bottom: var(--aidem-text-line-gap, 8px);
}

.aidem-motion-text-split-reveal.aidem-motion-text-layout-vertical .split-sentence:last-child,
.aidem-motion-text-split-reveal.aidem-motion-text-layout-vertical .split-line:last-child {
  margin-bottom: 0;
}

.aidem-motion-text-split-reveal.aidem-motion-text-layout-horizontal .split-sentence,
.aidem-motion-text-split-reveal.aidem-motion-text-layout-horizontal .split-line {
  display: inline-block;
  margin-right: var(--aidem-text-line-gap, 8px);
  vertical-align: top;
}

.aidem-motion-text-split-reveal.aidem-motion-text-layout-horizontal .split-sentence:last-child,
.aidem-motion-text-split-reveal.aidem-motion-text-layout-horizontal .split-line:last-child {
  margin-right: 0;
}

.aidem-motion-slice-reveal {
  position: relative;
  display: inline-block;
  line-height: inherit;
  text-transform: inherit;
  text-shadow: inherit;
  isolation: isolate;
  max-width: 100%;
}

.aidem-motion-slice-reveal .amt-slice-base {
  display: block;
  position: relative;
  z-index: 1;
  white-space: inherit;
}

.aidem-motion-slice-reveal .amt-slice-row {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  user-select: none;
  pointer-events: none;
}

.aidem-motion-slice-reveal .amt-slice-text {
  display: block;
  transform-origin: bottom left;
  will-change: transform, opacity, filter;
}

.aidem-motion-slice-reveal .amt-slice-row-1 {
  clip-path: polygon(-10% 75%, 110% 75%, 110% 110%, -10% 110%);
}

.aidem-motion-slice-reveal .amt-slice-row-2 {
  clip-path: polygon(-10% 50%, 110% 50%, 110% 75.3%, -10% 75.3%);
}

.aidem-motion-slice-reveal .amt-slice-row-3 {
  clip-path: polygon(-10% 25%, 110% 25%, 110% 50.3%, -10% 50.3%);
}

.aidem-motion-slice-reveal .amt-slice-row-4 {
  clip-path: polygon(-10% 0%, 110% 0%, 110% 25.3%, -10% 25.3%);
}

.aidem-motion-slice-reveal .amt-slice-row-5 {
  clip-path: polygon(-10% -25%, 110% -25%, 110% 0.3%, -10% 0.3%);
}

.aidem-motion-slice-reveal .amt-slice-row-6 {
  clip-path: polygon(-10% -50%, 110% -50%, 110% -24.7%, -10% -24.7%);
}

@media (prefers-reduced-motion: reduce) {
  .aidem-motion-slice-reveal .amt-slice-base {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  .aidem-motion-slice-reveal .amt-slice-text {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}
