/**
 * Лента канала Telegram — стиль веб-клиента
 *
 * @package Omcode_Theme
 */

.tg-feed {
    --tg-bg: #18222d;
    --tg-surface: #242f3d;
    --tg-text: #e4e4e4;
    --tg-text-muted: #8b98a5;
    --tg-link: #6ab3f3;
    --tg-accent: #2ea043;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--tg-bg);
    border-radius: 12px;
    overflow: hidden;

    max-width: 100%;
    height: 300px;
    min-height: 200px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    resize: none;
    position: relative;
}

.tg-feed__header {
    padding: 12px 16px;
    background: var(--tg-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.tg-feed__channel-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--tg-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.tg-feed__channel-link:hover {
    color: var(--tg-link);
}

.tg-feed__channel-icon {
    width: 32px;
    height: 32px;
    background: var(--tg-link);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.tg-feed__channel-name::before {
    content: "@";
    opacity: 0.7;
}

.tg-feed__list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.tg-feed__post {
    margin: 0 8px 8px;
    background: var(--tg-surface);
    border-radius: 10px;

}

.tg-feed__post-inner {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 10px 12px;
    cursor: pointer;
}

.tg-feed__post-inner:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tg-feed__post-media {
    margin: -10px -12px 10px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    max-height: 360px;
    min-height: 80px;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.tg-feed__post-preview {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.tg-feed__post-body {
    margin: 0;
}

.tg-feed__post-text {
    color: var(--tg-text);
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
}

.tg-feed__post-text ol,
.tg-feed__post-text ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.tg-feed__post-text li {
    margin: 0.25em 0;
}

.tg-feed__post-text br {
    display: block;
    content: "";
    margin-top: 0.25em;
}

.tg-feed__post-text a {
    color: var(--tg-link);
    text-decoration: underline;
    cursor: pointer;
}
.tg-feed__post-text a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.tg-feed__post-text b {
    font-weight: 600;
}

.tg-feed__post-text code {
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 4px;
    border-radius: 4px;
}

/* Цитата (в Telegram — блок с вертикальной полосой слева) */
.tg-feed__post-text .tg-feed__quote,
.tg-feed__post-text blockquote {
    margin: 0.5em 0;
    padding: 8px 12px 8px 14px;
    border-left: 4px solid var(--tg-link);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 6px 6px 0;
    color: var(--tg-text);
    font-size: 14px;
    line-height: 1.45;
}

.tg-feed__post-text .tg-feed__quote br,
.tg-feed__post-text blockquote br {
    display: block;
    content: "";
    margin-top: 0.25em;
}

/* Блок кода (как в Telegram) */
.tg-feed__post-text .tg-feed__code-block,
.tg-feed__post-text pre {
    margin: 0.5em 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.tg-feed__post-text .tg-feed__code-block code,
.tg-feed__post-text pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.tg-feed__post-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--tg-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tg-feed__post-date {
    flex-shrink: 0;
}

.tg-feed__post-views::before {
    content: " · ";
}

.tg-feed__post-reactions {
    display: inline-flex;
    gap: 6px;
}

.tg-feed__reaction {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.tg-feed__footer {
    padding: 10px 16px;
    background: var(--tg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    flex-shrink: 0;
}

/* Ручка для изменения высоты виджета */
.tg-feed__resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 12px;
    cursor: ns-resize;
    z-index: 2;
    background: transparent;
}

.tg-feed__resize-handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 4px;
    background: var(--tg-text-muted);
    border-radius: 2px;
    opacity: 0.6;
}

.tg-feed__resize-handle:hover::after,
.tg-feed__resize-handle:active::after {
    opacity: 1;
    background: var(--tg-link);
}

.tg-feed__open-tg {
    color: var(--tg-link);
    font-size: 13px;
    text-decoration: none;
}

.tg-feed__open-tg:hover {
    text-decoration: underline;
}

/* Пустая лента */
.tg-feed__list:empty::after {
    content: "Загрузка…";
    display: block;
    padding: 20px;
    text-align: center;
    color: var(--tg-text-muted);
    font-size: 14px;
}

.tg-feed--empty .tg-feed__list::after {
    content: "Нет записей";
}

/* Обёртка на слайде «О нас»: в ряду с аккредитацией на десктопе, ниже на мобиле */
.tg-feed-wrapper {
    margin-top: 1rem;
    position: relative;
}

@media (min-width: 992px) {
    .tg-feed-wrapper {
        margin-top: 0;
    }
}
