/* ═══════════════════════════════════════════════════════════════════════════
 * تقویم اقتصادی ای باهوشم — استایل سیستم تبلیغاتی (نسخه ۲.۱۰)
 * ▸ فلسفه: ظریف و کم‌سروصدا — نه ظاهر سایت را بشکند، نه تو چشم بزند
 * ▸ برچسب کوچک «تبلیغ»، حاشیه‌ی نرم، بدون انیمیشن پرشی؛ هماهنگ با تم روشن/تاریک
 * ▸ شناورها فقط دسکتاپ (≥1100px)؛ نوار چسبان در موبایل باریک و قابل بستن
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ چرخش خودکار داخل جایگاه (نسخه ۲.۱۱) ═══
   اسلایدهای غیرفعال با attribute hidden بسته می‌شوند؛ JS هر interval ثانیه عوض می‌کند */
.fc-ad [hidden], [hidden] { display: none !important; }
@keyframes fc-ad-fade { from { opacity: 0; } to { opacity: 1; } }
.fc-ad-zone[data-ad-rot] .fc-ad:not([hidden]) { animation: fc-ad-fade .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .fc-ad-zone[data-ad-rot] .fc-ad:not([hidden]) { animation: none; }
}

/* ── زون‌ها ── */
.fc-ad-zone { margin: 0; }
.fc-ad-zone-top        { margin: 14px auto 0; max-width: 1180px; padding-inline: 20px; }
.fc-ad-zone-incontent  { margin: 22px auto;  max-width: 1180px; padding-inline: 20px; }
.fc-ad-zone-bottom     { margin: 0 auto 18px; max-width: 1180px; padding-inline: 20px; }
.fc-ad-sticky-zone     { position: fixed; inset-inline: 0; bottom: 0; z-index: 70; pointer-events: none; }

/* ── جعبه‌ی پایه ── */
.fc-ad {
  position: relative;
  background: var(--surface-2, #fbfaf6);
  border: 1px solid var(--border, #e4e0d4);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  box-shadow: none;
}
.fc-ad + .fc-ad { margin-top: 10px; }

/* برچسب کوچک «تبلیغ» — لازم و بی‌آزار */
.fc-ad-label {
  position: absolute;
  top: 6px; inset-inline-start: 8px;
  font-size: 9.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--bg-soft, #f1eee5);
  color: var(--muted, #7b8a83);
  letter-spacing: .2px;
  user-select: none;
  pointer-events: none;
  z-index: 2;
}

/* تصویر بنر — حداکثر ارتفاع محدود تا صفحه نپرد */
.fc-ad-link-wrap { display: block; line-height: 0; }
.fc-ad-link-wrap img {
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  margin: 0 auto;
  display: block;
}
.fc-ad-pos-top .fc-ad-link-wrap img,
.fc-ad-pos-bottom .fc-ad-link-wrap img { max-height: 120px; }

/* لینک متنی */
.fc-ad-textlink {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px 11px;
  margin: 6px 0;
  max-width: 92%;
  text-decoration: none;
  color: var(--primary, #047857);
}
.fc-ad-textlink b { font-size: 14.5px; font-weight: 800; }
.fc-ad-textlink span { font-size: 12px; color: var(--text-soft, #4c5a54); font-weight: 400; }
.fc-ad-textlink:hover b { text-decoration: underline; }

/* کد HTML آزاد (ادسنس و…) */
.fc-ad-code { padding: 8px 6px; overflow: hidden; }
.fc-ad-code > * { max-width: 100%; }

/* دکمه‌ی بستن (فقط شناور/چسبان) */
.fc-ad-close {
  position: absolute;
  top: 4px; inset-inline-end: 4px;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px;
  background: rgb(0 0 0 / .28);
  color: #fff;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s ease;
  z-index: 3;
  padding: 0;
}
.fc-ad-close:hover, .fc-ad-close:focus-visible { opacity: 1; }

/* ═══ چرخش خودکار داخل جایگاه (نسخه ۲.۱۱) ═══
   اسلایدهای غیرفعال با attribute hidden بسته می‌شوند؛ JS هر interval ثانیه عوض می‌کند */
.fc-ad [hidden], [hidden] { display: none !important; }
@keyframes fc-ad-fade { from { opacity: 0; } to { opacity: 1; } }
.fc-ad-zone[data-ad-rot] .fc-ad:not([hidden]) { animation: fc-ad-fade .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .fc-ad-zone[data-ad-rot] .fc-ad:not([hidden]) { animation: none; }
}

/* ── تفاوت ظریف اولویت‌ها (بدون جلب توجه) ── */
.fc-ad-prio-high   { border-color: var(--border-strong, #d5d0bf); }
.fc-ad-prio-medium { border-style: dashed; }

/* ═══ شناور طرفین (فقط دسکتاپ — در موبایل مزاحم است) ═══
   ▸ از right/left فیزیکی استفاده می‌شود تا «شناور راست» دقیقاً سمت راست باشد
   ▸ عرض ۱۶۰px تا بنر استاندارد عمودی ۱۶۰×۶۰۰ بدون کشیدگی جا شود (۲.۱۱) */
.fc-ad-zone-float-left,
.fc-ad-zone-float-right {
  position: fixed;
  bottom: 18px;
  z-index: 65;
  width: 160px;
  display: none;
}
.fc-ad-zone-float-right { right: 14px; }
.fc-ad-zone-float-left  { left: 14px; }
@media (min-width: 1100px) {
  .fc-ad-zone-float-left, .fc-ad-zone-float-right { display: block; }
  .fc-ad-pos-float-left img, .fc-ad-pos-float-right img { max-height: 300px; }
}
/* وقتی فوتر رسیده تداخل نکند — کمی بالاتر از دکمه بازگشت به بالا */
.fc-ad-zone-float-left ~ .back-to-top, .back-to-top { z-index: 75; }

/* ═══ نوار چسبان پایین صفحه ═══ */
.fc-ad-sticky-zone .fc-ad {
  pointer-events: auto;
  border-radius: 12px 12px 0 0;
  border-bottom: 0;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow-md, 0 6px 24px -8px rgb(23 34 30 / .12));
}
.fc-ad-pos-sticky .fc-ad-link-wrap img { max-height: 66px; }
.fc-ad-pos-sticky .fc-ad-textlink { padding: 8px 16px 9px; margin: 2px 0; }
.fc-ad-pos-sticky .fc-ad-textlink b { font-size: 13.5px; }
.fc-ad-pos-sticky .fc-ad-code { padding: 4px; }
/* جا برای نوار چسبان — وقتی نوار فعال است بدنه کمی پایین‌تر تمام می‌شود */
body:has(.fc-ad-sticky-zone .fc-ad) { padding-bottom: 74px; }
@media (prefers-reduced-motion: reduce) { .fc-ad, .fc-ad-close { transition: none; } }

/* ── موبایل ── */
@media (max-width: 640px) {
  .fc-ad-zone-top, .fc-ad-zone-incontent, .fc-ad-zone-bottom { padding-inline: 14px; }
  .fc-ad-link-wrap img { max-height: 90px; }
  .fc-ad-textlink b { font-size: 13.5px; }
}
