/* Asan Pardazesh Hero v1.1 — scope the layout reset to the page containing the shortcode. */
@font-face {
  font-family: 'APH Persian';
  src: url('./fonts/asan-persian-bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

/* :has() also supports the shortcode when a page builder injects it dynamically. */
html:has(body.aph-hero-active),
html:has(body .aph-hero) {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: clip !important;
}

body.aph-hero-active,
body:has(.aph-hero) {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  overflow-x: clip !important;
  background: #080d20 !important;
}

/* Twenty Twenty-Five renders header and footer even if a separate plugin adds a hide class. */
body.aph-hero-active .wp-site-blocks > header,
body.aph-hero-active .wp-site-blocks > footer,
body:has(.aph-hero) .wp-site-blocks > header,
body:has(.aph-hero) .wp-site-blocks > footer {
  display: none !important;
}

/* Remove the WP block editor's root gap, constrained widths and global paddings. */
body.aph-hero-active .wp-site-blocks,
body.aph-hero-active .wp-site-blocks > main,
body.aph-hero-active .wp-site-blocks > main .wp-block-group,
body.aph-hero-active .wp-site-blocks > main .wp-block-post-content,
body:has(.aph-hero) .wp-site-blocks,
body:has(.aph-hero) .wp-site-blocks > main,
body:has(.aph-hero) .wp-site-blocks > main .wp-block-group,
body:has(.aph-hero) .wp-site-blocks > main .wp-block-post-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* Gutenberg sometimes places an empty paragraph after a shortcode. */
body.aph-hero-active .wp-block-post-content > p:empty,
body:has(.aph-hero) .wp-block-post-content > p:empty {
  display: none !important;
}

.aph-hero, .aph-hero *, .aph-hero *::before, .aph-hero *::after {
  box-sizing: border-box !important;
}

.aph-hero {
  position: relative;
  isolation: isolate;
  direction: rtl;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  overflow: hidden !important;
  /* Full viewport, including when the shortcode is inside a constrained theme container. */
  width: 100vw !important;
  max-width: none !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  min-height: 100svh !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 24px !important;
  border: none !important;
  border-radius: 0 !important;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(35, 104, 212, .38), transparent 45%),
    radial-gradient(ellipse at 82% 80%, rgba(139, 68, 201, .28), transparent 45%),
    linear-gradient(135deg, #080d20 0%, #101b3e 56%, #080e24 100%) !important;
  color: #fff !important;
}

.aph-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -30%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(81, 150, 255, .13), transparent 32%);
  animation: aph-glow 12s ease-in-out infinite alternate;
}

.aph-hero__title {
  position: relative;
  display: block !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  border: 0 !important;
  color: white !important;
  font-family: 'APH Persian', 'Noto Sans Arabic', Tahoma, sans-serif !important;
  font-size: clamp(2.15rem, 7.4vw, 7.25rem) !important;
  font-weight: 900 !important;
  line-height: 1.65 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-shadow: 0 12px 46px rgba(0, 0, 0, .17);
  animation: aph-enter .85s cubic-bezier(.22,1,.36,1) both;
}

.aph-hero__title span {
  font: inherit;
  background: linear-gradient(105deg, #77dbff 5%, #a2bcff 52%, #d1a4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

@keyframes aph-enter {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes aph-glow {
  from { transform: translate3d(-2%, 1%, 0) scale(.95); }
  to   { transform: translate3d(2%, -1%, 0) scale(1.08); }
}

@media (max-width: 600px) {
  .aph-hero { padding: 16px !important; }
  .aph-hero__title {
    font-size: clamp(2rem, 9vw, 3.5rem) !important;
    line-height: 1.85 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aph-hero::before, .aph-hero__title { animation: none !important; }
}
