@import url(reset.css);
@import url(FM_part.css);


:root {
    /* colors */
    /* primary*/
    --clr-moderate-blue: hsl(238, 40%, 52%);
    --clr-soft-red: hsl(358, 79%, 66%);
    --clr-light-grayish-blue: hsl(239, 57%, 85%);
    --clr-pale-red: hsl(357, 100%, 86%);

     /* neutral */
     --clr-dark-blue: hsl(212, 24%, 26%);
     --clr-grayish-blue: hsl(211, 10%, 45%);
     --clr-light-gray: hsl(223, 19%, 93%);
     --clr-very-light-gray: hsl(228, 33%, 97%);
     --clr-white: hsl(0, 0%, 100%);
  
    /* typography */
    /* fonts */
    --ff-primary: 'Rubik', sans-serif;
    --fw-400: 400; /* base */
    --fw-500: 500; 
    --fw-700: 700; 
    --fs-16: 1rem; /* 16px base */
}


html {
    height: 100%;
}

body {
    min-height: 100%;
}

p {
    line-height: 1.5;
}


body {
    display: flex;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    font-family: var(--ff-primary);
    font-size: var(--fs-16);
    font-weight: var(--fw-400);
    background-color: var(--clr-very-light-gray);
    margin:0px;
    padding:0px;
}

/*---------------------Mobile layout-------------------------*/
.grid__container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        'header'
        'main'
        'attribution';
    gap: 1rem;
    justify-items: center;
    align-self: start;
    width: 46rem;
}

/* style 1st component - mobile */
.header {
    display: inline-flex;
    overflow: hidden;
    position: fixed;
    top: 0;
    width: 94%;
    justify-content: center;
    align-items: center;
    background-color: var(--clr-very-light-gray);
}

.header__image {
    margin: 1rem 0 0.3rem 0;
    width: 3.6rem;
    padding: .2rem;
}
.owner {
    cursor: pointer;
    border: none;
    opacity: .6;
    transition: opacity 0.8s;
}

.owner.userstyle {
    border-radius: 50%;
    border: 3.5px solid var(--clr-moderate-blue);
    opacity: 1;
}

.owner:hover,
.owner:focus-visible{
  opacity: 1;
  border-radius: 50%;
  outline: 2px solid var(--clr-soft-red); 
  outline-offset: 2px;
}

/* style 2nd component - mobile */
.main {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        'main__title'
        'main__comments';
    margin-top: 4rem; 
    justify-items: center;
    width: 98%;
}

.main__title {
    display: none;
}

.main__comments {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        'main__comments-section'
        'main__respond';
    gap: 1.5rem;
    justify-items: center;
    justify-self: center;
    width: 97%;
}

.main__comments-section {
    display: flex;
    flex-direction: column;
    place-items: center;
    width: 96%;
}

/*--comment--*/
.comment {
    display: grid;
    grid-template-columns: 2fr;
    grid-template-areas:
        'comment__header comment__header'
        'comment__content comment__content'
        '. comment__update'
        'comment__vote comment__editor';
    gap: 1rem;
    padding: 1rem;
    margin: 0 0 1rem 0;
    align-content: center;
    justify-items: start;
    width: 100%;
    background-color: var(--clr-white);
    border-radius: 0.8rem;
}

.comment__header {
    display: grid;
    grid-template-columns: 1fr minmax(10rem, 27rem);
    grid-template-areas:
        'comment__header-picture comment__header-container';
    gap: .5rem;
    align-items: center;
}

.comment__header-picture{
    width: 3.2rem;
}

.comment__header-container {
    display: inline-flex;
    flex-wrap: wrap;
}

.comment__header-name {
    font-weight: var(--fw-500);
    margin: 0 .5rem 0 0;
}

.comment__header-owner {
    background-color: var(--clr-moderate-blue);
    color: var(--clr-white);
    font-weight: var(--fw-500);
    padding: 0 .4rem;
    margin: 0 .5rem 0 0;
}

.comment__header-time {
    color: var(--clr-grayish-blue);
    font-weight: var(--fw-500);
}

.comment__content {
    color: var(--clr-grayish-blue);
    border: none;
    width: 100%;
    max-height: 11rem;
    overflow-y: auto;
    padding: 0.3rem;
}

.update-btn {
    cursor: pointer;
    width: 6rem;
    padding: .5rem .2rem;
    border-radius: .4rem;
    border: none;
    text-transform: uppercase;
    font-weight: var(--fw-500);
    color: var(--clr-white);
    background-color: var(--clr-moderate-blue);
    justify-self: end;
    display: none;
}

