/* community */
.community {
    display: grid;
    grid-template-columns: 75% 23%;
    gap: 1.5em;
    overflow: hidden;
}

.community .box {
    overflow: hidden;
}

.community__tabs {
    display: block;
}

.community__tabs__create {
    display: block;
    padding: 0.75em;
}

.community__tabs__create--create {
    display: block;
    text-align: center;
    padding: 0.75em 0;
    color: var(--color-white);
    background-color: var(--background-green);
    border-radius: var(--border-radius);
}

.community__tabs__nav {
    display: block;
    border-top: 1px solid var(--border-grey);
}

.community__tabs__item {
    display: block;
    border-bottom: 1px solid var(--border-grey);
}

.community__tabs__item--link {
    display: block;
    padding: 0.75em 1.25em;
    color: var(--color-dark-grey);
}

.community__tabs__item--active {
    color: var(--color-black);
    background-color: var(--background-light-grey);
}

.community__post {
    display: block;
    border-bottom: 1px solid var(--border-grey);
}

.community__post--link,
.community__header {
    display: grid;
    grid-template-columns: 1fr 80px 80px 140px;
    gap: 1em;
    padding: 1em 1.25em;
    text-decoration: none;
    color: inherit;
}

.community__post--link {
    padding: 1.25em;
}

.community__header {
    color: var(--color-dark-grey);
    background-color: var(--background-grey);
    border-bottom: 1px solid var(--border-grey);
}

.community__post--link:hover {
    text-decoration: none;
    background-color: var(--background-light-grey);
}

.community__post__cell {
    position: relative;
}

.community__post__cell:first-child {
    padding-left: 3.75em;
}

.community__post--icon {
    position: absolute;
    top: 0.3em;
    left: 0;
    width: 45px;
    height: 45px;
    padding: 8px;
    fill: var(--color-dark-grey);
    background-color: var(--background-light-grey);
    border: 1px solid var(--border-grey);
    border-radius: 100%;
}

.community__post__cell:nth-child(2),
.community__post__cell:nth-child(3),
.community__post__cell:nth-child(4) {
    color: var(--color-dark-grey);
}
.community__post--title {
    display: block;
    font-weight: 500;
}

.community__post--new {
    display: inline-block;
    font-weight: 300;
    padding: 5px 12px;
    margin-left: 0.5em;
    color: var(--color-white);
    background-color: var(--background-green);
    border-radius: var(--border-radius);
}

.community__post--pin,
.community__post--lock {
    width: 18px;
    height: 18px;
    fill: var(--color-dark-grey);
    vertical-align: middle;
}

.community__post--tag {
    display: inline-block;
    padding: 3px 6px 5px 6px;
    margin-left: 4px;
    font-size: 0.8em;
    color: var(--color-white);
    font-weight: 300;
    background-color: var(--background-green);
    border-radius: var(--border-radius-small);
}

.community__post--text {
    display: block;
    padding: 0.5em 0 0 0;
    color: var(--color-dark-grey);
    margin: 0;
    font-size: 0.9em;
}

.community__category {
    display: block;
    border-bottom: 1px solid var(--border-grey);
}

.community__category--link {
    display: grid;
    grid-template-columns: 1fr 80px 80px 140px;
    gap: 1em;
    padding: 1.25em 1.25em 1.15em 4.5em;
    color: var(--color-dark-grey);
    position: relative;
}

.community__category--link:hover {
    text-decoration: none;
    background-color: var(--background-light-grey);
}

.community__category--icon {
    position: absolute;
    top: 1.6em;
    left: 1em;
    width: 45px;
    height: 45px;
    padding: 8px;
    fill: var(--color-black);
    opacity: 0.8;
    background-color: var(--background-light-grey);
    border: 1px solid var(--border-grey);
    border-radius: 100%;
}

.community__category--title {
    display: block;
    color: var(--color-black);
    font-weight: 500;
}

.community__category--text {
    display: block;
    padding: 0.5em 0 0 0;
    color: var(--color-dark-grey);
    line-height: 26px;
    margin: 0;
}

.community__search {
    display: block;
    border-bottom: 1px solid var(--border-grey);
}

.community__search--text {
    display: block;
    padding: 0 1.25em;
    color: var(--color-dark-grey);
}

.community__search form {
    position: relative;
    margin: 1em;
}

.community__search--input {
    width: 100%;
    padding: 1em 1em 0.9em 1em;
    font-size: 0.9em;
    color: var(--color-dark-grey);
    background-color: var(--background-white);
    border: 1px solid var(--border-grey);
    box-shadow: var(--box-shadow-inset);
    border-radius: var(--border-radius);
}

.community__search--input::placeholder {
    color: var(--color-grey);
}

.community__search--reset {
    position: absolute;
    top: 0.9em;
    right: 4em;
    padding: 0.3em 1em 0.3em 0.5em;
    font-size: 0.8em;
    color: var(--color-black);
    font-weight: 600;
    background-color: var(--background-dark-grey);
    border-top-right-radius: var(--border-radius-small);
    border-bottom-right-radius: var(--border-radius-small);
}

