/**
 * استایل صفحه مقاله و آرشیو مقالات — ایران آوسبیلدونگ
 *
 * فقط در صفحات single post / archive / search لود می‌شود.
 * همه قواعد داخل namespace های `.ia-article`, `.ia-single`, `.ia-archive`, `.ia-card`
 * محدود شده‌اند تا روی هدر، فوتر و بقیه صفحات اثر نگذارند.
 */

:root {
  --ia-ink: #1d1e22;
  --ia-ink-soft: #3f4148;
  --ia-ink-muted: #6b7280;
  --ia-line: #e6e8eb;
  --ia-surface: #fbfbfc;
  --ia-radius: 16px;
  --ia-reading-measure: 68ch;
}

/* =========================================================================
   1) چیدمان صفحه مقاله
   ========================================================================= */

/* هدر موبایل/تبلت جمع‌وجور است (~60px) و از 992px به بالا نوار دوم هم اضافه می‌شود */
.ia-single {
  padding-top: 5.5rem;
  padding-bottom: 2rem;
}

.ia-single__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.ia-single__main {
  min-width: 0;
}

/* نوار پیشرفت مطالعه */
.ia-reading-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 1031;
  background: transparent;
  pointer-events: none;
}

.ia-reading-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #ff7c8b);
  transition: width 0.1s linear;
}

/* =========================================================================
   2) هدر مقاله
   ========================================================================= */

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

.ia-article__header {
  padding: 1.15rem 1.15rem 0;
}

.ia-article__breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--ia-ink-muted);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.ia-article__breadcrumb ol {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0 0 0.35rem;
  list-style: none;
  width: max-content;
}

.ia-article__breadcrumb a {
  color: var(--ia-ink-muted);
  text-decoration: none;
}

.ia-article__breadcrumb a:hover {
  color: var(--brand);
}

.ia-article__breadcrumb li {
  flex-shrink: 0;
  white-space: nowrap;
}

.ia-article__breadcrumb li + li::before {
  content: '/';
  margin-inline-end: 0.35rem;
  color: #c9ccd1;
}

.ia-article__breadcrumb li:last-child {
  color: var(--ia-ink);
  font-weight: 600;
}

.ia-article__title {
  margin: 0 0 0.85rem;
  font-family: var(--morabba-font-family), sans-serif;
  font-size: clamp(1.35rem, 5.2vw, 2rem);
  font-weight: 800;
  line-height: 1.5;
  color: var(--ia-ink);
  letter-spacing: -0.01em;
}

.ia-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ia-line);
  font-size: 0.78rem;
  color: var(--ia-ink-muted);
}

.ia-article__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.ia-article__meta-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ia-article__meta-cat {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--c-brand-100);
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.ia-article__meta-cat:hover {
  background: var(--brand);
  color: #fff;
}

/* تصویر شاخص */
.ia-article__figure {
  margin: 1rem 0 0;
}

.ia-article__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}

/* =========================================================================
   3) فهرست مطالب
   ========================================================================= */

.ia-toc {
  margin: 1.15rem 0 0;
  border: 1px solid var(--ia-line);
  border-radius: 12px;
  background: var(--ia-surface);
  overflow: hidden;
}

.ia-toc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ia-ink);
  cursor: pointer;
  list-style: none;
}

.ia-toc > summary::-webkit-details-marker {
  display: none;
}

.ia-toc__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.ia-toc[open] .ia-toc__chevron {
  transform: rotate(180deg);
}