.comment__vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    gap: 0.6rem;
    padding: 0 .6rem;
    height: 2.5rem;
    background-color: var(--clr-very-light-gray);
    border-radius: .4rem;
}


.comment__vote-content {
    font-weight: var(--fw-500);
    color: hsl(238, 40%, 52%);
}

.vote-plus {
    border: none;
    background-color: var(--clr-very-light-gray);
    color: var(--clr-light-grayish-blue);
}

.vote-minus {
    border: none;
    background-color: var(--clr-very-light-gray);
    color: var(--clr-light-grayish-blue);
}

.comment__editor {
    display: grid;
    grid-template-columns: 3fr;
    grid-template-areas:
        'comment__delete comment__edit comment__reply';
    gap: 0.4rem;
    height: 2.5rem;
    justify-self: end;
    align-items: center;
}

.comment__delete {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--clr-soft-red);
    font-weight: var(--fw-500);
    width: 4.3rem;
}

.comment__edit {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-500);
    color: var(--clr-moderate-blue);
    width: 3.2rem;
}

.comment__reply {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-500);
    color: var(--clr-moderate-blue);
    gap: .3rem;
}

.reply__rc {
    border: none;
    background-color: var(--clr-very-light-gray);
}

.del {
    border: none;
    background-color: var(--clr-very-light-gray);
}

.edit {
    border: none;
    background-color: var(--clr-very-light-gray);
}

/*--reply--*/
.rep {
    padding-left: 1rem;
    border-left: 2px solid var(--clr-light-gray);
    width: 98%;
}

.reply {
    display: grid;
    grid-template-columns: 2fr;
    grid-template-areas:
        'reply__header reply__header'
        'reply__content reply__content'
        '. reply__update'
        'reply__vote reply__editor';
    gap: 0.4rem;
    padding: 1rem;
    margin: 0 0 1rem 0;
    align-content: center;
    justify-items: start;
    justify-self: end;
    width: 98%;
    background-color: var(--clr-white);
    border-radius: .8rem;
}

.reply__header {
    display: grid;
    grid-template-columns: 1fr minmax(9.8rem, 20rem);
    grid-template-areas:
        'reply__header-picture reply__header-container';
    gap: .5rem;
    align-items: center;
    width: 13rem;
}

.reply__header-picture {
    width: 3.2rem;
}

.reply__header-container {
    display: inline-flex;
    flex-wrap: wrap;
    width: 93%;
}

.reply__header-name {
    font-weight: var(--fw-500);
    margin: 0 .5rem 0 0;
}

.reply__header-owner {
    background-color: var(--clr-moderate-blue);
    color: var(--clr-white);
    font-weight: var(--fw-500);
    padding: 0 .4rem;
    margin: 0 .5rem 0 0;
}

.reply__header-time {
    color: var(--clr-grayish-blue);
    font-weight: var(--fw-500);
}
.reply__content {
    color: var(--clr-grayish-blue);
    border: none;
    width: 100%;
    max-height: 11rem;
    overflow-y: auto;
}

.content {
    padding-left: 0.3rem;
    outline-style: none;
}

.replyingTo {
    width: 100%;
    color: var(--clr-moderate-blue);
    font-weight: var(--fw-500);   
}

.reply__vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    gap: 0.6rem;
    padding: 0 .6rem;
    height: 2.5rem;
    background-color: var(--clr-very-light-gray);
    border-radius: .4rem;
}

.reply__vote-content {
    font-weight: var(--fw-500);
    color: hsl(238, 40%, 52%);
}

.reply__editor {
    display: grid;
    grid-template-columns: 3fr;
    grid-template-areas:
        'reply__delete reply__edit reply__reply';
    gap: 0.4rem;
    height: 2.5rem;
    justify-self: end;
    align-items: center;
}

.reply__delete {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--clr-soft-red);
    font-weight: var(--fw-500);
    width: 4.3rem;
}

.reply__edit {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-500);
    color: var(--clr-moderate-blue);
    width: 3.2rem;
}

.reply__reply {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-weight: var(--fw-500);
    color: var(--clr-moderate-blue);
    width: 4rem;
}

