/*
 * Homepage hero banner + logo party hat for the 23rd-anniversary festival (1405).
 * Loaded by index.php only while the festival is "before" or "live"
 * (includes/festival/festival-1405.php); after 30 Aban 1405 neither this file nor the
 * banner markup is emitted and the homepage shows its regular hero illustration.
 * Everything is scoped under .mh23 / .mh23-hat so no other page or widget is affected.
 */

/* ---------- logo party hat (homepage header only) ---------- */
.mh23-hat .elementor-element-5eef812 a { position: relative; display: inline-block; }
.mh23-hat .elementor-element-5eef812 a::after {
  content: ""; position: absolute; pointer-events: none;
  right: 0; top: -11px; width: 18px; height: 23px;
  background: url("../images/festival-1405/party-hat.svg") no-repeat center / contain;
  transform: rotate(12deg); transform-origin: 50% 100%;
  animation: mh23-hat 3.6s ease-in-out infinite;
}
@media (min-width: 768px) and (max-width: 1024px) {
  /* logo flush with the viewport edge and closer to the top here */
  .mh23-hat .elementor-element-5eef812 a::after { right: 4px; top: -4px; width: 15px; height: 19px; }
}
@media (max-width: 767px) {
  /* the logo renders ~30px tall here instead of 44px */
  .mh23-hat .elementor-element-5eef812 a::after { right: 3px; top: -8px; width: 13px; height: 17px; }
}
@keyframes mh23-hat { 0%, 100% { transform: rotate(12deg); } 50% { transform: rotate(4deg); } }

