/* Frontend + base styles */
.lf3d-card {
  position: relative;
  perspective: 1000px;
  width: 100%;
  max-width: 100%;
  margin: 16px 0;
}

.lf3d-inner {
  position: relative;
  width: 100%;
  min-height: 240px; /* JS will sync heights */
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.lf3d-card.is-flipped .lf3d-inner {
  transform: rotateY(180deg);
}

.lf3d-facewrap {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.lf3d-facewrap-back {
  transform: rotateY(180deg);
}

.lf3d-face {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  overflow: hidden;

  display: flex;
  gap: 12px;
  padding: 14px;
  padding-bottom: 64px; /* room for bottom button */
  box-sizing: border-box;
  background: #fff;
}

/* Layouts */
.lf3d-layout-image-top,
.lf3d-layout-image-bottom {
  flex-direction: column;
}
.lf3d-layout-image-left {
  flex-direction: row;
}
.lf3d-layout-image-right {
  flex-direction: row-reverse;
}

.lf3d-media {
  flex: 0 0 auto;
  width: 100%;
}
.lf3d-layout-image-left .lf3d-media,
.lf3d-layout-image-right .lf3d-media {
  width: 44%;
  max-width: 240px;
}

.lf3d-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.lf3d-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed rgba(0,0,0,0.25);
  border-radius: 10px;
  color: rgba(0,0,0,0.55);
  font-size: 13px;
}

\.lf3d-text {
  flex: 1 1 auto;
  min-width: 0;

  /* center content */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  /* allow Gutenberg typography/color to apply */
  font-size: inherit;
  line-height: inherit;
}


/* Bottom controls */
.lf3d-controls {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none; /* card click passes through */
}

.lf3d-flip-btn {
  pointer-events: auto;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.lf3d-flip-btn:hover {
  filter: brightness(0.95);
}

/* Allow card click anywhere to feel clickable */
.lf3d-card[data-flip-on-click="1"] .lf3d-face {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
  .lf3d-layout-image-left,
  .lf3d-layout-image-right {
    flex-direction: column;
  }
  .lf3d-layout-image-left .lf3d-media,
  .lf3d-layout-image-right .lf3d-media {
    width: 100%;
    max-width: none;
  }
}

.lf3d-text > * { margin: 0; }
.lf3d-text p { margin: 0; }
.lf3d-text h1, .lf3d-text h2, .lf3d-text h3, .lf3d-text h4, .lf3d-text h5, .lf3d-text h6 { margin: 0; }
