/*
Theme Name: NewsX Theme
Theme URI: https://newsx.com/
Author: Your Name
Author URI: https://newsx.com/
Description: Ultra fast, mobile-first
Version: 1.0
License: GPLv2 or later
Text Domain: newsx-theme
*/

:root {
  --primary-color: #c62828;
}

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  font-family: 'system-ui', 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #fff;
  color: #111;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: #0073aa;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  padding: 0 15px;
  box-sizing: border-box;
}
.clearfix {margin-top: 20px;}
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

figure {width:auto!important;}
#ez-toc-container {width:auto!important;}

/* Header */
.menu-toggle {display: none;}

.site-header {
  background: #fff;
}
.breaking-news .container {display: flex; }
/* Header Flex Layout */
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  flex-wrap: wrap;
}

.site-branding {
  flex-shrink: 0;
  max-width: 60%;
}

.site-branding a {
  display: inline-block;
  line-height: 1;
  padding-left: 10px;
}

.site-branding img {
  max-height: 55px;
  height: auto;
  width: auto;
}

/* Right part: nav + mobile toggle */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-grow: 1;
}

/* Desktop Menu */
.header-menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.header-menu li a {
  text-decoration: none;
  color: #111;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 6px;
  border-bottom: 2px solid transparent;
}

.header-menu li a:hover {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
  display: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  background: #f7f7f7;
  width: 100%;
  padding: 10px 0;
}

.mobile-menu-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mobile-menu-list li {
  padding: 8px 12px;
}

.mobile-menu-list li a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
}

/* Responsive - Mobile View */
@media (max-width: 768px) {
  .header-flex {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
            margin-top: 0px;
  }

  .site-branding img {
    max-height: 45px;
  }

  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu.active {
    display: block;
  }
}

/* Breaking News */
.breaking-news {
  background: #c62828;
  padding: 8px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  color: #fff;
}
.breaking-news .breaking-label {
  font-weight: bold;
  font-size: 16px;
  margin-right: 10px;
}
.breaking-news marquee {
  flex: 1;
}
.breaking-news span a {
  color: #fff;
  text-decoration: none;
}

/* Post Grid + Sidebar */
.card_title {color: #333;font-size: 16px;}
.top-stories-grid,
.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

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

.newsx-sidebar-list li {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #ddd;
}

.newsx-sidebar-list li a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.newsx-sidebar-list .category {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 2px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
}

/* Repeating every 5 items */
.newsx-sidebar-list li:nth-child(5n+1) .category {
    background-color: #c62828; /* Red */
}
.newsx-sidebar-list li:nth-child(5n+2) .category {
    background-color: #1565c0; /* Blue */
}
.newsx-sidebar-list li:nth-child(5n+3) .category {
    background-color: #2e7d32; /* Green */
}
.newsx-sidebar-list li:nth-child(5n+4) .category {
    background-color: #f9a825; /* Yellow */
    color: #000;
}
.newsx-sidebar-list li:nth-child(5n) .category {
    background-color: #6a1b9a; /* Purple */
}

.newsx-sidebar-list .title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #222;
  display: block;
}

/* POST PAGE */

.post-meta-top {
  font-size: 14px;
  margin-bottom: 10px;
  color: #777;
}
.post-featured-img {
  margin-bottom: 15px;
}
.post-title {
  font-size: 28px;
  margin-bottom: 20px;
}
.post-tags {
  margin-top: 20px;
  font-style: italic;
}
.post-share {
  margin-top: 15px;
}
.author-box {
  margin-top: 30px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
  font-size: 15px;
}
.related-posts {
  margin-top: 30px;
}
.related-posts ul {
  list-style: disc;
  padding-left: 20px;
}
/* Pagination */

.newsx-pagination-wrapper {
  width: 100%;
  margin: 30px auto 40px auto;
  text-align: center;
}

.newsx-pagination {
  display: inline-flex;
  gap: 8px;
  padding: 10px 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  list-style: none;
  justify-content: center;
  flex-wrap: wrap;
}

.newsx-pagination li {
  list-style: none;
}

.newsx-pagination li a,
.newsx-pagination li span {
  display: inline-block;
  padding: 6px 12px;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  min-width: 32px;
}

.newsx-pagination li .current {
  background: #c62828;
  color: #fff;
  border-color: #c62828;
  font-weight: bold;
}
/* Footer */
.site-footer {
  background: #222;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  margin-top: 20px;
}
.site-footer a {
  color: #fff;
  text-decoration: underline;
}

.footer-menu {
  margin-top: 20px;
}

.footer-menu-list {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.footer-menu-list a {
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}

.footer-menu-list a:hover {
  text-decoration: underline;
}
.breaking-news {
  background: var(--primary-color);
}
/* 🔷 General Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
  background: #fff;
}

/* 🔷 Table Header */
table thead {
  background-color: #f44336; /* Red header (can be dynamic via primary color) */
  color: #fff;
  text-align: left;
}

/* 🔷 Header + Cell Padding */
table th,
table td {
  padding: 12px 15px;
  border: 1px solid #ddd;
}

/* 🔷 Zebra Rows */
table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* 🔷 Hover Row Effect */
table tbody tr:hover {
  background-color: #f1f1f1;
}

/* 🔷 Responsive Overflow on Mobile */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

/* 👇 Table scroll on small screens without wrapper */
.entry-content table,
.post-content table,
.content-area table,
.container table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  border-collapse: collapse;
}

