/* assets/css/style.css */

.ca-container {
    display: flex;
    width: 100%;
    direction: rtl;
    /* گپ و ارتفاع از المنتور می آید */
}

.ca-item {
    flex: 1;
    position: relative;
    height: 100%;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- حالت بسته --- */
.ca-collapsed-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 30px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    z-index: 2;
    pointer-events: none;
    transform-origin: center;
}

.ca-item.is-active .ca-collapsed-content {
    opacity: 0;
    transform: rotate(90deg) translateY(-20px);
}

.ca-number {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px; /* فاصله پیشفرض */
}

.ca-title-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* --- حالت باز --- */
.ca-expanded-content {
    position: relative;
    width: 100%; height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
    z-index: 3;
}

.ca-item.is-active .ca-expanded-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* انیمیشن آیکون اصلی */
.ca-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.5) rotate(-30deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
    line-height: 0;
}
.ca-item.is-active .ca-icon {
    transform: scale(1) rotate(0);
}

.ca-body-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* فاصله ها از المنتور کنترل میشود */
}

.ca-title {
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.ca-desc {
    line-height: 1.6;
}

.ca-footer-area {
    width: 100%;
    display: flex;
	justify-content: flex-end !important;
    justify-content: inherit; /* ارث بری از تراز والد */
    margin-top: 20px;
}

.ca-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px; /* فاصله بین متن دکمه و فلش */
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s;
}
.ca-btn:hover { opacity: 1; }

.ca-arrow {
    transition: transform 0.3s ease;
    display: block; /* اطمینان از نمایش */
}
.ca-btn:hover .ca-arrow {
    transform: translate(-3px, -3px);
}

.ca-click-trigger {
    position: absolute; top:0; left:0; right:0; bottom:0; z-index: 10; cursor: pointer;
}

/* ترازبندی‌ها */
.ca-expanded-content[data-align="right"] { text-align: right; }
.ca-expanded-content[data-align="left"] { text-align: left; }
.ca-expanded-content[data-align="center"] { text-align: center; }

/* موبایل */
@media (max-width: 768px) {
    .ca-container { flex-direction: column; height: auto !important; }
    .ca-item { height: 80px; width: 100%; border-radius: 10px; flex: none !important; }
    .ca-item.is-active { height: auto; min-height: 400px; }
    .ca-collapsed-content {
        flex-direction: row;
        padding: 0 20px;
        align-items: center;
        justify-content: space-between;
    }
    .ca-title-vertical {
        writing-mode: horizontal-tb;
        transform: none;
        margin-bottom: 0;
    }
    .ca-number { margin-bottom: 0; }
    .ca-item.is-active .ca-collapsed-content {
        transform: translateY(-10px);
    }
}