/*--reply construct--*/
.reply__owner {
    display: grid;
    grid-template-columns: 2fr;
    grid-template-areas:
        'reply__owner-content reply__owner-content'
        'reply__owner-picture sendReply';
    gap: 1rem; 
    padding: 1rem;
    place-self: end;
    margin: 0 0 1rem 0;
    width: 93%;
    background-color: var(--clr-white);
    border-radius: .8rem;
}

.reply__owner-content {
    cursor: pointer;
    padding: 1rem;
    border-radius: .4rem;
    height: 7rem;
    overflow-y: auto;
    color: var(--clr-dark-blue);
    border-color: var(--clr-light-gray);
}

.reply__owner-picture {
    width: 3.2rem;
}

.sendReply {
    cursor: pointer;
    width: 5rem;
    height: 2.6rem;
    padding: .6rem .4rem;
    border-radius: .4rem;
    border: none;
    text-transform: uppercase;
    font-weight: var(--fw-500);
    color: var(--clr-white);
    background-color: var(--clr-moderate-blue);
}

/*--Owner main respond--*/
.main__respond {
    display: grid;
    grid-template-columns: 2fr;
    grid-template-areas:
        'main__respond-content main__respond-content'
        'main__respond-picture send';
    gap: 1rem;
    justify-self: center;
    padding: 1rem;
    width: 93%;
    background-color: var(--clr-white);
    border-radius: .8rem;
}

.main__respond-content {
    cursor: pointer;
    padding: 1rem;
    border-radius: 0.4rem;
    overflow-y: auto;
    width: 95%;
    height: 7rem;
    color: var(--clr-dark-blue);
    border-color: var(--clr-light-gray);
}

.main__respond-picture {
    width: 3.2rem;
}

#send {
    cursor: pointer;
    width: 5rem;
    height: 2.6rem;
    padding: 0.6rem 0.4rem;
    border-radius: 0.4rem;
    border: none;
    text-transform: uppercase;
    font-weight: var(--fw-500);
    color: var(--clr-white);
    background-color: var(--clr-moderate-blue);
}

.overlay {
    display: grid;
    justify-self: center;
    justify-items: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: hsl(211, 10%, 45%, 0.5);
  }
  
  .deletion__container {
    width: 19rem;
    padding: 1rem;
    border-radius: 0.4rem;
    font-family: var(--ff-primary);
    background-color: var(--clr-white);
  }
  
  .deletion__title {
    font-size: 1.2rem;
    font-weight: var(--fw-700);
    color: var(--clr-dark-blue);
    margin-bottom: 0.5rem;
  }
  
  .deletion__text {
    font-weight: var(--fw-500);
    color: var(--clr-grayish-blue);
    margin: 0.5rem 0 1rem 0;
  }
  
  .cancel__btn {
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    border: none;
    background-color: var(--clr-grayish-blue);
    text-transform: uppercase;
    font-weight: var(--fw-500);
    color: var(--clr-white);
    margin-right: 0.3rem;
  }
  
  .delete__btn {
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    border: none;
    background-color: var(--clr-soft-red);
    text-transform: uppercase;
    color: var(--clr-white);
  } 
  
  .cancel__btn:focus,
  .cancel__btn:focus-visible,
  .delete__btn:focus,
  .delete__btn:focus-visible
  {
     outline: 2px solid var(--clr-dark-blue);
     outline-offset: 2px;
  }
  
  .show__element {
    display: inline-block;
}
  
  .pointTo__element {
      cursor: pointer;
  }
  
  .border__show {
     border: 2px solid black;
     border-radius: 0.3rem;
  }
  

