/**
 * Redwolf Media - Global Dynamic Animated Headline System
 * Seamless animated rotating text in brand red without dark pill container
 */

.rw-animated-headline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  line-height: 1.25;
}

.rw-fixed-phrase {
  display: inline-block;
  vertical-align: baseline;
}

/* Seamless Rotating Word Clipping Slot (No background container, purely red text) */
.rw-pill-container {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  position: relative;
  vertical-align: baseline;
  overflow: hidden;
  background: transparent !important;
  background-color: transparent !important;
  color: #ED1C24 !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 0.06em !important;
  box-shadow: none !important;
  transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  white-space: nowrap;
}

/* Remove any pill top border glow */
.rw-pill-container::before {
  display: none !important;
}

/* Animated Rotating Word in Redwolf Red */
.rw-rotating-word {
  display: inline-block;
  color: #ED1C24 !important;
  font-weight: 800;
  letter-spacing: inherit;
  text-align: center;
  white-space: nowrap;
  line-height: inherit;
  will-change: transform, opacity, filter;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(0);
  opacity: 1;
  filter: blur(0);
}

/* Exit State: Slide Up & Blur Out */
.rw-rotating-word.rw-slide-exit {
  transform: translateY(-110%);
  opacity: 0;
  filter: blur(3px);
}

/* Enter Prep State: Below Viewport & Blurry */
.rw-rotating-word.rw-slide-enter-prep {
  transition: none !important;
  transform: translateY(110%);
  opacity: 0;
  filter: blur(3px);
}

/* Enter Active State: Slide Down into Rest */
.rw-rotating-word.rw-slide-enter-active {
  transform: translateY(0);
  opacity: 1;
  filter: blur(0);
}

/* Hidden Measurement Element (Zero Layout Shift) */
.rw-measure-element {
  position: absolute;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  top: -9999px;
  left: -9999px;
}

/* Screen Reader Accessible Semantic Fallback */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .rw-pill-container {
    transition: none !important;
    width: auto !important;
  }
  .rw-rotating-word {
    transition: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .rw-animated-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
  .rw-pill-container {
    max-width: 95vw;
    white-space: normal;
    text-align: center;
    padding: 0 !important;
  }
  .rw-rotating-word {
    white-space: normal;
  }
}
