:root {
    --primary-color: #0d5364;
    --primary-color--light: #558692;
    --secondary-color: #a2d5d0;

    --color-base: #313030;

    --white: #ffffff;
    --green: #b0d10e;
    --green-dark: #a0be04;
    --gray: #858e93;
    --gray-light: #e5e5ea;
    --gray-lighter: #f5f5f5;
    --gray-dark: #605e5e;
}

/**********/
/* ASSETS */
/**********/

.button {
    border: none;
}
.button i[class^="fa-"]:has(+ span) {
    margin-right: 5px;
}
.button.is-text {
    text-decoration: none;
}
.button.is-primary {
    background-color: var(--primary-color--light);
}
.button.is-gray.is-light {
    background-color: var(--gray-light);
    color: var(--primary-color);
}
.button.is-green {
    background-color: var(--green);
    color: var(--color-base);
}
.button.is-green:hover,
.button.is-green:active,
.button.is-green:focus {
    background-color: var(--green-dark);
}

.tag.is-secondary {
    background-color: var(--secondary-color);
    color: var(--color-base);
}
.tag.is-secondary {
    background-color: #9bd4f0;
    color: var(--color-base);
}

textarea {
    width: 100%;
    padding: 0;
    border-color: transparent;
    background: transparent;
    resize: none;
    scrollbar-color: var(--secondary-color) transparent;
    scrollbar-width: thin;
}
textarea:focus-visible {
    outline: 0;
}

/*******************************************/
/* ADD A POST FORM - MEDIUM (DEFAULT SIZE) */
/*******************************************/

#feed-form {
    background: var(--white);
}

.feed__new {
    border-bottom: 1px solid var(--secondary-color);
    padding: 1rem;
}

.feed__new input[type="text"],
.feed__new input[type="url"] {
    display: block;
    width: 100%;
    border: none;
    border-left: 2px solid var(--secondary-color);
    padding: 5px 10px;
    margin: 6px 0 10px;
}

.feed__new__container {
    display: grid;
    grid-template-columns: 65px auto;
    grid-gap: 1rem;
    padding: 0 1rem;
}
.feed__new__user .image-rounded img {
    border-radius: 50%;
}
.feed__new__username {
    font-weight: 500;
    color: var(--gray);
}

.feed__new__footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--secondary-color);
    padding: 1rem 0 0;
}

.feed__new__options {
    display: flex;
}
.feed__new__options div:nth-child(2) {
    border-left: 1px solid var(--secondary-color);
    margin-left: 1rem;
}

/***************************/
/* ADD A POST FORM - SMALL */
/***************************/

.feed__new.is-small {
    position: relative;
}

.feed__new.is-small .feed__new__container {
    grid-template-columns: 50px auto;
}
.feed__new.is-small figure.image {
    height: 50px;
    width: 50px;
}

.feed__new.is-small .feed__new__footer {
    padding: 0.5rem 0 0;
    justify-content: flex-end;
}

.feed__new.is-small .feed__new__options {
    flex-direction: column;
    position: absolute;
    top: 10px;
    right: 10px;
}
.feed__new.is-small .feed__new__options div:nth-child(2) {
    border: none;
    margin-left: 0;
}

.feed__new.is-small .feed__new__options .button.is-text {
    padding: 10px;
}
.feed__new.is-small .feed__new__options .button.is-light {
    padding: 10px 5px 10px 10px;
}
.feed__new.is-small .feed__new__options .button.is-light span {
    display: none;
}

/************/
/* CKEDITOR */
/************/

.cke_chrome {
    border: none !important;
    margin-bottom: 1rem !important;
}
.feed__new:not(.is-small) .cke_top {
    border-bottom: 1px solid var(--secondary-color) !important;
}
.feed__new.is-small #cke_postContent {
    margin-left: -20px !important;
    margin-top: -15px !important;
}

/*****************************/
/* FORM - ADDITIONAL OPTIONS */
/*****************************/

.feed__new__options__input .options__tags {
    padding-bottom: 1rem;
}

/* SELECT 2 */

