.nyehs-flip-card {
    position: relative;
    perspective: 1200px;
    border-radius: var( --nyehs-fc-r, 16px );
    display: block;
    overflow: visible;
    transition: translate 0.3s ease;
}

.nyehs-flip-card:hover {
    translate: 0 -6px !important;
}

.nyehs-flip-card__shadow {
    position: absolute;
    inset: 0;
    border-radius: var( --nyehs-fc-r, 16px );
    pointer-events: none;
}

.nyehs-flip-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.68s cubic-bezier( 0.4, 0, 0.2, 1 );
    will-change: transform;
}

.nyehs-flip-card.is-flipped .nyehs-flip-card__inner {
    transform: rotateY( 180deg );
}
.nyehs-flip-card[data-flip-axis="X"].is-flipped .nyehs-flip-card__inner {
    transform: rotateX( 180deg );
}

/* ── Faces ──────────────────────────────────────────────────────────────── */

.nyehs-flip-card__face {
    position: absolute;
    inset: 0;
    border-radius: var( --nyehs-fc-r, 16px );
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.nyehs-flip-card__face--back {
    transform: rotateY( 180deg );
}
.nyehs-flip-card[data-flip-axis="X"] .nyehs-flip-card__face--back {
    transform: rotateX( 180deg );
}

/* ── Face image ─────────────────────────────────────────────────────────── */

.nyehs-flip-card__face-img {
    flex-shrink: 0;
    overflow: hidden;
}

.nyehs-flip-card__face-img[data-modal-src] {
    cursor: zoom-in;
}

/* ── Image modal ────────────────────────────────────────────────────────── */

.nyehs-fc-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.nyehs-fc-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.nyehs-fc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba( 0, 0, 0, 0.88 );
}

.nyehs-fc-modal__img {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba( 0, 0, 0, 0.6 );
}

.nyehs-fc-modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 1px solid rgba( 255, 255, 255, 0.4 );
    border-radius: 50%;
    outline: none;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.nyehs-fc-modal__close:hover {
    opacity: 1;
    border-color: rgba( 255, 255, 255, 0.9 );
}

.nyehs-fc-modal__close:focus-visible {
    opacity: 1;
    border-color: #fff;
}

.nyehs-flip-card__face-img-label {
    position: absolute;
    bottom: 10px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var( --wp--preset--color--accent, #0d41ff );
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.9;
}

.nyehs-flip-card__face-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Face body (content + trigger) ─────────────────────────────────────── */

.nyehs-flip-card__face-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Face content ───────────────────────────────────────────────────────── */

.nyehs-flip-card__face-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nyehs-flip-card__face-content > * {
    margin-top: 0;
    margin-bottom: 0;
    color: inherit;
}

/* ── Trigger button ─────────────────────────────────────────────────────── */

.nyehs-flip-card__trigger {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    margin: 8px 18px 18px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: opacity .2s ease;
}

.nyehs-flip-card__trigger:hover {
    opacity: 0.75;
}

.nyehs-flip-card__trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Right-pointing arrow for front face trigger */
.nyehs-flip-card__trigger:not(.nyehs-flip-card__trigger--back)::after {
    content: '';
    display: block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transform: rotate( -45deg );
    transition: transform .22s ease;
}

.nyehs-flip-card__trigger:not(.nyehs-flip-card__trigger--back):hover::after {
    transform: rotate( 0deg );
}

/* Left-pointing arrow for back face trigger */
.nyehs-flip-card__trigger--back::before {
    content: '';
    display: block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transform: rotate( 135deg );
    transition: transform .22s ease;
}

.nyehs-flip-card__trigger--back:hover::before {
    transform: rotate( 180deg );
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media ( prefers-reduced-motion: reduce ) {
    .nyehs-flip-card__inner { transition: none; }
    .nyehs-flip-card__face--back {
        transform: none;
        opacity: 0;
        transition: opacity 0.25s ease;
        pointer-events: none;
        z-index: 0;
    }
    .nyehs-flip-card__face--front { z-index: 1; transition: opacity 0.25s ease; }
    .nyehs-flip-card.is-flipped .nyehs-flip-card__inner       { transform: none; }
    .nyehs-flip-card.is-flipped .nyehs-flip-card__face--front { opacity: 0; pointer-events: none; z-index: 0; }
    .nyehs-flip-card.is-flipped .nyehs-flip-card__face--back  { opacity: 1; pointer-events: auto; z-index: 1; }
}
