/* General styles for the eMINTS Versatile Flip Card */
.emints-versatile-card-container {
    perspective: 1000px !important;
    margin: 20px auto;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    transition: height 0.6s ease;
}

.emints-versatile-card-flip-button {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    line-height: 1;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

.emints-versatile-card-flip-button:hover {
    background: rgba(255, 255, 255, 1);
}

.emints-versatile-card-flip-button .dashicons {
    width: 1em;
    height: 1em;
}

.emints-v-card {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    border: 1px solid #eee;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    transform-style: preserve-3d !important;
    transition: height 0.6s ease;
    height: 100%;
}

/* FIXED: Removed backface-visibility from inner container - it should only be on faces */
.emints-v-card-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d !important;
    transition: transform 0.6s;
    text-align: center;
    box-sizing: border-box;
    transform-origin: center center !important;
    z-index: 1;
    will-change: transform;
}

.emints-v-card-inner.flipped {
    transform: rotateY(180deg) !important;
}

.emints-v-card-front,
.emints-v-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-radius: 8px;
}

.emints-v-card-front {
    transform: rotateY(0deg);
}

/* FIXED: Added translateZ to push back face forward in 3D space for Chrome */
.emints-v-card-back {
    transform: rotateY(180deg) translateZ(1px) !important;
}

/* === CHROME LINK FIX === */
/* Disable pointer events on inactive face */
.emints-v-card-inner:not(.flipped) .emints-v-card-back {
    pointer-events: none;
    visibility: hidden;
}

.emints-v-card-inner.flipped .emints-v-card-front {
    pointer-events: none;
    visibility: hidden;
}

/* Ensure links are always clickable on the active face */
.emints-v-card-front a,
.emints-v-card-back a,
.emints-v-card-text-content a {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

/* === IMAGE FIT CLASSES === */
.emints-v-card-img-fit-cover {
    object-fit: cover !important;
}

.emints-v-card-img-fit-contain {
    object-fit: contain !important;
}

.emints-v-card-front img,
.emints-v-card-back img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    padding: 0 !important;
    margin: 0 auto;
}

/* === TEXT CONTENT === */
.emints-v-card-text-content {
    width: 100%;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    text-align: center;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    column-count: 1 !important;
    column-width: auto !important;
    padding: 20px !important;
}

.emints-v-card-text-content > * {
    width: 100% !important;
    display: block !important;
    color: inherit !important;
}

.emints-v-card-text-content h1,
.emints-v-card-text-content h2,
.emints-v-card-text-content h3,
.emints-v-card-text-content h4,
.emints-v-card-text-content h5,
.emints-v-card-text-content h6,
.emints-v-card-text-content p,
.emints-v-card-text-content ul,
.emints-v-card-text-content ol,
.emints-v-card-text-content li {
    color: inherit !important;
}

/* Reset container-level padding */
.emints-v-card-front,
.emints-v-card-back {
    padding: 0 !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .emints-versatile-card-container {
        margin: 15px auto;
        max-width: 90%;
    }
    .emints-v-card-front,
    .emints-v-card-back {
        padding: 15px;
    }
}