.feed__new__options__input .select2-selection {
    border: none !important;
    border-left: 2px solid var(--secondary-color) !important;
    border-radius: 0 !important;
}
.feed__new__options__input .select2 textarea {
    font-size: 0.85rem;
    padding-top: 3px;
}
textarea.select2-search__field::placeholder {
    color: var(--gray-dark);
    font-size: 0.85rem;
}
.feed__new__options__input .select2-selection__choice {
    font-size: 0.9rem;
    background-color: var(--primary-color) !important;
    color: var(--gray-lighter);
    border-color: var(--primary-color--light) !important;
}
.feed__new__options__input .select2-selection__choice__remove {
    height: 100%;
    border-right-color: var(--secondary-color) !important;
    color: var(--gray-lighter) !important;
}
.feed__new__options__input .select2-selection__choice__remove:active,
.feed__new__options__input .select2-selection__choice__remove:focus,
.feed__new__options__input .select2-selection__choice__remove:hover {
    background-color: var(--primary-color--light) !important;
}
.feed__new__options__input .select2-selection__choice__remove span {
    margin-top: -2px;
    display: block;
}
.feed__new__options__input .select2-selection__choice__display {
    display: block;
    padding: 0 8px !important;
}

/***************/
/* FILTER FEED */
/***************/

.feed__filter {
    display: flex;
    margin: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--secondary-color);
}

.feed__filter__item {
    color: var(--primary-color);
    padding: 0.5rem 0.5rem 0.75rem;
    cursor: pointer;
}
.feed__filter__item:hover,
.feed__filter__item:active,
.feed__filter__item:focus {
    color: var(--secondary-color);
}

/*******************/
/* POSTS - CONTENT */
/*******************/

.feed__wrapper {
    margin-top: 0.5rem;
}

.feed__conversation:not(:last-of-type),
.feed__discover:not(:last-of-type) {
    border-bottom: 1px solid var(--secondary-color);
}

.feed__conversation {
    padding: 0.5rem 1rem;
}

.feed__conversation:first-of-type {
    padding-top: 0;
}

.post--pinned {
    text-align: right;
    margin-bottom: -1rem;
}
.post--pinned i[class^="fa-"] {
    transform: rotate(50deg);
    color: var(--primary-color);
}

.post {
    display: grid;
    grid-template-columns: 50px auto;
    grid-gap: 1rem;
    padding-top: 1rem;
}
.feed__conversation .post__content__wrapper {
    word-wrap: break-word;
    word-break: break-word;
}
.feed__conversation--small .post {
    grid-template-columns: 35px calc(100% - 35px);
    grid-gap: 0.5rem;
}
.feed__conversation--small .post__content__wrapper,
.feed__conversation--small .post__trad__btns,
.feed__conversation--small .post__content__tags,
.feed__conversation--small .post__content__medias {
    margin-left: calc((35px + 0.5rem) * -1);
}
.feed__conversation--small .post__content__medias {
    margin-top: 0.5rem;
}
.feed__conversation--small .post__content__header > div:first-of-type > span {
    display: block;
    margin: 0;
}

.post__content__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.post__time {
    color: var(--gray);
    font-size: 0.8rem;
    margin: 0 15px;
}
.post__groupname {
    color: var(--gray);
    font-size: 0.8rem;
    white-space: nowrap;
    & a {
        color: var(--gray);
    }
}
.post__content__header div:nth-child(2) {
    display: flex;
    align-items: center;
    position: relative;
}
.post__content__header .post__content__tags {
    margin-bottom: 0;
}
.post__content__tags .tag {
    margin-bottom: 0;
}
.post__content__header #more {
    padding: 0;
    height: fit-content;
    padding: 5px;
    margin-left: 10px;
}
.post__content__header #more:hover,
.post__content__header #more:active,
.post__content__header #more:focus {
    background: transparent;
    color: var(--primary-color--light);
    box-shadow: none;
}

