/* =====================================================================
   تبلیغ نمونه‌کارها (works-promo.css)
   ۱) اسپات‌لایت بزرگ: نمونه‌کارها یکی‌یکی روی صفحه می‌آیند
   ۲) تُست نمونه‌کار: هر چند ثانیه یک نمونه‌کار جدید به بازدیدکننده معرفی می‌شود
   رنگ‌ها از متغیرهای style.css می‌آیند و با حالت تاریک/روشن هماهنگ‌اند.
   ===================================================================== */

:root {
  --wp-accent: #7c5cfc;
  --wp-grad: linear-gradient(135deg, #7c5cfc 0%, #4c8dff 55%, #34d399 100%);
}

/* ---------------------------------------------------------------------
   ۱) اسپات‌لایت
   --------------------------------------------------------------------- */
.wp-spot {
  position: relative;
  width: var(--container-w);
  margin: var(--space-xl) auto var(--space-lg);
}

.wp-spot__head { text-align: center; max-width: 760px; margin: 0 auto 1.6rem; }
.wp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  color: var(--color-blue-soft);
  background: var(--glass-bg-strong);
  border: 1px solid var(--color-border-strong);
  margin-bottom: 0.8rem;
}
.wp-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wp-accent);
  box-shadow: 0 0 12px var(--wp-accent);
}
.wp-spot__head h2 { font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.5; color: var(--color-white); margin-bottom: 0.5rem; }
.wp-grad {
  background: var(--wp-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wp-spot__head p { color: var(--color-muted); line-height: 2; font-size: 0.95rem; }

.wp-spot__stage {
  position: relative;
  overflow: hidden;
  display: grid;
  border-radius: var(--radius-lg);
  background: var(--color-navy);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-card);
  outline-offset: 4px;
}
.wp-glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wp-accent), transparent 65%);
  opacity: 0.32;
  filter: blur(50px);
  pointer-events: none;
  transition: background 0.8s var(--ease-premium);
}

.wp-slide {
  grid-area: 1 / 1;
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.2rem, 3.5vw, 3rem);
  align-items: center;
  padding: clamp(1.3rem, 3.4vw, 3rem) clamp(1.3rem, 3.4vw, 3rem) clamp(3.2rem, 5vw, 4.2rem);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-28px) scale(0.985);
  transition: opacity 0.55s var(--ease-premium), transform 0.65s var(--ease-premium), visibility 0.55s;
}
.wp-slide.is-active { opacity: 1; visibility: visible; transform: none; }

/* قاب مرورگر */
.wp-shot {
  display: block;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #070a14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px -30px var(--wp-accent), 0 0 0 1px rgba(255, 255, 255, 0.02);
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease-premium), box-shadow 0.4s;
  will-change: transform;
}
.wp-shot__bar {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wp-shot__bar i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.wp-shot__bar i:nth-child(1) { background: #ff5f57; }
.wp-shot__bar i:nth-child(2) { background: #febc2e; }
.wp-shot__bar i:nth-child(3) { background: #28c840; }
.wp-shot__bar span {
  margin-left: 0.7rem;
  flex: 1;
  font-family: var(--font-en);
  font-size: 0.72rem;
  color: #9aa6c6;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.18rem 0.8rem;
}
.wp-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}
.wp-shot::after {
  content: "ورود به سایت ↗";
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1rem 0.9rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(5, 6, 10, 0.88));
  opacity: 0;
  transition: opacity 0.3s;
}
.wp-shot:hover::after, .wp-shot:focus-visible::after { opacity: 1; }

.wp-info { position: relative; }
.wp-count {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--wp-accent);
  margin-inline-end: 0.7rem;
}
.wp-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--color-white);
  border: 1px solid var(--wp-accent);
  background: var(--glass-bg);
}
.wp-info h3 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.55;
  margin: 0.8rem 0 0.6rem;
  color: var(--color-white);
}
.wp-info p { color: var(--color-muted); line-height: 2; font-size: 0.97rem; margin-bottom: 1rem; }

