:root {
    --rounded-default: .4rem;
    --border-error: red;
    --fg-error: red;
    --bg-error: red;
    --primary: moccasin
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    outline-color: var(--primary);
    outline-offset: .3em;
    outline-width: 0.1px;
}

body {
    font-family: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
}

main {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: red; */
    background-color: var(--primary);
    padding: .8em;
}


button {
    padding: .5em .9em;
    border-radius: var(--rounded-default);
    background: white;
    border-width: thin;

    border-bottom-width: thick;
    cursor: pointer;
    transition: background .2s ease-in-out
}

button:hover {
    background-color: var(--primary);
}

select {
    appearance: none;
    -webkit-appearance: none;

}

.task-item,
form {

    height: fit-content;
    border: .1em solid gray;
    background-color: white;
    border-radius: .8em;
    display: flex;
    flex-direction: column;
    transition: size 3s ease-in-out;
}



.hide {
    display: none !important;
}


.task-item .task-header,
.task-item .task-body,
.task-item .task-footer,
form {
    padding: .7em 1em;
}

.task-item .task-header {
    display: flex;
    gap: .4em;
    align-items: center;
}


/* CHECKBOX */

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.5em;
    aspect-ratio: 1;
    border: .1em solid grey;
    border-radius: var(--rounded-default);
    cursor: pointer;
    background: transparent;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}


input[type="checkbox"]:checked {
    background: var(--primary);
    color: black;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: .4rem;
    top: .1rem;
    width: 5px;
    height: 9px;
    border: 1.5px solid black;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}


/* END CHECKBOX */

.task-item .task-header h2 {
    flex: 1;
    font-size: 1.3rem;
}

.task-item input[type="checkbox"]:checked~.task-title {
    text-decoration: line-through;
}



.collapseable {
    overflow-y: hidden;
    padding: .2rem 0rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    text-overflow: ellipsis;
}

.task-item .task-body .task-description {
    color: rgb(45, 45, 45);
    font-size: .9rem;
    height: 3.2rem;
    line-height: 1.3rem;


}

.collapseable.expand {
    height: auto;
    display: auto !important;
    overflow: visible;
    -webkit-box-orient: inherit;
}



.toggle-description {
    font-size: .7rem;
    font-weight: bolder;
    width: 1.4rem;
    aspect-ratio: 1;
    padding: .2rem .2rem;
    outline-offset: 0.1rem;
    display: inline-block;
    height: fit-content;
    cursor: pointer;
    margin-right: .4rem;
    border: 1px solid rgba(221, 130, 130, 0.201);
}

.collapseable .toggle-description span {
    background-color: red !important;
    transform: rotate('90deg') !important;
}

.task-item .task-body .meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4em;
    margin: 1em 0;
    width: 100%;
}

.task-item .meta-label {
    font-size: .7rem;
    text-transform: uppercase;
    color: rgb(79, 79, 79);
}

.task-item .task-body .meta-grid div {
    width: 100%;
}

.task-item .task-body .meta-grid .meta-content {
    font-size: .8rem !important;
    margin-top: .4em;
    word-break: keep-all;
    word-wrap: break-word;
}

.task-item .task-body .meta-grid .meta-content .overdue {
    color: red !important;
}

.task-item .status {
    font-size: .7rem !important;
    background-color: rgb(229, 229, 229);
    padding: .2em .7em;
    width: fit-content;
    text-transform: capitalize;
    border-radius: 1em;
    cursor: pointer;
}


.task-item[task-status="done"] .status {
    color: rgb(2, 97, 2) !important;
    background-color: rgba(0, 128, 0, 0.264) !important;
}

.task-item[task-status="done"] .status::picker {
    background: white !important;
}

.task-item .separator {
    margin-bottom: 1em;
    border: 1px solid rgb(195, 195, 195);
}

.task-item .chip {
    background-color: rgb(229, 229, 229);
    padding: .4em .7em;
    width: fit-content;
    border-radius: 1em;
    font-size: .7rem;

    /* font-weight: 400; */
}

.task-item .task-priority {
    text-transform: capitalize;
}

.task-item[task-priority="high"] .task-priority {
    color: rgb(165, 34, 34) !important;
    background-color: rgba(221, 130, 130, 0.201) !important;
}

.task-item[task-priority="medium"] .task-priority {
    color: rgb(182, 154, 11) !important;
    background-color: rgba(221, 189, 130, 0.201) !important;
}

.task-item .tags {
    display: flex;
    gap: .3em;
    flex-wrap: wrap;
}

.task-item .task-footer {
    display: flex;
    justify-content: end;
    gap: .6em;
}


@media screen and (min-width: 797px) {

    .task-item,
    form {
        width: 300px;
    }
}

@media screen and (min-width: 414px) {

    .task-item,
    form {
        width: 400px;
    }

    .task-item .task-body .meta-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

}