.ia-toc__list {
  margin: 0;
  padding: 0 0.9rem 0.85rem;
  list-style: none;
  border-top: 1px solid var(--ia-line);
  /* مقالات بلند فهرست طولانی دارند؛ روی موبایل نباید کل صفحه اول را پر کند */
  max-height: 15rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ia-toc__item--h3 {
  padding-inline-start: 1rem;
}

.ia-toc__link {
  display: block;
  padding: 0.5rem 0.15rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ia-ink-soft);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.ia-toc__item--h3 .ia-toc__link {
  font-size: 0.8rem;
  color: var(--ia-ink-muted);
}

.ia-toc__link:hover,
.ia-toc__link:focus-visible {
  color: var(--brand);
  border-bottom-color: var(--c-brand-50);
}

/* =========================================================================
   4) بدنه مقاله (prose) — قلب خوانایی
   ========================================================================= */

.ia-article__content {
  padding: 1.15rem;
  font-size: 1.03rem;
  line-height: 2.05;
  color: var(--ia-ink-soft);
  overflow-wrap: break-word;
  word-break: break-word;
}

.ia-article__content p {
  margin: 0 0 1.15em;
  line-height: inherit;
  color: inherit;
}

/*
 * دو طرف متن تراز می‌شود تا انتهای خطوط دندانه‌دار نباشد.
 * hyphens برای واژه‌های لاتین (اسم رشته و شهر آلمانی) فاصله‌های
 * بزرگ بین کلمات را کم می‌کند و text-wrap: pretty از تک‌کلمه
 * ماندن خط آخر پاراگراف جلوگیری می‌کند.
 */
.ia-article__content p,
.ia-article__content li,
.ia-article__content blockquote {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  text-wrap: pretty;
}

.ia-article__content p:last-child {
  margin-bottom: 0;
}

/* سرتیترها: رنگ تیره + لهجه برند (رنگ قرمز روی همه تیترها خستگی چشم می‌آورد) */
.ia-article__content h2,
.ia-article__content h3,
.ia-article__content h4,
.ia-article__content h5 {
  font-family: var(--morabba-font-family), sans-serif;
  color: var(--ia-ink);
  font-weight: 800;
  line-height: 1.6;
  /* فاصله بالای تیتر بیشتر از پایین → گروه‌بندی بصری درست */
  margin: 2em 0 0.7em;
  scroll-margin-top: 6.5rem;
}

.ia-article__content > h2:first-child,
.ia-article__content > h3:first-child {
  margin-top: 0;
}

.ia-article__content h2 {
  position: relative;
  font-size: 1.28rem;
  padding-inline-start: 0.7rem;
}

.ia-article__content h2::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 4px;
  border-radius: 4px;
  background: var(--brand);
}

.ia-article__content h3 {
  font-size: 1.12rem;
  color: var(--ia-ink);
}

.ia-article__content h4,
.ia-article__content h5 {
  font-size: 1.02rem;
}

/* لینک‌های داخل متن */
.ia-article__content a:not(.ia-btn) {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--c-brand-50);
}

.ia-article__content a:not(.ia-btn):hover {
  text-decoration-color: var(--brand);
}

/* لیست‌ها */
.ia-article__content ul,
.ia-article__content ol {
  margin: 0 0 1.2em;
  padding-inline-start: 1.35rem;
}

.ia-article__content li {
  margin-bottom: 0.55em;
  line-height: inherit;
}

.ia-article__content li::marker {
  color: var(--brand);
  font-weight: 700;
}

.ia-article__content ul ul,
.ia-article__content ol ol {
  margin-top: 0.55em;
  margin-bottom: 0;
}

/* نقل‌قول */
.ia-article__content blockquote {
  margin: 1.5em 0;
  padding: 0.9rem 1.05rem;
  border-inline-start: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--c-brand-100);
  color: var(--ia-ink);
  font-weight: 600;
}

.ia-article__content blockquote p:last-child {
  margin-bottom: 0;
}

/* تصاویر و مدیا — علت اصلی بهم‌ریختگی موبایل: نبود max-width */
.ia-article__content img,
.ia-article__content video,
.ia-article__content iframe,
.ia-article__content embed,
.ia-article__content object {
  max-width: 100%;
  height: auto;
}

.ia-article__content img {
  display: block;
  margin: 1.4em auto;
  border-radius: 12px;
}

.ia-article__content figure {
  max-width: 100%;
  margin: 1.4em 0;
}

.ia-article__content figure img {
  margin: 0 auto;
}

.ia-article__content figcaption,
.ia-article__content .wp-caption-text {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ia-ink-muted);
  text-align: center;
}

.ia-article__content .alignleft,
.ia-article__content .alignright,
.ia-article__content .aligncenter {
  float: none;
  margin-inline: auto;
}

.ia-article__content iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.4em 0;
  border: 0;
  border-radius: 12px;
}

/* جدول‌ها — روی موبایل باید اسکرول افقی مستقل داشته باشند */
.ia-article__content .ia-table-scroll {
  max-width: 100%;
  margin: 1.4em 0;
  overflow-x: auto;
  border: 1px solid var(--ia-line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.ia-article__content .ia-table-scroll::-webkit-scrollbar {
  height: 8px;
}

.ia-article__content .ia-table-scroll::-webkit-scrollbar-thumb {
  background-color: var(--brand);
  border-radius: 10px;
}

.ia-article__content .ia-table-scroll::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 10px;
}

.ia-article__content table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.8;
}

/*
 * عرض جدول را محتوا تعیین می‌کند، نه یک min-width ثابت:
 * جدول کم‌ستون داخل صفحه جا می‌شود و جدول پهن اسکرول افقی می‌گیرد.
 */
