/* Gilanijan Reading UX — هویت بصری و تجربه خواندن */
:root {
  --gj-green: #0b5e2e;
  --gj-green-soft: #e8f5ee;
  --gj-accent: #e67e22; /* نارنجی ملایم فوری */
  --gj-accent-soft: #fff4e8;
  --gj-radius: 14px;
  --gj-shadow: 0 4px 18px rgba(11, 94, 46, 0.07);
  --gj-shadow-hover: 0 10px 28px rgba(11, 94, 46, 0.14);
  --gj-text: #1e2925;
  --gj-muted: #5c6b64;
  --gj-card-bg: #fff;
  --gj-transition: 180ms ease;
  --gj-read-width: 100%;
}

html.dark, body.dark, body.dark-mode, [data-theme="dark"] {
  --gj-text: #e8f0ec;
  --gj-muted: #a3b5ac;
  --gj-card-bg: #1a2420;
  --gj-green-soft: #16352a;
  --gj-accent-soft: #3a2a18;
  --gj-shadow: 0 4px 18px rgba(0,0,0,.35);
  --gj-shadow-hover: 0 10px 28px rgba(0,0,0,.5);
}

/* --- کارت خبر مدرن --- */
.news-card,
.news-grid .news-card {
  position: relative;
  background: var(--gj-card-bg);
  border-radius: var(--gj-radius);
  overflow: hidden;
  box-shadow: var(--gj-shadow);
  border: 1px solid rgba(11,94,46,.06);
  transition: transform var(--gj-transition), box-shadow var(--gj-transition);
  height: 100%;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--gj-shadow-hover);
}
.news-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #dfece4, #c5d9cc);
}
.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease;
}
.news-card:hover .news-card-img img {
  transform: scale(1.04);
}
.news-card-content {
  padding: 14px 16px 16px;
}
.news-card-content h3 {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.55;
  color: var(--gj-text);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-content .summary {
  color: var(--gj-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-content .meta,
.news-card-content time {
  font-size: 0.78rem;
  color: var(--gj-muted);
  font-weight: 500;
}

/* بج روی تصویر */
.gj-card-badge,
.gj-badge-breaking,
.gj-badge-city {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gj-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  line-height: 1.3;
}
.gj-badge-breaking {
  background: var(--gj-accent);
  right: auto;
  left: 10px;
}

/* دکمه مشاهده */
.gj-news-card-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: var(--gj-green) !important;
  color: #fff !important;
  border-radius: 999px !important;
  min-height: 36px;
  transition: background var(--gj-transition), transform var(--gj-transition);
}
.news-card:hover .gj-news-card-btn {
  background: #094d25 !important;
}

/* --- هیرو: یک بزرگ + چند کنار --- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin: 1rem 0 1.4rem;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-grid .hero-main {
  position: relative;
  border-radius: var(--gj-radius);
  overflow: hidden;
  min-height: 320px;
  box-shadow: var(--gj-shadow);
}
.hero-grid .hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}
.hero-grid .hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-grid .hero-side-item {
  display: flex;
  gap: 12px;
  background: var(--gj-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gj-shadow);
  border: 1px solid rgba(11,94,46,.06);
  transition: transform var(--gj-transition);
  min-height: 96px;
}
.hero-grid .hero-side-item:hover { transform: translateY(-2px); }
.hero-grid .hero-side-item img {
  width: 120px;
  min-width: 120px;
  height: 96px;
  object-fit: cover;
}
.hero-grid .hero-side-item h4 {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 10px 10px 4px 0;
  color: var(--gj-text);
}
.hero-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 20px 18px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff;
}
.hero-caption h2 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 6px;
  color: #fff !important;
}
.hero-caption .meta { color: rgba(255,255,255,.85); font-size: 0.8rem; }

/* شبکه اخبار */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- صفحه خبر خلوت --- */
.single-article article,
.article-wrap,
.news-single .article-body {
  max-width: 100%;
  width: 100%;
}
.news-page-main .single-article {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 1.5rem !important;
  align-items: start;
  width: 100%;
  margin: 0 auto;
}
.news-page-main .single-article > article {
  min-width: 0;
  max-width: none !important;
  width: 100%;
}
.news-page-main .article-content {
  max-width: none !important;
  width: 100%;
}
@media (max-width: 900px) {
  .news-page-main .single-article {
    grid-template-columns: 1fr !important;
  }
}
.article-content {
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--gj-text);
  max-width: none;
  width: 100%;
}
.article-content p { margin-bottom: 1.1em; }
.article-title, .single-article h1, article h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.45;
  color: var(--gj-text);
  margin: 0 0 10px;
}
.article-meta, .meta-line {
  font-size: 0.85rem;
  color: var(--gj-muted);
  margin-bottom: 14px;
}
.featured-image {
  border-radius: var(--gj-radius);
  overflow: hidden;
  margin: 0 0 1.2rem;
  aspect-ratio: 16 / 9;
  background: #dfece4;
}
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* نوار پیشرفت خواندن */
.gj-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  background: rgba(11,94,46,.12);
  pointer-events: none;
}
.gj-read-progress > span {
  display: block;
  width: 0%;
  height: 100%;
  transition: width 80ms linear;
}

