

.telegram-chats {
    background-color: #0A141E;
    padding: 60px;
}

.telegram-chats-heading {
    font-family: IBM Plex Serif;
    font-weight: 700;
    font-size: 56px;
    margin-bottom: 20px;
}
.telegram-chats-list-item {
    position: relative;
    margin-bottom: 10px;
    margin-left: 5px;
}
.telegram-chats-list-item::before {
    content: '';
    position: absolute;
    left: -18px;
    top: -2px;
    width: 13px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='18' viewBox='0 0 13 18' fill='none'%3E%3Cpath d='M0.205078 15.1303C0.205078 14.1952 0.984293 13.416 1.91936 13.416C2.85442 13.416 3.63364 14.1952 3.63364 15.1303C3.63364 16.0654 2.85442 16.8446 1.91936 16.8446C0.984293 16.8446 0.205078 16.0654 0.205078 15.1303Z' fill='%23FF763C'/%3E%3Cpath d='M12.052 12.6883H7.63637V17.1039H4.36365V12.6883H0V9.41558H4.36365V5H7.63637V9.41558H12.052V12.6883Z' fill='%23FF763C'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center left;
}

.telegram-chats-section {
    height: 700px;
    border: 3px solid #FFFFFF33;
    border-radius: 12px;
    margin-top: 40px;
}

.trg-chat-box-metadata {
    height: 700px;
}

.trg {
    display: grid;
    grid-template-columns: auto 1fr;
    height: 100%;
}

.trg-chat {
    /* background: url('http://localhost/greensby-local/wp-content/themes/greeners/assets/img/telegram-background.png'); */
    background: url('/wp-content/themes/greeners/assets/img/telegram-background.png');
    background-color: #000;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    color: #F7F4FD;
    font-family: Inter !important;
    position: relative;
    overflow: scroll;
    scroll-behavior: smooth;
}

.trg-chat-thread-box {
    position: sticky;
    top: -1px;
    left: 0;
    width: 100%;
    background-color: #212F3F;
    box-shadow: 0px 4.07px 6.11px 0px #00000008;

}

.trg-chat-thread-box-header {
    display: flex;
    padding: 14px 20px;
    gap: 16px;
    align-items: center;
}

.trg-chat-thread-box-header__img {
    max-width: 50px;
    max-height: 50px;
}

.trg-chat-thread-box-header__img img {
    border-radius: 50%;
}

.trg-chat-thread-box-header__button {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trg-chat-thread-box-header__button a  {
    font-size: 14px;
}

.trg-chat-thread-box-header__button button,
.trg-chat-box-metadata button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    border-radius: 32px;
    background-color: #1C93E3;
    font-weight: 500;
    font-size: 15px;
    padding: 12px 24px;
}

.trg-chat-thread-box-header__meta--title {
    font-weight: 600;
    font-size: 18px;
}

.trg-chat-thread-box-header__meta--messages {
    font-weight: 500;
    font-size: 14px;
    color: #5D6B7B;
}

.trg-chat-thread-box-header__resizer {
    margin-left: 34px;
}


.trg-chat p, 
.trg-chat h4 
{
    font-family: Inter !important;
}

.trg-list {
    padding: 20px 12px;
}

.trg-list {
   width: 360px;
   border-right: 2px solid #FFFFFF33;
}

.trg-list-item {
    display: flex;
    padding: 16px;
    gap: 12px;
    justify-content: flex-start;
    position: relative;
}