.community__search--reset::before {
    content: "";
    position: absolute;
    left: -0.95em;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 0.95em solid transparent;
    border-bottom: 0.95em solid transparent;
    border-right: 0.95em solid var(--background-dark-grey);
}

.community__search--reset:hover {
    text-decoration: none;
}

.community__search--button {
    position: absolute;
    top: 27px;
    right: 5px;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 1em;
    cursor: pointer;
}

.community__search--button svg {
    width: 23px;
    height: 23px;
}

.community__profile,
.community__reaction {
    display: block;
    margin: 0 0 1em 0;
    position: relative;
}

.community__profile__content {
    display: block;
    padding: 1em 1.25em;
    position: relative;
}

.community__profile__content strong {
    display: block;
    margin: 1em 0 1.25em 0;
    font-weight: 600;
    color: var(--color-black);
}

.community__profile__content ul {
    margin-left: 1em;
    margin-bottom: 1.25em;
    list-style-type: disc;
}

.community__profile__content li {
    margin-left: 1em;
    margin-bottom: 0.75em;
    list-style-type: disc;
    color: var(--color-dark-grey);
}

.community__profile__content li strong {
    font-weight: 500;
    margin: 0 0 0.25em 0;
}

.community__profile--edit,
.community__reaction--edit {
    position: absolute;
    top: 1em;
    right: 1em;
    z-index: 999;
}

.community__profile--edit svg,
.community__reaction--edit svg {
    width: 24px;
    height: 24px;
    fill: var(--color-light-grey);
}

.community__profile--edit:hover svg,
.community__reaction--edit:hover svg {
    fill: var(--color-black);
}

.community__profile__title {
    display: block;
    padding: 1em 1.25em;
    border-bottom: 1px solid var(--border-grey);
    position: relative;
}

.community__profile__title--title {
    display: block;
    font-weight: 600;
}

.community__profile__content__body {
    display: block;
}

.community__profile__content__body img,
.community__reaction__body img,
.community__answer .rich-text-editor .ql-editor img,
.community .rich-text-editor .ql-editor img {
    max-width: 400px;
    width: auto;
    height: auto;
    display: block;
}

.community__profile__content--text {
    display: block;
    padding: 0;
    margin: 0;
    color: var(--color-dark-grey);
    line-height: 28px;
}

.community__reaction {
    display: block;     
    padding: 1em 1.25em 1em 4.5em!important;
    position: relative;
}

.community__reaction__answer {
    margin-left: 3em;
}

.community__reaction--user-image {
    position: absolute;
    top: 1em;
    left: 1em;
    width: 45px;
    height: 45px;
    border-radius: 100%;
}

.community__reaction--title {
    display: block;
    color: var(--color-black);
}

.community__reaction--timestamp {
    color: var(--color-dark-grey);
    font-style: italic;
    font-weight: 300;
}

.community__reaction__body {
    display: block;;
}

.community__reaction--text {
    display: block;
    padding: 0.5em 0 0 0;
    margin: 0;
    color: var(--color-dark-grey);
    line-height: 28px;
}

.community__profile__vote {
    display: inline-flex;
    margin: 1em 0 0 0;
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
    cursor: pointer;
    overflow: hidden;
}

.community__profile__vote--up,
.community__profile__vote--down {
    align-items: center;
    justify-content: center;
    padding: 0.5em 1em;
    font-size: 0.9em;
}

.community__profile__vote--up {
    border-right: 1px solid var(--border-grey);
}

.community__profile__vote--active,
.community__profile__vote--up:hover,
.community__profile__vote--down:hover {
    color: var(--color-white);
    background-color: var(--background-green);
}

.community__profile__vote--down.community__profile__vote--active {
    background-color: var(--background-red);
}

.community__profile__tags {
    display: block;
    padding: 0 1.25em 1em 1.25em;
}

.community__profile__tags--text {
    display: inline-block;
    padding: 0;
    margin: 0 5px 0 0;
    color: var(--color-dark-grey);
}

.community__profile__tags--tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.9em;
    color: var(--color-white);
    background-color: var(--background-green);
    border-radius: var(--border-radius-small);
}

.community__answer {
    display: block;
    position: relative;
}

.community__answer form {
    display: block;
    padding: 1em 1.25em 2em 4.5em;
    position: relative;
}

.community__answer--textarea {
    width: 100%;
    min-height: 100px;
    padding: 1em;
    margin: 0 0 0.5em 0;
    resize: none;
    background-color: var(--background-white);
    border: 1px solid var(--border-grey);
    border-radius: var(--border-radius);
}

