/**
 * Shared exact-panel heroes (Home, Raw Materials, Photo Frames, Corporate Gifting).
 * 1) Frame sizes to the artwork — never crop / zoom the panel image.
 * 2) Transparent CTA hits over baked buttons + micro-animations.
 */

/* ---- Unified panel frame: container follows the image ---- */
:root {
  --hero-exact-radius: clamp(1.75rem, 4.5vw, 2.75rem);
}

.home-landing-hero--exact,
.hero-atelier__shell--exact-ref,
.hero-atelier__shell--exact-ref.home-landing-hero--exact,
.rm-landing-hero--exact,
.pf-landing-hero--exact,
.cg-landing-hero--exact {
  box-sizing: border-box;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  line-height: 0;
  isolation: isolate;
  /* border-radius + overflow on same element — image clips cleanly at corners */
  border-radius: var(--hero-exact-radius);
  overflow: hidden;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-image: none !important;
}

/* Split layout: hero column flush with category rail top edge */
body.page-home .hero-atelier,
body.guest-site .hero-atelier {
  padding: 0 !important;
  margin: 0;
  max-width: none;
}

body.page-home .hero-atelier__builtin-wrap {
  width: 100%;
}

/* Promo carousel — same clip language, no decorative outer frame */
body.page-home .hero-atelier--promo .hero-promo-carousel,
.hero-promo-carousel__frame {
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--hero-exact-radius);
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.home-landing-hero__exact-art,
.hero-atelier__exact-art.home-landing-hero__exact-art,
.hero-atelier__shell--exact-ref .hero-atelier__exact-art,
.rm-landing-hero__exact-art,
.pf-landing-hero__exact-art,
.cg-landing-hero__exact-art {
  position: relative !important;
  z-index: 1;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  inset: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top;
  object-fit: contain !important;
  object-position: center center !important;
  /* Intrinsic ratio from the file — do not force a mismatched aspect-ratio box */
  aspect-ratio: auto !important;
  pointer-events: none;
  user-select: none;
  border-radius: inherit;
  /* Opacity-only entrance — no scale/translate that clips under overflow:hidden */
  transform: none !important;
  transform-origin: center center;
  animation: heroExactArtFade 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: opacity;
}

@keyframes heroExactArtFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hits stay locked to the static art frame (no float desync / crop) */
.home-landing-hero__hits,
.rm-landing-hero__hits,
.pf-landing-hero__hits,
.cg-landing-hero__hits {
  animation: none !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .home-landing-hero__exact-art,
  .hero-atelier__exact-art.home-landing-hero__exact-art,
  .rm-landing-hero__exact-art,
  .pf-landing-hero__exact-art,
  .cg-landing-hero__exact-art {
    animation: none !important;
  }
}

/* ---- CTA hit targets ---- */

.hero-exact-hit {
  position: absolute;
  pointer-events: auto;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s ease,
    background 0.34s ease,
    filter 0.34s ease;
  will-change: transform;
  /* Gentle float is applied on the hits layer (synced with art); hits only fade in */
  animation:
    heroExactCtaIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both,
    heroExactSoftGlow 3.4s ease-in-out 1s infinite;
}

.hero-exact-hit--shop {
  animation-delay: 0.36s, 1.1s;
}

.hero-exact-hit:not(.hero-exact-hit--shop) {
  animation-delay: 0.48s, 1.35s;
}

/* Soft ambient pulse — does not hide artwork */
.hero-exact-hit::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.28), transparent 70%);
  opacity: 0;
  animation: heroExactHitPulse 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Soft edge glow ring */
.hero-exact-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.42) 50%, transparent 72%);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  transform: translateX(-130%);
  animation: heroExactHitShimmer 5.5s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.28s ease,
    box-shadow 0.34s ease;
  z-index: 1;
}

.hero-exact-hit:hover {
  transform: translateY(-3px) scale(1.04);
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 14px 32px rgba(20, 30, 55, 0.22),
    0 0 28px rgba(255, 255, 255, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.38) inset;
  filter: brightness(1.06);
}

.hero-exact-hit:hover::before {
  opacity: 0.9;
}

.hero-exact-hit:hover::after {
  opacity: 1;
  box-shadow: 0 0 18px 2px rgba(255, 255, 255, 0.28);
}

.hero-exact-hit:active {
  transform: translateY(-1px) scale(1.015);
  transition-duration: 0.12s;
  filter: brightness(1.02);
  box-shadow:
    0 6px 16px rgba(20, 30, 55, 0.18),
    0 0 12px rgba(255, 255, 255, 0.2);
}

.hero-exact-hit:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
  background: rgba(255, 255, 255, 0.12);
}

/* Animated arrow cue on primary hit (Shop) — decorative only */
.hero-exact-hit--shop .hero-exact-hit__arrow {
  position: absolute;
  right: 12%;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.28rem;
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  opacity: 0;
  transition:
    opacity 0.28s ease,
    transform 0.32s ease,
    right 0.32s ease;
  pointer-events: none;
  z-index: 2;
  animation: heroExactArrowNudge 2.4s ease-in-out 1.4s infinite;
}

.hero-exact-hit--shop:hover .hero-exact-hit__arrow {
  opacity: 0.95;
  right: 8%;
  transform: rotate(45deg) translate(3px, -3px);
  animation: none;
}

@keyframes heroExactHitPulse {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.38;
    transform: scale(1.05);
  }
}

@keyframes heroExactHitShimmer {
  0%,
  55% {
    transform: translateX(-130%);
  }
  80%,
  100% {
    transform: translateX(130%);
  }
}

@keyframes heroExactCtaIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroExactSoftGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0),
      0 4px 14px rgba(20, 30, 55, 0.04);
  }
  50% {
    box-shadow:
      0 0 18px 2px rgba(255, 255, 255, 0.26),
      0 10px 22px rgba(20, 30, 55, 0.12);
  }
}

@keyframes heroExactArrowNudge {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.35;
  }
  50% {
    transform: rotate(45deg) translate(2px, -2px);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-exact-hit,
  .hero-exact-hit::before,
  .hero-exact-hit::after,
  .hero-exact-hit--shop .hero-exact-hit__arrow {
    animation: none !important;
    transition: none !important;
  }

  .hero-exact-hit:hover,
  .hero-exact-hit:active {
    transform: none;
  }
}
