/*
  Taqrir v16 — جابه‌جایی ساختاری صفحه اول
  ستون راست: موضوع ویژه شماره
  ستون وسط: اخبار دفتر نمایندگی (۳ یا ۴ خبر)
  این فایل عمداً پس از همه CSSهای قبلی بارگذاری می‌شود.
*/

/* ---------- موضوع ویژه در ستون راست ---------- */
.feature-card {
  padding: 22px 18px 17px !important;
}

.feature-card > .card-content {
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.feature-kicker {
  margin: 0 0 7px;
  padding-bottom: 7px;
  border-bottom: 1.25px solid rgba(36,31,25,.78);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 900;
}

.feature-kicker::before,
.feature-kicker::after {
  content: "✥";
  margin: 0 7px;
  font-size: .78em;
}

.feature-title {
  margin: 0 0 8px !important;
  font-size: 25px !important;
  line-height: 1.34 !important;
  font-weight: 950 !important;
  text-align: center !important;
}

.feature-title .line {
  display: block;
}

.feature-subtitle {
  display: block;
  width: 100%;
  margin: 0 0 9px;
  padding: 5px 1px 6px;
  border-top: 1px solid rgba(36,31,25,.72);
  border-bottom: 1px solid rgba(36,31,25,.72);
  font-size: 11.5px;
  line-height: 1.55;
  font-weight: 800;
  text-align: center;
}

.taqrir-image-box.feature-image {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 4 / 3;
  margin: 0 0 9px !important;
  border-width: 1.35px;
}

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

.feature-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.78;
  font-weight: 700;
  text-align: justify;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 9;
  overflow: hidden;
  max-height: calc(9 * 1.78em);
}

.feature-summary p {
  margin: 0;
}

.feature-card .taqrir-readmore {
  margin-top: 7px !important;
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- اخبار دفتر نمایندگی در ستون وسط ---------- */
.center-news-card {
  padding: 22px 23px 18px !important;
}

.center-news-card > .card-content {
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.center-news-heading {
  flex: 0 0 auto;
  margin: 0 0 10px !important;
  padding: 0 0 9px !important;
  font-size: 24px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
}

.center-news-lead {
  flex: 0 0 auto;
  padding-bottom: 10px;
  border-bottom: 1.35px solid rgba(36,31,25,.68);
}

.taqrir-image-box.center-news-image {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 16 / 7.2;
  margin: 0 0 9px !important;
  border-width: 1.45px;
}

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

.center-news-lead-title {
  margin: 0 0 5px;
  font-size: 22px;
  line-height: 1.48;
  font-weight: 950;
  text-align: center;
}

.center-news-lead-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.78;
  font-weight: 720;
  text-align: justify;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(3 * 1.78em);
}

.center-news-lead .taqrir-readmore {
  margin-top: 5px !important;
  font-size: 12.5px;
}

.center-news-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0 15px;
  margin-top: 3px;
}

.center-news-compact {
  min-width: 0;
  padding: 10px 0 8px;
  border-bottom: 1px solid rgba(36,31,25,.54);
}

.center-news-compact:nth-child(even) {
  padding-right: 14px;
  border-right: 1px solid rgba(36,31,25,.48);
}

.center-news-grid.count-3 .center-news-compact:last-child {
  grid-column: 1 / -1;
  padding-right: 0;
  border-right: 0;
}

.center-news-compact-title {
  margin: 0 0 4px;
  font-size: 16.5px;
  line-height: 1.62;
  font-weight: 950;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(3 * 1.62em);
}

.center-news-compact-summary {
  margin: 0;
  font-size: 13.2px;
  line-height: 1.77;
  font-weight: 700;
  text-align: justify;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  max-height: calc(4 * 1.77em);
}

.center-news-grid.count-3 .center-news-compact:last-child .center-news-compact-summary {
  -webkit-line-clamp: 3;
  max-height: calc(3 * 1.77em);
}

.center-news-compact .taqrir-readmore {
  margin-top: 4px !important;
  font-size: 11.5px;
}

.center-news-empty {
  margin: 30px auto;
  text-align: center;
  font-weight: 800;
}

/* ستون چپ همان ساختار قبلی را دارد؛ فقط قانون حذف عنوان تکراری به مرکز سرایت نکند. */
.area-right > .card-content > .taqrir-section-title + .taqrir-item-title {
  display: block !important;
}

