/* ===== WRAPPER ===== */
.cfc-wrap{ display:inline-block; }

/* ===== BUTTON RESET (kill theme/Elementor borders & hover bg) ===== */
.cfc-wrap .cfc-btn{
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;

  -webkit-appearance: none;
  appearance: none;

  display:inline-block;
}
.cfc-wrap .cfc-btn:hover,
.cfc-wrap .cfc-btn:active,
.cfc-wrap .cfc-btn:focus,
.cfc-wrap .cfc-btn:focus-visible{
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
.cfc-wrap .cfc-btn::-moz-focus-inner{ border:0 !important; padding:0 !important; }

/* ===== STACK: stage equals image box ===== */
.cfc-wrap .cfc-stack{
  position:relative;
  display:inline-block;
  line-height:0; /* remove inline-image gap */
  max-width:100%;
}

/* ===== IMAGES ===== */
.cfc-wrap .cfc-img{
  display:block;
  width:100%;
  height:auto;
  border:0 !important;
  box-shadow:none !important;
}

/* ===== OPEN LAYER: absolute stack on top of closed ===== */
.cfc-wrap .cfc-open-layer{
  position:absolute;
  inset:0;
  display:none;
}

/* ===== TOGGLE ===== */
.cfc-wrap.is-open .cfc-open-layer{ display:block; }
.cfc-wrap.is-open .cfc-closed{ visibility:hidden; }

/* ===== TEXT OVERLAY: positioned relative to the image ===== */
.cfc-wrap .cfc-text.cfc-overlay{
  position:absolute;
  left: var(--cfc-paper-left, 50%);
  top: var(--cfc-paper-top, 55%);
  transform: translate(-50%, -50%);
  width: var(--cfc-paper-width, 48%);

  text-align:center;

  font-size: clamp(11px, 1.2vw, var(--cfc-font-size, 14px));
  line-height: 1.25;
  color:#111;

  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;

  pointer-events:none;
}

/* Optional error box */
.cfc-error{
  padding:12px 14px;
  border:1px solid #f0caca;
  background:#fff5f5;
  border-radius:10px;
}

/* ===== BOUNCE ANIMATION (light & soft) ===== */
@keyframes cfc-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.97); }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* dipicu saat klik */
.cfc-wrap.is-bouncing .cfc-stack{
  animation: cfc-bounce 0.18s ease-out;
}


/* === CLOSED split overlay (2 halves) === */
.cfc-wrap .cfc-closed-base{
  opacity: 0; /* hanya buat sizing, split overlay yang terlihat */
}

/* layer split menutupi area yang sama dengan gambar */
.cfc-wrap .cfc-closed-split{
  position:absolute;
  inset:0;
  pointer-events:none;
}

/* kedua halves pakai background image yang sama */
.cfc-wrap .cfc-closed-split .cfc-half{
  position:absolute;
  inset:0;
  background-image: var(--cfc-closed-url);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center;
}

/* overlap tipis biar ga ada seam */
.cfc-wrap .cfc-closed-split .cfc-left{
  clip-path: inset(0 49.2% 0 0);
}
.cfc-wrap .cfc-closed-split .cfc-right{
  clip-path: inset(0 0 0 49.2%);
}

/* saat open, split overlay disembunyikan */
.cfc-wrap.is-open .cfc-closed-split{
  display:none;
}

/* === ANIMASI “DIBELAH” === */
@keyframes cfc-split-left {
  0%   { transform: translateX(0) rotate(0) scale(1); }
  45%  { transform: translateX(-14px) rotate(-4deg) scale(1.02); }
  100% { transform: translateX(-26px) rotate(-7deg) scale(1.02); }
}
@keyframes cfc-split-right {
  0%   { transform: translateX(0) rotate(0) scale(1); }
  45%  { transform: translateX(14px) rotate(4deg) scale(1.02); }
  100% { transform: translateX(26px) rotate(7deg) scale(1.02); }
}

/* trigger ketika klik sebelum open */
.cfc-wrap.is-opening .cfc-closed-split .cfc-left{
  animation: cfc-split-left 0.45s cubic-bezier(.2,.8,.2,1) forwards;
}
.cfc-wrap.is-opening .cfc-closed-split .cfc-right{
  animation: cfc-split-right 0.45s cubic-bezier(.2,.8,.2,1) forwards;
}
