/* ===== Custom FAQ - Frontend Styles ===== */

.cfaq-wrapper {
    max-width: 860px;
    margin: 0 auto 36px;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Each item ── */
.cfaq-item {
    background: #fff;
    border: 1px solid #e2e4f0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.cfaq-item:hover {
    border-color: #c0c3f0;
}

.cfaq-item.cfaq-open {
    border-color: #393fd7;
    box-shadow: 0 4px 18px rgba(57, 63, 215, 0.13);
}

/* ── Question button ── */
.cfaq-question {
    width: 100%;
    background: #fff;
    color: #1a1a1a;
    border: none;
    padding: 18px 20px;
    text-align: left;
    font-size: 0.97rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    line-height: 1.5;
    transition: background 0.2s ease, color 0.2s ease;
}

.cfaq-question:focus {
    outline: 2px solid #393fd7;
    outline-offset: -2px;
}

/* ── Question text — wraps long content ── */
.cfaq-question-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ── Open state ── */
.cfaq-item.cfaq-open > .cfaq-question {
    background: #393fd7 !important;
    color: #fff;
}

/* ── Chevron icon (pure CSS, no external dependency) ── */
.cfaq-icon {
    flex-shrink: 0;
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2px solid #393fd7;
    border-bottom: 2px solid #393fd7;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.3s ease, border-color 0.2s ease;
}

.cfaq-item.cfaq-open > .cfaq-question .cfaq-icon {
    border-color: #fff;
    transform: rotate(-135deg);
    margin-top: 4px;
}

/* ── Answer panel ── */
.cfaq-answer {
    overflow: hidden;
    transition: max-height 0.32s ease;
}

.cfaq-answer[hidden] {
    display: block !important;
    max-height: 0 !important;
    overflow: hidden;
}

.cfaq-answer-inner {
    padding: 2px 20px 8px 20px;
    background: #f7f8ff;
    border-top: 2px solid #393fd7;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Rich content inside answer */
.cfaq-answer-inner p            { margin-bottom:0px !important; }
.cfaq-answer-inner p:last-child { margin-bottom: 0; }

.cfaq-answer-inner a            { color: #393fd7; text-decoration: underline; }
.cfaq-answer-inner a:hover      { opacity: 0.8; }

.cfaq-answer-inner ul,
.cfaq-answer-inner ol           { margin: 6px 0 8px 22px; padding: 0; }
.cfaq-answer-inner li           { margin-bottom: 3px; }

.cfaq-answer-inner h2 { font-size: 1.1em;   font-weight: 700; margin: 10px 0 5px; color: #1a1a1a; }
.cfaq-answer-inner h3 { font-size: 1em;     font-weight: 700; margin: 10px 0 5px; color: #1a1a1a; }
.cfaq-answer-inner h4 { font-size: 0.95em;  font-weight: 700; margin: 8px 0 4px;  color: #1a1a1a; }

/* ── No results ── */
.cfaq-no-results {
    color: #999;
    font-style: italic;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .cfaq-question       { padding: 14px 15px; font-size: 0.93rem; }
    .cfaq-answer-inner   { padding: 13px 15px 15px; font-size: 0.92rem; }
}
