/* Стили для блока (тизеры) */
.telegram-feed-wrapper {
  margin: 20px 0;
}

.telegram-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.telegram-feed-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.telegram-feed-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.teaser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.teaser-image-wrapper {
  width: 100%;
  padding-top: 56.25%;
  position: relative;
  background: #f0f0f0;
  overflow: hidden;
}

.teaser-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teaser-text {
  padding: 12px 16px;
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: #333;
}

.teaser-footer {
  padding: 8px 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #888;
}

.teaser-link {
  color: #1a73e8;
  font-weight: 500;
}

/* Информация о канале */
.telegram_channel-user-root-container {
  overflow: hidden;
  padding: 10px 7px;
  margin: 0 0 5px 0;
  border-radius: 3px;
}

.telegram_channel-profile-pic {
  background-position: 50% 50%;
  background-repeat: no-repeat;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  background-size: 100px 100px;
  float: left;
  margin: 8px 15px 0 0;
}

.sk-telegram_channel-profile-info {
  float: left;
  overflow: hidden;
  width: 70%;
  text-align: left;
}

.sk-telegram_channel-profile-usename {
  font-size: 23px !important;
  margin: 0 15px 0 0;
  font-weight: bold;
  display: block;
  float: left;
}

.sk-telegram_channel-profile-counts {
  margin: 0 0 8px 0;
}

.sk-telegram_channel-profile-count-item {
  margin: 0 15px 0 0;
}

.f-w-b {
  font-weight: bold;
}

.telegram_channel_username_follow {
  width: 100%;
  overflow: hidden;
  margin: 10px 0 8px 0;
}

.telegram_channel-user-container {
  display: inline-block;
  border-radius: 4px;
  padding: 8px 8px;
  height: 33px;
  background-color: #a08854;
  border: 1px solid #a08854;
  color: #ffffff;
  cursor: pointer;
  outline: none;
}

/* ===== Стили для попапа ===== */
.sk-popup-post {
  overflow: unset !important;
  position: relative;
  background: #fff;
  width: auto;
  max-width: 75%;
  margin: 20px auto;
  border-radius: 8px;
  height: 60vh; /* высота 60% от высоты экрана */
  max-height: 60vh;
}

.sk_popup_row {
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  height: 100%;
}

.sk_popup_row:after {
  content: "";
  display: table;
  clear: both;
}

.sk_popup_column {
  float: left;
  width: 60%;
  flex: 0 0 60%;
  height: 100%;
}

.sk_popup_column_description {
  width: 40%;
  flex: 0 0 40%;
}

.sk_popup_column_media {
  background: #000 !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sk_popup_column_media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sk_popup_column_spacer {
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.sk_popup_column_user {
  text-align: left;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  border-bottom: solid #dfdfdf 1px;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.sk_popup_column_user img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  margin-right: 10px;
}

.sk_popup_column_user p {
  margin: 0;
}

.sk_popup_column_body {
  text-align: left;
  white-space: pre-wrap;
  margin-bottom: 10px;
  overflow-y: auto; /* скролл только здесь */
  flex: 1;
  scrollbar-gutter: stable;
}

.sk_popup_column_body::-webkit-scrollbar {
  width: 5px;
}

.sk_popup_column_body::-webkit-scrollbar-track {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 5px rgb(128,128,128);
}

.sk_popup_column_body::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 5px rgb(128,128,128);
}

.sk_popup_column_footer {
  text-align: left;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.sk_popup_column_footer span {
  margin-right: 5px;
}

/* Стрелки навигации */
.prev_popup,
.next_popup {
  padding: 0;
  position: absolute;
  top: 47%;
  font-size: 30px;
  opacity: 0.8;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0);
  color: #fff;
  width: 35px;
  height: 35px;
  text-align: center;
  border-radius: 50%;
  border: none;
  outline: none !important;
  z-index: 1046;
}

.prev_popup {
  left: -45px;
}

.next_popup {
  right: -45px;
}

.prev_popup:hover,
.next_popup:hover {
  opacity: 1;
}

.mfp-close {
  outline: none;
  margin-top: -40px !important;
  margin-right: -10px !important;
  color: #FFF !important;
}

/* Адаптация для мобильных */
@media screen and (max-width: 800px) {
  .sk-popup-post {
    height: 90vh; /* на мобильных почти весь экран */
    max-height: 90vh;
  }

  .sk_popup_column {
    width: 100%;
    flex: 0 0 100%;
  }

  .sk_popup_column_description {
    width: 100%;
    flex: 0 0 100%;
  }

  .sk_popup_row {
    margin-top: 50px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .sk_popup_column_media {
    border-radius: 8px 8px 0 0;
    min-height: 40vh;
    flex: 0 0 auto;
  }

  .prev_popup,
  .next_popup {
    top: auto;
    bottom: 10px;
    background: rgba(0,0,0,0.5);
    color: #fff;
  }

  .prev_popup {
    left: 10px;
  }

  .next_popup {
    right: 10px;
  }
}