.feed__conversation.is-reduced .post__content__wrapper {
    max-height: 6lh;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 6;
    -webkit-line-clamp: 6;
}
.contentToggleSize {
    display: inline-block;
    color: var(--gray) !important;
    padding: 0;
    font-size: initial;
    font-weight: normal;
    font-family: Roboto, -apple-system, system-ui, BlinkMacSystemFont,
        "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.contentToggleSize:hover,
.contentToggleSize:active,
.contentToggleSize:focus {
    background: transparent !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
}

.post ul {
    list-style: disc;
    padding-inline-start: 40px;
}
.post ol {
    list-style: decimal;
    padding-inline-start: 40px;
}

.post__trad__btns {
    font-size: 0.8rem;
    text-align: right;
}

.post__content__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -10px;
    margin-top: 1rem;
}
.post__content__footer .button {
    height: fit-content;
    padding: 5px 8px;
    font-size: 1rem;
    color: var(--primary-color);
    border-radius: 8px;
}
.post .button.is-text:hover,
.post .button.is-text:active,
.post .button.is-text:focus {
    background: var(--gray-light);
}
.post__content__footer .button i[class^="fa-"] {
    color: var(--primary-color--light);
}
.post__content__footer .button span {
    font-size: 0.8rem;
}
.comments.is-active {
    background: var(--gray-light);
}

/* MORE DROPDOWN */

#moreMenu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border: 1px solid var(--secondary-color);
}
#moreMenu.is-hidden {
    display: none;
}
#moreMenu ul {
    list-style: none;
    padding-inline-start: 0;
    width: max-content;
}
#moreMenu .button {
    justify-content: flex-start;
    border-radius: 0;
    background: var(--white);
    z-index: 2;
}

/******************/
/* POSTS - MEDIAS */
/******************/

.post__content__medias {
    margin-top: 1rem;
}

.post__links__container {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}
.link__preview,
.video__preview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-gap: 10px;
    padding: 10px;
    background: var(--gray-lighter);
    border-radius: 6px;
    margin-top: 0.5rem;
}
.feed__conversation--small .link__preview,
.video__preview {
    grid-template-columns: 1fr;
}
.link__preview__image,
.video__preview__image {
    position: relative;
    min-height: 100px;
}
.link__preview__image img,
.video__preview__image img {
    display: block;
}
.link__preview__title,
.video__preview__title {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 500;
}
.link__preview__content p,
.video__preview__content p {
    color: var(--gray);
    font-size: 0.8rem;
}
.link__preview.is-full {
    grid-column: 1 / span 2;
}
.link__preview.is-minimalist {
    grid-template-columns: 40px auto;
    margin: 5px;
}
.link__preview.is-minimalist .link__preview__title {
    font-size: 0.9rem;
    word-break: break-word;
}
.link__preview__icon {
    font-size: 30px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.video__preview__overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    background: rgba(176, 209, 14, 0.3);
}
.video__preview__button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 46px;
    width: 46px;
    background: #0d5364;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    cursor: pointer;
}
.video__preview__button::after {
    content: "";
    position: absolute;
    top: calc(50% - 12px);
    left: calc(50% - 12px);
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #0d5364;
    animation: wave 1.6s infinite;
    animation-duration: 2s;
    transform-origin: center center;
    z-index: 0;
}
.video__preview__button img {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    left: 2px;
    z-index: 3;
}

.post__img__container {
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    margin: 0 -0.25rem;
}
.post__img__container .post__img__link {
    width: calc(100% / 2);
    flex-grow: 1;
    justify-content: space-between;
    text-align: center;
    padding: 0.25rem;
}
.post__img__container .post__img {
    margin-bottom: 0;
}
.post__img {
    background-size: cover;
    width: 100%;
    padding-top: 56.25%;
    display: block;
    margin-bottom: 0.5rem;
    object-fit: cover;
    border-radius: 6px;
    background-position: center;
    position: relative;
}
.post__img__more {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.5);
    font-size: 2rem;
    border-radius: 6px;
}

