/* Ling App Banner. Colors come from the settings page as CSS variables. */

.ling-ab {
  --ling-ab-bg: #FFC83D;
  --ling-ab-text: #2D2D2D;
  --ling-ab-cta-bg: #FF9900;
  --ling-ab-cta-text: #FFFFFF;
  --ling-ab-close: #2D2D2D;
  --ling-ab-radius: 12px;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px 10px 8px;
  background: var(--ling-ab-bg);
  color: var(--ling-ab-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.25;
  box-sizing: border-box;
  transition: transform 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

.ling-ab *,
.ling-ab *::before,
.ling-ab *::after {
  box-sizing: border-box;
}

.ling-ab--bottom {
  bottom: 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.14);
  transform: translateY(110%);
}

.ling-ab--top {
  top: 0;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
  transform: translateY(-110%);
}

.ling-ab.is-visible {
  transform: none;
}

.ling-ab button.ling-ab__close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--ling-ab-close);
  line-height: 1;
  cursor: pointer;
}

.ling-ab button.ling-ab__close svg {
  display: block;
  width: 18px;
  height: 18px;
}

.ling-ab img.ling-ab__icon {
  flex: 0 0 auto;
  display: block;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 12px;
  object-fit: cover;
}

.ling-ab .ling-ab__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ling-ab .ling-ab__title {
  font-size: 15px;
  font-weight: 600;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ling-ab .ling-ab__subtitle {
  font-size: 12.5px;
  color: inherit;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ling-ab a.ling-ab__cta {
  flex: 0 0 auto;
  margin-left: auto; /* stays on the right when there is no text */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 46%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--ling-ab-radius);
  background: var(--ling-ab-cta-bg);
  color: var(--ling-ab-cta-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  /* Wrap between words only, never inside one (long French and German labels). */
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}

.ling-ab a.ling-ab__cta:hover,
.ling-ab a.ling-ab__cta:focus {
  color: var(--ling-ab-cta-text);
  text-decoration: none;
  filter: brightness(0.96);
}

.ling-ab a.ling-ab__cta:focus-visible,
.ling-ab button.ling-ab__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ling-ab-spacer {
  height: var(--ling-ab-h, 0px);
}

/* Keep the AppsFlyer banner from showing while ours is active. */
html.ling-ab-hide-af #smart-banner {
  display: none !important;
}

/* Lift the theme's back-to-top button above a bottom banner. */
html.ling-ab-open--bottom .back-to-top {
  transform: translateY(calc(-1 * var(--ling-ab-h, 0px)));
}

/* Settings page preview. */
.ling-ab.ling-ab--preview {
  position: relative;
  transform: none;
  max-width: 420px;
  z-index: auto;
  padding-bottom: 10px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .ling-ab {
    transition: none;
  }
}
