@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600&display=swap");
:root {
  --Moderate-blue: hsl(238, 40%, 52%);
  --Soft-Red: hsl(358, 79%, 66%);
  --Light-grayish-blue: hsl(239, 57%, 85%);
  --Pale-red: hsl(357, 100%, 86%);

  --Dark-blue: hsl(212, 24%, 26%);
  --Grayish-Blue: hsl(211, 10%, 45%);
  --Light-gray: hsl(223, 19%, 93%);
  --Very-light-gray: hsl(228, 33%, 97%);
  --White: hsl(0, 0%, 100%);
}
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Rubik", sans-serif;
  font-size: 16px;
}
p{
    line-height: 1.5;
}
body{
    height: 100%;
    width: 100%;
    padding-top: 3rem;
    background-color: var(--Very-light-gray);
}
a{
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}
button{
    cursor: pointer;
}
button:hover{
    filter: saturate(80%);
}
.bu-primary{
    background-color: var(--Moderate-blue);
    color: var(--White);
    border: none;
    padding: .75rem 1.5rem;
    border-radius: 4px;
}
.comment-section{
    padding: 0 1rem;
}
.container{
    border-radius: 8px;
    padding: 1.5rem;
    background-color: var(--White);
}
.comments-wrp {
    display: flex;
    flex-direction: column;
}
.comment-section{
    max-width: 75ch;
    margin: auto;
    margin-top: 1rem;
}
.comment{
    margin-bottom: 1rem;
    display: grid;
    grid-template-areas: 
        "score user controls"
        "score comment comment"
        "score comment comment"
    ;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    row-gap: 1rem;
    color: var(--Grayish-Blue);
}

.c-score{
    color: var(--Moderate-blue);
    font-weight: 500;
    grid-area: score;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    padding: .75rem;
    padding-top: .5rem;
    width: 1rem;
    box-sizing: content-box;
    background-color: var(--Very-light-gray);
    border-radius: 8px;
    align-self: flex-start;
}
.score-control{
    width: 100%;
    cursor: pointer;
    object-fit: scale-down;
}
.c-text{
    grid-area: comment;
    width: 100%;
}
.c-user{
    width: 100%;
    grid-area: user;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.usr-name{
    color: var(--Dark-blue);
    font-weight: 700;
}
.usr-img{
    height: 2rem;
    width: 2rem;
}

.c-controls{
    display: flex;
    gap: 1rem;
    color: var(--Moderate-blue);
    grid-area: controls;
    align-self: center;
    justify-self: flex-end;
}
.c-controls a{
    align-items: center;
}
.edit , .reply{
    color: var(--Moderate-blue);
}
.edit{
    display: none;
}
.delete{
    color: var(--Soft-Red);
    display: none;
}
.control-icon{
    margin-right: .5rem;
}

.replies{
    display: flex;
    margin-left: 2.5rem;
    padding-left: 2.4rem;
    border-left: 1px solid var(--Light-grayish-blue);
}

.reply-to{
    color: var(--Moderate-blue);
    font-weight: 500;
}

.reply-input{
    display: grid;
    margin-bottom: 1rem;
    grid-template-areas: "avatar input button";
    grid-template-columns: min-content auto min-content;
    justify-items: center;
    gap: 1rem;
    min-height: 9rem;
}
.reply-input img{
    grid-area: avatar;
    height: 2.5rem;
    width: 2.5rem;
}
.reply-input button{
    grid-area: button;
    align-self: flex-start;
}
.reply-input textarea{
    grid-area: input;
    padding: 1rem;
    width: 100%;
    border: 1px solid var(--Light-gray);
    border-radius: 4px;
    resize: none;
}

.this-user .usr-name::after{
    font-weight: 400;
    content: "you";
    color: var(--White);
    background-color: var(--Moderate-blue);
    padding: 0 .4rem;
    padding-bottom: .2rem;
    font-size: .8rem;
    margin-left: .5rem;
    border-radius: 2px;
}

.this-user .reply{
    display: none;
}
.this-user .edit , .this-user .delete{
    display: flex;
}

@media screen and (max-width:640px) {
    .container{
        padding: .75rem;
    }
    .replies{
        padding-left: 1rem;
        margin-left: .5rem;
    }
    .comment{
        grid-template-areas: 
            "user user user"
            "comment comment comment"
            "score ... controls"
        ;

        gap: .5rem;
    }
    .c-score{
        flex-direction: row;
        width: auto;
    }
    .reply-input{
        grid-template-areas: 
            "input input input"
            "avatar ... button"
        ;
        grid-template-rows: auto min-content;
        align-items: center;
        gap: .5rem;
    }
    .reply-input img{
        height: 2rem;
        width: 2rem;
    }
    .reply-input textarea{
        height: 6rem;
        padding: .5rem;
        align-self: stretch;
    }
}


.modal-wrp{
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,.3);
}

.modal{
    padding: 1.5rem;
    max-width: 32ch;
    display: grid;
    gap: 1rem;
    grid-template-areas: 
    "heading heading"
    "body body"
    "no yes";
}

.invisible{
    display: none;
}

.modal h3{
    grid-area: heading;
    color: var(--Dark-blue);
}
.modal button{
    color: var(--White);
    padding: .75rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
}
.modal p{
    grid-area: body;
    color: var(--Grayish-Blue);
    line-height: 1.5;
}
.modal .yes{
    grid-area: yes;
    background-color: var(--Soft-Red);
}
.modal .no{
    background-color: var(--Grayish-Blue);
    grid-area: no;
}