/* ============================================
   DELOLAB - Минималистичный дизайн
   https://delolab.com
   ============================================ */

/* CSS Variables */
:root {
    /* Синяя палитра */
    --primary: #4A7FD6;
    --primary-dark: #3466B5;
    --primary-light: #6B9BE8;
    --primary-subtle: rgba(74, 127, 214, 0.08);

    /* Цвета для светлой темы */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #FAFAFA;
    --bg-hover: #F0F0F0;
    --text-primary: #1A1A1A;
    --text-secondary: #505050;
    --text-muted: #909090;
    --border-color: #E0E0E0;
    --border-light: #EEEEEE;

    /* Минимальные тени */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);

    /* Размеры */
    --header-height: 56px;
    --sidebar-width: 260px;
    --mobile-drawer-width: 280px;
    --max-width: 1200px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    /* Шрифты */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Темная тема */
[data-theme="dark"] {
    --bg-primary: #1A1A1A;
    --bg-secondary: #141414;
    --bg-tertiary: #222222;
    --bg-hover: #2A2A2A;
    --text-primary: #F0F0F0;
    --text-secondary: #B0B0B0;
    --text-muted: #707070;
    --border-color: #333333;
    --border-light: #2A2A2A;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background-color: var(--primary);
    color: white;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   Header - Минималистичный стиль DELOLAB
   ============================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 16px;
}

/* Mobile: Menu button on LEFT */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
    overflow: hidden;
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop nav */
.nav {
    display: none;
    flex: 1;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-toggle .theme-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.theme-toggle svg path,
.theme-toggle svg circle,
.theme-toggle svg line {
    stroke: currentColor;
    stroke-width: 2;
}

/* Theme icon visibility - moon icon shown in light mode, sun in dark mode */
.theme-icon-moon {
    display: block;
}

.theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

/* Mobile menu button - теперь слева */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 10px;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--primary);
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Mobile Sidebar Drawer - Боковая панель
   ============================================ */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--mobile-drawer-width);
    height: 100%;
    background: var(--bg-primary);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    min-height: 60px;
}

.mobile-drawer-header .logo {
    max-width: calc(100% - 48px);
}

.mobile-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.mobile-drawer-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-drawer-content {
    padding: 16px;
}