.post__files__container {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
}
.post__file__link {
    display: grid;
    grid-template-columns: 40px auto;
    grid-gap: 10px;
    padding: 10px;
    background: var(--gray-lighter);
    border-radius: 6px;
    margin: 5px;
}
.post__file__icon {
    font-size: 40px;
}
.post__file__content {
    font-size: 0.75rem;
}
.post__file__title {
    text-wrap: balance;
    line-height: 0.9rem;
}
.post__file__extension {
    color: var(--gray);
    padding-top: 5px;
}

/********************/
/* POSTS - COMMENTS */
/********************/

#resultat {
    background-color: var(--white);
    margin-bottom: 4rem;
}

.feed__conversation__comments {
    margin-left: calc(50px + 1rem);
    margin-top: 1rem;
    padding-top: 1rem;
}
.feed__conversation__comments:not(.is-hidden) {
    border-top: 1px solid var(--gray-light);
}

.commentsAdd {
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 15px 10px;
}
.commentsAdd__actions {
    display: flex;
    justify-content: flex-end;
}

.comments {
    margin-top: 1.5rem;
}

.comments__container {
    margin-bottom: 1rem;
}

.comments .post__interactions .button {
    height: 26px;
}

.comment .post__content__header {
    margin-bottom: 0.25rem;
}
.comment .post__content__footer {
    margin-top: 0.5rem;
}

.comment__replies {
    margin-top: 10px;
    margin-left: 50px;
    border-left: 1px solid var(--secondary-color);
    padding-left: 10px;
}

/* Old comments */

.feed__conversation__comments .media-left .image {
    height: 40px;
    width: 40px;
}
.feed__conversation__comments .media-left img {
    border-radius: 50%;
}
.feed__conversation__comments .media-content a {
    color: var(--primary-color);
}
.feed__conversation__comments .media-content .time {
    color: var(--gray);
    font-size: 0.8rem;
    margin-left: 15px;
}
.feed__conversation__comments .controls .reply {
    display: inline-block;
    margin: 0 0.25rem;
    font-size: 0.8rem;
}
.feed__conversation__comments .controls a {
    color: var(--primary-color);
}
.button[id^="bookmarkButton"].is-active,
.button[id^="likeButton"].is-active {
    background-color: transparent;
}
.button[id^="bookmarkButton"] i[class^="fa-"] {
    color: var(--primary-color);
}
.feed__conversation__comments [id^="AddaComm-"] > .media {
    background: transparent !important;
    margin-top: 1.25rem !important;
    padding: 0 !important;
    font-size: 0.8rem !important;
    align-items: center !important;
}
.feed__conversation__comments .card-footer {
    display: block;
    margin: 1rem 0;
    padding: 0 0.75rem 0.5rem;
    border-top: 0;
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
}
.feed__conversation__comments .card-footer textarea {
    border: 0 !important;
    resize: none;
}
.feed__conversation__comments .card-footer .actions {
    display: flex;
    justify-content: space-between;
}
.feed__conversation__comments .post-comment .cke_top {
    border-bottom: 0 !important;
    padding: 0 !important;
}

/******************/
/* DISCOVER BLOCK */
/******************/

.feed__discover {
    padding: 1.25rem 1rem;
}

.feed__discover__container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 1rem;
    margin-top: 1rem;
}
@media screen and (min-width: 768px) {
    .feed__discover__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.discover__item {
    background-color: var(--gray-lighter);
    padding: 1rem;
    border-radius: 12px;
}
.discover__item__header {
    display: flex;
    justify-content: space-between;
}
.discover__item__content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
    margin-top: 10px;
    &.no-columns {
        display: block;
    }
}
.discover__item__txt {
    font-size: 0.9rem;
    color: var(--gray-dark);
}
.discover__item__img {
    background-size: cover;
    background-position: center;
    min-height: 150px;
    border-radius: 12px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 5px solid var(--primary-color--light);
    border-bottom-color: transparent;
    border-radius: 50%;
    box-sizing: border-box;
    animation: rotation 1slinear infinite;
    display: block;
    margin: 2rem auto;
}
@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.post__content__tag {
    font-size: 0.8rem;
    color: var(--gray-dark);
}
