@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Roboto:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img, picture, video {
    max-width: 100%;
    height: auto;
    display: block;
}

:root {
    --primary-blue: #Ce1212;
    --accent-purple: #Ce1212;
    --text-dark: #1a1a1a;
    --text-medium: #374151;
    --text-light: #6b7280;
    --border-light: #e5e7eb;
    --border-dashed: #d1d5db;
    --bg-light: #f9fafb;
    --bg-white: #fff;
    --hover-bg: #f3f4f6;
    --success-green: #10b981;
    --error-red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0/.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0/.1);
    
    /* Responsive spacing variables */
    --container-padding: clamp(1rem, 4vw, 2rem);
    --content-gap: clamp(1.5rem, 3vw, 3rem);
    --section-spacing: clamp(2rem, 5vw, 2.5rem);
}

body {
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #eee;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

h1, h2, h3, h4, h5, h6 {
    font-family: Merriweather, Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Header styles */
.site-header {
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-light);
    padding: clamp(1rem, 3vw, 1.5rem) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1rem, 3vw, 2rem);
}

.site-title {
    font-family: Merriweather, serif;
    font-size: clamp(1.25rem, 5vw, 2.5rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-dark);
    text-align: center;
    flex: 1;
    margin: 0;
    line-height: 1.1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border-radius: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    background: var(--hover-bg);
    color: var(--primary-blue);
}

.search-input {
    width: 0;
    padding: 0;
    border: none;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-family: Roboto, sans-serif;
    opacity: 0;
    overflow: hidden;
}

.search-input.active {
    width: clamp(180px, 30vw, 220px);
    padding: 0.625rem 1rem;
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    margin-left: 0.5rem;
    opacity: 1;
    background: var(--bg-white);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: var(--section-spacing) auto;
    padding: 0 var(--container-padding);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: var(--content-gap);
    align-items: start;
}

.section-title {
    font-family: Merriweather, serif;
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 0.75rem;
    color: var(--text-dark);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border-light);
}

/* Featured story styles */
.featured-story {
    background: #eee;
}

.featured-image-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    border: 3px solid var(--text-dark);
    overflow: hidden;
}

.featured-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.featured-image:hover {
    transform: scale(1.02);
}

.featured-content {
    padding: 0 0.5rem;
    background-color: #eee;
}

