/* ==========================================================================
   News5 Professional Editorial & News Theme
   Crimson Red & Deep Midnight Slate Design System
   ========================================================================== */

:root {
    /* Brand Primary: Crimson News Red */
    --color-primary: #d32f2f !important;
    --color-primary-rgb: 211, 47, 47 !important;
    --color-primary-hover: #b71c1c !important;
    --color-primary-500: #d32f2f !important;
    --color-primary-600: #b71c1c !important;
    --color-primary-700: #8e0000 !important;

    /* Brand Secondary: Deep Midnight Slate */
    --color-secondary: #0f172a !important;
    --color-secondary-rgb: 15, 23, 42 !important;

    /* Base Typography & Backgrounds */
    --body-color-text: #1e293b !important;
    --heading-color-text: #0f172a !important;
    --link-color-text: #0f172a !important;
    --link-color-text-hover: #d32f2f !important;
    
    /* Global Accents */
    --bs-primary: #d32f2f !important;
    --bs-primary-rgb: 211, 47, 47 !important;
    --bs-link-color: #0f172a !important;
    --bs-link-hover-color: #d32f2f !important;
}

/* ==========================================================================
   Header & Top Navigation Bar
   ========================================================================== */
.uc-header {
    border-top: 3px solid #d32f2f !important;
}

.uc-top-navbar {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

.uc-top-navbar a {
    color: #cbd5e1 !important;
    transition: color 0.2s ease-in-out !important;
}

.uc-top-navbar a:hover {
    color: #ffffff !important;
}

.uc-top-navbar .vr {
    border-left-color: rgba(255, 255, 255, 0.15) !important;
}

.uc-navbar-container {
    background-color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05) !important;
}

.uc-navbar-nav > li > a {
    color: #0f172a !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    transition: color 0.2s ease !important;
}

.uc-navbar-nav > li > a:hover,
.uc-navbar-nav > li.uc-active > a {
    color: #d32f2f !important;
}

/* ==========================================================================
   Breaking News Ticker & Badges
   ========================================================================== */
.badge-breaking,
.news-badge-red,
.badge-primary {
    background-color: #d32f2f !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
}

