/* ============================================================
   YTB-MAIN.CSS — сетка главной в палитре хедера (тёмная тема)
   ============================================================ */

:root {
    --ytb-bg: var(--yt-bg, #14161b);
    --ytb-bg-elevated: var(--yt-bg-soft, #1a1d23);
    --ytb-text: var(--yt-text, #f1f2f4);
    --ytb-text-secondary: var(--yt-text-dim, #9aa0aa);
    --ytb-text-mute: var(--yt-text-mute, #7d828c);
    --ytb-border: var(--yt-border, #262a31);
    --ytb-border-soft: var(--yt-border-soft, #2a2e36);
    --ytb-hover: var(--yt-bg-hover, rgba(255, 255, 255, 0.06));
    --ytb-red: var(--yt-red, #ff4b4b);
    --ytb-radius: 12px;
    --ytb-chip-bg: #22262e;
    --ytb-chip-active-bg: #f1f2f4;
    --ytb-chip-active-text: #14161b;
    --ytb-skeleton-bg: #232730;
    --ytb-skeleton-shine: #2e333c;
}

/* Сайт тёмный по умолчанию — палитра наследуется от хедера */
[data-theme="dark"] {
    --ytb-bg: var(--yt-bg, #14161b);
    --ytb-bg-elevated: var(--yt-bg-soft, #1a1d23);
    --ytb-text: var(--yt-text, #f1f2f4);
    --ytb-text-secondary: var(--yt-text-dim, #9aa0aa);
    --ytb-border: var(--yt-border, #262a31);
    --ytb-hover: var(--yt-bg-hover, rgba(255, 255, 255, 0.06));
    --ytb-chip-bg: #22262e;
    --ytb-chip-active-bg: #f1f2f4;
    --ytb-chip-active-text: #14161b;
    --ytb-skeleton-bg: #232730;
    --ytb-skeleton-shine: #2e333c;
}

body { background: var(--ytb-bg); }

/* Скроллбар страницы в палитре сайта */
html { scrollbar-width: thin; scrollbar-color: #2e333c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #2e333c;
    border-radius: 5px;
    border: 2px solid var(--ytb-bg);
}
::-webkit-scrollbar-thumb:hover { background: #3a3f48; }

/* ============================================================
   ОТСТУПЫ ОТ ШАПКИ И МЕНЮ — страховка поверх header.css,
   контент не залезает под фиксированные элементы
   ============================================================ */
.yt-container {
    margin-left: var(--sb-w, 220px) !important;
    padding-top: var(--header-h, 68px) !important;
}

/* ============================================================
   ОБЁРТКА СТРАНИЦЫ
   ============================================================ */
.ytb-main {
    padding: 8px 24px 60px;
    background: transparent; /* фон даёт body — никаких светлых блоков */
    color: var(--ytb-text);
    min-height: calc(100vh - var(--header-h, 68px));
}

.ytb-container {
    max-width: 100%;
    margin: 0 auto;
}

/* ============================================================
   СЕТКА: 4 в ряд на MacBook Air (≥1200px), 5 на больших (≥1700px)
   ============================================================ */
.ytb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 16px;
}

@media (max-width: 1199px) {
    .ytb-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .ytb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ytb-grid { grid-template-columns: 1fr; gap: 20px 12px; }
}
@media (min-width: 1700px) {
    .ytb-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ============================================================
   ФИЛЬТРЫ (чипсы) — липнут под шапкой при скролле
   ============================================================ */
.ytb-filters {
    position: sticky;
    top: var(--header-h, 68px);
    z-index: 900;
    display: flex;
    gap: 8px;
    background: var(--ytb-bg);
    padding: 12px 0;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.ytb-filters::-webkit-scrollbar { display: none; }

.ytb-chip {
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: var(--ytb-chip-bg);
    color: var(--ytb-text);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}
.ytb-chip:hover { background: #2e333c; }
.ytb-chip.ytb-chip-active {
    background: var(--ytb-chip-active-bg);
    color: var(--ytb-chip-active-text);
}

/* ============================================================
   КАРТОЧКА ВИДЕО
   ============================================================ */
.ytb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.ytb-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ytb-radius);
    overflow: hidden;
    background: var(--ytb-skeleton-bg);
    display: block;
    margin-bottom: 12px;
}

.ytb-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}
.ytb-card:hover .ytb-thumb {
    transform: scale(1.03);
    filter: brightness(1.07);
}

/* Просмотренные — чуть приглушённое превью */
.ytb-watched .ytb-thumb { opacity: 0.8; }
.ytb-watched:hover .ytb-thumb { opacity: 1; }

.ytb-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(10, 12, 16, 0.85);
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 6px;
    z-index: 2;
    backdrop-filter: blur(4px);
}


	#ytb-card .ytb-avatar 
#ytb-card .ytb-avatar-link
{
		display:none !important;
	} 

.ytb-watched-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(10, 12, 16, 0.75);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.ytb-watched-badge svg { width: 14px; height: 14px; }

.ytb-progress-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 2;
}
.ytb-progress {
    height: 100%;
    background: var(--ytb-red);
    border-radius: 0 2px 2px 0;
    transition: width 0.2s ease;
}

/* ===== ТЕЛО КАРТОЧКИ (структура твоя, без изменений) ===== */
.ytb-card-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
}

.ytb-avatar-link { flex-shrink: 0; text-decoration: none;}
.ytb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ytb-meta { flex: 1; min-width: 0; }

.ytb-title-link { text-decoration: none; color: inherit; display: block; }
.ytb-title {
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ytb-text);
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: color 0.15s ease;
}
.ytb-card:hover .ytb-title { color: #ffffff; }

.ytb-author-link { text-decoration: none; }
.ytb-author {
    display: block;
    font-size: 13px;
    color: var(--ytb-text-secondary);
    margin-bottom: 2px;
    transition: color 0.15s ease;
}
.ytb-author:hover { color: var(--ytb-text); }

.ytb-stats {
    font-size: 12.5px;
    color: var(--ytb-text-secondary);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.ytb-dot { margin: 0 2px; }

/* ===== МЕНЮ «ТРИ ТОЧКИ» ===== */
.ytb-card-more {
    position: relative;
    flex-shrink: 0;
    margin-top: -4px;
}

.ytb-menu-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    color: var(--ytb-text-secondary);
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ytb-card:hover .ytb-menu-btn,
.ytb-card:focus-within .ytb-menu-btn { opacity: 1; }
.ytb-menu-btn:hover { background: var(--ytb-hover); color: var(--ytb-text); }

.ytb-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--ytb-bg-elevated);
    border: 1px solid var(--ytb-border-soft);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    min-width: 240px;
    padding: 6px;
    z-index: 1200;
}
.ytb-menu.show { display: block; }

.ytb-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--ytb-text);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}
.ytb-menu-item:hover { background: var(--ytb-hover); }
.ytb-menu-item svg { flex-shrink: 0; color: var(--ytb-text-secondary); }
.ytb-menu-item:disabled { opacity: 0.6; cursor: default; }

.ytb-menu-divider {
    height: 1px;
    background: var(--ytb-border-soft);
    margin: 6px 10px;
}

/* ============================================================
   СКЕЛЕТОНЫ — структура твоя, только тёмная перекраска
   ============================================================ */
@keyframes ytb-shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.ytb-skeleton {
    background: linear-gradient(
        90deg,
        var(--ytb-skeleton-bg) 0%,
        var(--ytb-skeleton-shine) 50%,
        var(--ytb-skeleton-bg) 100%
    );
    background-size: 800px 100%;
    animation: ytb-shimmer 1.4s infinite linear;
    border-radius: 4px;
}

.ytb-skeleton-card { pointer-events: none; }

.ytb-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ytb-radius);
    margin-bottom: 12px;
}
.ytb-skeleton-title { height: 16px; margin-bottom: 8px; width: 85%; }
.ytb-skeleton-meta { height: 12px; margin-bottom: 6px; width: 60%; }

/* ============================================================
   ИНДИКАТОРЫ
   ============================================================ */
#ytb-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}
#ytb-loading .ytb-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--ytb-border-soft);
    border-top-color: var(--ytb-red);
    border-radius: 50%;
    animation: ytb-spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes ytb-spin { to { transform: rotate(360deg); } }

#ytb-no-more {
    display: none;
    text-align: center;
    padding: 48px 20px;
    color: var(--ytb-text-mute);
    font-size: 13.5px;
}

/* ============================================================
   МОБИЛЬНЫЕ (шапка и меню скрыты — контент на всю ширину)
   ============================================================ */
@media (max-width: 768px) {
    .yt-container {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
    .ytb-main { padding: 4px 12px 60px; }
    .ytb-filters { top: 0; padding: 10px 0; }
    .ytb-chip { height: 32px; padding: 0 12px; font-size: 13px; }
    .ytb-menu-btn { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ytb-skeleton { animation: none; }
    .ytb-thumb,
    .ytb-title,
    .ytb-chip { transition: none; }
    .ytb-card:hover .ytb-thumb { transform: none; }
}

/* ============================================================
   ТИПОГРАФИКА КАРТОЧКИ
   Канал — жирный, мельче и контрастнее; мета — мельче и читаемее
   ============================================================ */
.ytb-author {
    font-size: 12.5px;
    font-weight: 700;
    color: #d9dde3;
    letter-spacing: 0.01em;
    margin-bottom: 3px;
}
.ytb-author:hover { color: #ffffff; }

.ytb-stats {
    font-size: 12px;
    color: #b4bac4;
}
.ytb-dot { color: #8a909a; }