.mobile-drawer-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.mobile-drawer-list {
    list-style: none;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.mobile-drawer-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-drawer-link .cat-icon {
    font-size: 20px;
}

.mobile-drawer-link .cat-count {
    margin-left: auto;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Main Content
   ============================================ */
.main {
    flex: 1;
    padding: 24px 0;
}

.page-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

/* ============================================
   Sidebar (Desktop)
   ============================================ */
.sidebar {
    display: none;
}

.sidebar-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-list {
    list-style: none;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.category-link:hover,
.category-link.active {
    background: var(--primary-subtle);
    color: var(--primary);
}

.category-icon {
    font-size: 18px;
}

.category-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.category-count {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.popular-list,
.related-list {
    list-style: none;
}

.popular-link,
.related-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.popular-link:hover,
.related-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.popular-title,
.related-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.popular-views,
.related-views {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Ad Banner - matches sidebar-card styling */
.sidebar-ad {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    text-align: center;
    position: relative;
}

.sidebar-ad-link {
    display: block;
}

.sidebar-ad-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    /* Allow up to 15% size variation */
    max-height: 600px;
}

.ad-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Between-articles Ad Banner */
.feed-ad-banner {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 8px;
    border: 1px solid var(--border-light);
    text-align: center;
    margin-bottom: 16px;
}

.feed-ad-link {
    display: block;
}

.feed-ad-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    /* Adaptive sizing - crops or adapts within 15% tolerance */
    max-width: 100%;
}

/* ============================================
   Content Area
   ============================================ */
.content {
    min-width: 0;
}

.content-header {
    margin-bottom: 20px;
}

.content-header-compact {
    margin-bottom: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: var(--text-muted);
}

/* ============================================
   Feed List - Card style with borders
   ============================================ */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

/* Feed Header: Author + Subscribe */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.feed-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.feed-author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.feed-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-author-avatar-link {
    display: flex;
}

.feed-author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

a.feed-author-name:hover {
    color: var(--primary);
}

.feed-category-name {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.feed-category-name:hover {
    color: var(--primary);
}

.feed-subscribe-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.feed-subscribe-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* Feed Title */
.feed-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feed-title a {
    color: inherit;
    transition: color 0.2s ease;
}

.feed-title a:hover {
    color: var(--primary);
}

/* Feed Image - Full width with rounded corners */
.feed-image-full {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.feed-image-full img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: var(--border-radius-lg);
}

.feed-image-full:hover img {
    transform: scale(1.02);
}

/* Feed Excerpt */
.feed-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Feed Read More */
.feed-read-more {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    transition: opacity 0.2s ease;
}

.feed-read-more:hover {
    opacity: 0.8;
}

/* Legacy article card styles (for profile page) */
.article-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-subtle);
    color: var(--primary);
}

.article-date {
    font-size: 13px;
    color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .feed-card {
        padding: 16px;
    }

    .feed-title {
        font-size: 17px;
    }

    .feed-preview {
        flex-direction: column;
    }

    .feed-image {
        width: 100%;
        height: 180px;
    }

    .feed-excerpt {
        -webkit-line-clamp: 3;
    }
}

/* ============================================
   Article Page - DELOLAB style
   ============================================ */
.article {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-light);
}

.article.article-page {
    padding: 28px 32px;
}

.article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

/* Article Source Row - DELOLAB style */
.article-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.article-source-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Author button in article header */
.article-author-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-author-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.article-author-btn svg {
    flex-shrink: 0;
}

/* Hide text on mobile, show only icon */
@media (max-width: 480px) {
    .article-author-btn-text {
        display: none;
    }

    .article-author-btn {
        padding: 8px;
    }
}

.article-source {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.article-source:hover {
    color: var(--primary);
}

.article-source-icon {
    font-size: 20px;
    line-height: 1;
}

.article-source-name {
    color: inherit;
}

.article-source-divider {
    color: var(--text-muted);
}

.article-date-full {
    font-size: 14px;
    color: var(--text-muted);
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-lead {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
}

/* Article Stats Row */
.article-stats-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.article-stat-item {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-image {
    margin-bottom: 24px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.article-content img {
    border-radius: var(--border-radius-lg);
    max-width: 100%;
    height: auto;
}

.article-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary);
    border-radius: var(--border-radius-sm);
    font-style: italic;
    color: var(--text-secondary);
}

.article-content em {
    font-style: italic;
}

.article-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Article footer row layout */
.article-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.article-stats-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.article-actions-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Reactions */
.article-reactions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.reaction-btn.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.reaction-btn svg {
    width: 18px;
    height: 18px;
}

.reaction-count {
    font-weight: 500;
}

.reaction-like:hover,
.reaction-like.active {
    border-color: #22C55E;
    color: #22C55E;
    background: rgba(34, 197, 94, 0.1);
}

.reaction-dislike:hover,
.reaction-dislike.active {
    border-color: #EF4444;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.article-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.share-btn:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive footer */
@media (max-width: 600px) {
    .article-footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-actions-right {
        width: 100%;
        justify-content: space-between;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}

.back-link:hover {
    opacity: 0.8;
}

/* ============================================
   Recommended Articles Section
   ============================================ */
.recommended-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.recommended-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.recommended-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.recommended-card {
    display: flex;
    gap: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.recommended-card:hover {
    border-color: var(--primary-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.recommended-image {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.recommended-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-no-image {
    background: linear-gradient(135deg, var(--primary-subtle), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommended-icon {
    font-size: 32px;
}

.recommended-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recommended-category {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 4px;
}

.recommended-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.recommended-card-title a {
    color: var(--text-primary);
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-card-title a:hover {
    color: var(--primary);
}

.recommended-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Recommended grid responsive */
@media (min-width: 480px) {
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .recommended-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .recommended-card {
        flex-direction: column;
        gap: 12px;
    }

    .recommended-image {
        width: 100%;
        height: 120px;
    }
}

/* ============================================
   Category Header
   ============================================ */
.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.category-header-compact {
    padding: 16px;
    margin-bottom: 12px;
    gap: 12px;
}

.category-icon-large {
    font-size: 40px;
}

.category-header-compact .category-icon-large {
    font-size: 32px;
}

.category-info {
    flex: 1;
}

.category-info .page-title {
    margin-bottom: 0;
}

.category-stats {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 14px;
}

/* ============================================
   Error Page
   ============================================ */

/* На десктопе: одноколоночный layout для центрирования контента */
.error-page-layout {
    grid-template-columns: 1fr !important;
    max-width: 800px;
    margin: 0 auto;
}

/* На десктопе скрываем сайдбар для страницы 404 */
.error-page-layout .error-sidebar-mobile {
    display: none;
}

/* На мобильных показываем сайдбар внизу страницы */
@media (max-width: 768px) {
    .error-page-layout .error-sidebar-mobile {
        display: block;
        order: 2;
    }

    .error-page-layout .content {
        order: 1;
    }
}

.error-page {
    text-align: center;
    padding: 64px 24px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.error-title {
    font-size: 24px;
    margin: 16px 0;
    font-weight: 600;
}

.error-text {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 15px;
}

.error-hint {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.error-suggestions {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.error-suggestions h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-suggestions li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    padding-left: 20px;
    position: relative;
}

.error-suggestions li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.error-suggestions a {
    color: var(--primary);
    text-decoration: none;
}

.error-suggestions a:hover {
    text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 32px 0 24px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.footer-section {
    position: relative;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.footer-subtitle {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Small */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }

    .nav {
        display: flex;
    }

    .page-layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .sidebar {
        display: block;
    }

    .page-title {
        font-size: 28px;
    }

    .article-title {
        font-size: 32px;
    }

    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none !important;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .article {
        padding: 32px;
    }

    .article-title {
        font-size: 36px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ============================================
   Header Auth & Profile
   ============================================ */
.header-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: var(--border-radius);
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* Longer login button on desktop */
@media (min-width: 768px) {
    .header-login-btn {
        padding: 10px 32px;
        min-width: 100px;
    }
}

.header-login-btn:hover {
    background: var(--primary-dark);
    color: white;
}

/* Header Ad Button (white with gray border) */
.header-ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-ad-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Hide ad button on mobile */
@media (max-width: 768px) {
    .header-ad-btn {
        display: none;
    }
}

.header-profile {
    display: flex;
    align-items: center;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.header-avatar:hover {
    border-color: var(--primary);
}

.header-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Mobile drawer user section */
.mobile-drawer-user {
    padding: 8px 16px 16px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mobile-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.mobile-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-logout-btn {
    display: block;
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    font-size: 14px;
    width: 100%;
}

.mobile-logout-btn:hover {
    color: var(--primary);
}

/* Mobile auth buttons centered */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.mobile-auth-buttons .btn {
    text-align: center;
    justify-content: center;
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 200px);
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.btn-full {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   Profile Pages
   ============================================ */
.profile-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 32px;
    font-weight: 600;
}

.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.profile-username {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Settings Page */
.settings-form {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    padding: 24px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.avatar-upload {
    display: flex;
    gap: 20px;
    align-items: center;
}

.current-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 32px;
    font-weight: 600;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input {
    display: none;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

[data-theme="dark"] .alert-error {
    background: rgba(185, 28, 28, 0.2);
    border-color: rgba(185, 28, 28, 0.3);
}

[data-theme="dark"] .alert-success {
    background: rgba(6, 95, 70, 0.2);
    border-color: rgba(6, 95, 70, 0.3);
}

[data-theme="dark"] .alert-info {
    background: rgba(30, 64, 175, 0.2);
    border-color: rgba(30, 64, 175, 0.3);
}

[data-theme="dark"] .alert-warning {
    background: rgba(146, 64, 14, 0.2);
    border-color: rgba(146, 64, 14, 0.3);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-error {
    background: #FEE2E2;
    color: #B91C1C;
}

/* Article cards horizontal */
.article-card-horizontal {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
}

.article-card-horizontal .article-card-content {
    flex: 1;
}

.article-card-horizontal .article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* Profile article card layout */
.article-card-profile {
    position: relative;
}

.article-card-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.article-card-meta-row .article-category {
    font-size: 13px;
}

.article-card-meta-row .article-date {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.article-card-body {
    margin-top: 4px;
}

.article-card-body .article-card-title {
    margin-bottom: 4px;
}

.article-card-body .article-card-excerpt {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-published {
    background: #D1FAE5;
    color: #065F46;
}

.status-rejected {
    background: #FEE2E2;
    color: #B91C1C;
}

.rejection-reason {
    margin-top: 8px;
    padding: 8px 12px;
    background: #FEE2E2;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    color: #B91C1C;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Article form */
.article-form {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    padding: 24px;
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.editor-toolbar button {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-toolbar button:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* Toolbar image upload button */
.toolbar-upload-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.toolbar-upload-btn:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* WYSIWYG Editor */
.wysiwyg-editor {
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    min-height: 400px;
    padding: 16px;
    background: var(--bg-primary);
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-y: auto;
}

.wysiwyg-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.wysiwyg-editor h2 {
    font-size: 24px;
    margin: 20px 0 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.wysiwyg-editor h3 {
    font-size: 20px;
    margin: 16px 0 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.wysiwyg-editor p {
    margin-bottom: 12px;
}

.wysiwyg-editor strong, .wysiwyg-editor b {
    font-weight: 700;
}

.wysiwyg-editor em, .wysiwyg-editor i {
    font-style: italic;
}

.wysiwyg-editor u {
    text-decoration: underline;
}

.wysiwyg-editor ul, .wysiwyg-editor ol {
    margin: 12px 0;
    padding-left: 24px;
}

.wysiwyg-editor li {
    margin-bottom: 6px;
}

.wysiwyg-editor blockquote {
    border-left: 4px solid var(--primary);
    margin: 16px 0;
    padding: 12px 20px;
    background: var(--bg-secondary);
    font-style: italic;
    color: var(--text-secondary);
}

.wysiwyg-editor a {
    color: var(--primary);
    text-decoration: underline;
}

.article-form textarea#content {
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    min-height: 400px;
    font-family: monospace;
}

/* Image upload for article form */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-upload-preview {
    display: none;
    position: relative;
    max-width: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-upload-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-remove-btn:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.image-upload-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.image-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.upload-progress {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Wide layout for article form */
.page-layout-wide {
    display: block;
}

.content-wide {
    max-width: 800px;
    margin: 0 auto;
}

/* Section header */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Page title */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Auth Message Toast */
.auth-message-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.auth-message-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   Author Profile Page
   ============================================ */
.author-profile-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.author-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.author-profile-avatar {
    flex-shrink: 0;
}

.author-profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 32px;
    font-weight: 600;
}

.author-profile-info {
    flex: 1;
}

.author-profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.author-profile-username {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.author-profile-bio {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.author-profile-stats {
    display: flex;
    gap: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.author-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.author-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Author Articles Section */
.author-articles-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.author-articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.author-article-card {
    display: flex;
    gap: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    transition: border-color 0.2s ease;
}

.author-article-card:hover {
    border-color: var(--primary);
}

.author-article-image {
    flex-shrink: 0;
    width: 160px;
    height: 100px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.author-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.author-article-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.author-article-category:hover {
    color: var(--primary);
}

.author-article-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.author-article-title a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.author-article-title a:hover {
    color: var(--primary);
}

.author-article-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    flex: 1;
}

.author-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .author-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-profile-stats {
        justify-content: center;
    }

    .author-article-card {
        flex-direction: column;
    }

    .author-article-image {
        width: 100%;
        height: 180px;
    }
}

/* ============================================
   Курсы, Сервисы, Старт бизнеса - страницы
   ============================================ */

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Category Tabs (horizontal scroll for mobile) */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Search Results Header */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.clear-search {
    font-size: 14px;
    color: var(--primary);
}

/* Featured Section */
.featured-section {
    margin-bottom: 32px;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.courses-grid.featured {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Course Card */
.course-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--text-primary);
}

.course-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-subtle);
}

.course-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.course-school {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.course-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.course-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.rating-star {
    color: #FFB800;
}

.reviews-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.course-duration {
    font-size: 13px;
    color: var(--text-muted);
}

.course-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-top: auto;
}

.course-link-btn {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-subtle);
    border-top: 1px solid var(--border-light);
    transition: background 0.2s;
}

.course-card:hover .course-link-btn {
    background: var(--primary);
    color: white;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.services-grid.featured {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Service Card */
.service-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--text-primary);
}

.service-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-subtle);
}

.service-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.service-image.placeholder {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.service-image.placeholder span {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.service-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.service-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.service-meta {
    margin-bottom: 8px;
}

.service-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.effectiveness-label {
    font-size: 12px;
    color: var(--text-muted);
}

.effectiveness-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.effectiveness-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.effectiveness-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.service-price {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    margin-top: auto;
}

.service-link-btn {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-subtle);
    border-top: 1px solid var(--border-light);
    transition: background 0.2s;
}

.service-card:hover .service-link-btn {
    background: var(--primary);
    color: white;
}

/* Section Titles */
.all-courses-section,
.all-services-section {
    margin-bottom: 32px;
}

/* Nav Links in Header */
.nav-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}

/* Mobile drawer sections divider */
.mobile-drawer-sections {
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .courses-grid,
    .courses-grid.featured,
    .services-grid,
    .services-grid.featured {
        grid-template-columns: 1fr;
    }

    .nav {
        display: none;
    }
}

@media (min-width: 769px) {
    .category-tabs {
        display: none;
    }
}

/* ============================================
   Authors Page
   ============================================ */

.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.author-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.author-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.author-card-link {
    display: block;
    padding: 24px;
    text-decoration: none;
    color: inherit;
}

.author-card-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
}

.author-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-card-avatar .author-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 32px;
    font-weight: 600;
}

.author-card-info {
    text-align: center;
    margin-bottom: 16px;
}

.author-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.author-card-username {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.author-card-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.author-card-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.author-card-stat {
    font-size: 13px;
    color: var(--text-muted);
}

.author-card-stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* SEO Text Block - Improved Design */
.seo-text-block {
    margin-top: 48px;
    padding: 28px 32px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    position: relative;
}

.seo-text-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.seo-text-content {
    position: relative;
    /* 2-3 строки текста: line-height 1.7 * font-size 15px * 3 строки ≈ 76px */
    max-height: 76px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.seo-text-content.expanded {
    max-height: 5000px;
}

.seo-text-content:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--bg-secondary));
    pointer-events: none;
}

.seo-text-content p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.seo-text-content p:last-child {
    margin-bottom: 0;
}

.seo-text-content ul,
.seo-text-content ol {
    margin-left: 24px;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.seo-text-content li {
    margin-bottom: 6px;
    line-height: 1.75;
}

.seo-text-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.seo-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 18px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.seo-toggle-btn:hover {
    background: var(--primary);
    color: white;
}

.seo-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.seo-toggle-btn.expanded svg {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .authors-grid {
        grid-template-columns: 1fr;
    }

    .seo-text-block {
        padding: 20px 20px 20px 22px;
        margin-top: 32px;
    }

    .seo-text-title {
        font-size: 17px;
    }

    .seo-text-content {
        /* На мобильных также 2-3 строки */
        max-height: 72px;
    }

    .seo-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}