.ticker-label {
    background-color: #d32f2f !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Live Pulse Animation for Breaking News */
.pulse-icon {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: newsPulse 1.5s infinite;
}

@keyframes newsPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ==========================================================================
   Category Tag Color Coding
   ========================================================================== */
.post-category,
.cat-tag {
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
    color: #d32f2f !important;
    transition: opacity 0.2s ease !important;
}

.post-category:hover,
.cat-tag:hover {
    color: #b71c1c !important;
}

/* Category Specific Highlights */
.cat-politics, .cat-breaking { color: #d32f2f !important; }
.cat-tech, .cat-ai, .cat-gadgets { color: #2563eb !important; }
.cat-business, .cat-finance { color: #059669 !important; }
.cat-sports, .cat-entertainment { color: #d97706 !important; }
.cat-world, .cat-science { color: #7c3aed !important; }

/* ==========================================================================
   Article Headings & Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: #0f172a;
    font-weight: 700;
}

/* Ensure white headers on dark hero sections & banners */
.category-hero-banner h1,
.category-hero-banner h2,
.category-hero-banner h3,
.category-hero-banner p,
.bg-slate-900 h1,
.bg-slate-900 h2,
.bg-slate-900 h3,
.text-white,
.text-white h1,
.text-white h2,
.text-white h3 {
    color: #ffffff !important;
}

.post-title,
article h2 a,
article h3 a,
article h4 a,
article h5 a {
    color: #0f172a !important;
    transition: color 0.2s ease-in-out !important;
    text-decoration: none !important;
}

.post-title:hover,
article h2 a:hover,
article h3 a:hover,
article h4 a:hover,
article h5 a:hover {
    color: #d32f2f !important;
}

/* Featured Article Image Zoom & Hover */
.post-media,
.featured-image {
    border-radius: 8px !important;
    overflow: hidden !important;
}

.post-media img,
.featured-image img {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

article:hover .post-media img,
article:hover .featured-image img {
    transform: scale(1.04) !important;
}

/* Widget Header Accents */
.widget-title,
.section-title,
.block-title {
    position: relative !important;
    padding-left: 12px !important;
    border-left: 4px solid #d32f2f !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.01em !important;
    color: #0f172a !important;
}

/* ==========================================================================
   Buttons & Action Controls
   ========================================================================== */
.btn-primary,
button[type="submit"].btn-primary,
a.btn-primary {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.3) !important;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    border-radius: 6px !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #b71c1c 0%, #8e0000 100%) !important;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.45) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    border: 2px solid #d32f2f !important;
    color: #d32f2f !important;
    font-weight: 700 !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
}

.btn-outline-primary:hover {
    background-color: #d32f2f !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Footer Editorial Styling
   ========================================================================== */
footer,
.uc-footer {
    background-color: #0b0f19 !important;
    color: #94a3b8 !important;
    border-top: 4px solid #d32f2f !important;
}

footer h1, footer h2, footer h3, footer h4, footer h5, footer h6,
.uc-footer h1, .uc-footer h2, .uc-footer h3, .uc-footer h4, .uc-footer h5, .uc-footer h6 {
    color: #ffffff !important;
}

footer a,
.uc-footer a {
    color: #cbd5e1 !important;
    transition: color 0.2s ease !important;
}

footer a:hover,
.uc-footer a:hover {
    color: #f87171 !important;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */
html.uc-dark,
body.uc-dark,
.uc-dark {
    --body-color-text: #cbd5e1 !important;
    --heading-color-text: #ffffff !important;
    --link-color-text: #ffffff !important;
    --link-color-text-hover: #f87171 !important;
    background-color: #0b0f19 !important;
}

.uc-dark .uc-navbar-container {
    background-color: #111827 !important;
}

.uc-dark .uc-navbar-nav > li > a {
    color: #f1f5f9 !important;
}

.uc-dark .uc-navbar-nav > li > a:hover,
.uc-dark .uc-navbar-nav > li.uc-active > a {
    color: #f87171 !important;
}

.uc-dark h1, .uc-dark h2, .uc-dark h3, .uc-dark h4, .uc-dark h5, .uc-dark h6,
.uc-dark .post-title,
.uc-dark article h2 a, .uc-dark article h3 a, .uc-dark article h4 a {
    color: #f8fafc !important;
}

.uc-dark .post-title:hover,
.uc-dark article h2 a:hover, .uc-dark article h3 a:hover, .uc-dark article h4 a:hover {
    color: #f87171 !important;
}

.uc-dark .widget-title,
.uc-dark .section-title {
    color: #ffffff !important;
    border-left-color: #f87171 !important;
}

/* ==========================================================================
   Article Table Styling (Compact & Clean)
   ========================================================================== */
.article-table,
.post-content table, 
.entry-content table,
article table,
.blog-content table,
.post-body table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    background: #ffffff !important;
}

.article-table th, 
.article-table td,
.post-content table th, 
.post-content table td,
.entry-content table th, 
.entry-content table td,
article table th, 
article table td {
    padding: 10px 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #1e293b !important;
    vertical-align: middle !important;
}

/* Force all child elements (span, p, b, strong, font) inside cells to compact 14px */
.article-table td *,
.post-content table td *,
.entry-content table td *,
article table td * {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    display: inline !important;
}

.article-table tr:last-child td,
.post-content table tr:last-child td {
    border-bottom: none !important;
}

.article-table td:last-child,
.post-content table td:last-child {
    border-right: none !important;
}

/* Header Row / First Row Compact Styling */
.article-table tr:first-child td,
.article-table tr:first-child th,
.article-table tr:first-child td *,
.post-content table tr:first-child td,
.post-content table tr:first-child th,
.post-content table tr:first-child td * {
    background-color: #0f172a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: -0.01em !important;
}

.article-table tr:first-child p,
.post-content table tr:first-child p {
    color: #ffffff !important;
    margin: 0 !important;
    font-weight: 700 !important;
}

/* Natural Flexible Column Widths for All Table Cells */
.article-table td:first-child:not([colspan]),
.article-table td:first-child:not([colspan]) *,
.post-content table td:first-child:not([colspan]),
.post-content table td:first-child:not([colspan]) * {
    font-weight: 600 !important;
    color: inherit !important;
    text-align: left !important;
    width: auto !important;
    max-width: none !important;
    font-size: 14px !important;
    background: transparent !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Number Column Optional Accent styling if single number */
.article-table td.num-col,
.post-content table td.num-col {
    font-weight: 700 !important;
    color: #d32f2f !important;
    text-align: center !important;
    width: 45px !important;
    background: #f8fafc !important;
}

/* Alternate Row Colors */
.article-table tr:nth-child(even):not(:first-child) td,
.post-content table tr:nth-child(even):not(:first-child) td {
    background-color: #fcfcfd !important;
}

.article-table p,
.post-content table p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Dark Mode Support */
.uc-dark .article-table,
.uc-dark .post-content table {
    border-color: #334155 !important;
    background: #0f172a !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.uc-dark .article-table th,
.uc-dark .article-table td,
.uc-dark .post-content table th,
.uc-dark .post-content table td,
.uc-dark .article-table td *,
.uc-dark .post-content table td * {
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.uc-dark .article-table tr:first-child td,
.uc-dark .article-table tr:first-child td *,
.uc-dark .post-content table tr:first-child td,
.uc-dark .post-content table tr:first-child td * {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

.uc-dark .article-table td:first-child:not([colspan]),
.uc-dark .article-table td:first-child:not([colspan]) *,
.uc-dark .post-content table td:first-child:not([colspan]),
.uc-dark .post-content table td:first-child:not([colspan]) * {
    background: transparent !important;
    color: inherit !important;
}

/* ==========================================================================
   Mobile Responsive Optimizations (Screen < 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Responsive Smooth Scroll Tables on Mobile */
    .table-responsive-wrapper,
    .post-content,
    .entry-content,
    article {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .article-table,
    .post-content table, 
    .entry-content table,
    article table,
    .blog-content table,
    .post-body table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: normal !important;
        margin: 16px 0 !important;
        border-radius: 8px !important;
    }

    .article-table th, 
    .article-table td,
    .post-content table th, 
    .post-content table td,
    .entry-content table th, 
    .entry-content table td,
    article table th, 
    article table td {
        padding: 8px 10px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    .article-table td *,
    .post-content table td *,
    .entry-content table td *,
    article table td * {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    .article-table td:first-child:not([colspan]),
    .article-table td:first-child:not([colspan]) *,
    .post-content table td:first-child:not([colspan]),
    .post-content table td:first-child:not([colspan]) * {
        width: auto !important;
        max-width: none !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    /* Article Content Media Responsiveness */
    .post-content img,
    .entry-content img,
    article img,
    .blog-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
    }

    .post-content iframe,
    .entry-content iframe,
    article iframe,
    .blog-content iframe,
    .post-content video,
    .entry-content video {
        width: 100% !important;
        max-width: 100% !important;
        height: 210px !important;
        border-radius: 8px !important;
    }

    /* Mobile Container Padding & Typography */
    .blog-details-content,
    .post-single {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .post-title,
    h1.h2,
    .entry-title {
        font-size: 1.45rem !important;
        line-height: 1.35 !important;
    }
}

/* ==========================================================================
   2-Line Maximum Title Clamp & Header Typography Fix
   ========================================================================== */
.post-title-clamp-2,
.single-post .post-header h1,
.single-post h1.post-title,
.post-header h1 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(1.35rem, 2.3vw, 2.1rem) !important;
    line-height: 1.28 !important;
    max-height: 2.7em !important;
    word-break: normal !important;
}

.post-title,
.entry-title,
article h2.post-title,
article h3.post-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
    max-height: 2.6em !important;
}