.community__answer .rich-text-editor {
    border: 1px solid #e5e7eb;
    max-height: 175px;
    margin-bottom: 1em;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.community__answer .rich-text-editor .ql-container {
    border: none !important;
}

.community__answer .rich-text-editor .ql-toolbar {
    border: none;
    border: none !important;
    background: #f9fafb;
}

.community__answer .rich-text-editor .ql-container {
    border: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
}

.community__answer .rich-text-editor .ql-editor {
    min-height: 80px;
    padding: 16px;
}

.community__answer--button {
    float: right;
    padding: 1em 1em 0.75em 1em;
    margin: 0 0 1em 0;
    font-size: 0.85em;
    color: var(--color-white);
    background: var(--background-green);
    border: 1px solid var(--border-green);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.community__locked {
    display: block;
}

.community__locked--text {
    display: block;
    padding: 0 1em;
    line-height: 28px;
    color: var(--color-dark-grey);
}

.community__locked--text svg {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    fill: var(--color-dark-grey);
}

.community__profile__user {
    display: block;
    position: relative;
    padding: 0.3em 0 0.3em 3.75em;
    border-top: 1px solid var(--border-grey);
}

.community__profile__user--user-image {
    position: absolute;
    top: 0.75em;
    left: 1em;
    width: 35px;
    height: 35px;
    border-radius: 100%;
}

.community__profile__user--title {
    display: block;
    padding: 0.8em 0;
    margin: 0;
    color: var(--color-dark-grey);
}

.community__mobile {
    display: none;
}

/* pagination */
.pagination {
    display: block;
    text-align: center;
    margin-top: 1.5em;
}

.pagination__nav {
    display: inline-block;
}

.pagination__list {
    display: inline-block;
    margin-right: 0.5em;
}

.pagination__list--link,
.pagination__list--active {
    display: inline-block;
    padding: 0.5em 0.75em;
    color: var(--color-black);
    border: 1px solid var(--border-grey);
    background-color: var(--background-white);
    border-radius: var(--border-radius);
}

.pagination__list--link:hover {
    text-decoration: none;
}

.pagination__list--active {
    color: var(--color-white);
    background-color: var(--background-red);
}

.pagination__list--dots {
    margin-right: 10px;
}

@media (max-width: 1150px) {

    .community {
        grid-template-columns: 66% 30%;
    }

    .community__header__cell:nth-child(3),
    .community__category--link div:nth-child(3),
    .community__post__cell:nth-child(3) {
        display: none;
    }

    .community__header,
    .community__category--link,
    .community__post--link {
        grid-template-columns: 1fr 90px 90px;
        gap: 0.5em;
    }
}

@media (max-width: 950px) {

    .community {
        grid-template-columns: 66% 30%;
    }

    .community__header__cell:nth-child(2),
    .community__category--link div:nth-child(2),
    .community__post__cell:nth-child(2),
    .community__header__cell:nth-child(3),
    .community__category--link div:nth-child(3),
    .community__post__cell:nth-child(3) {
        display: none;
    }
    
    .community__header,
    .community__category--link,
    .community__post--link {
        grid-template-columns: 1fr 90px;
        gap: 0.5em;
    }

}

/* ============================= */
/* Tablet */
/* ============================= */
@media (max-width: 820px) {

    .content {
        left: 0;
        padding: 1em 0.75em 0 0.75em!important;
    }

    .community {
        grid-template-columns: 100%;
        margin: -1em -1em 0 -1em;
        gap: 0;
    }

    .community .box {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .community__mobile__version {
        margin: 0 -1em!important;
    }

    .community__mobile__version .box--title {
        margin: 0 1em!important;
    }

    .community__mobile__version .form__item,
    .community__mobile__version .form__buttons {
        margin: 0 1em 1em 1em;
    }

    .community__mobile__version .form__buttons {
        padding-top: 0;
    }

    .community__profile.box,
    .community__reaction.box,
    .community__answer.box {
        margin-bottom: 0.5em;
        border-radius: 0;
        box-shadow: none;
    }

    .community__tabs {
        display: none;
        position: fixed;
        top: 6em;
        right: 5em;
        min-width: 30%;
        border-radius: var(--box-shadow);
    }

    .community__tabs.box {
        border: 1px solid var(--border-grey);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }

    .community__tabs--open {
        display: block!important;
    }

    .community__mobile {
        display: block;
        position: fixed;
        top: 14em;
        right: 0;
        padding: 1em 1.15em 0.5em 0.75em;
        background-color: var(--background-blue);
        border-top-left-radius: var(--border-radius);
        border-bottom-left-radius: var(--border-radius);
        transition: transform 0.25s ease, opacity 0.25s ease;
        will-change: transform, opacity;
        box-shadow: var(--box-shadow);
        cursor: pointer;
        z-index: 9999;
    }

    .community__mobile svg {
        width: 30px;
        height: 30px;
        fill: var(--color-white);
    }
}

@media (max-width: 720px) {

    .community__tabs {
        min-width: 40%;
    }
}

@media (max-width: 500px) {
    .community__tabs {
        min-width: 55%;
    }
}

@media (max-width: 400px) {
    .community__tabs {
        min-width: 70%;
    }
}
