/* =====================================================================
   الخاتمة (CTA) + الفوتر: الصفحة بترتفع متل ستارة والفوتر بيبيّن من تحتها.
   الفوتر جدول لوحة معماري، شبكته بتضوي حوالين الماوس، وبآخره DOUBLE H
   بتتعبّى. الكلاسات بتبلش بـ ct- و ft-   (الحركة: assets/js/footer.js)
   ===================================================================== */

/* الصفحة فوق الفوتر */
.ft-curtain main {
  position: relative;
  z-index: 2;
  background: var(--dh-paper);
  box-shadow: 0 30px 60px -20px rgba(5, 20, 20, 0.45);
}

/* ---------- الخاتمة ---------- */
.ct {
  padding-block: clamp(5.5rem, 11vw, 9rem);
  overflow: hidden;
  border-top: 1px solid var(--dh-line);
}
.ct__in { text-align: center; }
.ct__title {
  margin-top: 1.5rem;
  font-size: clamp(2.6rem, 1.2rem + 6vw, 6.5rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--dh-ink);
}
.ct__title em {
  font-style: normal;
  color: transparent;
  /* الكلمة بتتعبّى ذهبي من اليمين لليسار */
  background:
    linear-gradient(135deg, var(--dh-gold), var(--dh-gold-600)) no-repeat right / 0% 100%,
    var(--dh-teal);
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 1.4s var(--dh-ease-io) 0.6s;
}
.ct.is-visible .ct__title em,
.is-visible .ct__title em { background-size: 100% 100%; }
.ct__lead {
  margin: 1.4rem auto 0;
  max-width: 40rem;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.8;
  color: var(--dh-muted);
}
.ct__btns {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}
.ct__btns .ds-btn { min-width: 12rem; }

/* ---------- الفوتر ---------- */
.ft {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: #fff;
  background: var(--dh-ink);
}
.ft-curtain .ft { position: sticky; bottom: 0; }
.ft-curtain .ft.ft--flow { position: relative; }

/* الشبكة + الضو حوالين الماوس */
.ft__grid,
.ft__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--c) 1px, transparent 1px),
    linear-gradient(90deg, var(--c) 1px, transparent 1px),
    linear-gradient(var(--c2) 1px, transparent 1px),
    linear-gradient(90deg, var(--c2) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  background-position: center top;
}
.ft__grid { --c: rgba(217, 235, 235, 0.06); --c2: rgba(217, 235, 235, 0.025); }
.ft__glow {
  --c: rgba(242, 210, 127, 0.55);
  --c2: rgba(242, 210, 127, 0.18);
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-mask-image: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%), #000, transparent 75%);
  mask-image: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 50%), #000, transparent 75%);
}
.ft.is-lit .ft__glow { opacity: 1; }

.ft__wrap {
  position: relative;
  padding-top: clamp(3.5rem, 7vw, 5rem);
}
/* حركة الستارة بس لما الفوتر ثابت تحت الصفحة */
.ft-curtain .ft:not(.ft--flow) .ft__wrap {
  transform: translateY(calc((1 - var(--p, 1)) * -50px));
  opacity: calc(0.35 + var(--p, 1) * 0.65);
}

/* جدول اللوحة */
.ft__tb {
  display: grid;
  border: 1px solid rgba(217, 235, 235, 0.16);
}
.ft__cell {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(217, 235, 235, 0.16);
}
.ft__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(217, 235, 235, 0.6);
}
.ft__label b {
  font-family: var(--dh-mono);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--dh-gold);
}
.ft__brand img {
  height: 3.6rem;
  width: auto;
  filter: brightness(0) invert(1);
}
.ft__brand p {
  margin-top: 1rem;
  max-width: 19rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.72);
}

