/* =============================================
   FOOTER — footer.css
   فوتر جدید (کلاس‌های ft-*). همه‌ی صفحه‌ها.
   ============================================= */

.ft {
  position: relative;
  overflow: hidden;
  margin-top: var(--sp-16);
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
}

/* خط نارنجی محو بالای فوتر */
.ft::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-orange), transparent);
  opacity: 0.7;
}

.ft__glow {
  position: absolute;
  top: -180px;
  inset-inline-start: 50%;
  width: min(900px, 90vw);
  height: 360px;
  translate: 50% 0;
  background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.1), transparent 70%);
  pointer-events: none;
}
[dir='rtl'] .ft__glow { translate: 50% 0; }

/* ---------------------------------------------
   بنر تلگرام (همه‌ی صفحه‌ها به‌جز اصلی)
   --------------------------------------------- */
.ft-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  margin-top: calc(var(--sp-12) * -1);
  padding: var(--sp-6) var(--sp-8);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--clr-bg) 55%, rgba(249, 115, 22, 0.1));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.ft-cta__text { display: flex; flex-direction: column; gap: var(--sp-1); }
.ft-cta__text strong { font-size: var(--text-xl); color: var(--clr-white); }
.ft-cta__text span { font-size: var(--text-sm); color: var(--clr-text-muted); line-height: 1.8; }
.ft-cta + .ft-main, .ft:has(.ft-cta) .ft-main { padding-top: var(--sp-12); }

/* ---------------------------------------------
   ستون‌ها
   --------------------------------------------- */
.ft-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--sp-12);
  padding-block: var(--sp-16) var(--sp-8);
}
.ft-main:has(.ft-widgets) { grid-template-columns: 1.6fr 1fr 1fr 1fr; }

.ft-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
.ft-logo { display: inline-block; font-size: var(--text-2xl); }
.ft-tagline { max-width: 340px; margin: 0; font-size: var(--text-sm); line-height: 2; color: var(--clr-text-muted); }

.ft-socials { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.ft-social {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  background: var(--clr-bg);
  color: var(--clr-text-muted);
  transition: color var(--dur-med), border-color var(--dur-med), background var(--dur-med), transform var(--dur-med) var(--ease-out);
}
.ft-social:hover { color: #fff; background: var(--clr-orange); border-color: var(--clr-orange); transform: translateY(-4px); }

.ft-col { display: flex; flex-direction: column; }
.ft-title { margin: 0 0 var(--sp-5); font-size: var(--text-base); font-weight: 700; color: var(--clr-white); }
.ft-title::after { content: ''; display: block; width: 28px; height: 2px; margin-top: var(--sp-2); background: var(--clr-orange); border-radius: 2px; }

.ft-col ul { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
.ft-col li a {
  position: relative;
  display: inline-block;
  padding: var(--sp-1) 0;
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  transition: color var(--dur-fast), transform var(--dur-med) var(--ease-out);
}
.ft-col li a::before {
  content: '';
  position: absolute;
  inset-inline-start: calc(var(--sp-4) * -1);
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--clr-orange);
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.ft-col li a:hover { color: var(--clr-white); transform: translateX(-6px); }
.ft-col li a:hover::before { opacity: 1; }

/* ---------------------------------------------
   واترمارک و نوار پایین
   --------------------------------------------- */
.ft-mark {
  position: relative;
  z-index: 0;
  margin: var(--sp-4) 0 calc(var(--sp-6) * -1);
  text-align: center;
  direction: ltr;
  font-size: clamp(3.5rem, 17vw, 14rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  user-select: none;
  pointer-events: none;
}

.ft-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
  padding-block: var(--sp-6);
  border-top: 1px solid var(--clr-border);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}
.ft-bottom p { margin: 0; }
.ft-bottom a { color: var(--clr-text); }
.ft-bottom a:hover { color: var(--clr-orange); }

/* ---------------------------------------------
   دکمه‌ی بازگشت به بالا
   --------------------------------------------- */
.ft-top {
  position: fixed;
  inset-inline-end: var(--sp-6);
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--clr-orange);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0;
  translate: 0 16px;
  pointer-events: none;
  transition: opacity var(--dur-med), translate var(--dur-med) var(--ease-out), background var(--dur-fast), color var(--dur-fast);
}
.ft-top[hidden] { display: none; }
.ft-top.is-on { opacity: 1; translate: 0 0; pointer-events: auto; }
.ft-top:hover { background: var(--clr-orange); color: #fff; }
.ft-top:focus-visible { outline: 2px solid var(--clr-orange); outline-offset: 3px; }

/* ---------------------------------------------
   ریسپانسیو
   --------------------------------------------- */
@media (max-width: 1024px) {
  .ft-main, .ft-main:has(.ft-widgets) { grid-template-columns: 1fr 1fr; gap: var(--sp-10) var(--sp-8); }
  .ft-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .ft { margin-top: var(--sp-12); }
  .ft-cta { flex-direction: column; align-items: stretch; text-align: center; margin-top: calc(var(--sp-8) * -1); padding: var(--sp-5); gap: var(--sp-4); }
  .ft-cta .btn { justify-content: center; min-height: 48px; }

  .ft-main { padding-block: var(--sp-10) var(--sp-4); gap: var(--sp-8) var(--sp-5); }
  .ft-main .ft-brand { align-items: center; text-align: center; }
  .ft-tagline { max-width: none; }
  .ft-social { width: 48px; height: 48px; }

  .ft-col li a { padding: var(--sp-2) 0; }       /* هدف لمسی بزرگ‌تر */
  .ft-col li a::before { display: none; }
  .ft-col li a:hover { transform: none; }

  .ft-bottom { flex-direction: column; text-align: center; padding-block: var(--sp-5) calc(var(--sp-5) + 52px); }
  .ft-top { inset-inline-end: var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  .ft-top, .ft-social, .ft-col li a { transition: none; }
  .ft-top { translate: none; }
}