.wp-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.3rem; }
.wp-chips li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  color: var(--color-white);
  background: var(--glass-bg-strong);
  border: 1px solid var(--color-border-strong);
}
.wp-chips li::before { content: "✓ "; color: var(--dh-green, #34d399); font-weight: 800; }

.wp-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.wp-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.78rem 1.4rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  background: var(--wp-grad);
  background-size: 160% 160%;
  box-shadow: 0 16px 36px -14px var(--wp-accent);
  transition: transform var(--dur-fast) var(--ease-premium), background-position var(--dur-med) var(--ease-premium);
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.wp-btn:hover { transform: translateY(-2px); background-position: 100% 50%; color: #fff; }
.wp-btn--ghost {
  background: transparent;
  color: var(--color-white);
  border: 1px solid var(--color-border-strong);
  box-shadow: none;
  font-weight: 600;
}
.wp-btn--ghost:hover { background: var(--glass-bg-strong); color: var(--color-white); }
.wp-btn svg { width: 15px; height: 15px; flex: none; }

/* ناوبری و نوار پیشرفت */
.wp-arrows {
  position: absolute;
  inset-inline-end: clamp(1rem, 3vw, 2.2rem);
  bottom: 0.9rem;
  display: flex;
  gap: 0.4rem;
  z-index: 3;
}
.wp-arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-white);
  background: var(--glass-bg-strong);
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
  transition: transform var(--dur-fast), background var(--dur-fast);
}
.wp-arrow:hover { transform: scale(1.08); background: var(--wp-accent); border-color: transparent; color: #fff; }
.wp-arrow svg { width: 15px; height: 15px; }

.wp-progress {
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: var(--glass-bg);
  z-index: 3;
}
.wp-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--wp-grad);
}
.wp-progress i.is-running { animation: wp-fill var(--wp-dur, 7s) linear forwards; }
.wp-spot.is-paused .wp-progress i { animation-play-state: paused; }
@keyframes wp-fill { from { width: 0; } to { width: 100%; } }

/* نوار بندانگشتی */
.wp-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.wp-thumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.5rem;
  border-radius: var(--radius-sm, 12px);
  background: var(--glass-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-premium), border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.wp-thumb img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; object-position: top; flex: none; }
.wp-thumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-thumb:hover { transform: translateY(-2px); color: var(--color-white); }
.wp-thumb[aria-selected="true"] {
  color: var(--color-white);
  background: var(--glass-bg-strong);
  border-color: var(--wp-accent);
  box-shadow: 0 10px 30px -14px var(--wp-accent);
}

@media (max-width: 980px) {
  .wp-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .wp-slide { grid-template-columns: 1fr; padding-bottom: 4.2rem; }
  .wp-shot img { aspect-ratio: 16 / 10; }
}
@media (max-width: 520px) {
  .wp-thumbs { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 0.3rem; }
  .wp-thumb { flex: 0 0 auto; min-width: 150px; scroll-snap-align: start; }
}

/* ---------------------------------------------------------------------
   ۲) تُست یکی‌یکی (پایین سمت راست)
   --------------------------------------------------------------------- */
.wp-toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 32px));
  z-index: 870;
  direction: rtl;
  font-family: var(--font-fa);
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.85rem;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: var(--color-navy);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-card), 0 24px 70px -30px var(--wp-accent);
  overflow: hidden;
  transform: translateY(24px) scale(0.94);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.55s var(--ease-premium), opacity 0.4s, visibility 0.4s;
}
.wp-toast.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.wp-toast::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--wp-accent), transparent 60%);
  opacity: 0.22;
  pointer-events: none;
}
.wp-toast > * { position: relative; }

.wp-toast__img {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  object-position: top;
  border: 1px solid rgba(255, 255, 255, 0.12);
  align-self: center;
}
.wp-toast__top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.15rem; }
.wp-toast__count { font-family: var(--font-en); font-size: 0.7rem; font-weight: 800; color: var(--wp-accent); }
.wp-toast__tag { font-family: var(--font-en); font-size: 0.66rem; color: var(--color-muted); }
.wp-toast__close {
  margin-inline-start: auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  background: var(--glass-bg);
  cursor: pointer;
}
.wp-toast__close:hover { color: var(--color-white); }
.wp-toast__close svg { width: 10px; height: 10px; }
.wp-toast h4 { font-size: 0.95rem; line-height: 1.5; color: var(--color-white); margin-bottom: 0.2rem; }
.wp-toast p {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--color-muted);
  margin-bottom: 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wp-toast__row { display: flex; align-items: center; gap: 0.5rem; }
.wp-toast__go {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: #fff;
  background: var(--wp-grad);
  text-decoration: none;
}
.wp-toast__go:hover { color: #fff; filter: brightness(1.1); }
.wp-toast__next {
  font-size: 0.75rem;
  color: var(--color-muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}
.wp-toast__next:hover { color: var(--color-white); }
.wp-toast__bar { position: absolute; inset: auto 0 0 0; height: 3px; background: transparent; }
.wp-toast__bar i { display: block; height: 100%; width: 100%; background: var(--wp-grad); transform-origin: right; }
.wp-toast.is-open .wp-toast__bar i { animation: wp-shrink var(--wp-toast-dur, 10s) linear forwards; }
.wp-toast.is-hover .wp-toast__bar i { animation-play-state: paused; }
@keyframes wp-shrink { to { transform: scaleX(0); } }

@media (max-width: 600px) {
  .wp-toast {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px); /* بالای دکمه‌ی هاست */
    grid-template-columns: 76px 1fr;
  }
  .wp-toast__img { width: 76px; height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .wp-slide, .wp-toast, .wp-shot { transition: none !important; }
  .wp-progress i, .wp-toast__bar i { animation: none !important; }
  .wp-progress { display: none; }
}
