/* =============================================
   AI Accordion Image Widget — ai-accordion.css
   ============================================= */

/* Wrapper */
.ai-acc-section {
    margin: 0 auto;
    width: 100%;
}

/* Row layout */
.ai-acc-content {
    display: flex;
    gap: 30px;
    align-items: center;
}

/* ── IMAGE SIDE ────────────────────────────── */
.ai-acc-image-wrap {
    width: 50%;
    position: relative;
    min-height: 100px;
}

.ai-acc-image-wrap img.ai-acc-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.ai-acc-image-wrap img.ai-acc-img.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

/* ── ACCORDION SIDE ────────────────────────── */
.ai-acc-list {
    width: 50%;
    margin-top: 10px;
}

/* Item */
.ai-acc-item {
    background: #f4f5f9;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7ee;
}

.ai-acc-item.active {
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Title */
.ai-acc-title {
    padding: 8px 22px;
    font-size: 18px;
    font-weight: 500;
    color: #1744b3;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0;
    line-height: 1.4;
}

.ai-acc-item.active .ai-acc-title {
    color: #0b2f8f;
}

/* Icon — hidden by default, shown when active */
.ai-acc-title .ai-acc-icon {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.4s ease, opacity 0.4s ease, margin-right 0.4s ease;
    margin-right: 0;
}

.ai-acc-title .ai-acc-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.ai-acc-item.active .ai-acc-title .ai-acc-icon {
    max-width: 40px;
    opacity: 1;
    margin-right: 10px;
}

/* Description */
.ai-acc-desc {
    max-height: 0;
    overflow: hidden;
    padding: 0 22px;
    color: #555555;
    line-height: 1.6;
    font-size: 15px;
    transition: max-height 0.5s ease, padding 0.4s ease;
}

.ai-acc-item.active .ai-acc-desc {
    max-height: 300px;
    padding: 0 22px 20px;
}

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 767px) {
    .ai-acc-content {
        flex-direction: column !important;
    }

    .ai-acc-image-wrap,
    .ai-acc-list {
        width: 100%;
    }

    .ai-acc-image-wrap img.ai-acc-img {
        height: auto;
        min-height: 220px;
    }

    .ai-acc-title {
        font-size: 16px;
        padding: 8px 16px;
    }

    .ai-acc-desc {
        font-size: 14px;
        padding: 0 16px;
    }

    .ai-acc-item.active .ai-acc-desc {
        padding: 0 16px 16px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .ai-acc-title {
        font-size: 16px;
        padding: 6px 14px;
    }

    .ai-acc-desc {
        font-size: 14px;
    }

    .ai-acc-title .ai-acc-icon img {
        width: 22px;
        height: 22px;
    }

    .ai-acc-item.active .ai-acc-title .ai-acc-icon {
        max-width: 30px;
    }

    .ai-acc-image-wrap img.ai-acc-img {
        height: auto;
    }

    .ai-acc-content {
        align-items: center;
    }
}