/* Optional: Small font on mobile */
@media screen and (max-width: 480px) {
  .entry-content table,
  .post-content table,
  .content-area table,
  .container table {
    font-size: 14px;
  }
}

@media screen and (max-width: 768px) {
  /* 🔹 Menu Toggle Button */
  .menu-toggle {
    box-sizing: border-box;
    display: block;
    background: #c62828;
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin: 10px 0;
    text-align: center;
    border-radius: 5px;
    width: 100%;
  }
  /* 🔹 Mobile Header Menu */
  .main-nav {
    display: none;
    background: #f5f5f5;
    width: 100%;
    padding: 10px 0;
    position: relative;
    z-index: 1000;
  }

  .main-nav.active {
    display: block;
  }

  .header-menu {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
  }

  .header-menu li a {
    display: block;
    padding: 10px 15px;
    font-size: 16px;
    color: #111;
    width: 100%;
    text-align: center;
  }

  /* 🔹 Centered Post Cards */
  .top-stories-grid,
  .recent-posts-grid {
    grid-template-columns: 1fr;
    max-width: 90%;
    margin: 0 auto;
  }
  .post-card img {width: 100%;}
  .top-stories-grid > *,
  .recent-posts-grid > * {
    margin: 0 auto;
    width: 100%;
  }

  /* 🔹 Sidebar Below Content */
  .main-content-with-sidebar {
    display: block;
  }

  .main-content {
    width: 100% !important;
    float: none !important;
  }

  .sidebar {
    width: 100% !important;
    float: none !important;
    margin-top: 20px;
  }

  /* 🔹 Pagination Centered */
  .newsx-pagination-wrapper {
    text-align: center;
  }

  .newsx-pagination {
    justify-content: center;
  }

  /* 🔹 Scrollable Tables */
  .single-post table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Author Box */
.author-box {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.author-box img {
  border-radius: 50%;
}
.author-box h3 {
  margin: 0 0 5px;
  font-size: 17px;
}
.author-box p {
  margin: 0;
  color: #555;
  font-size: 15px;
}

/* Sharing Button */
.post-share {
  margin-top: 25px;
  font-size: 16px;
}

.share-buttons-rect {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-share {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #eee;
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 15px;
  text-decoration: none;
  transition: 0.2s ease-in-out;
  white-space: nowrap;
  cursor: pointer;
}

.btn-share i {
  font-size: 16px;
}

/* Colors */
.btn-share.facebook {
  background-color: #1877f2;
}

.btn-share.facebook:hover {
  background-color: #0d5ecd;
}

.btn-share.whatsapp {
  background-color: #25d366;
}

.btn-share.whatsapp:hover {
  background-color: #1da851;
}

.btn-share.twitter {
  background-color: #1da1f2;
}

.btn-share.twitter:hover {
  background-color: #0c8ad9;
}

/* 📱 Mobile Responsiveness */
@media screen and (max-width: 600px) {
  .share-buttons-rect {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-share {
    width: 95%;
    justify-content: center;
  }
}

/* Post Tags */
.post-tags {
  margin-top: 30px;
  font-size: 15px;
}

.post-tags strong {
  display: block;
  margin-bottom: 10px;
  color: #333;
}

.newsx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.newsx-tags a {
  background-color: #f2f2f2;
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: 1px solid #ddd;
}

.newsx-tags a:hover {
  background-color: #c62828;
  color: #fff;
  border-color: #c62828;
}

/* 📱 Responsive */
@media screen and (max-width: 600px) {
  .newsx-tags a {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* related Posts */
.related-posts-grid-box {
  margin-top: 30px;
}

.related-posts-grid-box h3 {
  font-size: 20px;
  margin-bottom: 15px;
  border-bottom: 2px solid #c62828;
  padding-bottom: 5px;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.related-post-card {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 5px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease;
}

.related-post-card:hover {
  transform: translateY(-3px);
}

.related-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.related-title {
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  color: #333;
}

/* Post Meta Date and Category */
.post-meta-top {
  font-size: 14px;
  color: #777;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.post-meta-top .post-category {
  color: #c62828;
  font-weight: 600;
  font-size: 14px;
}

.post-meta-top .post-date {
  color: #555;
}

.post-meta-top .dot-separator {
  font-size: 14px;
  color: #aaa;
}

/* 404 Page Style */
.newsx-404-wrapper {
  background: #fff;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.newsx-404-home-btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.newsx-404-home-btn:hover {
  background: #a81f1f;
}
.newsx-static-content {
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

/* Logo css */
.site-branding {
  text-align: center;
}

.site-branding img {
  max-height: 80px;
  width: auto;
  height: auto;
}

/* Mobile ke liye alag size */
@media (max-width: 768px) {

  .site-branding img {
    max-height: 60px;
  }
}

/* Menu Toggle Button */
.mobile-menu-toggle {
    color: #333;
    padding: 12px 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}

/* Mobile Menu Container */
.mobile-menu-container {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-container {
        display: block;
        margin-top: 10px;
    }

    .mobile-menu {
        display: none;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 6px;
        margin-top: 5px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

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

    .mobile-menu-list li {
        border-bottom: 1px solid #eee;
    }

    .mobile-menu-list li a {
        display: block;
        padding: 12px 18px;
        text-decoration: none;
        color: #333;
        font-weight: 500;
        transition: background 0.3s;
    }

    .mobile-menu-list li a:hover {
        background: #f7f7f7;
        color: #c62828;
    }
    
    .mobile-menu.show {
        display: block;
    }
}