/*---------------------Desktop layout-------------------------*/
@media screen and (min-width: 48rem) {

/*style 2nd component - desktop */
.main__comments-section {
    display: flex;
    flex-direction: column;
    place-items: center;
    width: 41rem;
}

.comment {
    grid-template-columns: 3fr;
    grid-template-areas:
        'comment__vote comment__header comment__editor'
        'comment__vote comment__content comment__content'
        '. . comment__update';
    width: 41rem;
    place-self: end;
    gap: 1rem;
}

.comment__content {
    max-height: 7rem;
}

.comment__update:hover {
    opacity: .5;
}

.comment__vote {
    display: grid;
    width: 2.4rem;
    height: 6.5rem;
    align-content: center;
    place-items: center;
    gap: .2rem;
}

.comment__vote-plus {
    padding: .2rem .5rem;
}

.comment__vote-plus:hover {
    cursor: pointer;
    color: hsl(238, 40%, 52%);
}

.comment__vote-minus {
    padding: .2rem .5rem;
}

.comment__vote-minus:hover {
    cursor: pointer;
    color: hsl(238, 40%, 52%);
}

.comment__editor {
    height: 3.2rem;
}

.comment__delete:hover {
    opacity: .5;
}

.comment__edit:hover {
    opacity: .5;
}

.comment__reply:hover {
    opacity: .5;
}

.rep {
    width: 39rem;
    place-self: end;
}

.reply {
    grid-template-columns: 3fr;
    grid-template-areas:
        'reply__vote reply__header reply__editor'
        'reply__vote reply__content reply__content'
        '. . reply__update';
    gap: .6rem;
    width: 100%;
}

.reply__header {
    width: 22rem;
}

.reply__header-container {
    width: 100%;
}

.reply__content {
    max-height: 7rem;
}

.reply__update:hover {
    opacity: .5;
}

.reply__vote {
    display: grid;
    width: 2.4rem;
    height: 6.5rem;
    align-content: center;
    place-items: center;
    gap: .2rem;
}

.reply__vote-plus {
    padding: .2rem .5rem;
}

.reply__vote-plus:hover {
    cursor: pointer;
    color: hsl(238, 40%, 52%);
}

.reply__vote-minus {
    padding: .2rem .5rem;
}

.reply__vote-minus:hover {
    cursor: pointer;
    color: hsl(238, 40%, 52%);
}

.reply__editor {
    height: 3.2rem;
    width: 9.5rem;
}

.reply__delete {
    width: 5rem;
    gap: 0.4rem;
}

.reply__delete:hover {
    opacity: .5;
}

.reply__edit {
    width: 4rem;
    gap: 0.4rem;
}

.reply__edit:hover {
    opacity: .5;
}

.reply__reply {
    width: 4.5rem;
    gap: 0.4rem;
}

.reply__reply:hover {
    opacity: .5;
}

.reply__owner {
    display: grid;
    grid-template-columns: 3fr;
    grid-template-areas:
        'reply__owner-picture reply__owner-content sendReply';
    width: 38rem;
}

.reply__owner-content {
    width: 26rem;
}

.sendReply:hover {
    opacity: .5;
}

.main__respond {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        'main__respond-picture main__respond-content send';
    width: 95%;
    height: 10rem;
    gap: 0.6rem;
    justify-items: center;
}

.main__respond-content {
    width: 28rem;
}

.main__respond-content:hover {
    border: 2px solid var(--clr-dark-blue);
}

#send:hover {
    opacity: .5;
}

.cancel__btn {
   cursor: pointer;
}
  
  .delete__btn {
    cursor: pointer;
} 

}

/*------------------grid area names---------------------------*/

.header {
    grid-area: header;
}

.main {
    grid-area: main;
}

.main__title {
    grid-area: main__title;
}

.main__comments {
    grid-area: main__comments;
}

.main__comments-section {
    grid-area: main__comments-section;
}

.comment {
    grid-area: comment;
}

.comment__header {
    grid-area: comment__header;
}

.comment__header-picture {
    grid-area: comment__header-picture;
}

.comment__header-container {
    grid-area: comment__header-container;
}

.comment__content {
    grid-area: comment__content;
}

.comment__update {
    grid-area: comment__update;
}

.comment__vote {
    grid-area: comment__vote;
}

.comment__editor {
    grid-area: comment__editor;
}

.comment__delete {
    grid-area: comment__delete;
}

.comment__edit {
    grid-area: comment__edit;
}

.comment__reply {
    grid-area: comment__reply;
}

.reply {
    grid-area: reply;
}

.reply__header {
    grid-area: reply__header;
}

.reply__content {
    grid-area: reply__content;
}

.reply__update {
    grid-area: reply__update;
}

.reply__vote {
    grid-area: reply__vote;
}

.reply__editor {
    grid-area: reply__editor;
}

.reply__delete {
    grid-area: reply__delete;
}

.reply__edit {
    grid-area: reply__edit;
}

.reply__reply {
    grid-area: reply__reply;
}

.reply__owner {
    grid-area: reply__owner;
}

.reply__owner-content {
    grid-area: reply__owner-content;
}

.reply__owner-picture {
    grid-area: reply__owner-picture;
}

.sendReply {
    grid-area: sendReply;
}

.main__respond {
    grid-area: main__respond;
}

.main__respond-content {
    grid-area: main__respond-content;
}

.main__respond-picture {
    grid-area: main__respond-picture;
}

#send {
    grid-area: send;
}

.attribution {
    grid-area: attribution;
}