@font-face {
  font-family: "VazirmatnLocal";
  src: local("Vazirmatn"), local("Vazir"), local("Tahoma");
  font-display: swap;
}

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #050505;
  --red: #d90429;
  --blue: #0b4f8a;
  --soft-blue: #e8f2ff;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: VazirmatnLocal, Tahoma, Arial, sans-serif;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  min-height: 62px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  border-bottom: 3px solid var(--red);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.brand-main {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: .5px;
}

.brand-main::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  background: var(--red);
  border-radius: 50%;
}

.brand-sub {
  margin-top: 4px;
  font-size: 10px;
  color: #cbd5e1;
  letter-spacing: .6px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 25px;
  display: grid;
  place-items: center;
}

.text-link {
  font-size: 34px;
  line-height: 1;
}

.menu-panel {
  display: none;
  position: sticky;
  top: 62px;
  z-index: 19;
  background: #111827;
  color: #fff;
  padding: 10px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.menu-panel.open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.menu-panel a {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  font-size: 14px;
  text-align: center;
}

.search-box {
  display: none;
  position: sticky;
  top: 62px;
  z-index: 18;
  background: #111827;
  padding: 10px 12px 12px;
}

.search-box.open {
  display: block;
}

.search-box input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  color: #fff;
  background: rgba(255,255,255,.08);
  direction: rtl;
}

.search-box input::placeholder {
  color: #cbd5e1;
}

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 10px 24px;
}

.breaking {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 6px 0 10px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-right: 5px solid var(--red);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.breaking span {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.breaking p {
  margin: 0;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  color: #374151;
  font-weight: 800;
  font-family: inherit;
}

.tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.feed {
  display: grid;
  gap: 9px;
}

.news-card {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  min-height: 104px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.thumb {
  flex: 0 0 94px;
  width: 94px;
  height: 78px;
  border-radius: 13px;
  overflow: hidden;
  background: #d1d5db;
  border: 1px solid #e5e7eb;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  min-width: 0;
  flex: 1;
  display: grid;
  align-content: start;
  gap: 5px;
  text-align: right;
}

.card-title {
  margin: 0;
  color: #123a5f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
}

.badge.urgent {
  background: #ffe7eb;
  color: var(--red);
}

.load-more {
  width: 100%;
  margin: 14px 0 4px;
  border: 0;
  border-radius: 16px;
  padding: 13px;
  background: #111827;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
}

.footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 14px 40px;
  color: #6b7280;
  text-align: center;
  font-size: 13px;
}

.footer strong {
  display: block;
  color: #111827;
  font-size: 20px;
  margin-bottom: 4px;
}

.article-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 10px 28px;
}

.article-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-hero {
  width: 100%;
  height: 210px;
  background: #d1d5db;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-inner {
  padding: 14px 14px 18px;
}

.article-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.65;
  color: #111827;
}

.article-lead {
  margin: 0 0 14px;
  color: #374151;
  font-size: 15px;
  line-height: 1.9;
  font-weight: 700;
}

.article-text {
  color: #1f2937;
  font-size: 16px;
  line-height: 2.15;
}

.article-text p {
  margin: 0 0 14px;
}

.article-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #6b7280;
  font-size: 13px;
}

@media (min-width: 768px) {
  .site-header {
    border-radius: 0;
  }

  .news-card {
    min-height: 120px;
  }

  .thumb {
    flex-basis: 126px;
    width: 126px;
    height: 94px;
  }

  .card-title {
    font-size: 18px;
  }

  .card-summary {
    font-size: 14px;
  }
}

/* ===== 4CW_MOBILE_UI_COMPACT_V2 START ===== */

/* هدف: فید خبری موبایل شبیه تلگرام، کم‌حجم‌تر، خبرهای بیشتر در یک صفحه */

body {
  background: #eef1f5;
}

.site-header {
  min-height: 58px;
  padding: 6px 10px;
  grid-template-columns: 50px 1fr 50px;
}

.brand-main {
  font-size: 30px;
  line-height: 1;
}

.brand-sub {
  margin-top: 3px;
  font-size: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 24px;
}

.page {
  padding: 8px 8px 18px;
}