/* عربی: اندکی فشرده‌تر برای عنوان‌های طولانی */
html[lang="ar"] .feature-title {
  font-size: 23px !important;
  line-height: 1.42 !important;
}

html[lang="ar"] .feature-subtitle {
  font-size: 11px;
  line-height: 1.62;
}

html[lang="ar"] .center-news-lead-title {
  font-size: 20px;
  line-height: 1.58;
}

html[lang="ar"] .center-news-compact-title {
  font-size: 15.5px;
  line-height: 1.7;
}

/* نمایش موبایل: ابتدا اخبار مرکز، سپس موضوع ویژه و بعد اخبار مجمع */
@media (max-width: 900px) {
  .feature-card,
  .center-news-card {
    padding: 22px 18px !important;
  }

  .feature-card > .card-content,
  .center-news-card > .card-content {
    height: auto;
    overflow: visible !important;
  }

  .feature-title {
    font-size: 28px !important;
  }

  .feature-summary,
  .center-news-lead-summary,
  .center-news-compact-title,
  .center-news-compact-summary {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .center-news-grid {
    grid-template-columns: 1fr;
  }

  .center-news-compact,
  .center-news-compact:nth-child(even),
  .center-news-grid.count-3 .center-news-compact:last-child {
    grid-column: auto;
    padding-right: 0;
    border-right: 0;
  }
}

/* خروجی PDF باید دقیقاً همان جایگاه دسکتاپ را حفظ کند. */
body.pdf-exporting .feature-card > .card-content,
body.pdf-exporting .center-news-card > .card-content {
  height: 100% !important;
  overflow: hidden !important;
}

/* جلوگیری از بریده‌شدن خبر سوم ستون چپ در متن‌های فارسی بلند */
@media (min-width: 901px) {
  .area-left .taqrir-item-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-height: calc(3 * 1.62em);
  }

  .area-left .taqrir-item-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    max-height: calc(4 * 1.86em);
  }
}

/* حالت چهارخبره: تصویر و خبر اصلی کمی فشرده‌تر می‌شود تا خبر چهارم کامل دیده شود. */
@media (min-width: 901px) {
  .has-four-center-news .center-news-heading {
    margin-bottom: 7px !important;
    padding-bottom: 7px !important;
    font-size: 22px !important;
  }

  .has-four-center-news .taqrir-image-box.center-news-image {
    aspect-ratio: 16 / 5.2;
    margin-bottom: 6px !important;
  }

  .has-four-center-news .center-news-lead-title {
    font-size: 19px;
    line-height: 1.48;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-height: calc(2 * 1.48em);
  }

  .has-four-center-news .center-news-lead-summary {
    -webkit-line-clamp: 2;
    max-height: calc(2 * 1.72em);
    line-height: 1.72;
  }

  .has-four-center-news .center-news-grid {
    gap: 0 13px;
  }

  .has-four-center-news .center-news-compact {
    padding-top: 7px;
    padding-bottom: 6px;
  }

  .has-four-center-news .center-news-compact-title {
    font-size: 15.5px;
    line-height: 1.58;
    -webkit-line-clamp: 2;
    max-height: calc(2 * 1.58em);
  }

  .has-four-center-news .center-news-compact-summary {
    font-size: 12.8px;
    line-height: 1.68;
    -webkit-line-clamp: 2;
    max-height: calc(2 * 1.68em);
  }

  .has-four-center-news .center-news-grid.count-3 .center-news-compact:last-child .center-news-compact-summary {
    -webkit-line-clamp: 2;
    max-height: calc(2 * 1.68em);
  }
}

/* شش عنوان رصد در ارتفاع ثابت بخش پایین، بدون بریده‌شدن */
@media (min-width: 901px) {
  .area-bottom-center .taqrir-bottom-list {
    margin-top: 4px !important;
    gap: 2px !important;
  }

  .area-bottom-center .taqrir-bottom-list li {
    padding-bottom: 1px !important;
    line-height: 1.34 !important;
  }

  .area-bottom-center .taqrir-bottom-list a {
    font-size: 11.5px !important;
    line-height: 1.34 !important;
  }

  html[lang="ar"] .area-bottom-center .taqrir-bottom-list a {
    font-size: 11.2px !important;
    line-height: 1.34 !important;
    word-spacing: -0.02em !important;
  }
}