/* اشتراک جمع‌وجور */
.share-buttons,
.gj-share-bottom,
.gj-share-top {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.share-buttons a,
.share-buttons button,
.gj-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--gj-green-soft);
  color: var(--gj-green) !important;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(11,94,46,.12);
  transition: background var(--gj-transition);
}
.share-buttons a:hover {
  background: #d4eddq;
  background: #d4eddc;
}

/* مطالب مرتبط افقی */
.related-news,
.gj-related-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.related-news .related-item,
.gj-related-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--gj-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gj-shadow);
  border: 1px solid rgba(11,94,46,.06);
}
.gj-related-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.gj-related-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 12px 12px;
  line-height: 1.5;
  margin: 0;
  color: var(--gj-text);
}

/* دکمه بازگشت شناور موبایل */
#gj-back-fab {
  display: none;
  position: fixed;
  bottom: 88px;
  left: 16px;
  z-index: 99980;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--gj-green);
  color: #fff;
  font-size: 20px;
  box-shadow: 0 6px 20px rgba(11,94,46,.35);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  #gj-back-fab.show { display: flex; }
}

/* منوی موبایل کشویی */
.gj-mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10050;
}
.gj-mobile-drawer-backdrop.open { display: block; }
.gj-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--gj-card-bg);
  z-index: 10060;
  transform: translateX(105%);
  transition: transform 200ms ease;
  box-shadow: -8px 0 30px rgba(0,0,0,.2);
  overflow-y: auto;
  padding: 16px;
}
.gj-mobile-drawer.open { transform: translateX(0); }
.gj-mobile-drawer a {
  display: block;
  padding: 12px 10px;
  font-weight: 700;
  color: var(--gj-text);
  border-bottom: 1px solid rgba(11,94,46,.08);
  min-height: 44px;
}
.gj-nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
}
@media (max-width: 768px) {
  .gj-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav ul.desktop-nav { display: none !important; }
}

/* Skeleton */
.gj-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 1rem 0;
}
.gj-skel-card {
  background: var(--gj-card-bg);
  border-radius: var(--gj-radius);
  overflow: hidden;
  box-shadow: var(--gj-shadow);
}
.gj-skel-img {
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, #e8eee9 25%, #f4f7f5 50%, #e8eee9 75%);
  background-size: 200% 100%;
  animation: gj-shimmer 1.2s infinite;
}
.gj-skel-line {
  height: 12px;
  margin: 12px 16px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8eee9 25%, #f4f7f5 50%, #e8eee9 75%);
  background-size: 200% 100%;
  animation: gj-shimmer 1.2s infinite;
}
.gj-skel-line.short { width: 40%; }
@keyframes gj-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
html.dark .gj-skel-img,
html.dark .gj-skel-line {
  background: linear-gradient(90deg, #1a2420 25%, #24332c 50%, #1a2420 75%);
  background-size: 200% 100%;
}

/* حالت خالی */
.gj-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gj-muted);
  background: var(--gj-card-bg);
  border-radius: var(--gj-radius);
  box-shadow: var(--gj-shadow);
}
.gj-empty-state .ico { font-size: 2.5rem; margin-bottom: 12px; }
.gj-empty-state h3 { color: var(--gj-text); margin: 0 0 8px; }

/* فوتر معنادار */
.main-footer {
  background: #0f1f18;
  color: #c5d6cc;
  padding: 2.2rem 0 1.4rem;
  margin-top: 2rem;
}
.main-footer a { color: #9fd4b5; }
.main-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 1.5rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: .9;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
  margin-bottom: 12px;
}
.footer-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

/* تیکر و badge فوری — رنگ تاکیدی */
.breaking-ticker,
.ticker-wrap {
  border-color: var(--gj-accent);
}
.ticker-label {
  background: var(--gj-accent) !important;
  color: #fff !important;
}

/* لینک‌ها و دکمه‌های اصلی */
a:not(.news-card-link):hover { color: var(--gj-green); }
.btn, button.primary {
  background: var(--gj-green);
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
  transition: background var(--gj-transition);
}

/* حالت کم‌حجم */
html.gj-low-data .news-card-img img,
html.gj-low-data .featured-image img,
html.gj-low-data .hero-main img {
  opacity: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
}
html.gj-low-data .news-card-img,
html.gj-low-data .featured-image {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gj-muted);
}
html.gj-low-data .news-card-img::after,
html.gj-low-data .featured-image::after {
  content: 'تصویر (حالت کم‌حجم)';
}

