/**
 * NewsPro Pro - Persian RTL / SEO polish / Mobile Menu / Tables / Speed
 * v2.0.0
 */
:root {
  --np-primary: #c62828;
  --np-primary-dark: #8e0000;
  --np-text: #1a1a1a;
  --np-text-muted: #444;
  --np-bg: #fff;
  --np-bg-soft: #f5f6f8;
  --np-border: #e4e6eb;
  --np-radius: 10px;
  --np-font: Tahoma, "Segoe UI", "Iranian Sans", IRANSans, system-ui, sans-serif;
  --np-header-h: 56px;
}

body.newspro-pro,
body.rtl-ready,
body {
  font-family: var(--np-font) !important;
  color: var(--np-text) !important;
  line-height: 1.8;
  background: var(--np-bg-soft);
  direction: rtl;
  text-align: right;
}

h1,h2,h3,h4,h5,h6,
.entry-title, .entry-title a,
.navbar a, .widget-title {
  font-family: var(--np-font) !important;
  color: #111 !important;
  opacity: 1 !important;
  font-weight: 700;
}

.entry-title a:hover { color: var(--np-primary) !important; }

.entry-content p, .entry-summary, article p, .post-excerpt {
  color: #2a2a2a !important;
  opacity: 1 !important;
}

.entry-meta, .entry-meta a, .posted-on, .byline {
  color: #555 !important;
  opacity: 1 !important;
}

/* Cards */
article, .post, .news-box, .content-wrapper .post {
  background: var(--np-bg);
  border-radius: var(--np-radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
article:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

img { max-width: 100%; height: auto; }

/* Breaking news bar */
.breaking-news {
  background: var(--np-primary) !important;
  color: #fff !important;
}
.breaking-news p, .breaking-news a {
  color: #fff !important;
  font-family: var(--np-font) !important;
  font-weight: 700;
}

/* ========== PROFESSIONAL MOBILE NEWS MENU ========== */
.np-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 99990;
  height: var(--np-header-h);
  background: #1a1a1a;
  color: #fff;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.np-mobile-bar .np-brand {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.np-menu-toggle,
.np-search-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.np-menu-toggle:hover,
.np-search-toggle:hover { background: rgba(255,255,255,0.1); }

/* Overlay */
.np-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99991;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.np-drawer-overlay.is-open {
  display: block;
  opacity: 1;
}

/* Side drawer */
.np-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: #111;
  color: #fff;
  z-index: 99992;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.np-drawer.is-open { transform: translateX(0); }

.np-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  background: var(--np-primary);
  position: sticky;
  top: 0;
  z-index: 2;
}
.np-drawer-header .np-drawer-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  color: #fff;
}
.np-drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  border-radius: 8px;
  cursor: pointer;
}

.np-drawer-nav {
  list-style: none;
  margin: 0;
  padding: 8px 0 40px;
}
.np-drawer-nav li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.np-drawer-nav a {
  display: block;
  padding: 14px 18px;
  color: #f0f0f0 !important;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}
.np-drawer-nav a:hover,
.np-drawer-nav .current-menu-item > a {
  background: rgba(198,40,40,0.35);
  color: #fff !important;
}
.np-drawer-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #0a0a0a;
}
.np-drawer-nav .sub-menu a {
  padding-right: 32px;
  font-size: 14px;
  color: #ccc !important;
}

/* Mobile search panel */
.np-mobile-search {
  display: none;
  position: fixed;
  top: var(--np-header-h);
  left: 0;
  right: 0;
  z-index: 99989;
  background: #fff;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.np-mobile-search.is-open { display: block; }
.np-mobile-search form { display: flex; gap: 8px; }
.np-mobile-search input[type="search"] {
  flex: 1;
  border: 1px solid var(--np-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--np-font);
  font-size: 15px;
}
.np-mobile-search button {
  background: var(--np-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

body.np-drawer-open { overflow: hidden; }

/* Show mobile bar / hide desktop nav on small screens */
@media (max-width: 991px) {
  .np-mobile-bar { display: flex !important; }
  #navbar .navbar-header,
  #navbar .navbar-toggle { display: none !important; }
  /* Keep desktop menu in DOM for cloning but hide visual bootstrap collapse on mobile */
  #navbar .navbar-nav.collapse { display: none !important; }
}

@media (min-width: 992px) {
  .np-mobile-bar,
  .np-drawer,
  .np-drawer-overlay,
  .np-mobile-search { display: none !important; }
}

/* ========== RESPONSIVE TABLES ========== */
.entry-content table,
.wp-block-table table,
article table,
.site-main table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.2em 0 !important;
  background: #fff;
  color: #1a1a1a !important;
}
.entry-content table th,
.entry-content table td,
article table th,
article table td {
  padding: 10px 12px !important;
  border: 1px solid #dde1e6 !important;
  text-align: right !important;
  color: #1a1a1a !important;
  opacity: 1 !important;
}
.entry-content table th,
article table th {
  background: #f0f2f5 !important;
  font-weight: 700 !important;
}

.entry-content,
.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (max-width: 767px) {
  .entry-content table,
  article table,
  .wp-block-table table {
    display: block !important;
    min-width: 480px;
    font-size: 13px !important;
    overflow-x: auto !important;
  }
  .entry-content table th,
  .entry-content table td,
  article table th,
  article table td {
    padding: 8px 10px !important;
    white-space: nowrap;
    font-size: 13px !important;
  }
  .entry-content table td:first-child,
  .entry-content table th:first-child {
    white-space: normal;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .entry-content table,
  article table { min-width: 400px; font-size: 12px !important; }
}

/* ========== GENERAL MOBILE ========== */
@media (max-width: 767px) {
  body { font-size: 15px !important; }
  .entry-title, .entry-title a { font-size: 1.12rem !important; line-height: 1.55 !important; }
  .container, .content-wrapper { padding-left: 12px !important; padding-right: 12px !important; max-width: 100% !important; }
  #secondary, .sidebar { width: 100% !important; float: none !important; margin-top: 24px; }
  .col-sm-8, .col-md-8, .col-sm-4, .col-md-4 { width: 100% !important; float: none !important; }
  article { margin-bottom: 16px !important; }
  .header-site { padding: 10px 0; }
  .top-header { font-size: 12px; }
}

/* Performance */
article, .widget { content-visibility: auto; contain-intrinsic-size: auto 260px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
