@use "message-content";

.SponsoredMessage {
  --border-top-left-radius: var(--border-radius-messages) !important;
  --border-bottom-left-radius: 0 !important;

  z-index: calc(var(--z-sticky-date) + 1);
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;

  &::before {
    display: none;
  }

  &__button {
    --riple-color: var(var(--accent-background-active-color));

    margin-top: 0.375rem;
    margin-bottom: -0.375rem;
    border-top: 1px solid var(--accent-background-active-color, var(--active-color));

    color: var(--accent-color) !important;

    transition: opacity 0.2s ease-in;

    &:hover, &:active {
      opacity: 0.85;
      background-color: transparent !important;
    }
  }

  .message-type {
    display: flex;
    gap: 0.25rem;
    align-items: center;

    padding-inline-end: 0.25rem;

    text-transform: capitalize;
  }

  .content-inner, .message-peer {
    color: var(--color-text);
  }

  .message-action-buttons {
    top: 0;
    bottom: auto !important;
  }

  .message-content {
    --border-top-left-radius: var(--border-radius-messages);
    --border-top-right-radius: var(--border-radius-messages);
    --border-bottom-right-radius: var(--border-radius-messages);

    padding: 0.5rem;

    @media (max-width: 600px) {
      max-width: min(29rem, calc(100vw - 4.5rem)) !important;
    }
  }

  .channel-avatar {
    --radius: 0.25rem;

    float: right;
    margin: 0 0 0.5rem 0.5rem;

    &.is-rtl {
      float: left;
      margin: 0 0.5rem 0.5rem 0;
    }
  }

  .content-inner {
    padding-top: 0.25rem;
    padding-bottom: 0;
    font-size: calc(var(--message-text-size, 1rem) - 0.125rem);

    > .Button {
      margin-bottom: 0;
      border: none;
      border-radius: 0 0 0.375rem 0.375rem;

      line-height: 1;

      background: none;

      &::before {
        content: '';

        position: absolute;
        top: 0;
        left: 0;

        width: 100%;
        height: 0.0625rem;

        opacity: 0.25;
        background: var(--accent-color);
      }
    }

    .sponsored-action-icon {
      position: absolute;
      top: 0.25rem;
      right: 0;
      transform: rotate(-45deg);

      font-size: 0.75rem;
    }
  }

  .svg-appendix {
    transform: translate(0.01875rem, -0.00625rem);
  }

  .ad-about {
    font-size: 0.6875rem;
  }

  .has-media {
    padding-top: 0.5rem;
  }

  .media-inner {
    --border-bottom-left-radius: var(--border-radius-messages-small);
    --border-bottom-right-radius: var(--border-radius-messages-small);
    --border-top-left-radius: var(--border-radius-messages-small);
    --border-top-right-radius: var(--border-radius-messages-small);
  }
}
