/**
 * Lo-fi pilot pages: home + category (only when .original-theme).
 */

/* --- Home --- */
html.original-theme body.page-home .main-content,
body.original-theme.page-home .main-content {
    position: relative;
    padding-top: 8px;
}

html.original-theme body.page-home #home-feed-grid,
body.original-theme.page-home #home-feed-grid {
    gap: 20px;
}

html.original-theme body.page-home #home-feed-grid > .video-card:hover .video-title-link,
body.original-theme.page-home #home-feed-grid > .video-card:hover .video-title-link {
    color: #c97b84;
}

html.original-theme body.page-home .video-thumbnail,
body.original-theme.page-home .video-thumbnail {
    border-radius: 14px;
}

html.original-theme body.page-home .shelf-title,
body.original-theme.page-home .shelf-title {
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: 0.02em;
}

html.original-theme body.page-home .empty-page-placeholder,
body.original-theme.page-home .empty-page-placeholder {
    background: rgba(255, 249, 243, 0.82);
    border-radius: 20px;
    padding: 48px 24px;
    border: 1px dashed rgba(139, 115, 85, 0.28);
    margin-top: 12px;
}

html.original-theme body.page-home #main-page-placeholder:not(.is-visible),
body.original-theme.page-home #main-page-placeholder:not(.is-visible) {
    display: none !important;
}

html.original-theme body.page-home .empty-page-placeholder h2,
body.original-theme.page-home .empty-page-placeholder h2 {
    color: var(--text-color);
}

html.original-theme body.page-home .empty-page-placeholder p,
body.original-theme.page-home .empty-page-placeholder p {
    color: var(--text-secondary-color);
}

html.original-theme body.page-home .empty-page-placeholder img,
body.original-theme.page-home .empty-page-placeholder img {
    opacity: 0.92;
    filter: sepia(0.12) saturate(0.85);
}

/* --- Category page --- */
html.original-theme body.page-category .category-page-container,
body.original-theme.page-category .category-page-container {
    max-width: 1280px;
    margin: 0 auto;
}

html.original-theme body.page-category .yt-category-header,
body.original-theme.page-category .yt-category-header {
    border-radius: 24px;
    overflow: hidden;
    min-height: 280px;
    padding: 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 22px 56px rgba(74, 63, 53, 0.14),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(160, 120, 80, 0.22);
}

html.original-theme body.page-category .yt-category-header::after,
body.original-theme.page-category .yt-category-header::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 70% at 50% 110%, rgba(58, 44, 34, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(201, 123, 132, 0.22) 0%, transparent 50%),
        linear-gradient(to top, rgba(45, 35, 28, 0.45) 0%, rgba(45, 35, 28, 0.08) 42%, transparent 72%);
}

html.original-theme body.page-category .yt-category-header::before,
body.original-theme.page-category .yt-category-header::before {
    background-color: transparent;
    background-blend-mode: normal;
    opacity: 0.92;
    filter: saturate(1.08) contrast(1.04);
}

html.original-theme body.page-category .yt-category-header:hover::before,
body.original-theme.page-category .yt-category-header:hover::before {
    transform: scale(1.03);
}

html.original-theme body.page-category .yt-category-content,
body.original-theme.page-category .yt-category-content {
    position: relative;
    z-index: 3;
    width: 80%;
    max-width: none;
    margin: 0;
    padding: 24px 32px;
    display: grid;
    grid-template-columns: 88px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 24px;
    row-gap: 8px;
    align-items: start;
    text-align: left;
    background: linear-gradient(
        145deg,
        rgba(255, 251, 245, 0.66) 0%,
        rgba(248, 236, 220, 0.6) 100%
    );
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 14px 44px rgba(74, 63, 53, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    outline: 1px dashed rgba(139, 115, 85, 0.26);
    outline-offset: 4px;
}

html.original-theme body.page-category .yt-category-eyebrow,
body.original-theme.page-category .yt-category-eyebrow {
    display: inline-flex;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8f6348;
    background: rgba(196, 137, 90, 0.14);
    border: 1px solid rgba(196, 137, 90, 0.28);
    border-radius: 999px;
    width: fit-content;
}

html.original-theme body.page-category .yt-category-icon,
body.original-theme.page-category .yt-category-icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 72px;
    height: 72px;
    margin: 0;
    padding: 10px;
    object-fit: contain;
    justify-self: center;
    align-self: center;
    transform: rotate(-2deg);
    background: rgba(255, 254, 251, 0.92);
    border-radius: 14px;
    border: 2px solid rgba(196, 137, 90, 0.32);
    box-shadow: 4px 6px 0 rgba(139, 107, 78, 0.16);
    filter: none;
}

