/* NABAWI — model animasi slider hero (dipilih di Admin → Slider Hero).
   Aktif lewat atribut data-style pada .nb-cinema-frame. "cinematic" = perilaku bawaan nabawi-cinema.css.
   Arah slide (data-dir="next|prev") diisi oleh nabawi-cinema.js. */

.nb-cinema-frame{--sl-ease:cubic-bezier(.65,0,.35,1);--sl-time:var(--cinema-fade,1250ms)}

/* ---------- PARALAKS: lapisan bergeser dengan kedalaman + ikut kursor ---------- */
.nb-cinema-frame[data-style="parallax"] .swiper-slide{opacity:1!important;transform:translate3d(100%,0,0);transition:transform var(--sl-time) var(--sl-ease),visibility 0s linear var(--sl-time)!important}
.nb-cinema-frame[data-style="parallax"] .swiper-slide.is-active{transform:translate3d(0,0,0);transition:transform var(--sl-time) var(--sl-ease),visibility 0s!important}
.nb-cinema-frame[data-style="parallax"] .swiper-slide.is-leaving{transform:translate3d(-35%,0,0);visibility:visible}
.nb-cinema-frame[data-style="parallax"][data-dir="prev"] .swiper-slide:not(.is-active):not(.is-leaving){transform:translate3d(-100%,0,0)}
.nb-cinema-frame[data-style="parallax"][data-dir="prev"] .swiper-slide.is-leaving{transform:translate3d(35%,0,0)}
.nb-cinema-frame[data-style="parallax"] .nb-cinema-slide img{animation:none!important;transform:scale(1.14) translate3d(calc(var(--mx,0) * -14px),calc(var(--my,0) * -10px),0);transition:transform .9s cubic-bezier(.2,.7,.2,1)}
.nb-cinema-frame[data-style="parallax"] .swiper-slide:not(.is-active):not(.is-leaving) img{transform:scale(1.14) translate3d(-22%,0,0)}

/* ---------- GESER: carousel kiri–kanan ---------- */
.nb-cinema-frame[data-style="slide"] .swiper-slide{opacity:1!important;transform:translate3d(100%,0,0);transition:transform calc(var(--sl-time) * .8) var(--sl-ease),visibility 0s linear var(--sl-time)!important}
.nb-cinema-frame[data-style="slide"] .swiper-slide.is-active{transform:none;transition:transform calc(var(--sl-time) * .8) var(--sl-ease),visibility 0s!important}
.nb-cinema-frame[data-style="slide"] .swiper-slide.is-leaving{transform:translate3d(-100%,0,0);visibility:visible}
.nb-cinema-frame[data-style="slide"][data-dir="prev"] .swiper-slide:not(.is-active):not(.is-leaving){transform:translate3d(-100%,0,0)}
.nb-cinema-frame[data-style="slide"][data-dir="prev"] .swiper-slide.is-leaving{transform:translate3d(100%,0,0)}
.nb-cinema-frame[data-style="slide"] .nb-cinema-slide img{animation:none!important;transform:scale(1.02)}

/* ---------- ZOOM (gaya animate.css zoomIn / zoomOut) ---------- */
.nb-cinema-frame[data-style="zoom"] .swiper-slide.is-active{animation:nbSlZoomIn var(--sl-time) cubic-bezier(.2,.8,.2,1) both}
.nb-cinema-frame[data-style="zoom"] .swiper-slide.is-leaving{animation:nbSlZoomOut var(--sl-time) cubic-bezier(.4,0,.6,1) both}
.nb-cinema-frame[data-style="zoom"] .nb-cinema-slide.is-active img{animation:nbCinemaKenBurns var(--cinema-duration) linear both}
@keyframes nbSlZoomIn{from{opacity:0;transform:scale(1.35)}to{opacity:1;transform:scale(1)}}
@keyframes nbSlZoomOut{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.82)}}

