/* ********* POSTS SECTION  ************************** */

.posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    order: 1;
}
/* OK */

@media only screen and (min-width: 39rem) {
    .post-box, .post {
        border-radius: 8px;
    }
}

.posts > .post-box {
    padding: 0 16px;
}

/* .posts > .post-box > .post {
    border-bottom: 1px solid var(--gray200);
} */

.post-box {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    background-color: white;
    /* background-color: brown; */
}
/* OK */

.post {
    padding: 12px 0;
    order: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: white;
    /* background-color: orange; */
}
/* OK */

.post:not(.cmmnt) {
    font-size: 1.3rem;
}

/* **************** POST COMPONENTS ***************** */

.post-headr, .post-footr {
    /* background-color: fuchsia; */
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}
/* OK */


.post-headr {
    gap: 8px;
    order: 0;
}

.post-footr {
    order: 2;
    gap: 4px;
}

.post-footr.footr-more-box {
    margin-left: auto;
}

.post-footr.footr-more {
    display: none;
    /* min-width: 120px; */
    width: max-content;
    flex-direction: column;
    align-items: end;
    position: absolute;
    bottom: calc(0.9rem + 16px);
    z-index: 1;
    right: 0px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--gray200);
    padding: 6px 12px;   
}

.small-btn.more {
    height: 24px;
    width: 24px;
    border-radius: 100px;
    border: 1px solid var(--gray200);
}

.post-main {
    order: 1;
}

.avtr {
    width: 36px;
    height: 36px;
    display: flex;
    border-radius: 100px;
    border: 1px solid var(--gray200);
    flex-shrink: 0;
    flex-grow: 0;
    overflow: hidden;
}

.avtr img {
    height: 100%;
}

span.usrnme-box {
    display: flex;
    gap: 4px;
}

.usrnme {
    color: var(--gray500);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.user-role {
    padding: 2px 4px;
    font-size: 0.8em;
    background-color: var(--blue500);
    color: white;
    border-radius: 2px;
}

span.votes {
    /* width: fit-content; don't delete yet. might need for vertical layout*/
    min-height: 32px;
    padding: 0px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: var(--gray100);
    text-align: center;
    border-radius: 100px;
}

span.score {
    padding: 4px;
    display: block;
    color: var(--blue500);
    font-weight: 500;
}

.vote-btn {
    padding: 4px;
    display: block;
    line-height: 85%;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--blue200);
}

.small-btn {
    width: fit-content; /* Should I delete this? Check in the modal*/
    font-weight: 500;
    color: var(--blue500);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    min-width: 20px;
    min-height: 20px;
    line-height: 100%;
}

.small-btn svg path {
    fill: var(--blue500);
}

.small-btn.more {
    width: 24px;
}


/* ***************** COMMENTS *************** */

.comments {
    order: 2;
    /* background-color: lightblue; */
}
/* OK */

.comments .post-box {
    /* background-color: cyan; */
    padding: 0px;
    display: grid;
    grid-template-columns: 32px 1fr;
    column-gap: 8px;
    row-gap: 0px;
}
/* OK */

.post.cmmnt {
    /* background-color: greenyellow; */
    gap: 8px;
    grid-column: 2;
    grid-row: 1;
}
/* OK */


.post.cmmnt .avtr {
    position: absolute;
    width: 32px;
    height: 32px;
    top: 0;
    left: -40px;
}
/* OK */

.comments .thread {
    /* height: 100%; */
    width: 16px;
    margin-top: 48px;
    margin-bottom: 12px;
    grid-column: 1;
    grid-row: 1 / 4;
    justify-self: center;
    display: block;
    /* background-color: orange; */
}
/* OK */

.thread {
    cursor: pointer;
    display: none;
}

.thread .thrdln {
    width: 2px;
    height: 100%;
    margin: 0 auto;
    display: block;
    background-color: var(--gray200);
}

.thread:is(:focus, :hover) .thrdln {
    background-color: var(--blue500);
}


/* OK */


/* **************** REPLIES ******************* */

.replies {
    grid-column: 2;
    grid-row: 3;
}
/* OK */

.replies .post-box {
    grid-template-columns: 24px 1fr;
    /* background-color: purple; */
}
/* OK */

