/* Motion and transient UI states live here so static component layout remains predictable. */
:root {
    overflow-anchor: none;
}

.task-form {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.task,
.drag-handle {
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.task--active {
    background: #eeebe2;
}

.task:hover,
.task--selected {
    background: #eeebe2;
}

/* FLIP animation: JavaScript first pins rows at old coordinates, then removes this no-motion state. */
.task--reorder-start {
    transition: none;
}

.task--reordering {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.task--reorder-active {
    background-color: #e5eadf;
}

.task__title-button {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.task__title-input {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.task--editor-open .task__title-button {
    opacity: 0;
    pointer-events: none;
}

.task--editor-open .task__title-input {
    opacity: 1;
    pointer-events: auto;
}

/* A zero-to-one fractional grid row animates unknown editor heights without absolute positioning. */
.task__editor-panel {
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
        grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
}

.task--editor-open .task__editor-panel {
    grid-template-rows: 1fr;
    opacity: 1;
}

.rich-editor {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.save-status {
    transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .task-form,
    .task,
    .drag-handle,
    .task--reordering,
    .task__editor-panel,
    .task__title-button,
    .task__title-input,
    .rich-editor,
    .save-status {
        transition-duration: 1ms;
    }

}