.category-badge {
    display: inline-block;
    background: #Ce1212;
    color: #fff;
    padding: 0.4rem 1rem;
    font-size: clamp(0.625rem, 2vw, 0.75rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.featured-headline {
    font-family: Merriweather, serif;
    font-size: clamp(1.25rem, 4vw, 2rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.featured-excerpt {
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.cta-button {
    background: #Ce1212;
    color: #fff;
    border: none;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    border-radius: 0;
    font-family: Roboto, sans-serif;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    background: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cta-button:focus {
    outline: 3px solid rgba(67, 56, 202, 0.3);
    outline-offset: 2px;
}

.article-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: var(--text-light);
    font-weight: 400;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta span:not(:last-child)::after {
    content: '/';
    margin-left: 1rem;
    color: var(--border-dashed);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.gallery-thumbnails img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-thumbnails img:hover {
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

/* News section styles */
.latest-news-list {
    display: flex;
    flex-direction: column;
}

.news-item {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    padding: clamp(1rem, 2.5vw, 1.25rem) 0;
    border-bottom: 2px dashed var(--border-dashed);
    transition: background 0.2s ease;
}

.news-item:hover {
    background: var(--hover-bg);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.news-item.hidden {
    display: none;
}

.news-thumbnail {
    width: clamp(80px, 15vw, 120px);
    height: clamp(54px, 10vw, 80px);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.news-item:hover .news-thumbnail {
    border-color: var(--primary-blue);
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: clamp(0.625rem, 1.5vw, 0.75rem);
    flex-wrap: wrap;
}

.news-meta .category-badge {
    margin-bottom: 0;
    padding: 0.2rem 0.6rem;
    font-size: clamp(0.5rem, 1.5vw, 0.625rem);
}

.news-meta time {
    color: var(--text-light);
    font-weight: 500;
}

.news-title {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    font-family: Merriweather, serif;
}

.news-link {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-link:hover {
    color: var(--primary-blue);
}

.news-author {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: var(--text-light);
    font-weight: 400;
}

/* Sidebar styles */
.trending-list {
    margin-bottom: 2rem;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.trending-item:hover {
    background: var(--hover-bg);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.trending-content {
    flex: 1;
    min-width: 0;
}

.trending-category {
    display: inline-block;
    background: #Ce1212;
    padding: 0.2rem 0.6rem;
    font-size: clamp(0.5rem, 1.5vw, 0.625rem);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: #ffffff;
    border-radius: 2px;
}

.trending-title {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    font-family: Merriweather, serif;
    color: var(--text-dark);
}

.trending-date {
    font-size: clamp(0.625rem, 1.5vw, 0.75rem);
    color: var(--text-light);
    font-weight: 400;
}

.trending-thumbnail {
    width: clamp(60px, 12vw, 80px);
    height: clamp(44px, 9vw, 60px);
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 4rem 0;
}

.chip {
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    padding: clamp(0.4rem, 1.5vw, 0.5rem) clamp(0.8rem, 2vw, 1rem);
    border-radius: 25px;
    font-size: clamp(0.625rem, 1.5vw, 0.75rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: capitalize;
    color: var(--text-medium);
    font-family: Roboto, sans-serif;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chip:hover {
    background: var(--hover-bg);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.chip.active {
    background: #Ce1212;
    color: #fff;
    border-color: #Ce1212;
}

.chip.all{
    width: 50px;
}

.chip:focus {
    outline: 3px solid rgba(67, 56, 202, 0.3);
    outline-offset: 2px;
}

.popular-heading {
    font-family: Merriweather, serif;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-dark);
}

.popular-topics {
    list-style: none;
    margin-bottom: 2.5rem;
}

.popular-topics li {
    padding: 0.75rem 0;
    border-bottom: 1px dotted var(--border-dashed);
}

.popular-topics a {
    color: #000;
    text-decoration: none;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    padding: 0.5rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.popular-topics a:hover {
    color: var(--primary-blue);
    padding-left: 0.5rem;
}
/* Modal styles */
.article-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    padding: 0;
    overflow-y: auto;
    backdrop-filter: blur(3px);
    -webkit-overflow-scrolling: touch;
}

.article-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(1rem, 4vw, 2rem);
    padding-bottom: clamp(1rem, 4vw, 2rem);
}

.modal-content {
    background: var(--bg-white);
    width: calc(100% - clamp(1rem, 4vw, 2rem) * 2);
    max-width: min(800px, 95vw);
    max-height: calc(100vh - clamp(2rem, 8vw, 4rem));
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: clamp(8px, 2vw, 12px);
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    font-family: Roboto, sans-serif;
    margin: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1rem);
    right: clamp(0.75rem, 2vw, 1rem);
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    cursor: pointer;
    color: var(--text-light);
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    z-index: 10;
}

.modal-close:hover {
    background: var(--error-red);
    color: var(--bg-white);
    border-color: var(--error-red);
    transform: scale(1.05);
}

.modal-close:focus {
    outline: 3px solid rgba(239, 68, 68, 0.3);
    outline-offset: 2px;
}

.modal-title {
    font-family: Merriweather, serif;
    font-size: clamp(1.125rem, 3.5vw, 1.5rem);
    font-weight: 700;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-dark);
    line-height: 1.3;
    padding-right: clamp(2rem, 5vw, 3rem);
}

.modal-body {
    font-size: clamp(0.8125rem, 2.2vw, 0.9375rem);
    line-height: 1.6;
    color: var(--text-medium);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.modal-body p {
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Media queries for responsive design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr 0.8fr;
        gap: clamp(1.5rem, 3vw, 2rem);
    }

    .sidebar-column {
        grid-column: span 2;
    }

    .topic-chips {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .content-grid {
        display: flex;
        flex-direction: column;
        gap: clamp(2rem, 4vw, 0rem);
    }

    /* Mobile layout order: Featured Stories → Topic Chips → Latest News → Popular Topics */
    .featured-column {
        order: 1;
    }

    .sidebar-column {
        order: 3;
    }

    .latest-column {
        order: 2;
        padding-top: 40px;
    }

    .header-container {
        flex-direction: row;
        text-align: center;
    }

    .site-title {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }

    .featured-headline {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }

    .newsletter-form {
        flex-direction: column;
    }

    .article-meta {
        flex-direction: row;
    }

    .search-input.active {
        width: clamp(150px, 40vw, 180px);
    }

    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .trending-item {
        flex-direction: column;
        text-align: left;
    }

    .trending-thumbnail {
        align-self: flex-start;
        width: 100%;
        height: auto;
        max-width: 200px;
        aspect-ratio: 4/3;
    }

    /* Mobile-specific spacing for sidebar elements */
    .topic-chips {
        margin: 1rem 0;
        justify-content: flex-start;
    }

    .popular-topics {
        margin-bottom: 1.5rem;
    }

    .popular-heading {
        margin-top: 3rem;
    }}

@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
        --content-gap: 1.5rem;
    }
    
    .site-title {
        font-size: clamp(1rem, 5vw, 1.25rem);
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .topic-chips {
        gap: 0.25rem;
    }
    
    .chip {
        font-size: 0.625rem;
        padding: 0.4rem 0.8rem;
    }
    
    .news-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-thumbnail {
        width: 100%;
        height: auto;
        max-width: 200px;
        aspect-ratio: 3/2;
        align-self: flex-start;
    }
    
    .cta-button {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

@media (max-width: 360px) {
    .header-container {
        gap: 0.5rem;
    }
    
    .search-toggle {
        padding: 0.5rem;
    }
    
    .search-input.active {
        width: 120px;
    }
    
    .site-title {
        font-size: 1rem;
    }
}

/* Utility classes */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .newsletter-box,
    .topic-chips,
    .cta-button {
        display: none;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .news-item,
    .trending-item {
        break-inside: avoid;
    }
}