/**
 * News Page Styles
 */

.news-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.news-header {
    text-align: center;
    margin-bottom: 30px;
}

.news-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--color-text-primary, #333);
}

.news-header .subtitle {
    color: var(--color-text-secondary, #666);
    font-size: 0.95rem;
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--color-bg-secondary, #f5f5f5);
    border-radius: 12px;
}

.category-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    background: var(--color-bg-primary, #fff);
    color: var(--color-text-primary, #333);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-btn:hover {
    background: var(--color-primary, #4a90d9);
    color: #fff;
    transform: translateY(-1px);
}

.category-btn.active {
    background: var(--color-primary, #4a90d9);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* News Card */
.news-card {
    background: var(--color-bg-primary, #fff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.news-card__image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.news-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.5rem;
}

.news-card__body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card__category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-primary-light, #e8f0fe);
    color: var(--color-primary, #4a90d9);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 10px;
    width: fit-content;
}

.news-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--color-text-primary, #333);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__title a {
    color: inherit;
    text-decoration: none;
}

.news-card__title a:hover {
    color: var(--color-primary, #4a90d9);
}

.news-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary, #666);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-muted, #999);
    padding-top: 12px;
    border-top: 1px solid var(--color-border, #eee);
}

.news-card__source {
    font-weight: 500;
}

.news-card__time {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading State */
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #666);
}

.news-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border, #eee);
    border-top-color: var(--color-primary, #4a90d9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.news-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff5f5;
    border-radius: 12px;
    color: #c53030;
}

.news-error__icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.news-error__retry {
    margin-top: 15px;
    padding: 10px 24px;
    background: #c53030;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Empty State */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #666);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .news-card {
    background: var(--color-bg-secondary, #1e1e1e);
}

[data-theme="dark"] .category-filter {
    background: var(--color-bg-tertiary, #2d2d2d);
}

[data-theme="dark"] .category-btn {
    background: var(--color-bg-secondary, #1e1e1e);
    color: var(--color-text-primary, #eee);
}

[data-theme="dark"] .news-card__category {
    background: rgba(74, 144, 217, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .news-page {
        padding: 15px;
    }

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

    .news-header h1 {
        font-size: 1.5rem;
    }

    .category-filter {
        gap: 8px;
        padding: 10px;
    }

    .category-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}

/* News Card Link */
.news-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.news-card__link:hover {
    text-decoration: none;
}

/* News Detail Page */
.news-detail {
    max-width: 800px;
    margin: 0 auto;
}

.news-detail__back {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--accent-color, #667eea);
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.news-detail__back:hover {
    opacity: 0.7;
}

.news-detail__header {
    margin-bottom: 24px;
}

.news-detail__category {
    display: inline-block;
    margin-bottom: 12px;
}

.news-detail__title {
    font-size: 1.8rem;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text-primary, #333);
}

.news-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

.news-detail__image {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.news-detail__image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-detail__content {
    padding: 20px 0;
}

.news-related {
    border-top: 1px solid var(--border-color, #eee);
    padding-top: 32px;
}

@media (max-width: 768px) {
    .news-detail__title {
        font-size: 1.4rem;
    }

    .news-detail__meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* 記事内画像のスタイル */
.content-image {
    margin: 24px 0;
    text-align: center;
}

.content-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-detail__text {
    white-space: pre-wrap;
    word-wrap: break-word;
}