/**
 * هيرو الرئيسية — Premium (منصة · AI · تطبيق)
 * يُحمَّل على index.php فقط.
 * الهجين: ai-hero-canva--home للخلفية · hero-home للمحتوى.
 */

.hero.hero--home.ai-hero-canva--home {
  padding: calc(var(--notice-height) + var(--nav-height) + clamp(14px, 2vw, 22px)) 0 clamp(34px, 5vw, 48px);
}

.ai-hero-canva--home__content {
  position: relative;
  z-index: 5;
}

.hero.hero--home {
  padding: calc(var(--notice-height) + var(--nav-height) + clamp(14px, 2vw, 22px)) 0 clamp(26px, 4vw, 40px);
}

.hero-home-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(253, 224, 71, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(82, 183, 136, 0.18) 0%, transparent 45%);
  z-index: 0;
}

.hero.hero--home > .container,
.hero.hero--home > .ai-hero-canva--home__content {
  position: relative;
  z-index: 4;
}

.hero-home-card--premium {
  border-radius: clamp(20px, 2.8vw, 28px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hero-home-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero-home-badges__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-home-badges__item--gold {
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.35), rgba(253, 224, 71, 0.18));
  border-color: rgba(253, 224, 71, 0.38);
  color: #fff8e7;
}

.hero-home-badges__item--ai {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(96, 165, 250, 0.14));
  border-color: rgba(147, 197, 253, 0.35);
}

.hero-home-badges__item--app {
  background: linear-gradient(135deg, rgba(82, 183, 136, 0.32), rgba(64, 145, 108, 0.16));
  border-color: rgba(167, 243, 208, 0.35);
}

.hero-home-badges__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  animation: hero-home-pulse 2.4s ease-in-out infinite;
}

@keyframes hero-home-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.88); }
}

.hero-home-subtitle {
  margin: 0 0 10px;
  font-size: clamp(0.88rem, 1.5vw, 1rem);
  font-weight: 600;
  color: rgba(253, 224, 71, 0.92);
  letter-spacing: 0.02em;
}

.hero-home-card--premium h1 {
  font-size: clamp(1.65rem, 3.6vw, 2.45rem);
  line-height: 1.18;
  margin-bottom: 12px;
}

.hero-home-card--premium .hero-desc {
  font-size: clamp(0.95rem, 1.7vw, 1.08rem);
  line-height: 1.72;
  max-width: 38rem;
}

/* ——— ركائز: منصة · AI · تطبيق (3 بطاقات أفقية) ——— */
.hero-home-card__media {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 16px);
  min-width: 0;
}

.hero-home-pillars {
  width: 100%;
  min-width: 0;
}

.hero-home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 12px);
  margin: 0;
}

.hero-home-features--tiles {
  align-items: stretch;
}

.hero-home-feature {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-height: clamp(152px, 20vw, 196px);
  padding: clamp(12px, 1.8vw, 16px) clamp(8px, 1.2vw, 12px) clamp(10px, 1.4vw, 14px);
  border-radius: clamp(14px, 2vw, 18px);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.hero-home-feature::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  opacity: 0.9;
}

