/* =============================================================
   FAQ Accordion Plugin — faq-accordion.css
   Все цвета через CSS-переменные — тема легко перебивает их.

   Чтобы переопределить из темы, добавь в style.css:
   .faq-accordion {
       --faq-accent:      #e74c3c;
       --faq-accent-bg:   #fff5f5;
       --faq-border:      #f0d0d0;
       --faq-answer-text: #333;
   }
   ============================================================= */

.faq-accordion {
    --faq-accent:      #2271b1;
    --faq-accent-bg:   #f0f4ff;
    --faq-border:      #e2e6ea;
    --faq-answer-text: #444444;

    max-width: 860px;
    margin: 0 auto 2em;
}

.faq-block-title {
    margin-bottom: 1.2em;
    font-size: 1.5em;
}

.faq-empty {
    color: #888;
    font-style: italic;
}

.faq-item {
    border: 1px solid var(--faq-border);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.faq-item:last-child { margin-bottom: 0; }

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-align: left;
    color: inherit;
    line-height: 1.4;
    transition: background 0.2s;
}

.faq-question:hover { background: #f8f9fa; }

.faq-question:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: -2px;
}

.faq-question[aria-expanded="true"] {
    background: var(--faq-accent-bg);
    color: var(--faq-accent);
}

.faq-question-text { flex: 1; }

/* --- Plus / Minus --- */
[data-icon="plus"] .faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-icon="plus"] .faq-icon::before,
[data-icon="plus"] .faq-icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
[data-icon="plus"] .faq-icon::before { width: 14px; height: 2px; }
[data-icon="plus"] .faq-icon::after  { width: 2px;  height: 14px; }
[data-icon="plus"] .faq-question[aria-expanded="true"] .faq-icon::after {
    transform: rotate(90deg);
    opacity: 0;
}

/* --- Arrow (▼) --- */
[data-icon="arrow"] .faq-icon {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
}
[data-icon="arrow"] .faq-icon::before {
    content: '';
    display: block;
    width: 10px; height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.3s ease;
}
[data-icon="arrow"] .faq-question[aria-expanded="true"] .faq-icon::before {
    transform: rotate(225deg) translateY(-3px);
}

/* --- Chevron (›) --- */
[data-icon="chevron"] .faq-icon {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
}
[data-icon="chevron"] .faq-icon::before {
    content: '';
    display: block;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translateX(-2px);
    transition: transform 0.3s ease;
}
[data-icon="chevron"] .faq-question[aria-expanded="true"] .faq-icon::before {
    transform: rotate(45deg) translateX(-2px);
}

/* --- Ответ --- */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
[data-animate="0"] .faq-answer { transition: none; }

.faq-answer-inner {
    padding: 4px 20px 20px;
    color: var(--faq-answer-text);
    line-height: 1.75;
    border-top: 1px solid var(--faq-border);
}
.faq-answer-inner p:first-child { margin-top: 0.6em; }
.faq-answer-inner p:last-child  { margin-bottom: 0; }

@media (max-width: 600px) {
    .faq-question     { padding: 14px 16px; font-size: 0.95em; }
    .faq-answer-inner { padding: 4px 16px 16px; }
}
