/* Vote control: column by default; pill variant in footers. */

@layer components {
  .vote {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;

    &.is-voting {
      opacity: 0.5;
      pointer-events: none;
    }
  }

  .vote__form {
    margin: 0;
    display: contents;
  }

  .vote__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: var(--tap);
    block-size: var(--tap);
    border-radius: var(--radius-sm);
    font-size: var(--text-normal);
    color: var(--color-text-muted);

    @media (any-hover: hover) {
      &:hover {
        background: var(--tint-ink-5);
        color: var(--color-ink);
      }
    }

    &.vote__btn--up[aria-pressed="true"] {
      color: var(--color-up);
      background: var(--color-up-surface);
    }

    &.vote__btn--down[aria-pressed="true"] {
      color: var(--color-down);
      background: var(--color-down-surface);
    }
  }

  .vote__count {
    min-inline-size: 3ch;
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-small);
    font-weight: 600;
  }

  .vote__icon {
    inline-size: 1.125rem;
    block-size: 1.125rem;
  }

  /* Footer vote pill (feed rows + deal page + comments + hero): horizontal,
     contained, one compact size everywhere. */
  .deal-row .vote, .deal__interactions .vote, .comment__foot .vote, .hero__vote .vote {
    flex-direction: row;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    padding: 0.125rem 0.2ch;
    gap: 0;
  }
  .deal-row .vote__btn, .deal__interactions .vote__btn, .comment__foot .vote__btn, .hero__vote .vote__btn {
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: var(--radius-pill);
  }
  .deal-row .vote__icon, .deal__interactions .vote__icon, .comment__foot .vote__icon, .hero__vote .vote__icon {
    inline-size: 1rem;
    block-size: 1rem;
  }
  .deal-row .vote__count, .deal__interactions .vote__count, .comment__foot .vote__count, .hero__vote .vote__count {
    font-size: var(--text-x-small);
    min-inline-size: 2.5ch;
  }
}
