/* ====== ریست و فونت ====== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Vazir', sans-serif; background:#f0f0f0; color:#222; line-height:1.8; direction:rtl; }
.container { width:95%; max-width:1230px; margin:auto; }
a { text-decoration:none; color:inherit; }
img { max-width:100%; height:auto; display:block; }

/* ====== هدر بالایی ====== */
.top-bar {
  background:#1a1a1a; color:#ccc; padding:0.5rem 0; font-size:0.85rem;
  border-bottom:2px solid #cc0000;
}
.top-bar .container { display:flex; justify-content:space-between; align-items:center; }
.top-bar .date { }
.top-bar .logo-area { display:flex; align-items:center; gap:0.5rem; }
.top-bar .logo { font-size:2.2rem; font-weight:900; color:#fff; letter-spacing:-1px; }
.top-bar .tagline { font-size:0.8rem; color:#aaa; }
.search-box { display:flex; align-items:center; background:#333; padding:0.3rem 0.5rem; border-radius:3px; }
.search-box input { background:none; border:none; color:#fff; padding:0.2rem; outline:none; }
.search-box button { background:#cc0000; border:none; color:#fff; padding:0.3rem 0.8rem; border-radius:2px; cursor:pointer; }

/* ====== منوی اصلی ====== */
.main-nav {
  background:#fff; box-shadow:0 2px 4px rgba(0,0,0,0.05); position:sticky; top:0; z-index:1000;
}
.main-nav .container { display:flex; }
.main-nav ul { display:flex; list-style:none; flex:1; }
.main-nav li { position:relative; }
.main-nav li a {
  display:block; padding:1rem 1.2rem; font-weight:700; color:#111; font-size:0.95rem;
  transition:0.2s; white-space:nowrap;
}
.main-nav li a:hover, .main-nav li.active > a { color:#cc0000; }
.main-nav li.has-dropdown > a::after { content:" ▾"; font-size:0.7em; }
.main-nav .dropdown {
  display:none; position:absolute; top:100%; right:0; background:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,0.12); min-width:200px; z-index:1001;
  border-radius:0 0 6px 6px; padding:0.5rem 0;
}
.main-nav li.has-dropdown:hover .dropdown { display:block; }
.main-nav .dropdown li { display:block; }
.main-nav .dropdown li a {
  padding:0.6rem 1.2rem; font-weight:normal; color:#333; font-size:0.9rem;
  border-bottom:1px solid #f0f0f0;
}
.main-nav .dropdown li:last-child a { border-bottom:none; }
.main-nav .dropdown li a:hover { background:#f9f9f9; color:#cc0000; }

/* ====== تیکر (حرکت از چپ به راست) ====== */
/* ====== تیکر (خبر فوری) ====== */
.breaking-ticker {
  background: #cc0000; color: #fff; padding: 0.4rem 0; overflow: hidden;
}
.ticker-inner { display: flex; align-items: center; }
.ticker-label { background: #8b0000; padding: 0.3rem 0.8rem; font-weight: bold; white-space: nowrap; }
.ticker-marquee { flex: 1; overflow: hidden; }
.ticker-marquee ul {
  list-style: none;
  display: inline-block;
  white-space: nowrap;
  animation-duration: 60s;              /* مقدار پیش‌فرض (با PHP بازنویسی می‌شود) */
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-delay: -30s;                /* بلافاصله از وسط مسیر شروع شود */
  padding: 0; margin: 0;
}
.ticker-marquee ul.rtl {
  animation-name: ticker-rtl;
  direction: rtl;
}
.ticker-marquee ul.ltr {
  animation-name: ticker-ltr;
  direction: ltr;
}
.ticker-marquee li {
  display: inline;
  margin-left: 2rem;
}
.ticker-marquee a {
  color: #fff;
  font-weight: 500;
}

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


/* ====== اسلایدر مدیریت‌شده ====== */
.hero-section { margin:2rem 0; }
.hero-slider {
  position:relative; border-radius:8px; overflow:hidden; height:450px; background:#000;
}
.hero-slide {
  position:absolute; top:0; right:0; left:0; bottom:0;
  opacity:0; transition:opacity 0.6s ease-in-out; pointer-events:none;
}
.hero-slide.active { opacity:1; pointer-events:auto; }
.hero-slide img { width:100%; height:100%; object-fit:cover; }
.hero-slide .hero-caption {
  position:absolute; bottom:0; right:0; left:0;
  padding:2rem 1.5rem 1rem;
  background:linear-gradient(transparent, rgba(0,0,0,0.8)); color:#fff;
}
.hero-slide .hero-caption h2 { font-size:1.6rem; margin-top:0.5rem; line-height:1.4; }
.hero-slide .hero-caption .category {
  display:inline-block; background:#cc0000; color:#fff;
  padding:0.2rem 0.6rem; border-radius:3px; font-size:0.8rem;
}
.slider-nav {
  position:absolute; top:50%; width:100%; display:flex; justify-content:space-between;
  transform:translateY(-50%); padding:0 1rem; z-index:10;
}
.slider-nav button {
  background:rgba(0,0,0,0.6); color:#fff; border:none; font-size:2rem;
  width:45px; height:45px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; border-radius:50%; transition:background 0.2s;
}
.slider-nav button:hover { background:rgba(0,0,0,0.85); }
.slider-dots {
  position:absolute; bottom:20px; width:100%; text-align:center; z-index:10;
}
.slider-dots .dot {
  display:inline-block; width:12px; height:12px; margin:0 5px;
  background:rgba(255,255,255,0.5); border-radius:50%; cursor:pointer; transition:background 0.2s;
}
.slider-dots .dot.active { background:#cc0000; }

/* Hero پیش‌فرض (در صورت نبود اسلاید مدیریتی) */
.hero-grid {
  display:grid; grid-template-columns:1fr 320px; gap:1.5rem;
}
.hero-main { position:relative; border-radius:4px; overflow:hidden; background:#000; }
.hero-main img { width:100%; height:450px; object-fit:cover; opacity:0.9; }
.hero-main .hero-caption {
  position:absolute; bottom:0; right:0; left:0; padding:2rem 1.5rem 1rem;
  background:linear-gradient(transparent, rgba(0,0,0,0.85)); color:#fff;
}
.hero-main .hero-caption h2 { font-size:1.8rem; margin-top:0.5rem; }
.hero-main .hero-caption .category {
  background:#cc0000; display:inline-block; padding:0.2rem 0.5rem; font-size:0.8rem; border-radius:2px;
}
.hero-sidebar { display:flex; flex-direction:column; gap:1rem; }
.hero-side-item {
  background:#fff; border-radius:4px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.1);
  display:flex; align-items:center; gap:0.8rem; padding:0.8rem;
}
.hero-side-item img { width:100px; height:70px; object-fit:cover; border-radius:3px; }
.hero-side-item h4 { font-size:0.9rem; line-height:1.4; }

/* ====== محتوای اصلی ====== */
.main-content {
  display:grid; grid-template-columns:1fr 320px; gap:2rem; margin-bottom:2rem; align-items:start;
}
.news-grid-section { background:#fff; padding:1.5rem; border-radius:4px; margin-bottom:2rem; }
.section-title {
  border-bottom:3px solid #cc0000; padding-bottom:0.5rem; margin-bottom:1.5rem;
  font-size:1.4rem; font-weight:900; color:#111;
}
.news-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:1.5rem;
}
.news-card {
  background:#fff; border-radius:8px; overflow:hidden; box-shadow:0 2px 5px rgba(0,0,0,0.05);
  transition:0.2s; display:flex; flex-direction:column;
}
.news-card:hover { transform:translateY(-3px); }
.news-card-img { height:180px; overflow:hidden; }
.news-card-img img { width:100%; height:100%; object-fit:cover; }
.news-card-content { padding:1rem; flex:1; display:flex; flex-direction:column; }
.news-card-content h3 { font-size:1.1rem; margin-bottom:0.5rem; line-height:1.6; }
.news-card-content .summary { font-size:0.9rem; color:#555; margin-bottom:0.8rem; flex:1; }
.news-card-content .meta { font-size:0.8rem; color:#888; display:flex; justify-content:space-between; }

/* ====== ستون کناری (sticky) ====== */
.sidebar { position:sticky; top:1rem; align-self:start; }
.sidebar .widget { background:#fff; padding:1.2rem; border-radius:4px; margin-bottom:1.5rem; }
.widget h3 { color:#111; border-bottom:2px solid #cc0000; padding-bottom:0.5rem; margin-bottom:1rem; font-size:1.1rem; }
.widget ul { list-style:none; }
.widget li { margin-bottom:0.7rem; padding-bottom:0.7rem; border-bottom:1px dashed #ddd; }
.widget li:last-child { border:none; }
.widget li a { font-size:0.9rem; color:#222; line-height:1.5; }

/* ====== صفحه‌بندی ====== */
.pagination { display:flex; justify-content:center; gap:0.5rem; margin:2rem 0; }
.pagination a {
  display:inline-block; padding:0.5rem 1rem; background:#fff; border:1px solid #ddd;
  border-radius:4px; color:#333; text-decoration:none; transition:0.2s;
}
.pagination a:hover { background:#0b5e2e; color:#fff; }
.pagination a.active { background:#0b5e2e; color:#fff; font-weight:bold; }

/* ====== فوتر ====== */
.main-footer { background:#1a1a1a; color:#bbb; padding:2rem 0 0; margin-top:2rem; }
.main-footer .footer-widgets {
  display:grid !important; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:2rem; margin-bottom:2rem; text-align:right;
}
.main-footer .footer-widgets .widget { background:transparent !important; padding:0; border-radius:0; box-shadow:none; margin-bottom:0; }
.main-footer .footer-widgets .widget h3 { color:#fff !important; border-bottom:1px solid #444; padding-bottom:0.7rem; margin-bottom:1rem; font-size:1.1rem; }
.main-footer .footer-widgets .widget ul { list-style:none; padding:0; margin:0; }
.main-footer .footer-widgets .widget ul li { margin-bottom:0.5rem; border-bottom:none; }
.main-footer .footer-widgets .widget ul li a { color:#bbbbbb; font-size:0.9rem; }
.main-footer .footer-widgets .widget ul li a:hover { color:#fff; }
.main-footer .copyright { text-align:center; padding:1.5rem 0; border-top:1px solid #333; font-size:0.85rem; color:#bbb; }

/* ====== صفحه خبر ====== */
.single-article { display:grid; grid-template-columns:1fr 300px; gap:2rem; margin:2rem auto; }
.single-article article { background:#fff; border-radius:8px; padding:2rem; box-shadow:0 2px 8px rgba(0,0,0,0.05); }
.article-header { margin-bottom:1.5rem; }
.article-category { display:inline-block; background:#cc0000; color:#fff; padding:0.2rem 0.8rem; border-radius:2px; font-size:0.8rem; margin-bottom:0.8rem; }
.single-article h1 { font-size:2rem; color:#111; line-height:1.4; margin-bottom:0.8rem; }
.article-meta { display:flex; gap:1.5rem; color:#666; font-size:0.9rem; }
.featured-image { margin-bottom:1.5rem; border-radius:6px; overflow:hidden; }
.featured-image img { width:100%; display:block; }
.article-content { font-size:1.05rem; line-height:2.1; color:#333; }
.article-content img, .article-content video, .article-content iframe { max-width:100%; height:auto; margin:1rem 0; border-radius:4px; }
.article-footer { margin-top:2rem; padding-top:1.5rem; border-top:1px solid #eee; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:1rem; }
.source-line { color:#777; font-style:italic; }
.share-buttons a { display:inline-block; margin-right:0.5rem; background:#eee; padding:0.4rem 0.8rem; border-radius:3px; font-size:0.9rem; color:#333; transition:0.2s; }
.share-buttons a:hover { background:#cc0000; color:#fff; }
.related-list { list-style:none; }
.related-list li { margin-bottom:0.8rem; }
.related-list a { display:flex; align-items:center; gap:0.8rem; }
.related-thumb { width:70px; height:50px; object-fit:cover; border-radius:4px; flex-shrink:0; }

/* ====== صفحات دسته‌بندی و جستجو ====== */
.category-page { margin:2rem auto; }
.category-title { background:#cc0000; color:#fff; display:inline-block; padding:0.5rem 1.5rem; border-radius:3px; margin-bottom:1.5rem; font-size:1.3rem; }

/* ====== تصویر پیش‌فرض ====== */
img[src*="default-news.jpg"] { background:#eee; object-fit:contain; padding:1rem; }

/* ====== نظرات ====== */
.comment { background:#f9f9f9; padding:1rem; margin-bottom:1rem; border-radius:8px; }
.comment strong { color:#0b5e2e; }
.comment small { color:#888; margin-right:1rem; }
.comment p { margin-top:0.5rem; }

/* ====== واکنش‌گرایی ====== */
@media (max-width: 768px) {
  .hero-slider { height:280px; }
  .hero-slide .hero-caption h2 { font-size:1.2rem; }
  .hero-grid, .main-content, .single-article { grid-template-columns:1fr; }
  .hero-main img { height:250px; }
  .news-card { flex-direction:column; }
  .news-card-img { width:100%; height:150px; }
  .top-bar .container { flex-wrap:wrap; }
  .main-nav ul { flex-wrap:wrap; }
  .main-nav li { flex:1 1 50%; }
  .main-nav li.has-dropdown.open .dropdown { display:block; position:static; box-shadow:none; }
  .sidebar { position:static; }
  .main-footer .footer-widgets { grid-template-columns:1fr; }
}
/* ====== دکمه شناور تغییر حالت شب/روز ====== */
#themeToggleBtn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #0b5e2e;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
#themeToggleBtn:hover { background: #094c26; }

/* ====== حالت شب (Dark Mode) ======
   این قوانین رنگ زمینه/متن اصلی را برای عنصر html.dark-mode بازنویسی می‌کنند.
   اگر رنگ خاصی درست دیده نشد، همین بخش قابل تنظیم دقیق‌تر است. */
html.dark-mode { background:#121212; }
html.dark-mode body { background:#121212; color:#e4e4e4; }
html.dark-mode a { color:#8ecf9e; }
html.dark-mode .header,
html.dark-mode .top-bar,
html.dark-mode .main-nav,
html.dark-mode .main-footer,
html.dark-mode .news-card,
html.dark-mode .sidebar,
html.dark-mode .single-article,
html.dark-mode .comment,
html.dark-mode .category-page,
html.dark-mode .form-container {
  background:#1e1e1e !important;
  color:#e4e4e4 !important;
  border-color:#333 !important;
}
html.dark-mode .comment { background:#232323 !important; }
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
  background:#2a2a2a !important;
  color:#e4e4e4 !important;
  border-color:#444 !important;
}

/* ====== ویجت واکنش به خبر ====== */
#newsReactions { margin:1.5rem 0; }
.reactions-buttons { display:flex; gap:0.6rem; flex-wrap:wrap; }
.reaction-btn {
  background:#f0f0f0;
  border:1px solid #ddd;
  border-radius:20px;
  padding:0.4rem 0.9rem;
  font-size:1rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:0.3rem;
}
.reaction-btn:hover { background:#e2e2e2; }
html.dark-mode .reaction-btn { background:#2a2a2a; border-color:#444; color:#e4e4e4; }
html.dark-mode .reaction-btn:hover { background:#333; }


/* —— Dark mode تکمیلی (هدر/کارت/محتوا) —— */
html.dark, html.dark-mode,
html.dark body, html.dark-mode body,
body.dark, body.dark-mode {
  background: #121212 !important;
  color: #e8e8e8 !important;
}
html.dark .top-bar, html.dark-mode .top-bar, body.dark .top-bar, body.dark-mode .top-bar {
  background: #0a0a0a !important; color: #eee !important;
}
html.dark .main-nav, html.dark-mode .main-nav, body.dark .main-nav {
  background: #1a1a1a !important;
}
html.dark .main-nav a, html.dark-mode .main-nav a { color: #d0e8d8 !important; }
html.dark .news-card, html.dark-mode .news-card,
html.dark .single-article article, html.dark-mode .single-article article,
html.dark .sidebar .widget, html.dark-mode .sidebar .widget,
html.dark .widget, html.dark-mode .widget {
  background: #1e1e1e !important; color: #e4e4e4 !important; border-color: #333 !important;
}
html.dark .main-footer, html.dark-mode .main-footer {
  background: #0a0a0a !important; color: #ccc !important;
}
html.dark input, html.dark-mode input, html.dark textarea, html.dark-mode textarea {
  background: #2a2a2a !important; color: #eee !important; border-color: #444 !important;
}
html.dark .local-seo-cities, html.dark-mode .local-seo-cities {
  background: #1a2420 !important; border-color: #2a4035 !important; color: #ddd !important;
}
html.dark .theme-toggle, html.dark-mode .theme-toggle { filter: none; }

/* فوتر وسط‌چین */
.main-footer .footer-bottom,
.main-footer .footer-bottom p,
.main-footer .copyright {
  text-align: center !important;
}

/* هدر یکپارچه */
.top-bar-inner{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.logo-area .brand-link{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.logo-area .site-logo{height:2.6rem;width:auto;max-width:120px;object-fit:contain}
.logo-area .brand-text{display:flex;flex-direction:column;line-height:1.25}
.logo-area .site-name{font-weight:800;font-size:1.15rem}
.logo-area .tagline{font-size:.78rem;opacity:.85}
.logo-area .header-desc{font-size:.72rem;opacity:.75;max-width:220px}
.header-meta .last-update{font-size:.8rem;opacity:.9}
.header-meta .lu-label{opacity:.75;margin-left:4px}
.header-actions{display:flex;align-items:center;gap:8px}
@media(max-width:720px){
  .top-bar-inner{flex-direction:column;align-items:stretch}
  .header-actions{justify-content:space-between}
}

/* پیشنهاد جستجوی زنده — زیر کادر */
.search-box { position: relative; }
.live-search-box {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: auto !important;
  min-width: 260px;
  max-width: 360px;
  background: #fff !important;
  color: #222 !important;
  border: 1px solid #d0d8d4;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  z-index: 5000;
}
.live-search-box a:hover { background: #f0f7f3; }