.post.cmmnt.reply .avtr {
    width: 24px;
    height: 24px;
    left: -32px;
}
/* OK */

.post.cmmnt.reply span.votes {
    min-height: 28px;
}

.replies .thread {
    margin-top: 40px;
}
/* OK */


/* ********** POST FORM  ***************************** */

.post.form.create {
    padding: 12px 16px;
    order: 0;
}
/* OK */

.post.form textarea {
    width: 100%;
    flex-shrink: 100;
    min-height: 3em;
    padding: 12px;
    font-size: 1.3rem;
    border: 1px solid var(--gray200);
}
/* OK */

.big-btn {
    padding: 8px;
    display: block;
    background-color: var(--blue500);
    color: white;
    text-align: center;
    font-weight: 500;
    border-radius: 8px;
}
/* OK */

.post.form.create .post-footr {
    justify-content: space-between;
}
/* OK */



/* ******* COMMENT FORM ********************** */

.post:not(.form) textarea {
    display: none;
}

.post.form.create.cmmnt {
    order: 1;
    padding: 12px 0px;
    flex-direction: row;
    align-items: start;
    /* position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw; */
    /* padding: 12px 16px; */
    z-index: 1;
}
/* OK */


@media only screen and (min-width: 39rem) {
    .post.form.create.cmmnt {
        position: relative;
        top: 0;
        width: auto;
        padding: 12px 0px;
    }
}

.post.form.create.cmmnt .avtr {
    position: relative;
    left: 0;
    order: 0;
}
/* OK */

.post.form.create.cmmnt textarea {
    font-size: 1rem;
    min-height: 3em;
    padding: 6px;
    order: 1;
}
/* OK */

.post.form.create.cmmnt .big-btn {
    order: 2;
}

/* *********** REPLY FORM ************* */

.post.form.create.cmmnt.reply {
    grid-column: 2;
    grid-row: 2;
}
/* OK */

/* ************ UPDATE COMMENT FORM *********************** */

.post.form.updt .post-main {
    display: none;
}

.post.form.updt textarea {
    display: block;
    padding: 6px;
    font-size: inherit; /*need something*/
}

.post.form.updt .post-footr.footr-main {
    display: none;
}

.post-footr.footr-updt {
    display: none;
}

.post.form.updt .post-footr.footr-updt {
    display: flex;
}

.post.form.updt .post-footr.footr-more-box {
    display: none;
}

.post.form.updt .post-footr {
    justify-content: flex-end;
} 


/* ************* OTHERS ************ */

.big-btn {
    /* height: 32px; */
    min-height: 32px;
    min-width: 32px;
    /* width: fit-content; */
    line-height: 100%;
}

.big-btn svg {
    height: 100%;
    display: block;

}

.post .big-btn svg path {
    fill: white;
}

.btn-text {
    display: none;
    word-break: normal;
    white-space: normal;
}

button {
    white-space: normal;
    word-break: break-word;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}


@media only screen and (min-width: 30rem) {
    .btn-text {
        display: block;
    }
    .post .big-btn svg {
        display: none;
    }
}


/* ************ ACTIVE STATES *************** */

a.avtr:is(:focus, :hover) {
    outline: 1px solid var(--blue500);
}

.big-btn:is(:focus, :hover) {
    background-color: var(--blue200);
}

a:is(.usrnme, .post-date):is(:focus, :hover) {
    text-decoration: underline;
}

a.user-role:is(:focus, :hover) {
    background-color: var(--blue200);
}

.vote-btn:is(:focus, :hover) {
    color: var(--blue500);
}

.small-btn:is(:focus, :hover) {
    color: var(--blue200);
}

.small-btn.more:is(:focus, :hover) {
    outline: 1px solid var(--blue500);
}

.small-btn.del:is(:focus, :hover) {
    color: var(--red200);
}

.post.form textarea:is(:focus, :hover) {
    outline: 1px solid var(--blue500);
}

/* @media only screen and (hover: none) {
    @keyframes hover {
        0% {
            background-color: var(--hover);
        }
        100% {
            background-color: var(--main);
        }
    }

    .big-btn:not(.light-btn):hover {
        --main: var(--blue500);
        --hover: var(--blue200);
        animation-name: hover;
        animation-duration: 1s;
    }

} */