/* faq.css — بعد از style.css، ui.css و lists.css (برای page-head و back-link) */

[hidden] { display: none !important; }

.faq-logo {
    height: 34px;
    width: auto;
    margin-inline-start: auto;
    flex-shrink: 0;
}

/* ========== جستجو ========== */
.faq-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    cursor: text;
    transition: border-color .2s, box-shadow .2s;
}

.faq-search:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.faq-search svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--purple);
}

.faq-search input {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.faq-search input::placeholder { color: var(--text-3); font-size: .85rem; }
.faq-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ========== گروه‌ها ========== */
.faq-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== آیتم سوال (details) ========== */
.faq-item {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color .25s, box-shadow .25s;
}

.faq-item:hover { border-color: var(--line-strong); }

.faq-item[open] {
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
}

.faq-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    list-style: none;
    cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--purple-deep);
    background: var(--purple-soft);
    border: 1px solid #d9ccff;
    border-radius: 10px;
    transition: all .25s;
}

.faq-icon svg { width: 17px; height: 17px; }

.faq-item[open] .faq-icon {
    color: #fff;
    background: var(--purple);
    border-color: var(--purple-deep);
}

.faq-q {
    flex: 1;
    min-width: 0;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.8;
}

.faq-chevron {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: var(--text-3);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    transition: all .25s;
}

.faq-chevron svg {
    width: 16px;
    height: 16px;
    transition: transform .25s ease;
}

.faq-item:hover .faq-chevron,
.faq-item[open] .faq-chevron {
    color: var(--purple-deep);
    background: var(--purple-soft);
    border-color: var(--purple);
}

.faq-item[open] .faq-chevron svg { transform: rotate(180deg); }

/* ========== جواب ========== */
.faq-a {
    padding: 0 14px 14px;
    padding-inline-start: 60px;       /* هم‌ترازی با متن سوال (آیکون + فاصله) */
    animation: faqIn .25s ease;
}

@keyframes faqIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.faq-a p {
    font-size: .8rem;
    line-height: 2;
    color: var(--text-2);
}

.faq-a p + ol { margin-top: 6px; }

.faq-a ol {
    padding-inline-start: 18px;
    font-size: .8rem;
    line-height: 2;
    color: var(--text-2);
}

.faq-a li::marker { color: var(--purple); font-weight: 700; }

.faq-a strong { font-weight: 700; color: var(--text); }

.faq-a .ltr {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    font-family: ui-monospace, monospace;
    font-size: .78rem;
    padding: 0 8px;
    color: var(--purple-deep);
    background: var(--purple-soft);
    border: 1px solid #d9ccff;
    border-radius: 8px;
}

/* ========== نتیجه‌ای پیدا نشد ========== */
.faq-empty {
    padding: 36px 20px;
    text-align: center;
    background: var(--card);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.faq-empty p { margin-bottom: 6px; font-size: .9rem; font-weight: 600; color: var(--text-2); }
.faq-empty small { font-size: .72rem; color: var(--text-3); }

/* ========== هنوز سوال دارید؟ ========== */
.faq-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(90deg, #ffffff 0%, #faf7ff 100%);
    border: 1px solid #d9ccff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.faq-cta-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    border: 1px solid var(--purple-deep);
    border-radius: 14px;
    box-shadow: 0 8px 18px -8px var(--purple-glow);
}

.faq-cta-icon svg { width: 22px; height: 22px; }

.faq-cta-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.faq-cta-text strong { font-size: .88rem; font-weight: 700; }
.faq-cta-text span { font-size: .7rem; line-height: 1.7; color: var(--text-3); }

.faq-cta-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--purple-deep);
    background: var(--purple-soft);
    border: 1px solid var(--purple-deep);
    border-radius: 10px;
    transition: all .25s;
}

.faq-cta-btn:hover { color: #fff; background: var(--purple); }

@media (max-width: 420px) {
    .faq-item summary { padding: 11px 12px; gap: 10px; }
    .faq-a { padding: 0 12px 12px; padding-inline-start: 12px; }
    .faq-cta { flex-wrap: wrap; }
    .faq-cta-text { flex-basis: calc(100% - 60px); }
    .faq-cta-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-a { animation: none; }
    .faq-chevron svg { transition: none; }
}