/* ============================================================
   THREADS NEWS - FIXED CSS
   ============================================================ */

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

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

/* ========== HEADER ========== */
.header {
    background: #ffffff;
    border-bottom: 4px solid #0066FF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-top {
    background: #0066FF;
    padding: 5px 0;
    text-align: center;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.header-top a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.header-main {
    padding: 10px 0;
}

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

.logo-text {
    font-size: 28px;
    font-weight: 900;
    color: #0066FF;
    letter-spacing: -1px;
}

.logo-text span {
    color: #1a1a2e;
}

/* Navigation */
.nav-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-list a {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #4a4a6a;
    border-radius: 4px;
    transition: 0.2s;
}

.nav-list a:hover {
    color: #0066FF;
    background: #e8f0fe;
}

.nav-list a.breaking {
    color: #dc3545;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-actions button {
    background: none;
    border: none;
    padding: 8px 10px;
    font-size: 18px;
    color: #4a4a6a;
    cursor: pointer;
    border-radius: 4px;
}

.header-actions button:hover {
    background: #e8f0fe;
    color: #0066FF;
}

/* Search */
.search-bar {
    display: none;
    padding-top: 12px;
    margin-top: 10px;
    border-top: 1px solid #e8ecf0;
}

.search-bar.active {
    display: block;
}

.search-form {
    display: flex;
    background: #f5f7fa;
    border-radius: 6px;
    border: 2px solid #e8ecf0;
    overflow: hidden;
}

.search-form:focus-within {
    border-color: #0066FF;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: #0066FF;
    border: none;
    padding: 0 24px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

/* Breaking Ticker */
.breaking-ticker {
    background: #dc3545;
    padding: 6px 0;
    color: #fff;
    overflow: hidden;
}

.breaking-ticker-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.breaking-label {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breaking-label i {
    font-size: 10px;
}

.breaking-ticker-items {
    display: flex;
    gap: 40px;
    overflow: hidden;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

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

.breaking-ticker-items a {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.breaking-ticker-items a:hover {
    text-decoration: underline;
}

/* Menu Toggle Mobile */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle .hamburger {
    width: 24px;
    height: 2px;
    background: #4a4a6a;
    border-radius: 2px;
    transition: 0.3s;
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-block;
    padding: 8px 20px;
    background: #0066FF;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #0044CC;
}

/* ========== HERO ========== */
.hero-section {
    padding: 20px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.hero-featured {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hero-featured:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hero-image {
    position: relative;
    aspect-ratio: 16/9;
    background: #e8ecf0;
}

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

.hero-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #dc3545;
    color: #fff;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-content {
    padding: 18px 20px 20px;
}

.hero-topic {
    color: #0066FF;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 26px;
    font-weight: 800;
    margin: 6px 0 10px;
    line-height: 1.2;
}

.hero-excerpt {
    color: #4a4a6a;
    font-size: 15px;
    margin-bottom: 10px;
}

.hero-meta {
    font-size: 13px;
    color: #8888a8;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.hero-meta .author {
    color: #1a1a2e;
    font-weight: 600;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Ads */
.ad-inner {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ad-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ad-desc {
    color: #4a4a6a;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Breaking Mini */
.hero-breaking-mini {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.breaking-mini-title {
    font-size: 14px;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breaking-mini-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
}

.breaking-mini-list li:last-child {
    border-bottom: none;
}

.breaking-mini-list a {
    font-size: 14px;
    color: #4a4a6a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breaking-mini-list a:hover {
    color: #0066FF;
}

.breaking-dot {
    width: 6px;
    height: 6px;
    background: #dc3545;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== SECTION ========== */
.section {
    padding: 30px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #0066FF;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #0066FF;
}

.view-all {
    color: #0066FF;
    font-size: 14px;
    font-weight: 600;
}

.view-all:hover {
    text-decoration: underline;
}

/* ========== TRENDING TOPICS ========== */
.trending-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scroll-snap-type: x mandatory;
}

.trending-scroll::-webkit-scrollbar {
    height: 4px;
}

.trending-scroll::-webkit-scrollbar-thumb {
    background: #0066FF;
    border-radius: 4px;
}

.trending-topic-card {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid #e8ecf0;
    text-align: center;
    min-width: 110px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: 0.2s;
}

.trending-topic-card:hover {
    border-color: #0066FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.topic-rank {
    font-size: 11px;
    color: #8888a8;
    font-weight: 700;
}

.topic-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin: 2px 0;
}

.topic-count {
    font-size: 11px;
    color: #8888a8;
}

/* ========== FEATURED GRID ========== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.featured-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8ecf0;
    transition: 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.featured-image {
    aspect-ratio: 16/9;
    background: #e8ecf0;
}

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

.featured-content {
    padding: 14px 16px 16px;
}

.featured-topic {
    color: #0066FF;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-title {
    font-size: 16px;
    font-weight: 700;
    margin: 4px 0 6px;
    line-height: 1.3;
}

.featured-excerpt {
    color: #4a4a6a;
    font-size: 13px;
    margin-bottom: 8px;
}

.featured-meta {
    font-size: 12px;
    color: #8888a8;
    display: flex;
    gap: 6px;
    align-items: center;
}

.featured-meta .author {
    color: #1a1a2e;
    font-weight: 600;
}

/* ========== ARTICLE LIST ========== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-article {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8ecf0;
    transition: 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.list-article:hover {
    border-color: #0066FF;
}

.list-article-link {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    padding: 12px;
}

.list-article-image {
    aspect-ratio: 1/1;
    border-radius: 6px;
    overflow: hidden;
    background: #e8ecf0;
}

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

.list-article-topic {
    color: #0066FF;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-article-title {
    font-size: 15px;
    font-weight: 600;
    margin: 2px 0 4px;
    line-height: 1.3;
}

.list-article-excerpt {
    color: #4a4a6a;
    font-size: 13px;
    margin-bottom: 4px;
}

.list-article-meta {
    font-size: 12px;
    color: #8888a8;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ========== CONTENT + SIDEBAR ========== */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* ========== SIDEBAR ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #0066FF;
    border-bottom: 2px solid #0066FF;
    padding-bottom: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trending-tags .tag {
    padding: 4px 12px;
    background: #e8f0fe;
    border-radius: 4px;
    font-size: 12px;
    color: #0066FF;
    font-weight: 600;
    transition: 0.2s;
}

.trending-tags .tag:hover {
    background: #0066FF;
    color: #fff;
}

.hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hashtag-list .hashtag {
    padding: 4px 12px;
    background: #f5f7fa;
    border-radius: 4px;
    font-size: 12px;
    color: #4a4a6a;
    transition: 0.2s;
}

.hashtag-list .hashtag:hover {
    background: #0066FF;
    color: #fff;
}

.most-read-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.most-read-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: 0.2s;
}

.most-read-item:hover {
    background: #e8f0fe;
}

.most-read-item .rank {
    font-weight: 800;
    color: #0066FF;
    min-width: 22px;
    font-size: 15px;
}

.most-read-item .title {
    font-size: 13px;
    font-weight: 500;
}

/* Newsletter Widget */
.newsletter-box {
    text-align: center;
}

.newsletter-box h4 {
    font-size: 16px;
    color: #0066FF;
}

.newsletter-box p {
    color: #4a4a6a;
    font-size: 13px;
    margin: 4px 0 12px;
}

.newsletter-box form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.newsletter-box input {
    padding: 8px 12px;
    border: 2px solid #e8ecf0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.newsletter-box input:focus {
    border-color: #0066FF;
}

.newsletter-box .btn-primary {
    width: 100%;
}

/* ========== POPULAR TOPICS ========== */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.popular-topic-card {
    background: #fff;
    padding: 14px 10px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e8ecf0;
    transition: 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.popular-topic-card:hover {
    border-color: #0066FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.popular-icon {
    font-weight: 700;
    color: #0066FF;
    font-size: 16px;
}

.popular-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin: 2px 0;
}

.popular-count {
    font-size: 11px;
    color: #8888a8;
}

/* ========== EDITOR'S PICK ========== */
.editors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.editor-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8ecf0;
    transition: 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.editor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.editor-image {
    aspect-ratio: 16/9;
    background: #e8ecf0;
}

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

.editor-content {
    padding: 14px 16px 16px;
}

.editor-topic {
    color: #0066FF;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}

.editor-title {
    font-size: 16px;
    font-weight: 700;
    margin: 4px 0 6px;
    line-height: 1.3;
}

.editor-excerpt {
    color: #4a4a6a;
    font-size: 13px;
}

/* ========== NEWSLETTER CTA ========== */
.newsletter-cta {
    padding: 30px 0 20px;
}

.newsletter-cta-inner {
    background: linear-gradient(135deg, #0066FF, #0044CC);
    border-radius: 10px;
    padding: 40px 32px;
    text-align: center;
    color: #fff;
}

.newsletter-cta-icon {
    font-size: 40px;
    display: block;
}

.newsletter-cta h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 8px 0 4px;
}

.newsletter-cta p {
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 20px;
}

.newsletter-cta-form {
    display: flex;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
}

.newsletter-cta-form input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.newsletter-cta-form .btn-primary {
    background: #fff;
    color: #0066FF;
    padding: 12px 32px;
    font-size: 15px;
}

.newsletter-cta-form .btn-primary:hover {
    background: #e8f0fe;
}

.newsletter-cta small {
    opacity: 0.8;
    font-size: 12px;
    display: block;
    margin-top: 8px;
}

/* ========== FLOATING CTA ========== */
.cta-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.cta-floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0066FF;
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,102,255,0.4);
    transition: 0.2s;
}

.cta-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0,102,255,0.5);
}

/* ========== FOOTER ========== */
.footer {
    background: #1a2a3a;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 24px;
}

.footer-desc {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    max-width: 300px;
    margin: 8px 0 14px;
}

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    color: rgba(255,255,255,0.7);
    transition: 0.2s;
}

.footer-social a:hover {
    background: #0066FF;
    color: #fff;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-links ul li {
    margin-bottom: 4px;
}

.footer-links ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: 0.2s;
}

.footer-links ul li a:hover {
    color: #fff;
}

.footer-newsletter p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-newsletter-form input {
    padding: 10px 14px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.footer-newsletter-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.footer-newsletter-form .btn-primary {
    background: #0066FF;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.footer-bottom a {
    color: #0066FF;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 998;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #fff;
    color: #0066FF;
    border: 1px solid #e8ecf0;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0066FF;
    color: #fff;
}

/* ========== RESPONSIVE ========== */

/* Desktop */
@media (max-width: 1024px) {
    .popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .header-nav {
        display: none !important;
    }
    .header-nav.active {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        padding: 16px;
        border-top: 1px solid #e8ecf0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        z-index: 100;
    }
    .header-nav.active .nav-list {
        flex-direction: column;
        gap: 4px;
    }
    .header-nav.active .nav-list a {
        display: block;
        padding: 10px 14px;
    }
    .menu-toggle {
        display: flex !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .featured-grid {
        grid-template-columns: 1fr 1fr;
    }
    .editors-grid {
        grid-template-columns: 1fr 1fr;
    }
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .newsletter-cta-form {
        flex-direction: column;
    }
    .hero-title {
        font-size: 22px;
    }
    .section-title {
        font-size: 18px;
    }
    .cta-floating-btn .cta-text {
        display: none;
    }
    .cta-floating-btn {
        padding: 12px 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    .editors-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .list-article-link {
        grid-template-columns: 70px 1fr;
        gap: 10px;
        padding: 10px;
    }
    .logo-text {
        font-size: 20px;
    }
    .hero-title {
        font-size: 18px;
    }
    .hero-content {
        padding: 12px 14px 14px;
    }
    .hero-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
    .newsletter-cta-inner {
        padding: 24px 16px;
    }
    .newsletter-cta h2 {
        font-size: 20px;
    }
    .container {
        padding: 0 10px;
    }
}