/* =========================================================
   آدین — پرسش‌های متداول
   افزوده‌ی main.css است؛ فقط از توکن‌های همان فایل استفاده می‌کند.
   ========================================================= */

/* ---------- Header nav (بدون همبرگر → روی موبایل هم دیده می‌شود) ---------- */
.faq-nav { display: flex; align-items: center; gap: 4px; }
.faq-nav a {
    padding: 8px 12px; font-size: .96rem; color: var(--text);
    border-radius: 10px; transition: color .25s var(--ease);
}
.faq-nav a:hover { color: var(--gold-deep); }
.faq-nav .btn { padding: 10px 22px; margin-inline-start: 6px; }

/* ---------- جست‌وجو ---------- */
.faq-search {
    position: sticky; top: calc(var(--nav-h) + 10px); z-index: 50;
    max-width: 700px; margin: 0 auto 52px;
}
.faq-search-box {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 18px 4px 6px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(160%) blur(12px);
    border: 1px solid var(--line); border-radius: 999px;
    box-shadow: var(--shadow-md);
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.faq-search-box:focus-within {
    border-color: var(--gold);
    box-shadow: var(--shadow-md), 0 0 0 4px rgba(200, 162, 74, .14);
}
.faq-search-ic { display: grid; place-items: center; flex: 0 0 auto; color: var(--gold-deep); }
.faq-search-ic svg { width: 20px; height: 20px; }

.faq-search input {
    flex: 1; min-width: 0; padding: 14px 0;
    font-family: inherit; font-size: 1rem; color: var(--ink);
    background: none; border: 0; outline: none;
}
.faq-search input::placeholder { color: var(--muted); }

.faq-clear {
    flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center;
    color: var(--muted); background: var(--bg-warm);
    border: 1px solid var(--line); border-radius: 50%;
    cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease);
}
.faq-clear:hover { color: var(--gold-deep); background: var(--gold-tint); }
.faq-clear svg { width: 15px; height: 15px; }
.faq-clear[hidden] { display: none; }

.faq-status {
    min-height: 1.4em; margin: 12px 0 0;
    text-align: center; font-size: .9rem; color: var(--muted);
}

/* ---------- گروه‌ها ---------- */
.faq-group + .faq-group { margin-top: 46px; }
.faq-group.is-hidden, .faq-item.is-hidden { display: none; }

.faq-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.faq-group-head h2 { margin: 0; font-size: 1.2rem; white-space: nowrap; }
.faq-group-head .n {
    flex: 0 0 auto; font-size: .74rem; font-weight: 700;
    color: var(--gold-deep); background: var(--gold-tint);
    border: 1px solid var(--gold-soft); border-radius: 999px; padding: 3px 11px;
}
.faq-group-head .bar {
    flex: 1; height: 1px; min-width: 20px;
    background: linear-gradient(to left, var(--line), transparent);
}

/* ---------- آیتم‌ها ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.faq-item:hover { border-color: var(--gold-soft); }
.faq-item.open { border-color: var(--gold-soft); box-shadow: var(--shadow-md); }

.faq-h { margin: 0; font-size: inherit; }

.faq-q {
    display: flex; align-items: center; gap: 14px;
    width: 100%; padding: 18px 22px;
    font-family: inherit; font-size: 1.02rem; font-weight: 700; line-height: 1.75;
    color: var(--ink); text-align: start;
    background: none; border: 0; cursor: pointer;
}
.faq-qt { flex: 1; min-width: 0; }

.faq-ic {
    flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
    color: var(--gold-deep); background: var(--gold-tint);
    border: 1px solid var(--gold-soft); border-radius: 50%;
    transition: transform .34s var(--ease), background .25s var(--ease),
    color .25s var(--ease), border-color .25s var(--ease);
}
.faq-ic svg { width: 15px; height: 15px; }
.faq-item.open .faq-ic {
    transform: rotate(135deg);
    color: #35270a; background: var(--gold-btn); border-color: transparent;
}

/* باز/بسته شدن نرم — بدون max-height حدسی و بدون پرش چیدمان */
.faq-a {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .34s var(--ease);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; min-height: 0; }

.faq-body {
    margin: 0 22px; padding: 16px 0 20px;
    border-top: 1px solid var(--line);
    font-size: .97rem; line-height: 2.05; color: var(--text);
    opacity: 0; transform: translateY(-6px);
    transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.faq-item.open .faq-body { opacity: 1; transform: none; transition-delay: .07s; }

.faq-body a {
    color: var(--gold-deep); font-weight: 700;
    text-decoration: underline; text-underline-offset: 3px;
    overflow-wrap: anywhere;
}
.faq-body a:hover { color: var(--gold); }

/* ---------- هایلایت نتایج ---------- */
.faq-qt mark {
    color: inherit; background: var(--gold-tint);
    border-radius: 4px; padding: 0 3px;
    box-shadow: inset 0 -2px 0 var(--gold-soft);
}

/* ---------- حالت خالی ---------- */
.faq-empty {
    display: none; text-align: center; padding: 46px 24px;
    color: var(--muted); background: var(--surface);
    border: 1px dashed var(--line); border-radius: var(--radius);
}
.faq-empty.show { display: block; }
.faq-empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 6px; }
.faq-empty p { margin-bottom: 20px; }

/* ---------- ورود نرم ---------- */
@media (scripting: enabled) {
    .faq-group { animation: faqUp .55s var(--ease) both; }
    .faq-group:nth-child(2) { animation-delay: .06s; }
    .faq-group:nth-child(3) { animation-delay: .12s; }
    .faq-group:nth-child(n+4) { animation-delay: .18s; }
}
@keyframes faqUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- دسترسی‌پذیری ---------- */
.faq-q:focus-visible,
.faq-clear:focus-visible,
.faq-nav a:focus-visible {
    outline: 2px solid var(--gold); outline-offset: 2px;
}

/* ---------- موبایل ---------- */
@media (max-width: 640px) {
    .faq-nav a { padding: 8px 9px; font-size: .9rem; }
    .faq-nav .btn { padding: 9px 16px; font-size: .92rem; margin-inline-start: 2px; }
    .faq-search { margin-bottom: 38px; }
    .faq-q { padding: 16px 16px; font-size: .97rem; gap: 10px; }
    .faq-body { margin: 0 16px; }
    .faq-group-head h2 { font-size: 1.08rem; white-space: normal; }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
    .faq-a, .faq-body, .faq-ic { transition: none; }
    .faq-group { animation: none; }
}