.ia-article__content .ia-table-scroll table {
  width: max-content;
  min-width: 100%;
}

.ia-article__content th,
.ia-article__content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ia-line);
  text-align: start;
  vertical-align: top;
}

.ia-article__content thead th {
  background: var(--c-brand-100);
  color: var(--ia-ink);
  font-weight: 700;
  white-space: nowrap;
}

.ia-article__content tbody tr:nth-child(even) {
  background: var(--ia-surface);
}

.ia-article__content tbody tr:last-child td {
  border-bottom: 0;
}

/* کد */
.ia-article__content code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: #f1f2f4;
  font-size: 0.9em;
  direction: ltr;
  unicode-bidi: embed;
}

.ia-article__content pre {
  max-width: 100%;
  margin: 1.4em 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: #1d1e22;
  color: #f6f6f6;
  direction: ltr;
  text-align: left;
}

.ia-article__content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.ia-article__content hr {
  max-width: 100%;
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--ia-line);
  opacity: 1;
}

/* =========================================================================
   5) فوتر مقاله: برچسب‌ها + اشتراک‌گذاری
   ========================================================================= */

.ia-article__footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem;
  border-top: 1px solid var(--ia-line);
  background: var(--ia-surface);
}

.ia-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.ia-tags__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ia-ink);
}

.ia-tags__item {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--ia-line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.75rem;
  color: var(--ia-ink-soft);
  text-decoration: none;
}

.ia-tags__item:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ia-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ia-share__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ia-ink);
  margin-inline-end: 0.15rem;
}

.ia-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ia-line);
  border-radius: 11px;
  background: #fff;
  color: var(--ia-ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ia-share__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ia-share__btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.ia-share__btn.is-copied {
  border-color: #16a34a;
  color: #16a34a;
}

/* =========================================================================
   6) مقالات مرتبط (در موبایل هم دیده می‌شود)
   ========================================================================= */

.ia-related {
  margin-top: 1.5rem;
}

.ia-related__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-family: var(--morabba-font-family), sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ia-ink);
}

.ia-related__title::before {
  content: '';
  width: 4px;
  height: 1.2em;
  border-radius: 4px;
  background: var(--brand);
}

/* =========================================================================
   6.5) سایدبار مقاله
   ========================================================================= */

.ia-single__aside {
  min-width: 0;
}

.ia-aside__card {
  padding: 1.1rem;
  border: 1px solid var(--ia-line);
  border-radius: var(--ia-radius);
  background: #fff;
}

.ia-aside__card + .ia-aside__card {
  margin-top: 1.25rem;
}

/* کارت فراخوان خدمات — همان چیدمان صفحه آوسبیلدونگ */
.ia-aside__card--cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding: 1.25rem 0.9rem 1.4rem;
  box-shadow: 0 0.25rem 0.75rem rgba(29, 30, 34, 0.08);
}

.ia-aside__flag {
  display: block;
  width: 82px;
  height: 82px;
}

.ia-aside__cta-title {
  display: block;
  margin: 0.85rem 1.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.75;
  text-align: center;
  color: var(--ia-ink);
}

/* فلش خمیده از تیتر به آیکون اولین دکمه — همان مختصات صفحه آوسبیلدونگ */
.ia-aside__arrow {
  position: absolute;
  top: 38%;
  left: 80%;
  width: 23px;
  height: 50px;
  pointer-events: none;
}

.ia-aside__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.ia-aside__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  color: var(--ia-ink);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ia-aside__btn svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.ia-aside__btn:hover,
.ia-aside__btn:focus-visible {
  background: var(--brand);
  color: #fff;
}

.ia-aside__btn:hover path,
.ia-aside__btn:focus-visible path {
  fill: #fff;
}

/* تیتر ویجت‌های سایدبار */
.ia-aside__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--ia-line);
  font-family: var(--morabba-font-family), sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ia-ink);
}

.ia-aside__title::before {
  content: '';
  flex-shrink: 0;
  width: 4px;
  height: 1.1em;
  border-radius: 4px;
  background: var(--brand);
}

/* لیست فشرده مقالات پیشنهادی */
.ia-mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ia-mini + .ia-mini {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px dashed var(--ia-line);
}

.ia-mini__link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.4rem 0.2rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.ia-mini__link:hover {
  background: var(--ia-surface);
}

.ia-mini__media {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--c-light-gray);
  overflow: hidden;
}

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

.ia-mini__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.ia-mini__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.75;
  color: var(--ia-ink);
  /* حداکثر سه خط تا ارتفاع آیتم‌ها یکنواخت بماند */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ia-mini__link:hover .ia-mini__title {
  color: var(--brand);
}

