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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
  top: 0;
  z-index: 1000;
}

.header-banner {
    background: #1e293b;
    padding: 1rem 0;
    overflow: visible;
  position: relative;
  display: flex;
  align-items: center;
    justify-content: center;
}

.combined-logo {
  display: flex;
  align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 1000px;
    width: 100%;
    height: 180px;
    background: #1e293b;
    border-radius: 8px;
    padding: 0.5rem;
}

.logo-part {
    height: 162px;
    width: 450px;
    object-fit: contain;
    object-position: center;
    display: block;
    flex: 0 0 auto;
    background: transparent;
    transition: opacity 0.2s ease;
}

.logo-part:hover {
    opacity: 0.8;
}

.combined-logo a {
    text-decoration: none;
    display: inline-block;
}

.logo-tnn {
    height: 162px;
    width: 300px;
}

.logo-text {
    height: 162px;
    width: 300px;
}

.logo-icons {
    height: 162px;
    width: 300px;
}

.header-nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

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

.site-branding {
  display: flex;
  align-items: center;
    gap: 1.5rem;
}

.app-download-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo-btn {
  display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    padding: 2px;
}

.app-logo-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.download-buttons {
  display: flex;
  align-items: center;
}

.download-btn {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.download-btn:hover {
    transform: scale(1.05);
}

.app-store-logo {
    height: 40px;
    width: auto;
}

.site-title h1 {
  font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.site-title-link {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-title-link:hover {
    color: #007AFF;
    text-decoration: none;
}

.tagline {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    font-weight: 400;
}

.nav-toggle {
  display: none;
  flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: #007AFF;
    color: white;
}

.nav-toggle {
    display: none;
  flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Main Layout with Ads */
.main-container {
  display: grid;
    grid-template-columns: 240px 1fr 240px; /* narrower sidebars, wider news area */
    gap: 2rem;
    max-width: 1600px; /* allow more width overall */
    margin: 0 auto;
    padding: 2rem 20px;
    min-height: calc(100vh - 200px);
}

.content-area {
    min-width: 0; /* Prevents grid blowout */
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Ad Spaces */
.ad-space {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1rem;
  text-align: center;
  margin-bottom: 2rem;
    min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ad-label {
    font-size: 0.75rem;
    color: #6c757d;
  text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.ad-content {
  width: 100%;
    min-height: 250px;
  display: flex;
  align-items: center;
    justify-content: center;
    background: white;
    border-radius: 4px;
}

.ad-banner {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
  border-radius: 8px;
    padding: 1rem;
  text-align: center;
    margin: 2rem 0;
    min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ad-banner .ad-content {
  width: 100%;
    min-height: 90px;
    background: white;
    border-radius: 4px;
}

/* Category Tabs */
.category-tabs {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.tabs-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 8px 0;
}

.tab {
  display: flex;
  align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
  border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
}

.tab:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.tab.active {
    background: #007AFF;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.tab-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 2px;
}

/* Loading Styles */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Articles Grid */
.articles-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-description {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Intro Section */
.intro-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.intro-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.intro-content > p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1rem;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007AFF;
}

.feature-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #6c757d;
    margin: 0;
}

@media (max-width: 768px) {
    .intro-section {
        padding: 1.5rem;
    }
    
    .intro-content h2 {
        font-size: 1.5rem;
    }
    
    .intro-features {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

.articles-grid {
  display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Ensure two columns on tablets and larger */
@media (min-width: 769px) {
    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.article-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.article-card.expanding {
    animation: cardExpand 0.3s ease-out;
}

@keyframes cardExpand {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.article-image {
  width: 100%;
    height: 200px;
  object-fit: cover;
    background: #f8f9fa;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
  display: flex;
    justify-content: space-between;
  align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.article-source {
    font-weight: 500;
    color: #007AFF;
}

.article-date {
    color: #6c757d;
}

.article-title {
    font-size: 1.125rem;
  font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.article-source-link {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.article-source-link a {
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.article-source-link a:hover {
    color: #0056CC;
    text-decoration: underline;
}

/* Modal attribution styles */
.article-excerpt {
    margin-bottom: 1.5rem;
}

.article-attribution {
    background: #f8f9fa;
    border-left: 4px solid #007AFF;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.attribution-note {
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.attribution-note a {
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
}

.attribution-note a:hover {
    text-decoration: underline;
}

.fair-use-notice {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
    margin: 0;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 2.5rem;
    max-height: 82vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-image {
    width: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    flex-shrink: 0;
}

.modal-image img {
    width: 100%;
    max-height: 500px;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.modal-content-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin: 0;
    text-align: justify;
    clear: both;
}

.modal-content-text .article-excerpt {
    margin-bottom: 1.5rem;
}

.modal-content-text .article-excerpt p {
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2d3748;
}

.modal-content-text .article-attribution {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.modal-content-text .attribution-note {
    margin-bottom: 0.75rem;
    color: #6c757d;
}

.modal-content-text .fair-use-notice {
    color: #6c757d;
    font-size: 0.85rem;
}

.modal-actions {
  display: flex;
    justify-content: center;
}

/* Button Styles */
.btn {
    display: inline-flex;
  align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
  border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover::after {
    content: " (opens in new window)";
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

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

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

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #007AFF;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
}

.footer-disclaimer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #999;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.footer-disclaimer strong {
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 220px 1fr 220px;
    gap: 1.5rem;
    }
    
    .ad-space {
        min-height: 500px;
    }
}

/* Extra-wide screens: give even more space to news area */
@media (min-width: 1400px) {
    .main-container {
        grid-template-columns: 220px 1fr 220px;
        max-width: 1700px;
    }
}

@media (max-width: 992px) {
    .main-container {
    grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        display: none; /* Hide sidebars on tablet */
    }
    
    .ad-banner {
        margin: 1rem 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .main-container {
        padding: 1rem 16px;
    }
    
    .combined-logo {
        height: 144px;
        max-width: 100%;
        padding: 0.25rem;
    }
    
    .logo-part {
        height: 126px;
        width: 270px;
    }
    
    .logo-tnn {
        height: 126px;
        width: 180px;
    }
    
    .logo-text {
        height: 126px;
        width: 180px;
    }
    
    .logo-icons {
        height: 126px;
        width: 180px;
    }
    
    .site-branding {
        gap: 1rem;
    }
    
    .app-download-section {
        gap: 0.5rem;
    }
    
    .app-logo {
        width: 40px;
        height: 40px;
    }
    
    .app-store-logo {
        height: 32px;
    }
    
    .site-title h1 {
        font-size: 1.25rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .tabs-container {
        gap: 6px;
    }
    
    .tab {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .tab-icon {
        width: 14px;
        height: 14px;
    }
    
    /* Only switch to single column on small mobile devices */
    .articles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .ad-banner {
        margin: 1rem 0;
        min-height: 50px;
    }
    
    .ad-banner .ad-content {
        min-height: 50px;
    }
    
    .modal-content {
        width: 98%;
        margin: 5% auto;
        max-width: 95vw;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-content-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .combined-logo {
        height: 108px;
        padding: 0.25rem;
    }
    
    .logo-part {
        height: 90px;
        width: 180px;
    }
    
    .logo-tnn {
        height: 90px;
        width: 120px;
    }
    
    .logo-text {
        height: 90px;
        width: 120px;
    }
    
    .logo-icons {
        height: 90px;
        width: 120px;
    }
    
    .app-download-section {
        gap: 0.25rem;
    }
    
    .app-logo {
        width: 35px;
        height: 35px;
    }
    
    .app-store-logo {
        height: 28px;
    }
    
    .site-title h1 {
        font-size: 1.125rem;
    }
    
    .tagline {
        display: none; /* Hide tagline on very small screens */
    }
    
    .category-tabs {
        padding: 0.75rem 0;
    }
    
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
    font-size: 1rem;
  }
}

/* News Status Indicator */
.news-status {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #1976d2;
}

.status-icon {
    font-size: 1rem;
}

.status-text {
    font-weight: 600;
}

.status-details {
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Loading indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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