/* ---------- TIRAI / REVEAL: dibuka seperti tirai ---------- */
.nb-cinema-frame[data-style="reveal"] .swiper-slide{opacity:1!important}
.nb-cinema-frame[data-style="reveal"] .swiper-slide.is-active{z-index:2;animation:nbSlReveal var(--sl-time) var(--sl-ease) both}
.nb-cinema-frame[data-style="reveal"][data-dir="prev"] .swiper-slide.is-active{animation-name:nbSlRevealPrev}
.nb-cinema-frame[data-style="reveal"] .swiper-slide.is-leaving{z-index:1;opacity:1!important}
.nb-cinema-frame[data-style="reveal"] .swiper-slide.is-leaving img{animation:none;transform:scale(1.12);filter:brightness(.7)}
.nb-cinema-frame[data-style="reveal"] .swiper-slide.is-active::after{content:'';position:absolute;inset:0 auto 0 0;width:3px;background:linear-gradient(#f3d9a0,#c9a45e);box-shadow:0 0 24px #f3d9a0;animation:nbSlRevealEdge var(--sl-time) var(--sl-ease) both;z-index:3}
@keyframes nbSlReveal{from{clip-path:inset(0 0 0 100%)}to{clip-path:inset(0 0 0 0)}}
@keyframes nbSlRevealPrev{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes nbSlRevealEdge{from{left:100%;opacity:1}90%{opacity:1}to{left:0;opacity:0}}

/* ---------- FLIP 3D ---------- */
.nb-cinema-frame[data-style="flip"] .nb-cinema-swiper{perspective:1600px}
.nb-cinema-frame[data-style="flip"] .swiper-slide{transform-origin:center;backface-visibility:hidden}
.nb-cinema-frame[data-style="flip"] .swiper-slide.is-active{animation:nbSlFlipIn var(--sl-time) cubic-bezier(.3,.7,.2,1) both}
.nb-cinema-frame[data-style="flip"] .swiper-slide.is-leaving{animation:nbSlFlipOut calc(var(--sl-time) * .6) cubic-bezier(.5,0,.8,.4) both}
@keyframes nbSlFlipIn{0%{opacity:0;transform:rotateY(-70deg) scale(.9)}35%{opacity:0}100%{opacity:1;transform:rotateY(0) scale(1)}}
@keyframes nbSlFlipOut{to{opacity:0;transform:rotateY(70deg) scale(.9)}}

/* ---------- BLUR LEMBUT ---------- */
.nb-cinema-frame[data-style="blur"] .swiper-slide.is-active{animation:nbSlBlurIn calc(var(--sl-time) * 1.3) ease both}
.nb-cinema-frame[data-style="blur"] .swiper-slide.is-leaving{animation:nbSlBlurOut var(--sl-time) ease both}
@keyframes nbSlBlurIn{from{opacity:0;filter:blur(22px) saturate(1.4);transform:scale(1.08)}to{opacity:1;filter:blur(0);transform:scale(1)}}
@keyframes nbSlBlurOut{to{opacity:0;filter:blur(18px)}}

/* ---------- PAN DINAMIS: Ken Burns bergantian + cahaya hangat ---------- */
.nb-cinema-frame[data-style="pan"] .nb-cinema-slide.is-active img{animation:nbSlPanA var(--cinema-duration) linear both}
.nb-cinema-frame[data-style="pan"] .nb-cinema-slide:nth-child(even).is-active img{animation-name:nbSlPanB}
.nb-cinema-frame[data-style="pan"] .swiper-slide.is-active::after{content:'';position:absolute;inset:0;background:linear-gradient(115deg,transparent 30%,rgba(255,214,150,.28) 50%,transparent 70%);mix-blend-mode:screen;animation:nbSlSheen 2.4s ease-out both;pointer-events:none}
@keyframes nbSlPanA{from{transform:scale(1.18) translate3d(4%,0,0)}to{transform:scale(1.18) translate3d(-4%,-1%,0)}}
@keyframes nbSlPanB{from{transform:scale(1.18) translate3d(-4%,1%,0)}to{transform:scale(1.18) translate3d(4%,0,0)}}
@keyframes nbSlSheen{from{transform:translateX(-60%);opacity:0}30%{opacity:1}to{transform:translateX(60%);opacity:0}}

@media (prefers-reduced-motion:reduce){
  .nb-cinema-frame[data-style] .swiper-slide,.nb-cinema-frame[data-style] .swiper-slide img,.nb-cinema-frame[data-style] .swiper-slide::after{animation:none!important;transition:none!important;transform:none!important;clip-path:none!important;filter:none!important}
}

/* ================= BENTUK BINGKAI FOTO HERO (data-frame pada .nb4-hero) =================
   arch = bawaan (kubah). Foto kecil & badge bisa disembunyikan (data-thumb / data-badge). */
.nb4-main-shot{transition:border-radius .6s ease,clip-path .6s ease,transform .6s ease}

/* Mihrab — lengkung lancip khas masjid */
[data-frame="mihrab"] .nb4-main-shot{border-radius:0 0 22px 22px;clip-path:polygon(0.0% 100.0%,0.0% 48.0%,0.1% 45.0%,0.5% 42.1%,1.1% 39.2%,1.9% 36.3%,3.0% 33.4%,4.3% 30.6%,5.8% 27.8%,7.5% 25.2%,9.5% 22.6%,11.6% 20.1%,14.0% 17.7%,16.5% 15.4%,19.2% 13.2%,22.1% 11.2%,25.1% 9.2%,28.3% 7.5%,31.7% 5.8%,35.1% 4.3%,38.7% 3.0%,42.4% 1.8%,46.2% 0.8%,50.0% 0.0%,53.8% 0.8%,57.6% 1.8%,61.3% 3.0%,64.9% 4.3%,68.3% 5.8%,71.7% 7.5%,74.9% 9.2%,77.9% 11.2%,80.8% 13.2%,83.5% 15.4%,86.0% 17.7%,88.4% 20.1%,90.5% 22.6%,92.5% 25.2%,94.2% 27.8%,95.7% 30.6%,97.0% 33.4%,98.1% 36.3%,98.9% 39.2%,99.5% 42.1%,99.9% 45.0%,100.0% 48.0%,100.0% 100.0%);border:0}
[data-frame="mihrab"] .nb4-second-shot{clip-path:polygon(0.0% 100.0%,0.0% 48.0%,0.1% 45.0%,0.5% 42.1%,1.1% 39.2%,1.9% 36.3%,3.0% 33.4%,4.3% 30.6%,5.8% 27.8%,7.5% 25.2%,9.5% 22.6%,11.6% 20.1%,14.0% 17.7%,16.5% 15.4%,19.2% 13.2%,22.1% 11.2%,25.1% 9.2%,28.3% 7.5%,31.7% 5.8%,35.1% 4.3%,38.7% 3.0%,42.4% 1.8%,46.2% 0.8%,50.0% 0.0%,53.8% 0.8%,57.6% 1.8%,61.3% 3.0%,64.9% 4.3%,68.3% 5.8%,71.7% 7.5%,74.9% 9.2%,77.9% 11.2%,80.8% 13.2%,83.5% 15.4%,86.0% 17.7%,88.4% 20.1%,90.5% 22.6%,92.5% 25.2%,94.2% 27.8%,95.7% 30.6%,97.0% 33.4%,98.1% 36.3%,98.9% 39.2%,99.5% 42.1%,99.9% 45.0%,100.0% 48.0%,100.0% 100.0%);border-radius:0 0 12px 12px}

/* Oktagon — segi delapan bergaya Islami */
[data-frame="octagon"] .nb4-main-shot{border-radius:0;border:0;clip-path:polygon(29% 0,71% 0,100% 29%,100% 71%,71% 100%,29% 100%,0 71%,0 29%)}
[data-frame="octagon"] .nb4-second-shot{border-radius:0;clip-path:polygon(29% 0,71% 0,100% 29%,100% 71%,71% 100%,29% 100%,0 71%,0 29%)}

/* Lingkaran */
[data-frame="circle"] .nb4-main-shot{border-radius:50%;width:auto;height:auto;aspect-ratio:1/1;max-height:100%;max-width:95%;margin:auto 0}
[data-frame="circle"] .nb4-hero-media{display:flex;align-items:center}
[data-frame="circle"] .nb4-second-shot{border-radius:50%;width:132px;height:132px}

/* Persegi membulat */
[data-frame="rounded"] .nb4-main-shot{border-radius:32px}
[data-frame="rounded"] .nb4-second-shot{border-radius:20px}

/* Blob organik — bergerak pelan */
[data-frame="blob"] .nb4-main-shot{border-radius:63% 37% 54% 46% / 55% 48% 52% 45%;animation:nbFrameBlob 14s ease-in-out infinite}
[data-frame="blob"] .nb4-second-shot{border-radius:58% 42% 46% 54% / 50% 56% 44% 50%}
@keyframes nbFrameBlob{0%,100%{border-radius:63% 37% 54% 46% / 55% 48% 52% 45%}33%{border-radius:40% 60% 54% 46% / 49% 60% 40% 51%}66%{border-radius:54% 46% 38% 62% / 63% 42% 58% 37%}}

/* Polaroid — bingkai putih, sedikit miring */
[data-frame="polaroid"] .nb4-main-shot{border-radius:6px;border:14px solid #fbf8f1;border-bottom-width:56px;transform:rotate(-2.2deg);box-shadow:0 40px 80px rgba(0,0,0,.38)}
[data-frame="polaroid"] .nb4-hero-media:hover .nb4-main-shot{transform:rotate(0)}
[data-frame="polaroid"] .nb4-second-shot{border-radius:4px;border:6px solid #fbf8f1;border-bottom-width:22px;transform:rotate(5deg)}
[data-frame="polaroid"] .nb4-photo-caption.nb-cinema-caption{bottom:70px}

/* Bertumpuk — kartu foto berlapis */
[data-frame="stack"] .nb4-main-shot{border-radius:26px;box-shadow:22px 22px 0 -4px rgba(223,196,149,.38),44px 44px 0 -8px rgba(255,255,255,.12),0 35px 85px rgba(0,0,0,.32)}
[data-frame="stack"] .nb4-second-shot{border-radius:16px}

/* Lanskap lebar */
[data-frame="wide"] .nb4-main-shot{border-radius:28px;height:74%;width:100%;margin-top:12%}
[data-frame="wide"] .nb4-second-shot{border-radius:16px;bottom:auto;top:0}

/* Sakelar elemen dekoratif */
[data-thumb="0"] .nb4-second-shot{display:none}
[data-badge="0"] .nb4-float-badge{display:none}
[data-thumb="0"] .nb4-photo-caption.nb-cinema-caption{left:24px}

@media (prefers-reduced-motion:reduce){[data-frame="blob"] .nb4-main-shot{animation:none}}
@media (max-width:760px){
  [data-frame="polaroid"] .nb4-main-shot{border-width:8px;border-bottom-width:34px}
  [data-frame="polaroid"] .nb4-photo-caption.nb-cinema-caption{bottom:44px}
  [data-frame="wide"] .nb4-main-shot{height:80%;margin-top:8%}
  [data-frame="stack"] .nb4-main-shot{box-shadow:12px 12px 0 -3px rgba(223,196,149,.38),24px 24px 0 -6px rgba(255,255,255,.12)}
}