.ft__links { display: grid; gap: 0.15rem; }
.ft__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.3rem;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.3s ease, transform 0.4s var(--dh-ease);
}
.ft__links a::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--dh-gold);
  transition: width 0.4s var(--dh-ease);
}
.ft__links a:hover { color: #fff; }
.ft__links a:hover::before { width: 0.9rem; }

/* أزرار الحسابات المغناطيسية */
.ft__social { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ft__soc {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1px solid rgba(217, 235, 235, 0.22);
  color: #fff;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
.ft__soc svg { width: 1.3rem; height: 1.3rem; }
.ft__soc:hover { background: var(--dh-gold); border-color: var(--dh-gold); color: var(--dh-ink); }
.ft__soc:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: 3px; }

/* التواصل: الإيميل بينسخ بكبسة */
.ft__contact { display: grid; gap: 0.7rem; justify-items: start; }
.ft__copy,
.ft__tel {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}
.ft__copy { cursor: copy; text-align: start; }
.ft__copy span:first-child,
.ft__tel span { overflow-wrap: anywhere; }
.ft__copy:hover,
.ft__tel:hover { color: #fff; }
.ft__copy:focus-visible,
.ft__tel:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: 3px; }
.ft__chip {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(217, 235, 235, 0.22);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dh-gold-light);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.ft__copy:hover .ft__chip { background: var(--dh-gold); color: var(--dh-ink); border-color: var(--dh-gold); }

/* سطر بيانات اللوحة */
.ft__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  font-size: 0.78rem;
  color: rgba(217, 235, 235, 0.6);
}
.ft__meta > * {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(217, 235, 235, 0.16);
}
.ft__meta > *:nth-child(odd) { border-inline-end: 1px solid rgba(217, 235, 235, 0.16); }
.ft__meta b { font-family: var(--dh-mono); font-weight: 500; color: #fff; font-size: 0.82rem; }
.ft__meta .ft__copyr { grid-column: 1 / -1; border-inline-end: 0; }
.ft__meta .ft__copyr b { font-family: Cairo, sans-serif; font-weight: 700; }
.ft__top {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.ft__top svg { width: 1rem; height: 1rem; transition: transform 0.4s var(--dh-ease); }
.ft__top:hover { background: var(--dh-gold); color: var(--dh-ink); }
.ft__top:hover svg { transform: translateY(-3px); }
.ft__top:focus-visible { outline: 2px solid var(--dh-gold); outline-offset: -2px; }

/* DOUBLE H الضخمة */
.ft__word {
  position: relative;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(4rem, 16.5vw, 17rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  padding-bottom: 0.06em;
}
.ft__word span { display: block; }
.ft__word-out {
  color: transparent;
  -webkit-text-stroke: 1px rgba(217, 235, 235, 0.3);
}
.ft__word-in {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--dh-gold-light), var(--dh-gold) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  clip-path: inset(0 calc((1 - var(--p, 1)) * 100%) 0 0);
}

/* رسالة "تم النسخ" */
.ft__toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  background: #fff;
  color: var(--dh-ink);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 16px 40px -12px rgba(5, 20, 20, 0.5);
  transform: translate(-50%, 150%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--dh-ease), opacity 0.3s ease;
}
.ft__toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 768px) {
  .ft__tb { grid-template-columns: 1.4fr 1fr 1fr 1.3fr; }
  .ft__cell { border-bottom-width: 1px; }
  .ft__cell + .ft__cell { border-inline-start: 1px solid rgba(217, 235, 235, 0.16); }
  .ft__meta { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr) 1.6fr auto; }
  .ft__meta > * { border-bottom: 0; border-inline-end: 1px solid rgba(217, 235, 235, 0.16); }
  .ft__meta .ft__copyr { grid-column: auto; border-inline-end: 1px solid rgba(217, 235, 235, 0.16); }
  .ft__top { grid-column: auto; padding-inline: 1.5rem; border-inline-end: 0 !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .ft__tb { grid-template-columns: 1fr 1fr; }
  .ft__cell:nth-child(3) { border-inline-start: 0; }
  .ft__meta { grid-template-columns: repeat(4, 1fr); }
  .ft__meta .ft__copyr { grid-column: span 3; }
  .ft__meta > *:nth-child(4) { border-inline-end: 0; }
  .ft__meta > *:nth-child(-n + 4) { border-bottom: 1px solid rgba(217, 235, 235, 0.16); }
}

@media (prefers-reduced-motion: reduce) {
  .ft__wrap { transform: none; opacity: 1; }
  .ft__word-in { clip-path: none; }
  .ct__title em { transition: none; background-size: 100% 100%; }
  .ft__toast, .ft__links a, .ft__links a::before, .ft__glow { transition: none; }
}
