/* News Page - Tweakers Style */

.news-section {
    padding: 2rem 0 4rem;
    background: #f8f9fa;
    min-height: 80vh;
}

.news-header {
    margin-bottom: 1.5rem;
}

.news-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.news-header p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

/* RSS Link */
.rss-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #ff6600;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.rss-link:hover {
    background: #fff5eb;
    border-color: #ff6600;
    color: #ff6600;
}

.rss-link svg {
    flex-shrink: 0;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    gap: 0.25rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.lang-btn.active {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

/* Category Tabs */
.news-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.news-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.news-tab:hover {
    color: #1a1a1a;
}

.news-tab.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

/* News List */
.news-list {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.news-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: #f8f9fa;
}

/* Date Column */
.news-item-date {
    flex-shrink: 0;
    width: 45px;
    text-align: center;
    padding-top: 0.25rem;
}

.date-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.date-month {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Content */
.news-item-content {
    flex: 1;
    min-width: 0;
}

.news-item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.news-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.news-tag.tag-syntax {
    background: #ede9fe;
    color: #7c3aed;
}

.news-tag.tag-tips {
    background: #d1fae5;
    color: #059669;
}

.news-tag.tag-patterns {
    background: #e0e7ff;
    color: #4f46e5;
}

.news-time {
    font-size: 0.8rem;
    color: #888;
}

.news-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.35rem 0;
    line-height: 1.35;
}

.news-item:hover .news-item-title {
    color: #0066cc;
}

.news-item-summary {
    font-size: 0.875rem;
    color: #555;
    margin: 0 0 0.35rem 0;
    line-height: 1.5;
}

/* Empty State */
.news-empty {
    padding: 3rem;
    text-align: center;
    color: #666;
}

/* Pagination */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.pagination-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not([disabled]) {
    background: #f5f5f5;
    border-color: #ccc;
}

.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: #666;
}

/* ===================== */
/* News Detail Page */
/* ===================== */

.news-detail-section {
    padding: 2rem 0 4rem;
    background: #f8f9fa;
}

.back-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

.news-detail {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 800px;
}

.news-detail-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-detail-meta .news-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
}

.news-detail-meta .cat-syntax {
    background: #ede9fe;
    color: #7c3aed;
}

.news-detail-meta .cat-tips {
    background: #d1fae5;
    color: #059669;
}

.news-detail-meta .cat-patterns {
    background: #e0e7ff;
    color: #4f46e5;
}

.news-detail-date {
    font-size: 0.875rem;
    color: #888;
}

.news-detail h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0;
}

.news-detail-content {
    padding: 2rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
}

.news-detail-content p {
    margin-bottom: 1.25rem;
}

.news-detail-content p:last-child {
    margin-bottom: 0;
}

.news-detail-content pre {
    background: #f4f6f8;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    overflow-x: auto;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.news-detail-content pre code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Consolas", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #2d2d2d;
    background: none;
    white-space: pre;
}

.news-detail-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.source-label {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .news-item {
        padding: 0.875rem 1rem;
    }

    .news-item-date {
        width: 40px;
    }

    .date-day {
        font-size: 1.25rem;
    }

    .news-item-title {
        font-size: 0.95rem;
    }

    .news-detail-header,
    .news-detail-content,
    .news-detail-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .news-detail h1 {
        font-size: 1.4rem;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .news-section,
    .news-detail-section {
        background: #1a1a1a;
    }

    .news-header h1,
    .news-item-title,
    .news-detail h1 {
        color: #f0f0f0;
    }

    .news-header p,
    .news-item-summary,
    .news-detail-content {
        color: #aaa;
    }

    .news-list,
    .news-detail {
        background: #242424;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }

    .news-item {
        border-bottom-color: #333;
    }

    .news-item:hover {
        background: #2a2a2a;
    }

    .lang-btn {
        border-color: #444;
        color: #888;
    }

    .lang-btn:hover {
        border-color: #4d9fff;
        color: #4d9fff;
    }

    .lang-btn.active {
        background: #4d9fff;
        border-color: #4d9fff;
        color: #1a1a1a;
    }

    .rss-link {
        border-color: #444;
        color: #ff9966;
    }

    .rss-link:hover {
        background: #2a2a2a;
        border-color: #ff9966;
    }

    .news-tabs {
        border-bottom-color: #333;
    }

    .news-tab {
        color: #888;
    }

    .news-tab:hover,
    .news-tab.active {
        color: #4d9fff;
    }

    .news-tab.active {
        border-bottom-color: #4d9fff;
    }

    .pagination-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #ddd;
    }

    .pagination-btn:hover:not([disabled]) {
        background: #333;
    }

    .news-detail-header,
    .news-detail-content {
        border-color: #333;
    }

    .news-detail-footer {
        background: #1e1e1e;
        border-color: #333;
    }

    .source-label {
        color: #666;
    }

    .news-detail-content pre {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }

    .news-detail-content pre code {
        color: #d4d4d4;
    }
}