html.original-theme body.page-category .yt-category-title,
body.original-theme.page-category .yt-category-title {
    grid-column: 2;
    grid-row: 2;
    color: #3d3228;
    text-shadow: none;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: clamp(1.65rem, 3.5vw, 2.5rem);
    line-height: 1.12;
    margin: 0;
    padding: 0 0 10px;
    position: relative;
    align-self: start;
}

html.original-theme body.page-category .yt-category-title::after,
body.original-theme.page-category .yt-category-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 52px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #c4895a 0%, #c97b84 100%);
}

html.original-theme body.page-category .yt-category-description,
body.original-theme.page-category .yt-category-description {
    grid-column: 2;
    grid-row: 3;
    color: #6b5344;
    text-shadow: none;
    font-weight: 500;
    font-size: 15px;
    max-width: 38em;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 640px) {
    html.original-theme body.page-category .yt-category-header,
    body.original-theme.page-category .yt-category-header {
        min-height: 260px;
        padding: 16px;
    }

    html.original-theme body.page-category .yt-category-content,
    body.original-theme.page-category .yt-category-content {
        padding: 20px 18px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        row-gap: 10px;
        text-align: center;
        justify-items: center;
    }

    html.original-theme body.page-category .yt-category-icon,
    body.original-theme.page-category .yt-category-icon {
        grid-column: 1;
        grid-row: 1;
        transform: rotate(-2deg);
    }

    html.original-theme body.page-category .yt-category-eyebrow,
    body.original-theme.page-category .yt-category-eyebrow {
        grid-column: 1;
        grid-row: 2;
    }

    html.original-theme body.page-category .yt-category-title,
    body.original-theme.page-category .yt-category-title {
        grid-column: 1;
        grid-row: 3;
    }

    html.original-theme body.page-category .yt-category-title::after,
    body.original-theme.page-category .yt-category-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    html.original-theme body.page-category .yt-category-description,
    body.original-theme.page-category .yt-category-description {
        grid-column: 1;
        grid-row: 4;
        text-align: center;
    }
}

html.original-theme body.page-category .empty-page-placeholder,
body.original-theme.page-category .empty-page-placeholder {
    background: rgba(255, 249, 243, 0.7);
    border-radius: 20px;
    padding: 48px 24px;
    border: 1px dashed rgba(139, 115, 85, 0.25);
}

html.original-theme body.page-category .empty-page-placeholder h2,
body.original-theme.page-category .empty-page-placeholder h2 {
    color: var(--text-color);
}

html.original-theme body.page-category .empty-page-placeholder p,
body.original-theme.page-category .empty-page-placeholder p {
    color: var(--text-secondary);
}

/* --- Все категории --- */
html.original-theme body.page-morecategories .category-grid-container,
body.original-theme.page-morecategories .category-grid-container {
    max-width: 1280px;
}

html.original-theme body.page-morecategories .page-main-title,
body.original-theme.page-morecategories .page-main-title {
    color: var(--text-color);
    font-weight: 800;
    letter-spacing: -0.02em;
}

html.original-theme body.page-morecategories .category-card,
body.original-theme.page-morecategories .category-card {
    border-radius: 16px;
    border: 1px solid rgba(139, 115, 85, 0.12);
    box-shadow: 0 8px 24px rgba(74, 63, 53, 0.08);
}

html.original-theme body.page-morecategories .category-grid,
body.original-theme.page-morecategories .category-grid {
    gap: 18px;
}

/* Текст поверх превью — только на десктопных плашках */
@media (min-width: 901px) {
    html.original-theme body.page-morecategories .category-card .card-title,
    html.original-theme body.page-morecategories .category-card .card-meta,
    body.original-theme.page-morecategories .category-card .card-title,
    body.original-theme.page-morecategories .category-card .card-meta {
        color: #fffdf9 !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75) !important;
    }
}

/* --- Категория: карточки видео и меню ⋮ --- */
html.original-theme body.page-category .video-card .video-title,
html.original-theme body.page-category .video-card .video-title a,
html.original-theme body.page-category .channel-name-link,
body.original-theme.page-category .video-card .video-title,
body.original-theme.page-category .video-card .video-title a,
body.original-theme.page-category .channel-name-link {
    color: var(--text-color);
}