.trg-list-text {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.trg-list-item:hover {
    border-radius: 10px;
    cursor: pointer;
    background: #212F3F;
}

.trg-list-img {
    max-width: 56px;
    max-height: 56px;
    border-radius: 50%;
}

.trg-list-title {
    font-family: Inter;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}
.trg-list-title-group-name {
    margin-bottom: 6px;
}
.trg-list-title-group-owner {
}

.trg-list-members {
    font-family: Inter;
    font-weight: 500;
    font-size: 14px;
    color:  #91959A;
    margin-bottom: 0;
}

.trg-list-members-counter {
    font-weight: 600;
    font-size: 13px;
    color: #FFFFFF;
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 2px 6px;
    border-radius: 12px;
    background-color: #4A5259;
}

.trg-list-live-button {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 56px;
    height: 26px;
    border-radius: 4px;
    gap: 4px;
    padding: 5px 6px;
    background: #DB0B31;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}
.trg-list-live-button--text {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
}

.trg-list-live-button--icon-mobile {
    display: none;
}
/* CHAT CONTENT */

.trg-chat-boxes {
    padding:  20px 80px 0 30px;
}

.trg-chat-box {
    padding: 8px 0;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
    align-content: flex-start;
}

.trg-chat-user-icon,
.trg-chat-contents__content-reaciton--user {

    background-color: #49CDCF;
    border-radius: 50%;
    max-width: 34px;
    height: 34px;
    font-size: 13px;
    font-weight: 600;
    font-family: Inter;
    width: 100%;
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    overflow: hidden;
}


.trg-chat-contents {
    background-color: #272334;
    height: 100%;
    padding: 16px;
    border-radius: 14px;
    overflow: hidden;
}

.trg-chat-contents__content {
}

.trg-chat-contents__content-single {
    font-weight: 400;
    font-size: 15px;
    margin-bottom: unset;  
}


.trg-chat-contents__user {
    color: #CCB3ED;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.trg-chat-contents__content-reaction {
    margin-top: 16px;
    display: flex;
    gap: 5px;
    background-color: #402F4280;
    border-radius: 100px;
    padding: 3px 8px;
    max-width: fit-content;
}
.trg-chat-contents__content-reaciton--emoji {
    max-width: 20px;
    max-height: 20px;
}
.trg-chat-contents__content-reaciton--user {
    /* color: #CCB3ED;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px; */
    
    max-width: 24px;
    max-height: 24px;
    font-size: 11.3px;
    width: 34px;
}

.trg-chat-contents__content-reply-to {
    background-color: #1C93E31A;
    border-left: 4px solid #2B88C5;
    border-radius: 4px;
    margin: 10px 0;
    padding: 5px 10px;
}

.trg-chat-contents__content-reply-to--username {
    font-weight: 600;
    font-size: 14px;
    color: #2B88C5;
    margin: 0;
    margin-bottom: 4px;
}

.trg-chat-contents__content-reply-to--content {
    font-weight: 400;
    font-size: 13px;
    margin: 0;
}

.trg-chat-contents__content-reply-to--has-media {
    display: flex;
    gap: 10px;
}

/** IMAGES **/

/* 1) Make sure the inner wrapper itself is full-width and uses stretch alignment */
/* 1) Base grid reset */
/*——————————————————————————————————————————————*/
/* 1) Base grid reset (your existing code)       */
/*——————————————————————————————————————————————*/
.trg-chat-contents__content-image > div[class*="--img-"] {
    display: grid;
    gap: 6px;
    width: 100%;
    align-items: stretch;
    justify-items: stretch;
    align-content: stretch;
  }
  
  /*——————————————————————————————————————————————*/
  /* 2) Make both images and videos fill & crop   */
  /*——————————————————————————————————————————————*/
  .trg-chat-contents__content-image > div[class*="--img-"] img,
  .trg-chat-contents__content-image > div[class*="--img-"] video {
    display: block;        /* ensure block-level */
    width: 100%;           /* fill cell width */
    height: 100%;          /* fill cell height */
    object-fit: cover;     /* crop to fit */
  }

/* 1 image (full width) */
.trg-chat-contents__content-image--img-1 {
    grid-template-columns: 1fr;
  }
  
  /* 2 images: first takes 2fr, second 1fr */
  .trg-chat-contents__content-image--content-image--img-2,
  .trg-chat-contents__content-image--img-2 {
    grid-template-columns: 1fr 1fr;
  }
  
   /* 2) 3-image layout: named areas, 2fr/1fr columns, equal 1fr/1fr rows */
   .trg-chat-contents__content-image--img-3 {
    grid-template-areas:
      "img1 img2"
      "img1 img3";
  }
  
  .trg-chat-contents__content-image--img-3 img:nth-child(1) {
    grid-area: img1;
  }
  .trg-chat-contents__content-image--img-3 img:nth-child(2) {
    grid-area: img2;
  }
  .trg-chat-contents__content-image--img-3 img:nth-child(3) {
    grid-area: img3;
  }

  
  /* 4 images: fallback 2×2 */
  .trg-chat-contents__content-image--img-4 {
    grid-template-columns: repeat(2,1fr);
  }
  
  /* 5–10 images: simple 3-column wrap */
  .trg-chat-contents__content-image--img-5,
  .trg-chat-contents__content-image--img-6,
  .trg-chat-contents__content-image--img-7,
  .trg-chat-contents__content-image--img-8,
  .trg-chat-contents__content-image--img-9,
  .trg-chat-contents__content-image--img-10 {
    grid-template-columns: repeat(3,1fr);
  }
  



.trg-chat-contents-has-img {
    max-width: 480px;
    padding: unset;
}

.trg-chat-contents-has-img .trg-chat-contents__user {
    padding: 10px 10px 0px 10px;
}

.trg-chat-contents-has-img .trg-chat-contents__content {
    padding: 16px;
}

.trg-chat-thread-box-footer {
    display: none;
    position: sticky;
    bottom: -1px;
    width: 100%;
    background-color: #212F3F;
    box-shadow: 0px 4.07px 6.11px 0px #00000008;
    padding: 20px;
    
}
.trg-chat-thread-box-footer__button {

    display: flex;
    align-content: center;
    justify-content: center;
    flex-direction: column;
    width: max-content;
    margin: 0 auto;
    gap: 5px;
}

.trg-chat-thread-box-footer__button button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    border-radius: 32px;
    background-color: #1C93E3;
    font-weight: 500;
    font-size: 15px;
    padding: 12px 24px;
    border: unset !important;
}

.trg-chat-thread-box-footer__button a  {
    font-size: 14px;
}


.trg-chat-box-metadata {
    display: flex;
    justify-content: center;
    align-items: center;  
    flex-direction: column;
    margin-top: 20px;
}

.trg-chat-box-metadata-list {
    text-align: center;
}

.trg-chat-box-metadata-list--item {
    padding: 10px 16px 10px 20px;
    border-radius: 100px;
    background-color: #212F3F;
    margin-bottom: 20px;
    font-family: Inter;
    font-weight: 500;
    font-size: 16px;
}

.trg-chat-box-metadata-list--item a {
    color: #fff;
    text-decoration: none !important;
}
.trg-chat-box-metadata-list--item a:hover {
    color: #fff;
}

/* CHAT CONTENT END */

@media (max-width: 1199px)
{
    .trg-chat-thread-box-header__button {
        display: none;
    }
    .trg-chat-thread-box-header__resizer {
        display: none;
    }

    .trg-chat-thread-box-footer {
        display: block;
    }

    .trg-list {
        width: 240px;
    }

    .trg-list-img {
        max-width: 34px;
        max-height: 34px;
    }

    .trg-list-title {
        font-size: 13px;
    }

    .trg-list-members {
        font-size: 11px;
    }

    .trg-list-live-button {
        top: 36px;
        right: 0px;
        width: 48px;
        height: 20px;
    }

    .trg-chat-thread-box-header__meta--title {
        font-size: 15px;
    }
    
    .trg-chat-thread-box-header__meta--messages {
        font-size: 13px;
    }

    .trg-chat-thread-box-header__img {
        max-width: 40px;
        max-height: 40px;
    }
}

@media (max-width: 767px)
{

    #telegram-chats {
        padding: 40px;
    }

    .telegram-chats-heading {
        font-size: 40px;
    }

    .telegram-chats-section {
        border: 0;
        border-radius: unset;
    }
    .trg {
        grid-template-columns: 1fr;
    }

    .trg-chat {
        border-radius: 10px;
    }
    .trg-chat-boxes {
        padding: 10px;
    }
    .trg-list {
        width: 100%;
        border-right: unset;
        overflow-x: scroll;
        padding: 0;
        margin-bottom: 10px;
    }

    .trg-list-items {
        display: flex;
        flex-direction: row;
        /* overflow: hidden; */
    }
    .trg-list-item {
        width: 100%;
        min-width: 220px;
    }

    .trg-list-text {
        width: 100%;
    }
    .trg-chat-user-icon {
        min-width: 34px;
        min-height: 34px;
    }

    .trg-list-item {
        border-radius: 10px;
        cursor: pointer;
        background:#212F3F;
        padding: 10px;
        margin-right: 10px;
        min-height: 88px;
    }
    .trg-list-members {
        position: absolute;
        bottom: 0;
        left: -44px;
        font-size: 13px;

    }

    .trg-list-live-button {
        background-color: unset;
        bottom: 8px;
        right: 8px;
        top: unset;
        width: unset;
        height: unset;
        padding: unset;
    }

    .trg-list-live-button--icon-desktop {
        display: none;
    }

    .trg-list-live-button--icon-mobile {
        display: block;
    }

    .trg-list-live-button--text {
        display: none;
    }

    .trg-chat-thread-box-header {
        padding: 8px 12px;
    }

    .trg-chat-box-metadata {
        height: 530px;
    }
}

@media (max-width:525px)
{
    #telegram-chats {
        padding: 20px;
    }
    .telegram-chats-heading {
        font-size: 30px;
    }
}

@media (max-width:330px)
{
    .trg-chat-thread-box-footer__button button {
        font-size: 13px;
    }
}

.loading-telegram-chat-messages {
    text-align: center;
    margin-top: 10px;
}