/* ============================================================
   Flip Card — style.css
   Blockenberg plugin
   ============================================================ */

/* ── Scene wrapper (alignment) ──────────────────────────── */
.bkbg-fc-scene {
    display: flex;
    width: 100%;
}

/* ── Outer: perspective container ───────────────────────── */
.bkbg-fc-outer {
    width:  var(--bkbg-fc-w,  280px);
    height: var(--bkbg-fc-h,  320px);
    perspective: 1000px;
    cursor: pointer;
    box-sizing: border-box;
}

/* Click-trigger: no special cursor difference needed */
/* .bkbg-fc-outer:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 3px;
} */

/* ── Inner: the actual flipping element ─────────────────── */
.bkbg-fc-inner {
    width:  100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform var(--bkbg-fc-speed, 500ms) ease;
    border-radius: var(--bkbg-fc-radius, 16px);
    box-shadow: var(--bkbg-fc-shadow, 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06));
}

/* ── Hover trigger ──────────────────────────────────────── */
.bkbg-fc-outer[data-flip-trigger="hover"]:hover .bkbg-fc-inner,
.bkbg-fc-outer[data-flip-trigger="hover"]:focus .bkbg-fc-inner {
    transform: rotateY(180deg);
}

.bkbg-fc-outer[data-flip-dir="vertical"][data-flip-trigger="hover"]:hover .bkbg-fc-inner,
.bkbg-fc-outer[data-flip-dir="vertical"][data-flip-trigger="hover"]:focus .bkbg-fc-inner {
    transform: rotateX(180deg);
}

/* ── Click trigger (JS adds data-flipped) ───────────────── */
.bkbg-fc-outer[data-flip-trigger="click"][data-flipped="true"] .bkbg-fc-inner {
    transform: rotateY(180deg);
}

.bkbg-fc-outer[data-flip-dir="vertical"][data-flip-trigger="click"][data-flipped="true"] .bkbg-fc-inner {
    transform: rotateX(180deg);
}

/* ── Both faces ─────────────────────────────────────────── */
.bkbg-fc-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    border-radius: var(--bkbg-fc-radius, 16px);
}

/* ── Front face ─────────────────────────────────────────── */
.bkbg-fc-front {
    background: #ffffff;
    /* rotation = 0° already faces viewer */
}

/* ── Back face ──────────────────────────────────────────── */
.bkbg-fc-back {
    background: #3b82f6;
    transform: rotateY(180deg);
}

.bkbg-fc-outer[data-flip-dir="vertical"] .bkbg-fc-back {
    transform: rotateX(180deg);
}

/* ── Icon wrapper ───────────────────────────────────────── */
.bkbg-fc-icon-wrap {
    flex-shrink: 0;
}

.bkbg-fc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--bkbg-fc-icon-size, 48px);
    height: var(--bkbg-fc-icon-size, 48px);
    color: var(--bkbg-fc-icon-color, currentColor);
    flex-shrink: 0;
}

.bkbg-fc-icon svg {
    display: block;
    width: var(--bkbg-fc-icon-size, 48px);
    height: var(--bkbg-fc-icon-size, 48px);
    fill: currentColor;
}

.bkbg-fc-icon .dashicons {
    font-size: var(--bkbg-fc-icon-size, 48px);
    width: var(--bkbg-fc-icon-size, 48px);
    height: var(--bkbg-fc-icon-size, 48px);
    color: inherit;
}

.bkbg-fc-char {
    font-size: var(--bkbg-fc-icon-size, 48px);
    line-height: 1;
    display: block;
    color: inherit;
}

/* ── Front title ────────────────────────────────────────── */
.bkbg-fc-front-title,
.bkbg-fc-face .bkbg-fc-front-title {
    margin: 0;
    padding: 0;
}

/* ── Subtitle / tag line ────────────────────────────────── */
.bkbg-fc-sub,
.bkbg-fc-face .bkbg-fc-sub {
    margin: 0;
    padding: 0;
}

/* ── Flip hint ──────────────────────────────────────────── */
.bkbg-fc-hint {
    margin: 0;
    padding: 0;
}

/* ── Back title ─────────────────────────────────────────── */
.bkbg-fc-back-title,
.bkbg-fc-face .bkbg-fc-back-title {
    margin: 0;
    padding: 0;
}

/* ── Back body text ─────────────────────────────────────── */
.bkbg-fc-back-text,
.bkbg-fc-face .bkbg-fc-back-text {
    margin: 0;
    padding: 0;
}

/* ── Button ─────────────────────────────────────────────── */
.bkbg-fc-btn {
    display: inline-block;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: opacity .15s ease, transform .15s ease;
    cursor: pointer;
}

.bkbg-fc-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bkbg-fc-inner {
        transition: none;
    }
}
