<div id="primary-answer-container" class="position-relative primary-answer-wrap py-1">
    <strong>{{ question.get_primary_answer }}</strong>
    {% if can_edit %}
        <button
            class="edit-primary-btn btn btn-sm btn-outline-secondary position-absolute"
            style="right:0; top:0;"
            hx-get="{% url 'anatomy:primary_answer_htmx' pk=question.pk %}"
            hx-target="#primary-answer-container"
            hx-swap="outerHTML"
            aria-label="Edit primary answer"
        >
            Edit primary answer
        </button>
    {% endif %}

    <style>
    /* Scoped styles for primary answer edit control: match outline-secondary look */
        .primary-answer-wrap .edit-primary-btn {
            opacity: 0.9;
            transition: opacity 120ms ease, transform 120ms ease;
        }
        .primary-answer-wrap:hover .edit-primary-btn {
            opacity: 1;
            transform: none;
        }
    </style>
</div>