.hero-home-feature--platform::before {
  background: linear-gradient(90deg, #fde047, #d4a017);
}

.hero-home-feature--ai::before {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}

.hero-home-feature--app::before {
  background: linear-gradient(90deg, #86efac, #2d6a4f);
}

.hero-home-feature:hover,
.hero-home-feature:focus-visible {
  transform: translateY(-4px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.07) 100%);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  outline: none;
}

.hero-home-feature__head {
  display: contents;
}

.hero-home-feature__icon {
  flex-shrink: 0;
  width: clamp(42px, 5vw, 48px);
  height: clamp(42px, 5vw, 48px);
  display: grid;
  place-items: center;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 2px;
}

.hero-home-feature--platform .hero-home-feature__icon {
  background: rgba(212, 160, 23, 0.22);
  border-color: rgba(253, 224, 71, 0.3);
}

.hero-home-feature--ai .hero-home-feature__icon {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(147, 197, 253, 0.32);
}

.hero-home-feature--app .hero-home-feature__icon {
  background: rgba(82, 183, 136, 0.22);
  border-color: rgba(167, 243, 208, 0.32);
}

.hero-home-feature__title {
  margin: 0;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.hero-home-feature__desc {
  margin: 0;
  font-size: clamp(0.68rem, 1.35vw, 0.76rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.76);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-home-feature__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: auto;
}

.hero-home-feature__tags li {
  font-size: clamp(0.58rem, 1.2vw, 0.66rem);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.hero-home-feature__cta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: clamp(0.68rem, 1.3vw, 0.74rem);
  font-weight: 700;
  color: rgba(253, 224, 71, 0.95);
}

.hero-home-card__visual--guest {
  width: 100%;
}

@media (min-width: 901px) {
  .hero-home-card__visual--guest {
    margin-top: 2px;
  }

  .hero-home-card__visual--guest .hero-video-frame {
    max-height: clamp(180px, 22vw, 240px);
  }
}

@media (max-width: 900px) {
  /* ترتيب صريح: عنوان → CTA → وصف → ثقة → بطاقات → فيدio */
  .hero-home-card--premium .hero-home-card__col,
  .hero-home-card--premium .hero-home-card__details,
  .hero-home-card--premium .hero-home-card__media {
    display: contents;
  }

  .hero-home-card--premium .hero-home-card__head {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  .hero-home-card--premium .hero-actions--compact {
    order: 2;
    width: 100%;
  }

  .hero-home-card--premium .hero-home-card__details .hero-desc {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-top: clamp(6px, 1.5vw, 10px);
  }

  .hero-home-card--premium .hero-home-trust {
    order: 4;
    width: 100%;
  }

  .hero-home-card--premium .hero-home-pillars {
    order: 5;
    width: 100%;
  }

  .hero-home-card--premium .hero-home-card__visual {
    order: 6;
    width: 100%;
  }

  .hero-home-card--premium .hero-home-quicklinks {
    order: 7;
    width: 100%;
  }

  .hero-home-card__visual--guest {
    display: block;
    width: 100%;
    margin-top: 0;
    position: relative;
    z-index: 1;
  }

  .hero-home-card__visual--guest .hero-visual.hero-visual--media {
    width: 100%;
    margin: 0;
  }

  .hero-home-card__visual--guest .hero-video-frame {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: clamp(14px, 2vw, 18px);
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  }

  .hero-home-card__visual--guest .hero-video-wrap {
    aspect-ratio: 16 / 9;
    max-height: none;
    width: 100%;
    overflow: hidden;
  }

  .hero-home-card__visual--guest .hero-video,
  .hero-home-card__visual--guest .hero-poster-img {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.hero-home-feature--ai .hero-home-feature__cta {
  color: #bfdbfe;
}

.hero-home-feature--app .hero-home-feature__cta {
  color: #bbf7d0;
}

.hero-home-feature__cta::after {
  content: '←';
  font-size: 0.85em;
  opacity: 0.85;
}

body.is-ltr .hero-home-feature__cta::after {
  content: '→';
}

.hero-home-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-home-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.hero-home-trust li::before {
  content: '✓';
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(82, 183, 136, 0.35);
  color: #ecfdf5;
}

.hero-home-card--premium .hero-actions--compact {
  margin-top: 6px;
}

.hero-home-hook {
  margin: 10px 0 0;
  font-size: clamp(1rem, 2.4vw, 1.05rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
  max-width: 38rem;
}

.hero-home-hook strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05em;
}

.hero-home-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-home-summary__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-home-summary__chip strong {
  font-size: 1.05rem;
}

.hero-home-summary__chip--allowed {
  background: rgba(22, 101, 52, 0.35);
}

.hero-home-summary__chip--forbidden {
  background: rgba(153, 27, 27, 0.35);
}

.hero-home-summary__chip--restricted {
  background: rgba(146, 64, 14, 0.35);
}

@media (max-width: 900px) {
  .hero-home-card--premium .hero-actions--compact .btn {
    min-height: 44px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }
}

.hero-home-card--premium .hero-home-quicklinks {
  margin-top: 6px;
  padding-top: 10px;
}

.hero-home-card__metrics.hero-home-card__metrics--premium {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.hero-home-card__metrics--premium .hero-stat {
  padding: 14px 12px;
  text-align: center;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-home-card__metrics--premium .hero-stat:last-child {
  border-inline-end: none;
}

.hero-home-card__metrics--premium .hero-stat strong {
  display: block;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 800;
  color: #fde68a;
  line-height: 1.1;
}

.hero-home-card__metrics--premium .hero-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

@media (max-width: 992px) {
  .hero-home-card__metrics--premium {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-home-card__metrics--premium .hero-stat:nth-child(2) {
    border-inline-end: none;
  }

  .hero-home-card__metrics--premium .hero-stat:nth-child(1),
  .hero-home-card__metrics--premium .hero-stat:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 768px) {
  .hero-home-features {
    gap: 8px;
  }

  .hero-home-feature {
    min-height: 138px;
    padding: 10px 6px 10px;
  }

  .hero-home-feature__desc {
    -webkit-line-clamp: 1;
  }

  .hero-home-card--premium h1 {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
  }

  .hero-home-badges__item {
    font-size: 0.68rem;
    padding: 4px 10px;
  }

  .hero-home-subtitle {
    font-size: 0.82rem;
  }

  .hero-home-trust {
    gap: 8px 12px;
  }

  .hero-home-trust li {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-home-badges__dot {
    animation: none;
  }

  .hero-home-feature:hover {
    transform: none;
  }
}

/* ——— Dark mode ——— */
html[data-theme="dark"] .hero-home-card--premium {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(82, 183, 136, 0.22);
}

html[data-theme="dark"] .hero-home-feature {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(82, 183, 136, 0.18);
}

html[data-theme="dark"] .hero-home-feature:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(82, 183, 136, 0.32);
}

html[data-theme="dark"] .hero-home-card__metrics--premium {
  background: rgba(0, 0, 0, 0.22);
}

/* ——— App CTA (logged-in hero) ——— */
.hero-app-cta {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(82, 183, 136, 0.18) 0%, rgba(45, 106, 79, 0.12) 100%);
  border: 1px solid rgba(167, 243, 208, 0.28);
}

.hero-app-cta--highlight {
  animation: hero-app-cta-pulse 2.4s ease-in-out infinite;
  border-color: rgba(253, 224, 71, 0.45);
  box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.15), 0 12px 32px rgba(45, 106, 79, 0.25);
}

@keyframes hero-app-cta-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.15), 0 12px 32px rgba(45, 106, 79, 0.25); }
  50% { box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.35), 0 16px 40px rgba(45, 106, 79, 0.35); }
}

.hero-app-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-app-cta__copy {
  flex: 1 1 220px;
  min-width: 0;
  text-align: right;
}

.hero-app-cta__eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fde68a;
}

.hero-app-cta__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
  color: #fff;
}

.hero-app-cta__hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.hero-app-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  color: #0f291f;
  background: linear-gradient(135deg, #fde047 0%, #d4a017 100%);
  box-shadow: 0 8px 24px rgba(212, 160, 23, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-app-cta__btn:hover,
.hero-app-cta__btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 160, 23, 0.45);
  color: #0f291f;
}

.hero-home-cta-app {
  box-shadow: 0 10px 28px rgba(82, 183, 136, 0.35);
}

html[dir="ltr"] .hero-app-cta__copy {
  text-align: left;
}

@media (max-width: 640px) {
  .hero-app-cta__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-app-cta__btn {
    justify-content: center;
    width: 100%;
  }
}
