/* =========================================================
   Flip Card Widget — Tekcom
   Front: Image | Back: Text
   ========================================================= */

/* ── Wrapper ───────────────────────────────────────────── */
.fc-wrapper {
    display: block;
    position: relative;
    width: 300px;
    height: 300px;
    flex-shrink: 0;
    min-height: 0;

    /* perspective must sit here, outside the rotating element */
    perspective: 1200px;
    perspective-origin: 50% 50%;

    /* Clip for non-Safari */
    overflow: hidden;
    cursor: default;
}

/* ── Rotating card ─────────────────────────────────────── */
.fc__inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Horizontal flip */
.fc-wrapper--horizontal:hover .fc__inner,
.fc-wrapper--horizontal:focus-within .fc__inner {
    transform: rotateY(180deg);
}

/* Vertical flip */
.fc-wrapper--vertical:hover .fc__inner,
.fc-wrapper--vertical:focus-within .fc__inner {
    transform: rotateX(180deg);
}

/* ── Faces ──────────────────────────────────────────────── */
.fc__face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(1px);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Overlay tint on front */
.fc__face--front::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ── Front face: image ──────────────────────────────────── */
.fc__face--front img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translateZ(0);
}

/* ── Front face: title label ────────────────────────────── */
.fc__front-label {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 12px 16px;
    color: #ffffff;
    pointer-events: none;
    /* keep label above the overlay ::after pseudo */
    isolation: isolate;
}

.fc__front-label--top    { top: 0; }
.fc__front-label--center { top: 50%; transform: translateY(-50%); }
.fc__front-label--bottom { bottom: 0; }

/* ── Back face: text content ────────────────────────────── */
.fc__face--back {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e293b;
}

/* Horizontal back — start rotated away */
.fc-wrapper--horizontal .fc__face--back {
    transform: rotateY(180deg) translateZ(1px);
}

/* Vertical back — start rotated away */
.fc-wrapper--vertical .fc__face--back {
    transform: rotateX(180deg) translateZ(1px);
}

/* ── Content inside back face ───────────────────────────── */
.fc__back-content {
    width: 100%;
    padding: 24px;
    text-align: center;
    /* prevent content overflow */
    overflow: hidden;
}

.fc__title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.fc__desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

/* ── Button ─────────────────────────────────────────────── */
.fc__btn-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.fc__btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #ffffff;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.fc__btn:hover {
    opacity: 0.85;
    text-decoration: none;
}

/* ── Accessibility ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .fc__inner {
        transition: none !important;
    }
}