html.original-theme body.page-category .video-card .video-meta,
body.original-theme.page-category .video-card .video-meta {
    color: var(--text-secondary);
}

html.original-theme body.page-category .thumbnail-wrapper,
body.original-theme.page-category .thumbnail-wrapper {
    border-radius: 14px;
    background: #f5ebe2;
    border: 1px solid rgba(139, 115, 85, 0.1);
}

html.original-theme body.page-category .context-menu-button:hover,
body.original-theme.page-category .context-menu-button:hover {
    background: rgba(201, 123, 132, 0.12) !important;
}

html.original-theme body.page-category .context-menu-button img,
body.original-theme.page-category .context-menu-button img {
    filter: brightness(0) saturate(100%) opacity(0.45) !important;
}

html.original-theme body.page-category .context-menu-dropdown,
html.original-theme body.page-category .video-item-menu,
body.original-theme.page-category .context-menu-dropdown,
body.original-theme.page-category .video-item-menu {
    background: #fffefb !important;
    border: 1px solid rgba(180, 150, 120, 0.22) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 32px rgba(74, 63, 53, 0.14) !important;
    padding: 6px 0 !important;
}

html.original-theme body.page-category .context-menu-dropdown a,
html.original-theme body.page-category .video-item-menu a,
body.original-theme.page-category .context-menu-dropdown a,
body.original-theme.page-category .video-item-menu a {
    color: #4a3f35 !important;
}

html.original-theme body.page-category .context-menu-dropdown a:hover,
html.original-theme body.page-category .video-item-menu a:hover,
body.original-theme.page-category .context-menu-dropdown a:hover,
body.original-theme.page-category .video-item-menu a:hover {
    background: #f5efe6 !important;
}

html.original-theme body.page-category .context-menu-dropdown a img,
html.original-theme body.page-category .video-item-menu a img,
body.original-theme.page-category .context-menu-dropdown a img,
body.original-theme.page-category .video-item-menu a img {
    filter: brightness(0) saturate(100%) opacity(0.45) !important;
}

/* --- Unified guest placeholders (all pages) --- */
html.original-theme .main-content > .empty-page-placeholder,
body.original-theme .main-content > .empty-page-placeholder {
    background: rgba(255, 249, 243, 0.82);
    border-radius: 20px;
    padding: 48px 24px;
    border: 1px dashed rgba(139, 115, 85, 0.28);
    margin-top: 12px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    color: #4a3f35;
}

html.original-theme .main-content > .empty-page-placeholder h2,
body.original-theme .main-content > .empty-page-placeholder h2 {
    color: #4a3f35 !important;
}

html.original-theme .main-content > .empty-page-placeholder p,
body.original-theme .main-content > .empty-page-placeholder p {
    color: #8b7355 !important;
}

html.original-theme .main-content > .empty-page-placeholder img,
body.original-theme .main-content > .empty-page-placeholder img {
    opacity: 0.92;
    filter: brightness(0) saturate(100%) opacity(0.35) sepia(0.12);
}

html.original-theme .main-content > .empty-page-placeholder .empty-page-button,
body.original-theme .main-content > .empty-page-placeholder .empty-page-button,
html.original-theme a.empty-page-button,
body.original-theme a.empty-page-button {
    background: linear-gradient(135deg, #c4895a 0%, #b8927a 100%) !important;
    color: #fffdf9 !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 10px 24px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(74, 63, 53, 0.12);
}

html.original-theme .main-content > .empty-page-placeholder .empty-page-button:hover,
body.original-theme .main-content > .empty-page-placeholder .empty-page-button:hover,
html.original-theme a.empty-page-button:hover,
body.original-theme a.empty-page-button:hover {
    filter: brightness(1.05);
}

/* Guest header sign-in */
html.original-theme .login-button-header,
body.original-theme .login-button-header {
    color: #6b5344 !important;
    border-color: rgba(139, 115, 85, 0.35) !important;
    background: rgba(255, 249, 243, 0.75) !important;
}

html.original-theme .login-button-header:hover,
body.original-theme .login-button-header:hover {
    background: rgba(255, 243, 232, 0.95) !important;
}

html.original-theme .login-button-header .guest-icon,
body.original-theme .login-button-header .guest-icon {
    filter: brightness(0) saturate(100%) opacity(0.42) !important;
}