.ia-mini__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--ia-ink-muted);
}

.ia-mini__meta svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ia-aside__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}

.ia-aside__more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.ia-aside__more:hover svg {
  transform: translateX(-3px);
}

/*
 * زیر ۹۹۲px سایدبار به ستون پایین صفحه تبدیل می‌شود و همان‌جا بخش
 * «مقالات مرتبط» هم هست؛ نمایش هر دو لیست پشت سر هم اضافه‌کاری است،
 * پس ویجت پیشنهادی فقط وقتی نشان داده می‌شود که واقعاً سایدبار باشد.
 */
.ia-aside__card--suggested {
  display: none;
}

/* =========================================================================
   7) گرید و کارت مقاله (آرشیو + مجله)
   ========================================================================= */

.ia-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.ia-card {
  min-width: 0;
  height: 100%;
  border: 1px solid var(--ia-line);
  border-radius: var(--ia-radius);
  background: #fff;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ia-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(29, 30, 34, 0.12);
}

.ia-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.ia-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-light-gray);
  overflow: hidden;
}

.ia-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.ia-card:hover .ia-card__media img {
  transform: scale(1.04);
}

.ia-card__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #eceef1, #f7f8f9);
}

.ia-card__badge {
  position: absolute;
  inset-inline-end: 0.6rem;
  top: 0.6rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.ia-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.9rem 0.9rem;
}

.ia-card__title {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.75;
  color: var(--ia-ink);
  /* حداکثر ۲ خط تا ارتفاع کارت‌ها یکنواخت بماند */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ia-card:hover .ia-card__title {
  color: var(--brand);
}

.ia-card__excerpt {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.9;
  color: var(--ia-ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ia-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--ia-line);
  font-size: 0.72rem;
  color: var(--ia-ink-muted);
}

.ia-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}

.ia-card__meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================================
   8) صفحه آرشیو مقالات
   ========================================================================= */

.ia-archive {
  padding-top: 5.5rem;
  padding-bottom: 2.5rem;
}

.ia-archive__head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.ia-archive__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.75rem;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  background: var(--c-brand-100);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
}

.ia-archive__title {
  margin: 0 0 0.4rem;
  font-family: var(--morabba-font-family), sans-serif;
  font-size: clamp(1.4rem, 5.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.5;
  color: var(--ia-ink);
}

.ia-archive__title span {
  color: var(--brand);
}

.ia-archive__lead {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 0.85rem;
  line-height: 1.95;
  color: var(--ia-ink-muted);
}

/* جستجو */
.ia-search {
  position: relative;
  max-width: 620px;
  margin: 0 auto 1.25rem;
}

/* صفحه مگ ظرف .ia-archive را ندارد، پس فاصله بالای نوار جستجو اینجا داده می‌شود */
.mag-search-bar {
  margin-block: 1.5rem 0.5rem;
}

.ia-search__form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem;
  border: 1px solid var(--ia-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(29, 30, 34, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ia-search__form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 6px 22px rgba(236, 60, 78, 0.14);
}

.ia-search__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-inline-start: 0.5rem;
  fill: none;
  stroke: var(--ia-ink-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ia-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.6rem 0.15rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ia-ink);
}

.ia-search__input::placeholder {
  color: #a3a7ad;
}

.ia-search__clear {
  display: none;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--c-light-gray);
  color: var(--ia-ink-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.ia-search.has-value .ia-search__clear {
  display: inline-flex;
}

.ia-search__submit {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ia-search__submit:hover {
  background: var(--c-brand-dark);
}

/* پیشنهادهای زنده */
.ia-search__suggest {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  padding: 0.4rem;
  border: 1px solid var(--ia-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(29, 30, 34, 0.14);
  text-align: start;
}

.ia-search__suggest[hidden] {
  display: none;
}

.ia-suggest__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: 10px;
  color: var(--ia-ink);
  text-decoration: none;
}

.ia-suggest__item:hover,
.ia-suggest__item:focus-visible {
  background: var(--ia-surface);
  color: var(--brand);
}

.ia-suggest__thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--c-light-gray);
}

.ia-suggest__text {
  min-width: 0;
}

.ia-suggest__title {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ia-suggest__cat {
  font-size: 0.7rem;
  color: var(--ia-ink-muted);
}

.ia-suggest__state {
  padding: 0.75rem 0.6rem;
  font-size: 0.82rem;
  color: var(--ia-ink-muted);
  text-align: center;
}

.ia-suggest__all {
  display: block;
  margin-top: 0.2rem;
  padding: 0.55rem;
  border-top: 1px solid var(--ia-line);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

/* چیپ‌های دسته‌بندی */
.ia-chips {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ia-chips::-webkit-scrollbar {
  display: none;
}

.ia-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--ia-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ia-ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ia-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ia-chip.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.ia-chip__count {
  font-size: 0.7rem;
  opacity: 0.75;
}

/* نوار ابزار: تعداد نتایج + ترتیب */
.ia-archive__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--ia-line);
}

.ia-archive__count {
  font-size: 0.82rem;
  color: var(--ia-ink-muted);
}

.ia-archive__count strong {
  color: var(--ia-ink);
}

.ia-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ia-ink-muted);
}