/* ---------- hero banner ---------- */
.mh23 {
  --mh23-navy: #25308f; --mh23-orange: #ff6a1a; --mh23-ink: #2b2b3a;
  box-sizing: border-box; width: 100%; max-width: 1180px; margin: 26px auto 40px; padding: 0 16px;
  display: grid; grid-template-columns: .9fr 1.35fr; align-items: center; gap: 10px;
  direction: rtl; font-family: "IRANSansXFN", Tahoma, sans-serif; color: var(--mh23-ink);
}
.mh23 *, .mh23 *::before, .mh23 *::after { box-sizing: border-box; }
.mh23 p, .mh23 h2 { margin: 0; padding: 0; }
.mh23-text { text-align: right; padding-right: 10px; position: relative; min-width: 0; }
.mh23 .mh23-title {
  position: relative; display: inline-block; margin: 0;
  font: 900 clamp(34px, 4.6vw, 62px)/1.18 "Peyda", "IRANSansXFN", Tahoma, sans-serif;
  color: var(--mh23-navy);
}
.mh23-spark { position: absolute; width: 70px; height: 70px; left: -58px; top: -26px; color: var(--mh23-orange); animation: mh23-pop 1.8s ease-in-out infinite; }
.mh23-spark2 { width: 56px; height: 56px; left: -48px; top: auto; bottom: -6px; transform: scaleY(-1); animation: none; }
.mh23 .mh23-lead { font: 700 clamp(16px, 1.6vw, 21px)/1.7 "IRANSansXFN", Tahoma, sans-serif; color: var(--mh23-ink); margin: 16px 0 18px; }
.mh23 .mh23-pill {
  position: relative; display: inline-flex; align-items: center; margin: 0 26px 0 0;
  background: #e65c00; color: #fff; border-radius: 999px; padding: 6px 64px 6px 30px;
  font: 900 clamp(22px, 2.4vw, 32px)/1.4 "Peyda", "IRANSansXFN", Tahoma, sans-serif;
  box-shadow: 0 10px 22px rgba(230, 92, 0, .3);
}
.mh23-pill svg { position: absolute; right: -26px; top: 50%; width: 76px; height: 76px; transform: translateY(-55%); animation: mh23-gift 2.2s ease-in-out infinite; }
.mh23 .mh23-scope { font-size: clamp(13px, 1.2vw, 15.5px); font-weight: 700; line-height: 1.7; color: #3b3550; margin: 14px 0 22px; }
.mh23 .mh23-cta {
  display: inline-flex; align-items: center; gap: 14px; background: var(--mh23-navy); color: #fff; text-decoration: none;
  font: 700 clamp(15px, 1.4vw, 19px)/1.6 "IRANSansXFN", Tahoma, sans-serif; border-radius: 999px; padding: 14px 44px;
  box-shadow: 0 10px 22px rgba(37, 48, 143, .3); transition: transform .15s;
}
.mh23 .mh23-cta:hover, .mh23 .mh23-cta:focus-visible { color: #fff; transform: translateY(-2px); }
.mh23 .mh23-cta:focus-visible { outline: 3px solid var(--mh23-orange); outline-offset: 3px; }
.mh23-cta svg { width: 24px; height: 24px; flex: none; }
.mh23-art { min-width: 0; }

/* layered stage: 1000 x 640 design units, every layer positioned in % */
.mh23-stage { position: relative; width: 100%; aspect-ratio: 1000 / 640; overflow: hidden; }
.mh23-stage .mh23-ly { position: absolute; display: block; max-width: none; height: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.mh23-stage .mh23-blob { left: 3%; top: 9%; width: 94%; height: 86%; border-radius: 46% 54% 38% 44% / 52% 48% 40% 42%; background: #e8e3fb; }
.mh23-stage .mh23-peach { left: 26%; top: 12%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: #fbdcd2; }
.mh23-stage .mh23-pastel { left: 8%; top: 74%; width: 84%; opacity: .7; animation: mh23-drift 9s ease-in-out infinite; }
.mh23-stage .mh23-bunting { left: 10%; top: 4%; width: 80%; transform-origin: 50% 0; animation: mh23-sway 4.2s ease-in-out infinite; }
.mh23-stage .mh23-servers { left: 28%; top: 31%; width: 44%; animation: mh23-in .9s cubic-bezier(.2, .8, .2, 1) both; }
.mh23-stage .mh23-cheering { left: 33.5%; top: 22%; width: 33%; animation: mh23-jump 1.7s cubic-bezier(.3, 0, .4, 1) infinite; }
.mh23-stage .mh23-laptop { left: 9%; top: 56.6%; width: 29%; transform-origin: 50% 100%; animation: mh23-bob 3.4s ease-in-out infinite; }
.mh23-stage .mh23-coffee { left: 64%; top: 52.6%; width: 24%; transform-origin: 50% 100%; animation: mh23-sip 4.6s ease-in-out infinite; }
.mh23-stage .mh23-coffee img { display: block; width: 100%; max-width: none; height: auto; transform: scaleX(-1); }
.mh23-stage .mh23-floor { left: 4%; top: 95.2%; width: 92%; height: 3%; border-radius: 999px; background: #cfc8f3; }
.mh23-stage .mh23-cake { left: 36%; top: 57%; width: 28%; animation: mh23-in .9s cubic-bezier(.2, .8, .2, 1) .15s both; }
.mh23-stage .mh23-gifts { left: 65%; top: 83%; width: 20%; transform-origin: 50% 100%; animation: mh23-hop 3.2s ease-in-out infinite; }
.mh23-stage .mh23-plant-l { left: 1.5%; top: 67%; width: 12%; transform-origin: 50% 100%; animation: mh23-plant 4.4s ease-in-out infinite; }
.mh23-stage .mh23-plant-r { left: 88.5%; top: 71%; width: 9.5%; transform-origin: 50% 100%; animation: mh23-plant 4.4s ease-in-out -2.2s infinite; }
.mh23-stage .mh23-led { width: 1.6%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(#fff 0, #ffb37a 35%, rgba(255, 106, 26, 0) 70%); animation: mh23-blink 1.5s ease-in-out infinite; }
.mh23-stage .mh23-led1 { left: 46.6%; top: 36.4%; }
.mh23-stage .mh23-led2 { left: 48.2%; top: 41.6%; animation-delay: -.5s; animation-duration: 1.9s; }
.mh23-stage .mh23-led3 { left: 33.4%; top: 44.2%; animation-delay: -1s; animation-duration: 1.2s; }
.mh23-stage .mh23-led4 { left: 65.2%; top: 44.2%; animation-delay: -.5s; animation-duration: 1.9s; }
.mh23-stage .mh23-led5 { left: 33.4%; top: 52.6%; }
.mh23-stage .mh23-led6 { left: 65.4%; top: 53%; animation-delay: -1s; animation-duration: 1.2s; }
.mh23-stage .mh23-glow { width: 5%; aspect-ratio: 1; top: 57.6%; border-radius: 50%; background: radial-gradient(rgba(255, 214, 120, .95), rgba(255, 214, 120, 0) 70%); animation: mh23-glow 1.1s ease-in-out infinite alternate; }
.mh23-stage .mh23-glow1 { left: 44.9%; }
.mh23-stage .mh23-glow2 { left: 50.6%; animation-delay: -.55s; }
.mh23-stage .mh23-conf { width: 1.1%; aspect-ratio: .6; top: -4%; border: 1px solid var(--mh23-ink); border-radius: 2px; opacity: 0; animation: mh23-fall 7s linear infinite; }
.mh23-stage .mh23-c1 { left: 12%; background: #ff6a1a; }
.mh23-stage .mh23-c2 { left: 24%; background: #5a63d8; animation-delay: -1.2s; animation-duration: 8s; }
.mh23-stage .mh23-c3 { left: 38%; background: #ffd23f; animation-delay: -2.6s; }
.mh23-stage .mh23-c4 { left: 55%; background: #ff6a1a; animation-delay: -3.8s; animation-duration: 9s; }
.mh23-stage .mh23-c5 { left: 69%; background: #5a63d8; animation-delay: -4.6s; }
.mh23-stage .mh23-c6 { left: 82%; background: #ff6a1a; animation-delay: -5.6s; animation-duration: 8s; }
.mh23-stage .mh23-c7 { left: 92%; background: #ffd23f; animation-delay: -6.4s; }
.mh23-stage .mh23-c8 { left: 5%; background: #fff; animation-delay: -2s; animation-duration: 10s; }

@keyframes mh23-in { from { opacity: 0; transform: translateY(8%); } to { opacity: 1; transform: none; } }
@keyframes mh23-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes mh23-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2%); } }
@keyframes mh23-jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6%); } 55% { transform: translateY(-5%); } }
@keyframes mh23-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2%) rotate(-1.2deg); } }
@keyframes mh23-sip { 0%, 65%, 100% { transform: rotate(0); } 75%, 88% { transform: rotate(2.5deg); } }
@keyframes mh23-hop { 0%, 78%, 100% { transform: translateY(0); } 84% { transform: translateY(-8%); } 90% { transform: translateY(0); } 94% { transform: translateY(-3%); } }
@keyframes mh23-plant { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes mh23-blink { 0%, 100% { opacity: .1; } 50% { opacity: 1; } }
@keyframes mh23-glow { from { transform: scale(.8); opacity: .55; } to { transform: scale(1.2); opacity: 1; } }
@keyframes mh23-fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(180%, 9000%) rotate(600deg); opacity: 0; } }
@keyframes mh23-pop { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: .75; } }
@keyframes mh23-gift { 0%, 100% { transform: translateY(-55%) rotate(-6deg); } 50% { transform: translateY(-62%) rotate(6deg); } }

@media (max-width: 900px) {
  .mh23 { grid-template-columns: 1fr; gap: 0; }
  .mh23-text { text-align: center; padding: 0; }
  .mh23-spark { left: -40px; width: 50px; height: 50px; }
  .mh23-spark2 { display: none; }
  .mh23 .mh23-pill { margin: 0 20px 0 0; padding: 6px 54px 6px 22px; }
  .mh23-pill svg { width: 62px; height: 62px; right: -20px; }
  .mh23-art { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .mh23 *, .mh23-hat .elementor-element-5eef812 a::after { animation: none !important; }
  .mh23-stage .mh23-conf { display: none; }
  .mh23 .mh23-cta { transition: none; }
}
