/* ==========================================================
   FAQ Accordion — Ananda SURE design
   Version: 1.3.0
   ========================================================== */

/* ── Wrapper ── */
.faq-accordion-wrap {
    max-width: 100%;
    margin: 0;
    font-family: inherit;
}

.faq-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0d1b3e;
}

/* ── Accordion container ── */
.faq-accordion {
    border-top: 1px solid #1a1a1a;
}

/* ── FAQ Item ── */
.faq-item {
    border-bottom: 1px solid #1a1a1a;
    border-left: 4px solid #0d1b3e;
    padding-left: 14px;
    background: #fff;
}

/* ── Question Button ── */
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.15rem 1rem 1.15rem 0;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 400;
    color: #0d1b3e;
    gap: 1.5rem;
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
}

.faq-question:hover {
    color: #1a3a7c;
}

/* h3 อยู่ใน button — reset ทุก default heading style */
.faq-question-text {
    flex: 1;
    line-height: 1.5;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    letter-spacing: inherit;
}

/* ── Icon — plain + / − ── */
.faq-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
}

/* Horizontal bar */
.faq-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: #0d1b3e;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

/* Vertical bar */
.faq-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1.5px;
    height: 100%;
    background: #0d1b3e;
    transform: translateX(-50%);
    transition: opacity 0.25s ease;
}

/* เปิดแล้ว: vertical หายไป → กลายเป็น − */
.faq-question[aria-expanded='true'] .faq-icon::after {
    opacity: 0;
}

/* ── Answer Panel ── */
.faq-answer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

.faq-answer[hidden] {
    display: block !important; /* override [hidden] เพื่อให้ animate ได้ */
    visibility: hidden;
}

.faq-answer.is-open {
    visibility: visible;
    max-height: 2000px;
}

.faq-answer-inner {
    padding: 0 1rem 1.4rem 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
}

.faq-answer-inner p:last-child {
    margin-bottom: 0;
}

/* ── Override Astra focus-visible yellow outline ── */
.faq-question:focus,
.faq-question:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ── Error / Empty states ── */
.faq-error,
.faq-empty {
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.faq-error code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
