/* ==========================================================================
   Before / After 3D Image Flip Styling (VnExpress Style)
   ========================================================================== */

.image-flip-container {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
    max-width: 100%;
}

.image-flip-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
}

.image-flip-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.25s ease-in-out;
    -webkit-transition: -webkit-transform 0.25s ease-in-out;
}

.image-flip-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.image-flip-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.image-flip-btn-text {
    line-height: 1;
    color: #ffffff;
    font-family: inherit;
}

.image-flip-icon {
    flex-shrink: 0;
    transition: transform 0.4s ease;
}

.image-flip-wrapper.is-after .image-flip-icon {
    transform: rotate(180deg);
}

.image-flip-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #666666;
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}
