/**
 * AES Topbar Messages — widget styles.
 *
 * The message is centered on the widget; dots and play/pause are absolutely
 * positioned on the right so they never pull the text off-center.
 */

.aes-topbar-messages {
  --aes-topbar-controls-space: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  color: #fff;
  font-family: var(--aes-ref-font-display, inherit);
  font-size: inherit;
  line-height: 1.2;
}

.aes-topbar-message,
.aes-topbar-swiper {
  width: 100%;
  min-width: 0;
}

.aes-topbar-swiper {
  overflow: hidden;
}

.aes-topbar-swiper.is-static .swiper-slide:not(:first-child) {
  display: none;
}

.aes-topbar-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.aes-topbar-message {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Symmetric space for the absolute controls keeps the text on the widget axis. */
.aes-topbar-messages--with-controls .aes-topbar-swiper .swiper-slide,
.aes-topbar-messages--with-controls .aes-topbar-message {
  padding-inline: var(--aes-topbar-controls-space);
}

.aes-topbar-message-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.aes-topbar-message-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aes-topbar-message-link:hover .aes-topbar-message-text,
.aes-topbar-message-link:focus-visible .aes-topbar-message-text {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aes-topbar-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.aes-topbar-controls > * {
  pointer-events: auto;
}

.aes-topbar-controls--align-right {
  justify-content: flex-end;
  gap: 7px;
}

.aes-topbar-controls--align-left {
  justify-content: flex-start;
  gap: 7px;
}

.aes-topbar-controls--align-between {
  justify-content: space-between;
}

.aes-topbar-controls--reverse .aes-topbar-pause {
  order: 1;
}

.aes-topbar-controls--reverse .aes-topbar-dots {
  order: 2;
}

.aes-topbar-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.aes-topbar-dot {
  position: relative;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.aes-topbar-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
}

.aes-topbar-dot.is-active::after {
  background: currentColor;
}

.aes-topbar-dot:focus-visible,
.aes-topbar-pause:focus-visible,
.aes-topbar-message-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.aes-topbar-pause {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.aes-topbar-pause__icon {
  display: inline-grid;
  width: 12px;
  height: 12px;
  place-items: center;
}

.aes-topbar-pause__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aes-topbar-pause__icon--play,
.aes-topbar-pause.is-paused .aes-topbar-pause__icon--pause {
  display: none;
}

.aes-topbar-pause.is-paused .aes-topbar-pause__icon--play {
  display: inline-grid;
}

.aes-topbar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 0.8125rem;
}

.aes-topbar-fallback a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aes-topbar-fallback a:hover {
  text-decoration-thickness: 2px;
}

.aes-topbar-fallback a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/*
 * The widget is the messages/fallback area; Trustpilot is a separate widget
 * with the `.aes-topbar-trust` class. On mobile show one of the two.
 */
@media (max-width: 767px) {
  .aes-topbar-messages:not(.aes-topbar-messages--active) {
    display: none;
  }

  .aes-topbar-shell:has(.aes-topbar-messages--active) .aes-topbar-trust,
  .aes-topbar-shell.aes-has-messages .aes-topbar-trust {
    display: none;
  }

  .aes-topbar-messages--active {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aes-topbar-swiper .swiper-wrapper {
    transition-duration: 0.01ms !important;
  }
}
