/* ============================================================
   کارت‌های سه‌بعدی تعاملی - استایل‌ها
   ============================================================ */

.ft-3d-cards-container {
    display: grid;
    justify-content: center;
    align-items: start;
    width: 100%;
    direction: rtl;
}

/* ===== کانتینر هر کارت ===== */
.ft-3d-card-wrap {
    perspective: 800px;
    transform-style: preserve-3d;
    cursor: pointer;
    position: relative;
}

/* ===== خود کارت ===== */
.ft-3d-card {
    position: relative;
    width: 100%;
    height: 320px;
    background-color: #333;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.6s ease,
                border-color 0.3s ease,
                border-width 0.3s ease,
                border-style 0.3s ease;
    box-shadow: rgba(0, 0, 0, 0.66) 0 30px 60px 0;
    will-change: transform;
}

/* ===== حاشیه داخلی (Inset Border) با شبه‌عنصر ===== */
.ft-3d-card::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    border: 5px solid #333333;
    border-radius: 8px;
    pointer-events: none;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: block;
}

/* ===== تصویر پس‌زمینه ===== */
.ft-3d-card-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    padding: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.6s ease;
    pointer-events: none;
    opacity: 0.5;
    will-change: transform;
}

/* لایه روی تصویر */
.ft-3d-card-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.4s ease;
}

/* ===== محتوای کارت (عنوان و توضیحات) ===== */
.ft-3d-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(40%);
    transition: transform 0.6s 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
    z-index: 2;
    pointer-events: none;
}

.ft-3d-card-title {
    font-size: 36px;
    font-weight: 700;
    font-family: "Playfair Display", serif;
    margin: 0 0 5px 0;
    text-shadow: rgba(0, 0, 0, 0.5) 0 10px 10px;
    color: #fff;
    line-height: 1.2;
}

.ft-3d-card-description {
    margin: 0;
    opacity: 0;
    text-shadow: rgba(0, 0, 0, 0.8) 0 2px 3px;
    transition: opacity 0.6s 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
    color: #eee;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== لینک کلیک‌پذیر کل کارت ===== */
.ft-3d-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    text-indent: -9999px;
}

/* ============================================================
   حالت هاور (Hover)
   ============================================================ */

/* ---- کارت اصلی ---- */
.ft-3d-card-wrap:hover .ft-3d-card {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.6s ease,
                border-color 0.3s ease,
                border-width 0.3s ease,
                border-style 0.3s ease;
    box-shadow: rgba(255, 255, 255, 0.15) 0 0 40px 5px,
                rgba(0, 0, 0, 0.66) 0 30px 60px 0;
}

/* ---- تصویر پس‌زمینه ---- */
.ft-3d-card-wrap:hover .ft-3d-card-bg {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.6s ease;
    opacity: 0.8;
    transform: scale(1.1);
}

.ft-3d-card-wrap:hover .ft-3d-card-bg::after {
    background: rgba(0, 0, 0, 0.7);
}

/* ---- محتوای کارت ---- */
.ft-3d-card-wrap:hover .ft-3d-card-info {
    transform: translateY(0);
    transition: transform 0.6s 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}

.ft-3d-card-wrap:hover .ft-3d-card-description {
    opacity: 1;
    transition: opacity 0.6s 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================================================
   واکنش‌گرا (Responsive)
   ============================================================ */

@media (max-width: 991px) {
    .ft-3d-cards-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .ft-3d-cards-container {
        grid-template-columns: 1fr !important;
        justify-items: center;
    }
    .ft-3d-card-wrap {
        width: 80% !important;
    }
}