/*
 * 6.0.3 Home banner (assets/js/app/promo-hero.js): the Buy-1-get-1 Chicken Biryani offer, animated in CSS.
 * Reference: Deliveroo's Tesco banner (a floating product over slowly turning sun rays that pull the eye in).
 *
 *   Layout   desktop: text left, dish right; phones: text, then the whole dish (never cropped).
 *   Motion   on load: text rises in, the bowl drops in, the free bowl jumps in, the badge pops, the tag swings.
 *            Then calm loops: rays turn, bowls float, sparkles twinkle. Transforms and opacity only.
 *   Comfort  no motion for "reduce motion"; paused while off screen (.is-paused, set by setupPromoHero).
 * Colours are the site's (skin.css tokens) with fallbacks, so this file also works on its own.
 */
.ph {
  --ph-green: var(--dc-green, #0F402B);
  --ph-green-2: #165a37;
  --ph-cream: var(--dc-cream, #F8F4EC);
  --ph-beige: var(--dc-beige, #E8C99E);
  --ph-orange: #F26A1B;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--ph-cream);
  cursor: pointer;
  background: radial-gradient(120% 90% at 72% 60%, var(--ph-green-2) 0%, var(--ph-green) 55%, #0a3121 100%);
}
.ph::before { content: none; } /* no dot pattern from .hero */
.ph::after { /* the kolam dots along the top, as on the rest of the site */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; opacity: .45; pointer-events: none;
  background: radial-gradient(circle, var(--ph-beige) 1.2px, transparent 1.6px) 0 50% / 12px 10px repeat-x;
}
.ph-inner {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(12px, 3vw, 40px);
  min-height: clamp(420px, 38vw, 580px); padding-block: clamp(28px, 4vw, 56px);
}

/* ---------- Text ---------- */
.ph-copy { position: static; } /* no z-index: a grid item with one becomes its own layer and the stretched link stops at its edge */
.ph-copy > * { margin: 0; animation: ph-rise .7s cubic-bezier(.2, .9, .3, 1) backwards; } /* backwards: no transform left after it ends, so the link can cover the banner */
.ph-kicker { color: var(--ph-beige); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; animation-delay: .05s; }
.ph-title { display: grid; line-height: .98; margin-top: 10px !important; animation-delay: .15s; }
.ph-l1, .ph-l2 { font-weight: 400; font-size: clamp(40px, 5.6vw, 84px); letter-spacing: -.02em; }
.ph-dish { font-family: var(--dc-display, Georgia, serif); font-weight: 700; font-size: clamp(38px, 5.4vw, 80px); color: #fff; margin-top: .12em; letter-spacing: -.01em; }
.ph-price { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px !important; animation-delay: .3s; }
.ph-tag {
  display: inline-flex; align-items: flex-start; background: var(--ph-orange); color: #fff; font-weight: 800; line-height: 1;
  font-size: clamp(34px, 4.4vw, 60px); padding: .14em .38em .16em .3em; clip-path: polygon(0 6%, 100% 0, 97% 100%, 1% 94%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25); transform-origin: 18% 0; animation: ph-swing 1.6s linear .55s both;
}
.ph-tag sup { font-size: .42em; margin: .18em .05em 0 0; }
.ph-tag small { font-size: .6em; margin-top: .06em; }
.ph-pair { color: var(--ph-beige); font-weight: 700; font-size: 15px; }
.ph-sub { margin-top: 16px !important; max-width: 34ch; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.4; color: color-mix(in srgb, var(--ph-cream) 88%, transparent); animation-delay: .45s; }
.ph-sub b { color: var(--ph-beige); }
.ph-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 20px !important; animation-delay: .6s; }
.ph-cta { /* the whole banner is this link (stretched with ::after over .ph) */
  position: static; display: inline-flex; align-items: center; gap: .55em; padding: .85em 1.6em; border-radius: 999px; text-decoration: none;
  color: var(--ph-green); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%) no-repeat, var(--ph-cream);
  background-size: 260% 100%, auto; background-position: 140% 0, 0 0; animation: ph-shine 5s ease-in-out 2.2s infinite;
  transition: box-shadow .15s ease, filter .15s ease;
}
.ph-cta::after { content: ''; position: absolute; inset: 0; z-index: 3; }
.ph-cta:hover { box-shadow: 0 14px 28px rgba(0, 0, 0, .3); filter: brightness(1.03); }
.ph-cta:focus-visible { outline: 3px solid var(--ph-beige); outline-offset: 3px; }
.ph-terms { position: relative; z-index: 3; color: color-mix(in srgb, var(--ph-cream) 75%, transparent); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- The dish ---------- */
.ph-stage { position: relative; z-index: 1; display: grid; place-items: center; aspect-ratio: 1.15; width: 100%; max-width: 640px; justify-self: end; pointer-events: none; }
.ph-rays { /* sun rays that pull the eye to the dish */
  position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1; translate: -50% -50%; z-index: -2; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .085) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, .55) 38%, transparent 68%); mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, .55) 38%, transparent 68%);
  animation: ph-spin 70s linear infinite; will-change: transform;
}
.ph-glow { position: absolute; inset: 12% 10% 18%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 220, 160, .28), transparent); animation: ph-breathe 6s ease-in-out infinite; }
.ph-bowl { position: absolute; height: auto; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .38)); user-select: none; }
.ph-bowl-1 { width: 78%; left: 4%; bottom: 10%; animation: ph-drop 1s cubic-bezier(.2, 1.25, .4, 1) .1s both, ph-float 4.8s ease-in-out 1.1s infinite alternate; }
.ph-bowl-2 { width: 50%; right: 0; top: 2%; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .35)) saturate(1.05); animation: ph-jump 1s cubic-bezier(.25, 1.6, .45, 1) .85s both, ph-float-2 5.4s ease-in-out 1.85s infinite alternate; }
.ph-badge {
  position: absolute; left: 0; top: 4%; width: clamp(92px, 11vw, 150px); aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: .95;
  background: var(--ph-cream); color: var(--ph-green); font-weight: 800; box-shadow: 0 12px 26px rgba(0, 0, 0, .3), 0 0 0 6px rgba(248, 244, 236, .22);
  animation: ph-pop 1.3s linear 1.35s both, ph-wobble 3.6s ease-in-out 2.7s infinite;
}
.ph-badge b { font-size: clamp(11px, 1.15vw, 16px); text-transform: uppercase; letter-spacing: .04em; rotate: -10deg; }
.ph-badge strong { font-size: clamp(26px, 3.2vw, 44px); color: var(--ph-orange); rotate: -10deg; margin: .06em 0; }
.ph-badge small { font-size: clamp(10px, 1vw, 13px); text-transform: uppercase; letter-spacing: .08em; rotate: -10deg; font-weight: 800; }
.ph-spark { position: absolute; width: 18px; aspect-ratio: 1; opacity: 0; background: #fff; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: ph-twinkle 2.8s ease-in-out infinite; }
.ph-spark.s1 { left: 18%; top: 30%; animation-delay: 1.6s; }
.ph-spark.s2 { right: 8%; top: 46%; width: 12px; animation-delay: 2.3s; }
.ph-spark.s3 { left: 52%; top: 8%; width: 14px; animation-delay: 3.1s; }
.ph-spark.s4 { left: 8%; bottom: 14%; width: 10px; animation-delay: 3.8s; }

/* ---------- Phones: text first, then the whole dish ---------- */
@media (max-width: 760px) {
  .ph-inner { grid-template-columns: 1fr; min-height: 0; gap: 4px; padding-block: 26px 8px; }
  .ph-title { display: block; }
  .ph-l1, .ph-l2 { font-size: clamp(30px, 9.5vw, 44px); }
  .ph-l1::after { content: ','; }
  .ph-l2 { display: inline; text-transform: lowercase; }
  .ph-dish { display: block; font-size: clamp(34px, 10.5vw, 50px); }
  .ph-price { margin-top: 12px !important; }
  .ph-sub { margin-top: 10px !important; }
  .ph-actions { margin-top: 14px !important; }
  .ph-stage { max-width: 420px; width: 100%; justify-self: center; aspect-ratio: 1.3; }
  .ph-bowl-1 { width: 72%; left: 6%; bottom: 8%; }
  .ph-bowl-2 { width: 44%; right: 2%; top: 4%; }
  .ph-badge { width: 84px; left: auto; right: 40%; top: 0; }
}

/* ---------- Comfort ---------- */
.ph.is-paused * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .ph * { animation: none !important; }
}

