/* Follow button shared by the tenant templates. Colours: set --follow-bg and --follow-fg on a parent element. */
.follow {
    display: inline-flex;
}

.follow__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.follow__btn[hidden] {
    display: none;
}

.follow__btn:disabled {
    cursor: default;
}

.follow__btn:focus-visible {
    outline: 2px solid var(--follow-bg, #101828);
    outline-offset: 2px;
}

.follow__btn--primary {
    color: var(--follow-fg, #fff);
    background: var(--follow-bg, #101828);
}

.follow__btn--primary:hover:not(:disabled) {
    filter: brightness(1.15);
}

.follow__btn--secondary {
    color: #333;
    background: transparent;
    border-color: #d0d0d0;
}

.follow__btn--secondary:hover {
    color: #000;
    background: #f5f5f5;
    border-color: #333;
}

.follow__chevron {
    font-size: 0.65rem;
}

/* Saving: keep the button's size, swap the label for a spinner */
.follow__btn {
    position: relative;
}

.follow__btn.is-busy {
    color: transparent;
}

.follow__btn.is-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--follow-fg, #fff);
    border-radius: 50%;
    animation: follow-spin 0.7s linear infinite;
}

@keyframes follow-spin {
    to { transform: rotate(360deg); }
}

/* In a header's name row, pushed to the right edge */
.follow-slot {
    flex-shrink: 0;
    margin-left: auto;
}

.follow-slot .follow__btn {
    min-height: 2.25rem;
    padding: 0.35rem 1.1rem;
}

/* Centered layouts: a compact button under the name */
.follow-row {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}

.follow-row .follow__btn {
    min-width: 8rem;
}

.follow__error {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    text-align: center;
    color: #d92d20;
}

@media (prefers-reduced-motion: reduce) {
    .follow__btn {
        transition: none;
    }
}
