/* News Page Styles - Catalog Design */

/* Временно скрываем переключатель языков */
.lang-switch, #langSwitch, #mobileLangSwitch {
    display: none !important;
}

:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --primary-color: #ff8a50;
    --primary-hover: #ff7043;
    --secondary-color: #666;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --header-height: 60px;
    --mobile-bottom-nav: 60px;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #444;
    --secondary-color: #aaa;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Override main-content margins */
.main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* News Grid Container */
.news-grid-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 16px 24px 16px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    /* Оптимизации для плавной прокрутки */
    contain: layout style;
    will-change: scroll-position;
}

@media (min-width: 640px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 24px;
    }
}

/* News Card - Similar to manga card but larger */
.news-card {
    cursor: pointer;
    background: var(--card-bg);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.news-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

[data-theme="dark"] .news-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* News Image */
.news-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

/* Category Badge */
.news-category-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    z-index: 2;
}

/* News Content */
.news-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

/* News Header - категория и дата */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.news-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-excerpt {
    font-size: 12px;
    color: var(--secondary-color);
    line-height: 1.4;
    margin-bottom: 12px;
}


.news-tag {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    white-space: nowrap;
}

.news-date {
    font-size: 10px;
    color: var(--secondary-color);
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--secondary-color);
    font-size: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--secondary-color);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.empty-text {
    font-size: 1rem;
    color: var(--secondary-color);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .news-grid-container {
        padding: 12px 12px 16px 12px;
    }
    
    .news-title {
        font-size: 13px;
    }
    
    .news-excerpt {
        font-size: 11px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .news-grid-container {
        padding: 8px 8px 12px 8px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .news-card {
        border-radius: 10px;
    }
    
    .news-card:hover {
        transform: translateY(-2px) scale(1.01);
    }
    
    .news-content {
        padding: 10px;
    }
    
    .news-title {
        font-size: 12px;
        -webkit-line-clamp: 3;
        margin-bottom: 6px;
    }
    
    .news-excerpt {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    
    .news-tag {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .news-date {
        font-size: 9px;
    }
    
    .news-category-badge {
        top: 6px;
        right: 6px;
        font-size: 8px;
        padding: 3px 6px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .news-grid-container {
        padding: 6px 6px 8px 6px;
    }
    
    .news-grid {
        gap: 6px;
    }
    
    .news-card {
        border-radius: 8px;
    }
    
    .news-content {
        padding: 8px;
    }
    
    .news-title {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }
    
    .news-excerpt {
        font-size: 9px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-image img,
    .spinner {
        animation: none;
        transition: none;
    }
    
    .news-card:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid var(--text-color);
    }
    
    .news-category-badge {
        background: var(--text-color);
        color: var(--card-bg);
    }
}

/* Focus states for accessibility */
.news-card:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .news-grid {
        display: block;
    }
    
    .news-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .news-card:hover {
        transform: none;
        box-shadow: none;
    }
}