/**
 * HardNews Pro v3.0.0 - Persian / Mobile Menu / Tables / Click-safe
 */
:root {
  --hn-primary: #f3ad29;
  --hn-dark: #353535;
  --hn-text: #1a1a1a;
  --hn-font: Tahoma, "Segoe UI", "Iranian Sans", system-ui, sans-serif;
  --hn-bar-h: 56px;
}

body.hardnews-pro, body.rtl-ready, body {
  font-family: var(--hn-font) !important;
  color: var(--hn-text) !important;
  direction: rtl;
  text-align: right;
  line-height: 1.8;
}

h1,h2,h3,h4,h5,h6,
.entry-title, .entry-title a,
.main-navigation a, .widget-title {
  font-family: var(--hn-font) !important;
  color: #111 !important;
  opacity: 1 !important;
  font-weight: 700;
}
.entry-title a:hover { color: var(--hn-primary) !important; }
.entry-content p, .entry-summary, article p, .post-excerpt {
  color: #2a2a2a !important;
  opacity: 1 !important;
}
.entry-meta, .entry-meta a, .item-metadata {
  color: #555 !important;
  opacity: 1 !important;
}
img { max-width: 100%; height: auto; }

/* CRITICAL: all post links clickable */
a[href],
.entry-title a,
article a,
.post a,
.spotlight-post a,
.grid-item a,
.figure-categories a,
.read-more {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 3 !important;
}

/* ========== Mobile news menu ========== */
.hn-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--hn-bar-h);
  background: var(--hn-dark);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.hn-mobile-bar .hn-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;
  font-family: var(--hn-font) !important;
}
.hn-menu-toggle, .hn-search-toggle {
  width: 44px; height: 44px; border: 0;
  background: transparent; color: #fff;
  font-size: 20px; cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

/* display:none when closed — never blocks clicks */
.hn-drawer-overlay {
  display: none !important;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10010;
  pointer-events: none;
}
.hn-drawer-overlay.is-open {
  display: block !important;
  pointer-events: auto;
}

.hn-drawer {
  display: none !important;
  position: fixed; top: 0; right: 0;
  width: min(320px, 86vw); height: 100%;
  background: #1a1a1a; color: #fff;
  z-index: 10011;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
  pointer-events: none;
}
.hn-drawer.is-open {
  display: block !important;
  pointer-events: auto;
}

.hn-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: var(--hn-primary);
  position: sticky; top: 0; z-index: 2;
}
.hn-drawer-header .hn-drawer-title {
  font-weight: 700; font-size: 16px; margin: 0; color: #1a1a1a;
  font-family: var(--hn-font) !important;
}
.hn-drawer-close {
  width: 40px; height: 40px; border: 0;
  background: rgba(0,0,0,.15); color: #1a1a1a;
  font-size: 22px; border-radius: 8px; cursor: pointer;
}
.hn-drawer-nav { list-style: none; margin: 0; padding: 8px 0 40px; }
.hn-drawer-nav li { border-bottom: 1px solid rgba(255,255,255,.08); }
.hn-drawer-nav a {
  display: block; padding: 14px 18px;
  color: #f0f0f0 !important; text-decoration: none !important;
  font-size: 15px; font-weight: 500;
  font-family: var(--hn-font) !important;
}
.hn-drawer-nav a:hover,
.hn-drawer-nav .current-menu-item > a {
  background: rgba(243,173,41,.35); color: #fff !important;
}
.hn-drawer-nav .sub-menu {
  list-style: none; margin: 0; padding: 0; background: #0d0d0d;
}
.hn-drawer-nav .sub-menu a {
  padding-right: 32px; font-size: 14px; color: #ccc !important;
}

.hn-mobile-search {
  display: none !important;
  position: fixed; top: var(--hn-bar-h); left: 0; right: 0;
  z-index: 10005; background: #fff; padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  pointer-events: none;
}
.hn-mobile-search.is-open {
  display: block !important;
  pointer-events: auto;
}
.hn-mobile-search form { display: flex; gap: 8px; }
.hn-mobile-search input[type="search"] {
  flex: 1; border: 1px solid #e4e6eb; border-radius: 8px;
  padding: 10px 14px; font-family: var(--hn-font); font-size: 15px;
}
.hn-mobile-search button {
  background: var(--hn-primary); color: #1a1a1a; border: 0;
  border-radius: 8px; padding: 0 16px; font-weight: 700; cursor: pointer;
  font-family: var(--hn-font);
}

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

@media (max-width: 991px) {
  .hn-mobile-bar { display: flex !important; }
  /* Hide parent mobile toggle if it conflicts */
  .toggle-menu, .af-mobile-site-title-wrap { /* keep parent nav structure */ }
}

@media (min-width: 992px) {
  .hn-mobile-bar, .hn-drawer, .hn-drawer-overlay, .hn-mobile-search {
    display: none !important;
    pointer-events: 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;
  }
  body { font-size: 15px !important; }
  .entry-title, .entry-title a { font-size: 1.12rem !important; line-height: 1.55 !important; }
  .container { padding-left: 12px !important; padding-right: 12px !important; max-width: 100% !important; }
  #secondary, .sidebar, .widget-area { width: 100% !important; float: none !important; margin-top: 24px; }
  article { margin-bottom: 16px !important; }
  .header-layout-3 .site-header .site-branding .site-title { font-size: 32px !important; }
}
@media (max-width: 480px) {
  .entry-content table, article table { min-width: 400px; font-size: 12px !important; }
}

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