.posts-reactions {
    margin: 1rem 0;
    text-align: center;
}

.posts-reactions-title {
    font-weight: 600;
    margin: 0 auto 0.75rem;
    max-width: 100%;
    text-align: center;
}

/* Shared controls container */
.posts-reactions-controls,
.posts-reactions-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 auto;
}

.posts-reactions-controls--select {
    display: block;
    max-width: 320px;
}

/* Visually hidden inputs / screen-reader text */
.posts-reactions .screen-reader-text,
.posts-reactions .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Button display */
.posts-reaction-btn,
.posts-reaction-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
}

.posts-reaction-btn:hover,
.posts-reaction-btn:focus,
.posts-reaction-label:hover,
.posts-reaction-radio:focus+.posts-reaction-label {
    background: #f7f7f7;
    border-color: #999;
}

.posts-reaction--selected,
.posts-reaction-radio:checked+.posts-reaction-label {
    background: #e6f7ff;
    border-color: #13890e;
}

.posts-reaction-emoji {
    font-size: 1.25rem;
    line-height: 1;
}

.posts-reaction-count {
    font-size: 0.85rem;
    color: #555;
}

/* Select display */
.posts-reaction-select {
    width: 100%;
    max-width: 320px;
    padding: 0.6rem 2rem 0.6rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    border: 1px solid #ccc;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.posts-reaction-select:focus {
    outline: 2px solid #13890e;
    outline-offset: 2px;
}

/* Size variants */
.posts-reactions--small .posts-reaction-btn,
.posts-reactions--small .posts-reaction-label {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.posts-reactions--small .posts-reaction-emoji {
    font-size: 1rem;
}

.posts-reactions--small .posts-reaction-count {
    font-size: 0.75rem;
}

.posts-reactions--small .posts-reaction-select {
    padding: 0.4rem 1.75rem 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.posts-reactions--large .posts-reaction-btn,
.posts-reactions--large .posts-reaction-label {
    padding: 0.6rem 1.2rem;
    font-size: 1.125rem;
}

.posts-reactions--large .posts-reaction-emoji {
    font-size: 1.5rem;
}

.posts-reactions--large .posts-reaction-count {
    font-size: 1rem;
}

.posts-reactions--large .posts-reaction-select {
    padding: 0.75rem 2.25rem 0.75rem 1.25rem;
    font-size: 1.125rem;
}

/* Hide counts when disabled */
.posts-reactions--no-counts .posts-reaction-count {
    display: none;
}

/* Disabled state: user already reacted */
.posts-reactions--disabled {
    pointer-events: none;
}

.posts-reactions--disabled .posts-reaction-btn,
.posts-reactions--disabled .posts-reaction-label,
.posts-reactions--disabled .posts-reaction-select,
.posts-reactions--disabled .posts-reaction-radio-wrap {
    cursor: not-allowed;
    opacity: 0.55;
}

.posts-reactions--disabled .posts-reaction--selected,
.posts-reactions--disabled .posts-reaction-radio:checked + .posts-reaction-label {
    opacity: 1;
    background: #e9f5e9;
    border-color: #13890e;
    box-shadow: 0 0 0 1px #13890e;
}

.posts-reactions--disabled .posts-reaction-btn:hover,
.posts-reactions--disabled .posts-reaction-label:hover {
    background: #fff;
    border-color: #ccc;
}

.posts-reactions--disabled .posts-reaction--selected:hover,
.posts-reactions--disabled .posts-reaction-radio:checked + .posts-reaction-label:hover {
    background: #e9f5e9;
    border-color: #13890e;
}