.breaking {
  margin: 6px 0 9px;
  padding: 8px 9px;
  border-radius: 15px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.breaking span {
  padding: 6px 10px;
  font-size: 12px;
}

.breaking p {
  font-size: 13px;
}

.tabs {
  gap: 6px;
  padding: 1px 0 8px;
}

.tab {
  padding: 8px 13px;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
}

.feed {
  gap: 8px;
}

.news-card {
  min-height: 92px;
  padding: 8px;
  gap: 9px;
  border-radius: 17px;
  border-color: #dde3ea;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .055);
}

.thumb {
  flex: 0 0 86px;
  width: 86px;
  height: 70px;
  border-radius: 14px;
}

.card-body {
  gap: 3px;
}

.card-title {
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -.15px;
  color: #123a5f;
}

.card-summary {
  font-size: 12.7px;
  line-height: 1.62;
  color: #4b5563;
  -webkit-line-clamp: 2;
}

.meta {
  margin-top: 1px;
  gap: 4px;
  font-size: 11px;
}

.badge {
  padding: 3px 7px;
  font-size: 11px;
}

.load-more {
  margin-top: 12px;
  border-radius: 15px;
  padding: 12px;
}

.footer {
  padding-top: 18px;
}

/* صفحه خبر هم کمی تمیزتر و موبایلی‌تر */
.article-page {
  padding: 10px 8px 22px;
}

.article-box {
  border-radius: 18px;
}

.article-hero {
  height: 190px;
}

.article-inner {
  padding: 13px 13px 17px;
}

.article-title {
  font-size: 21px;
  line-height: 1.75;
}

.article-lead {
  font-size: 14.5px;
  line-height: 1.9;
}

.article-text {
  font-size: 15.5px;
  line-height: 2.12;
}

/* موبایل‌های خیلی باریک */
@media (max-width: 380px) {
  .brand-main {
    font-size: 28px;
  }

  .thumb {
    flex-basis: 80px;
    width: 80px;
    height: 66px;
  }

  .card-title {
    font-size: 14.8px;
  }

  .card-summary {
    font-size: 12.2px;
  }

  .news-card {
    gap: 8px;
    padding: 7px;
  }
}

/* دسکتاپ فعلاً فقط تمیز، نه پیچیده */
@media (min-width: 768px) {
  .page,
  .footer,
  .article-page {
    max-width: 720px;
  }

  .thumb {
    flex-basis: 118px;
    width: 118px;
    height: 88px;
  }

  .news-card {
    min-height: 112px;
  }
}

/* ===== 4CW_MOBILE_UI_COMPACT_V2 END ===== */

/* ===== 4CW_FULL_STORY_EXPORT_V2 START ===== */
.article-action {
  display: block;
  margin: 18px 0 10px;
  padding: 13px 16px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
/* ===== 4CW_FULL_STORY_EXPORT_V2 END ===== */

/* ===== 4CW_NEWS_UX_FIX_V10 START ===== */

/* صفحه اصلی: فقط تیتر خبر، بدون خلاصه نصفه‌نیمه */
.news-card .card-summary {
  display: none !important;
}

.news-card {
  min-height: 82px;
  align-items: center;
}

.card-body {
  justify-content: center;
}

.card-title {
  -webkit-line-clamp: 3;
  font-size: 15.8px;
  line-height: 1.62;
}

/* متادیتا کمی جمع‌وجورتر زیر تیتر */
.meta {
  margin-top: 4px;
}

/* صفحه خبر: خود صفحه باید شرح خبر باشد */
.article-section-title {
  margin: 18px 0 8px;
  padding: 8px 12px;
  border-right: 4px solid #d90429;
  border-radius: 12px;
  background: #f3f6fa;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

/* دکمه بیرونی یعنی منبع، نه شرح خبر */
.article-action {
  background: #0f172a;
}

/* ===== 4CW_NEWS_UX_FIX_V10 END ===== */

/* ===== 4CW_ARTICLE_PERSIAN_BODY_V11 START ===== */

/* صفحه خبر: خلاصه تکراری حذف؛ بخش شرح خبر واضح‌تر */
.article-lead {
  display: none !important;
}

.article-section-title {
  margin: 18px 0 14px;
  padding: 10px 14px;
  border-right: 5px solid #d90429;
  border-radius: 14px;
  background: #f3f6fa;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  text-align: right;
}

.article-text p {
  text-align: right;
  direction: rtl;
}

/* متن انگلیسی اگر جایی باقی ماند، با این کلاس استفاده نمی‌شود؛ پاکسازی در JS انجام می‌شود. */

/* ===== 4CW_ARTICLE_PERSIAN_BODY_V11 END ===== */

/* ===== 4CW_HOME_LONG_TITLE_FIX_V1 START ===== */
/* صفحه اصلی: تیترهای بلند کامل‌تر دیده شوند، بدون خراب شدن کارت موبایل */
.news-card .card-title {
  font-size: 18px;
  line-height: 1.75;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.news-card .card-title.long-title {
  font-size: 17px;
  line-height: 1.72;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.news-card .card-title.very-long-title {
  font-size: 16px;
  line-height: 1.68;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.news-card {
  min-height: 118px;
}

@media (max-width: 420px) {
  .news-card .card-title {
    font-size: 17px;
    line-height: 1.72;
  }

  .news-card .card-title.long-title {
    font-size: 16px;
  }

  .news-card .card-title.very-long-title {
    font-size: 15.5px;
  }
}
/* ===== 4CW_HOME_LONG_TITLE_FIX_V1 END ===== */

/* ===== 4CW_HOME_TITLE_TOP_ALIGN_V1 START ===== */
/* صفحه اصلی: تیتر کارت‌ها همیشه از بالا و سمت راست شروع شود */
.news-card {
  align-items: flex-start !important;
}

.news-card .card-body {
  align-content: start !important;
  justify-content: start !important;
  align-items: stretch !important;
  padding-top: 0 !important;
  text-align: right !important;
}

.news-card .card-title {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
  text-align: right !important;
  align-self: start !important;
}

.news-card .meta {
  justify-content: flex-start !important;
  margin-top: 2px !important;
}
/* ===== 4CW_HOME_TITLE_TOP_ALIGN_V1 END ===== */
