
:root {
    --primary-color: #b91c1c;
    --secondary-color: #1a202c;
    --accent-color: #f56565;
    --text-color: #4a5568;
    --heading-color: #2d3748;
    --background-color: #f7fafc;
    --white: #ffffff;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-family-serif: 'Lora', serif;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: var(--font-family-sans);
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Loader */
.loader {
    border: 8px solid var(--gray-200);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 5rem auto;
}

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

/* Header */
.site-header {
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.logo {
    font-family: var(--font-family-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav .nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav .nav-list a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--heading-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav .nav-list a:hover {
    color: var(--primary-color);
}

.header-actions .search-btn,
.header-actions .subscribe-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.5rem;
}

.header-actions .subscribe-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 5px;
    padding: 0.5rem 1rem;
    margin-left: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.header-actions .subscribe-btn:hover {
    background-color: #a01c1c;
}

/* Main Content */
.breaking-news {
    display: flex;
    align-items: center;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.breaking-news span {
    font-weight: 700;
    margin-right: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.ticker {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.ticker span {
    display: inline-block;
    animation: ticker-scroll 30s linear infinite;
}

@keyframes ticker-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .content-area {
        grid-template-columns: 2fr 1fr;
    }
}

/* News Card */
.news-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card .image-container {
    height: 220px;
}

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

.news-card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.news-card-content h3 {
    font-family: var(--font-family-serif);
    font-size: 1.25rem;
    color: var(--heading-color);
    margin: 0.5rem 0;
}

.news-card-content p {
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.news-card-content .news-meta {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 1rem;
}

/* Sidebar */
.trending-news {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.trending-news h3 {
    font-family: var(--font-family-serif);
    font-size: 1.5rem;
    margin-top: 0;
    color: var(--heading-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.trending-news ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-news li a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.trending-news li:last-child a {
    border-bottom: none;
}

.trending-news li a:hover {
    color: var(--primary-color);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

#load-more {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#load-more:hover {
    background-color: #a01c1c;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    color: var(--gray-400);
    padding: 3rem 0 0;
    margin-top: 3rem;
}

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

.footer-title {
    font-family: var(--font-family-serif);
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-text, .footer-list, .newsletter-form {
    font-size: 0.9rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-list a {
    text-decoration: none;
    color: var(--gray-400);
    transition: color 0.3s ease;
}

.footer-list a:hover {
    color: var(--white);
}

.social-icons-footer a {
    color: var(--gray-400);
    font-size: 1.25rem;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.social-icons-footer a:hover {
    color: var(--white);
}

.newsletter-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-700);
    background-color: var(--gray-800);
    color: var(--white);
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.newsletter-form button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #a01c1c;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-700);
    font-size: 0.8rem;
}

/* Article Page */
.article-wrapper {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

@media (min-width: 768px) {
    .article-wrapper {
        padding: 3rem;
    }
}

.article-header .category-badge {
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.article-title {
    font-family: var(--font-family-serif);
    font-size: 2.5rem;
    color: var(--heading-color);
    margin: 1rem 0;
}

.article-meta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-300);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.article-meta .author-name {
    font-weight: 600;
}

.article-meta span {
    margin: 0 0.5rem;
}

.hero-image-container {
    margin-bottom: 2rem;
}

.hero-image {
    width: 100%;
    border-radius: 8px;
}

.article-content {
    font-family: var(--font-family-serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-family: var(--font-family-sans);
    font-weight: 700;
    color: var(--heading-color);
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* Utility */
.spinner {
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 5rem auto;
}

#error-state {
    text-align: center;
    padding: 5rem 0;
}

.error-msg {
    color: var(--accent-color);
    font-weight: 500;
}

.back-btn, .refresh-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-btn:hover, .refresh-btn:hover {
    background-color: var(--gray-900);
}
