/* ===== HA Content: top banner, insight tab, ad slots ===== */
:root { --ha-hdr-top: 0px; --ha-red: #e11d48; }

/* --- بنر تمام‌عرض بالای هدر ---------------------------------------- */
.ha-topbanner { position: relative; width: 100%; background: #f3f4f6; }
.dark .ha-topbanner { background: #1a1a1a; }
.ha-topbanner__in { width: 100%; aspect-ratio: var(--ar); overflow: hidden; }
.ha-topbanner__a, .ha-topbanner picture { display: block; width: 100%; height: 100%; }
.ha-topbanner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ha-topbanner__x, .ha-corner__x {
  position: absolute; width: 24px; height: 24px; line-height: 22px; padding: 0;
  border: 0; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff;
  font-size: 16px; cursor: pointer; opacity: .75; transition: opacity .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.ha-topbanner__x { top: 6px; left: 8px; }
.ha-topbanner__x:hover, .ha-corner__x:hover { opacity: 1; background: rgba(0,0,0,.7); }
html.ha-top-off .ha-topbanner, html.ha-corner-off .ha-corner { display: none !important; }

/* هدر ثابت بعد از بنر قرار می‌گیرد و با اسکرول به بالا می‌چسبد */
body.ha-has-topbanner > header.fixed {
  top: var(--ha-hdr-top, var(--ha-bh-init, 0px)) !important;
  transition-property: background-color, border-color, box-shadow, color !important;
}
@media (max-width: 767px) { .ha-topbanner__in { aspect-ratio: var(--arm, var(--ar)); } }

/* --- نوار جمله‌ها زیر هدر (همه‌ی صفحات) ------------------------------ */
.ha-tab {
  position: fixed; z-index: 49; left: 50%;
  top: calc(var(--ha-hdr-top, 0px) + 89px);
  transform: translateX(-50%);
  max-width: min(calc(100vw - 24px), 680px);
  padding: .45rem 1.4rem .55rem;
  text-align: center; font-size: 12.5px; line-height: 1.8; font-weight: 500;
  color: #6b7280;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(0,0,0,.07); border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.25);
  will-change: opacity, transform; pointer-events: auto;
}
.dark .ha-tab { background: rgba(17,17,17,.82); color: #d1d5db; border-color: rgba(255,255,255,.08); }
.ha-tab__red { color: var(--ha-red); font-weight: 800; }
.ha-tab__gray { color: #111827; }
.dark .ha-tab__gray { color: #f3f4f6; }
@media (min-width: 768px) { .ha-tab { font-size: 14.5px; padding: .5rem 1.8rem .6rem; } }

/* اسپیسر درون‌جریان: نوار روی محتوای بالای صفحه نمی‌افتد و CLS ندارد */
.ha-tab-spacer { height: 3.4rem; }
@media (min-width: 768px) { .ha-tab-spacer { height: 2.75rem; } }

/* --- جایگاه‌های تبلیغاتی ------------------------------------------- */
.ha-ad { display: block; width: 100%; overflow: hidden; border-radius: 1rem; background: #f3f4f6; }
.dark .ha-ad { background: #1a1a1a; }
.ha-ad__a, .ha-ad picture { display: block; width: 100%; }
.ha-ad img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; }
@media (max-width: 767px) { .ha-ad img { aspect-ratio: var(--arm, var(--ar)); } }

/* بنر بین دو سکشن صفحه اصلی (۱۲۸۷×۱۱۲) */
.ha-promo { max-width: 1287px; margin: 1.5rem auto; padding: 0 1rem; }
@media (min-width: 768px) { .ha-promo { padding: 0 2rem; margin: 2rem auto; } }
.ha-ad--promo { border-radius: .9rem; box-shadow: 0 14px 30px -20px rgba(0,0,0,.45); transition: transform .3s, box-shadow .3s; }
.ha-ad--promo:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -18px rgba(0,0,0,.5); }
.ha-ad--promo img { height: auto; }
.ha-ad--sidebar, .ha-ad--checklist { margin-top: 1.5rem; }
.ha-share-banners {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2.5rem;
}
@media (min-width: 768px) { .ha-share-banners { grid-template-columns: repeat(3, 1fr); } }
.ha-share-banners .ha-ad { margin: 0; }

/* بنر ثابت گوشه (بالاتر از دکمه‌ی «بازگشت به بالا») */
.ha-corner { display: none; position: fixed; z-index: 40; right: 24px; bottom: 96px; width: 150px; }
.ha-corner .ha-ad { box-shadow: 0 14px 30px -12px rgba(0,0,0,.4); }
.ha-corner__x { top: -8px; left: -8px; }
@media (min-width: 1100px) { .ha-corner { display: block; } }

@media print { .ha-topbanner, .ha-tab, .ha-tab-spacer, .ha-corner, .ha-share-banners, .ha-ad, .ha-promo { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ha-ad--promo { transition: none; } }
