/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.beta-tag {
    font-size: 0.6rem;
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-weight: 600;
    vertical-align: middle;
}

.logo .tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logo a {
    color: white;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

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

.language-selector select {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Homepage Styles */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem; /* Balanced spacing - not too much with card margins */
    margin: 3rem 0; /* Increased from 2rem */
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.news-card .news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.news-card .news-content {
    padding: 2rem; /* Increased from 1.5rem */
}

.news-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem; /* Increased from 0.5rem */
    color: #2c3e50;
    line-height: 1.5; /* Added for better title readability */
}

.news-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.news-card h3 a:hover {
    color: #3498db;
}

.news-card .meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem; /* Increased from 1rem */
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem; /* Increased from 0.5rem */
    align-items: center;
}

.news-card .source {
    background: #f0f4f8;
    color: #2c3e50;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.news-card .crawl-indicator {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: help;
}

.news-card .excerpt {
    color: #555;
    line-height: 1.8; /* Increased from 1.6 for better readability */
    margin-bottom: 1.5rem; /* Added spacing before read-more link */
}

.news-card .read-more {
    display: inline-block;
    margin-top: 1.5rem; /* Increased from 1rem */
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem; /* Added padding for better clickability */
    border: 1px solid #3498db; /* Added border */
    border-radius: 4px;
    transition: all 0.3s;
}

.news-card .read-more:hover {
    background: #3498db;
    color: white;
    text-decoration: none;
}

/* Article Styles */
.news-article {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.article-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
}

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

.article-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.lang-indicator {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-line; /* Preserve line breaks from content */
}

.article-content h2 {
    color: #2c3e50;
    margin: 2rem 0 1rem 0;
}

.article-content h3 {
    color: #34495e;
    margin: 1.5rem 0 0.8rem 0;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 2rem;
}

.source-attribution {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.language-switch {
    text-align: center;
    margin-top: 2rem;
}

.lang-switch-btn {
    background: #3498db;
    color: white;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s;
}

.lang-switch-btn:hover {
    background: #2980b9;
}

/* Archive Styles */
.archive-navigation {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.archive-item {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
    transition: border-color 0.3s;
}

.archive-item:hover {
    border-color: #3498db;
}

/* Footer Styles */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0 1rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card .news-image {
        height: 150px;
    }
    
    .article-image {
        height: 250px;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .news-article {
        padding: 1rem;
        margin: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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