.ia-sort select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--ia-line);
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--ia-ink);
  cursor: pointer;
}

/* دکمه لود بیشتر */
.ia-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.ia-loadmore__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ia-loadmore__btn:hover:not(:disabled) {
  background: var(--brand);
  color: #fff;
}

.ia-loadmore__btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.ia-loadmore__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ia-spin 0.7s linear infinite;
}

.ia-loadmore__spinner[hidden] {
  display: none;
}

@keyframes ia-spin {
  to {
    transform: rotate(360deg);
  }
}

/* حالت خالی */
.ia-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}

.ia-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.9rem;
  fill: none;
  stroke: #c9ccd1;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ia-empty__title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ia-ink);
}

.ia-empty__text {
  margin: 0 0 1.1rem;
  font-size: 0.85rem;
  color: var(--ia-ink-muted);
}

.ia-empty__btn {
  display: inline-flex;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

/* =========================================================================
   9) بریک‌پوینت‌ها
   ========================================================================= */

@media (min-width: 576px) {
  .ia-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

/*
 * روی موبایل کارت‌بندی مقاله برداشته می‌شود.
 * قبلاً پدینگ .container (۱۲px هر طرف) + بوردر کارت + پدینگ داخلی کارت
 * (۱۸px هر طرف) روی نمایشگر ۳۶۰px حدود ۶۰px از عرض متن می‌خورد و
 * متن داخل یک ستون باریک فشرده می‌شد. از ۷۶۸px به بالا کارت برمی‌گردد.
 */
@media (max-width: 767.98px) {
  .ia-article {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .ia-article__header,
  .ia-article__content,
  .ia-article__footer {
    padding-inline: 0;
  }

  .ia-article__content {
    padding-block: 0.5rem 1rem;
    font-size: 1.07rem;
    line-height: 1.95;
  }

  /* تصویر شاخص تا لبه صفحه باز می‌شود تا حس «باکس تو باکس» از بین برود */
  .ia-article__figure {
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) / -2);
  }

  .ia-article__figure img {
    border-radius: 0;
  }
}

@media (min-width: 768px) {
  .ia-article__header,
  .ia-article__content,
  .ia-article__footer {
    padding-inline: 1.75rem;
  }

  .ia-article__header {
    padding-top: 1.5rem;
  }

  .ia-article__content {
    padding-block: 1.5rem;
    font-size: 1.08rem;
  }

  .ia-article__content h2 {
    font-size: 1.45rem;
  }

  .ia-article__content h3 {
    font-size: 1.22rem;
  }

  .ia-article__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ia-article__breadcrumb {
    font-size: 0.82rem;
  }

  .ia-toc__list {
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 992px) {
  /* از این بریک‌پوینت هدر دسکتاپ دو ردیفه می‌شود */
  .ia-single,
  .ia-archive {
    padding-top: 8.5rem;
  }

  .ia-single__grid {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 1.75rem;
  }

  .ia-single__aside {
    position: sticky;
    top: 7.5rem;
    align-self: start;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .ia-aside__card--suggested {
    display: block;
  }

  .ia-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
  }

  .ia-related .ia-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  /* روی نمایشگر پهن، ستون متن را به عرض خوانای ~۷۰ کاراکتر محدود می‌کنیم؛
     خطوط بلندتر از این باعث گم شدن چشم در برگشت به سر خط بعدی می‌شود. */
  .ia-article__content {
    max-width: calc(var(--ia-reading-measure) + 3.5rem);
    margin-inline: auto;
    font-size: 1.11rem;
  }
}

/* کاربرانی که انیمیشن کمتر می‌خواهند */
@media (prefers-reduced-motion: reduce) {
  .ia-card,
  .ia-card__media img,
  .ia-share__btn,
  .ia-reading-progress__bar,
  .ia-toc__chevron {
    transition: none;
  }

  .ia-loadmore__spinner {
    animation: none;
  }
}