/* ---------- Keyframes ---------- */
@keyframes ph-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ph-spin { to { rotate: 360deg; } }
@keyframes ph-breathe { 0%, 100% { opacity: .7; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
@keyframes ph-drop { 0% { opacity: 0; transform: translateY(-30%) scale(.9); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes ph-jump { /* the free bowl jumps in, overshoots and settles */
  0% { opacity: 0; transform: translateY(60%) scale(.6) rotate(-8deg); }
  45% { opacity: 1; transform: translateY(-14%) scale(1.04) rotate(4deg); }
  70% { transform: translateY(3%) scale(.98) rotate(-2deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes ph-float { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-10px) rotate(1.2deg); } }
@keyframes ph-float-2 { from { transform: translateY(-4px) rotate(2deg); } to { transform: translateY(8px) rotate(-1.5deg); } }
@keyframes ph-pop {
  0% { opacity: 0; transform: scale(0) rotate(-40deg); }
  22% { opacity: 1; transform: scale(1.15) rotate(6deg); }
  34% { transform: scale(.94) rotate(-3deg); }
  46% { transform: scale(1.03) rotate(1deg); }
  60%, 100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes ph-wobble { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg) scale(1.04); } }
@keyframes ph-swing {
  0% { opacity: 0; transform: translateY(-120%) rotate(-14deg); }
  14% { opacity: 1; transform: translateY(6%) rotate(12deg); }
  24% { transform: translateY(-2%) rotate(-9deg); }
  36% { transform: rotate(6deg); }
  50% { transform: rotate(-3.5deg); }
  64% { transform: rotate(2deg); }
  78% { transform: rotate(-1deg); }
  100% { opacity: 1; transform: rotate(0); }
}
@keyframes ph-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 40% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; transform: scale(.4) rotate(90deg); } }
@keyframes ph-shine { 0%, 70% { background-position: 140% 0, 0 0; } 100% { background-position: -40% 0, 0 0; } }

/* 6.1.0 A banner scheduled in Dashboard → Banners: the designed picture, full width, the whole banner a link. */
.bn-hero { padding: 0; background: var(--dc-green, #0F402B); }
.bn-hero .bn-link { display: block; }
.bn-hero img { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 760; object-fit: cover; }
@media (max-width: 640px) { .bn-hero.has-phone img { aspect-ratio: 1080 / 1250; } }