/* تب شهرستان‌ها */
.gj-city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.gj-city-chips button {
  border: 1px solid rgba(11,94,46,.2);
  background: var(--gj-card-bg);
  color: var(--gj-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  min-height: 40px;
  transition: background var(--gj-transition), color var(--gj-transition);
}
.gj-city-chips button.active,
.gj-city-chips button:hover {
  background: var(--gj-green);
  color: #fff;
  border-color: var(--gj-green);
}

/* جستجوی زنده — پیش‌نمایش */
.gj-live-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--gj-card-bg);
  border-radius: 12px;
  box-shadow: var(--gj-shadow-hover);
  z-index: 1000;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 6px;
}
.gj-live-search-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(11,94,46,.08);
  color: var(--gj-text);
  text-decoration: none;
}
.gj-live-search-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.gj-live-search-item strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
}
.gj-live-search-item span {
  font-size: 0.75rem;
  color: var(--gj-muted);
}

/* دارک‌مود — کنتراست واقعی */
html.dark body,
body.dark,
body.dark-mode {
  background: #0f1412 !important;
  color: #e8f0ec !important;
}
html.dark .news-card,
body.dark .news-card {
  background: #1a2420 !important;
  border-color: #2a3a33 !important;
}
html.dark .news-card-content h3,
html.dark .article-title,
html.dark article h1 {
  color: #f0f7f3 !important;
}
html.dark .summary,
html.dark .meta,
html.dark .article-meta {
  color: #a3b5ac !important;
}
html.dark .article-content {
  color: #dde8e2 !important;
}

/* انیمیشن کوتاه عمومی */
.main-nav li a,
.news-card,
.gj-city-chips button,
.share-buttons a {
  transition-duration: 180ms;
}

/* لمسی موبایل */
@media (max-width: 768px) {
  .main-nav li a {
    padding: 14px 16px;
    min-height: 44px;
  }
  .search-box button,
  .search-box input {
    min-height: 40px;
  }
}

.gj-city-chips a.gj-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(11,94,46,.2);
  background: var(--gj-card-bg);
  color: var(--gj-text) !important;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  min-height: 40px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}
.gj-city-chips a.gj-chip:hover {
  background: var(--gj-green);
  color: #fff !important;
  border-color: var(--gj-green);
}

.related-cards.gj-related-row,
.related-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.related-card {
  flex: 0 0 200px;
  background: var(--gj-card-bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gj-shadow);
  text-decoration: none;
  color: inherit;
}
.related-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.related-card .rc-title {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px;
  line-height: 1.5;
  color: var(--gj-text);
}

.search-box, form[data-ajax-search="1"] { position: relative; }
.gj-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--gj-card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.15);
  z-index: 10020;
  border: 1px solid rgba(11,94,46,.1);
  text-align: right;
}
.gj-suggest .sec {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gj-muted, #5c6b64);
}
.gj-suggest a {
  display: block;
  padding: 8px 12px;
  color: var(--gj-text, #1e2925);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid rgba(11,94,46,.06);
}
.gj-suggest a.gj-live-search-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.gj-suggest a.gj-live-search-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.gj-suggest a.gj-live-search-item strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 700;
}
.gj-suggest a.gj-live-search-item .ex,
.gj-suggest a.gj-live-search-item span.ex {
  display: block;
  font-size: 0.75rem;
  color: var(--gj-muted, #5c6b64);
  margin-top: 2px;
  line-height: 1.4;
}
html.dark .gj-suggest {
  background: #1a2420;
  border-color: #2a3a33;
}

.gj-article-dek {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--gj-muted, #5c6b64);
  margin: 0 0 12px;
  font-weight: 500;
}

/* اخبار مرتبط — اسلاید خودکار بدون نوار اسکرول */
.gj-related-carousel-wrap {
  position: relative;
  overflow: hidden;
  margin: 1.25rem 0;
}
.gj-related-carousel-wrap h3 { margin: 0 0 12px; }
.gj-related-viewport {
  overflow: hidden;
  width: 100%;
}
.gj-related-track {
  display: flex;
  gap: 12px;
  transition: transform 0.55s ease;
  will-change: transform;
}
.gj-related-track .gj-related-card,
.gj-related-track .related-card {
  flex: 0 0 calc((100% - 24px) / 3);
  min-width: 200px;
  max-width: 280px;
  text-decoration: none;
  color: inherit;
  background: var(--gj-card-bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(11,94,46,.08);
  border: 1px solid rgba(11,94,46,.08);
}
.gj-related-track .gj-related-card img,
.gj-related-track .related-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.gj-related-track h4,
.gj-related-track .rc-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 12px 12px;
  margin: 0;
}
@media (max-width: 700px) {
  .gj-related-track .gj-related-card,
  .gj-related-track .related-card {
    flex: 0 0 78%;
    max-width: none;
  }
}

/* اسلایدر تمام‌عرض هم‌تراز با container (شامل فضای بالای سایدبار) */
.hero-section.hero-fullwidth {
  width: 100%;
  margin: 1.2rem 0 1.5rem;
}
.hero-section.hero-fullwidth > .container {
  width: 95%;
  max-width: 1230px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  display: block !important;
  grid-template-columns: none !important;
}
.hero-section.hero-fullwidth .hero-slider {
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
  border-radius: 12px;
  overflow: hidden;
}
.main-content.container {
  width: 95%;
  max-width: 1230px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
