/* ==============================================
   FAQ ACCORDION — Didakta (единый стиль)
   ============================================== */

/* ----- 1. ПЕРЕМЕННЫЕ (меняй здесь) ----- */
:root {

    --faq-primary: var(--global-palette5,#3d5e81);      /* фон открытого вопроса и текста при наведении*/
    --faq-icon: var(--global-palette5,#3d5e81);  
    --faq-icon-hover: var(--global-palette2,#4abc1a);
 
    --faq-border-item: var(--global-palette1, #1a252e);
    
    --faq-question-bg: var(--global-palette9,#FFFFFF);
    --faq-question-bg-hover: var(--global-palette8,#F1F3F8);
    --faq-answer-bg: var(--global-palette8,#F1F3F8);
    --faq-text-question: var(--global-palette1, #1a252e);
    --faq-text-question-active: var(--global-palette9,#FFFFFF);

    --faq-text-answer: var(--global-palette1, #1a252e);
    --faq-answer-link: var(--global-palette10,#ff4500);
    --faq-answer-link-hover: var(--global-palette13,#ff9f00);    
    --faq-font-size: 13px;           
    --faq-mobile-font-size: 14px;     
    --faq-line-height: 1.4;           
    --faq-font-weight: 500;         
}

/* ----- 2. ОБЩИЕ СТИЛИ ----- */
.faq-item {
    border: 1px dotted var(--faq-border-item);
    border-radius: 0;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

/* ----- 3. ВОПРОСЫ ----- */
.faq-question {
    width: 100%;
    padding: 15px 15px 15px 54px;
    background: var(--faq-question-bg);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--faq-text-question);
    display: block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: normal;
    position: relative;
    margin: 0;
    border: none;
    outline: none;
    user-select: none;
    text-align: left;
    line-height: 1.3;
}

.faq-question:hover {
    background: var(--faq-question-bg-hover);
    color: var(--faq-primary);
}

.faq-question:focus-visible {
    outline: 2px solid var(--faq-border-item);
    outline-offset: -2px;
    background: var(--faq-question-bg-hover);
}

.faq-question[aria-expanded="true"] {
    background: var(--faq-primary);
    color: var(--faq-text-question-active);
}

/* ----- 4. ИКОНКИ ----- */
.faq-icon-wrapper {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-icon {
    color: var(--faq-icon);
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: all 0.3s ease;
}

.faq-icon svg[viewBox="0 0 512 512"] {
    transform: scale(0.85);
    transform-origin: center;
}

.faq-question:hover .faq-icon {
    color: var(--faq-icon-hover);
    transform: scale(1.05);
}

.faq-question[aria-expanded="true"] .faq-icon {
    color: #fff;
}

.faq-question[aria-expanded="true"] .faq-icon svg {
    animation: iconPulse 0.5s ease;
}

@keyframes iconPulse {
    0% { transform: scale(0.85); }
    50% { transform: scale(0.92); }
    100% { transform: scale(0.85); }
}

/* ----- 5. ОТВЕТЫ ----- */
.faq-answer {
    background: var(--faq-answer-bg);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition-property: max-height, opacity, visibility;
    position: relative;
    padding-left: 15px;
}

.faq-answer.open {
    max-height: 5000px;
    opacity: 1;
    visibility: visible;
}

/* ----- 6. КОНТЕНТ ОТВЕТА ----- */
.faq-answer-content {
    padding: 15px 15px 15px 0;
    line-height: var(--faq-line-height);
    color: var(--faq-text-answer);
    font-weight: var(--faq-font-weight);
    letter-spacing: 0.5px;
}

.faq-answer-content p,
.faq-answer-content li,
.faq-answer-content ul,
.faq-answer-content ol {
    font-size: var(--faq-font-size) !important;
    font-weight: var(--faq-font-weight) !important;
    line-height: var(--faq-line-height) !important;
    margin-bottom: 8px;
}

.faq-answer-content p:last-child,
.faq-answer-content li:last-child {
    margin-bottom: 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
    padding-left: 20px;
}

.faq-answer-content a {
    color: var(--faq-answer-link);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.faq-answer-content a:hover {
    color: var(--faq-answer-link-hover);
}

/* ----- 7. ОШИБКИ ----- */
.faq-error {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 20px;
    font-size: 16px;
    border: 1px dashed #e2e8f0;
    background: #f7fafc;
}

/* ----- 8. АДАПТИВ ----- */
@media (max-width: 768px) {
    .faq-item {
        margin-bottom: 8px;
    }

    .faq-question {
        padding: 12px 12px 12px 48px;
    }

    .faq-icon-wrapper {
        left: 12px;
        width: 22px;
        height: 22px;
    }

    .faq-icon {
        width: 22px;
        height: 22px;
    }

    .faq-icon svg[viewBox="0 0 512 512"] {
        transform: scale(0.8);
    }

    .faq-answer {
        padding-left: 12px;
    }

    .faq-answer-content {
        padding: 12px 12px 12px 0;
    }

    .faq-answer-content-inner {
        padding: 12px 0;
    }

    .faq-answer-content p,
    .faq-answer-content li,
    .faq-answer-content ul,
    .faq-answer-content ol {
        font-size: var(--faq-mobile-font-size) !important;
        font-weight: var(--faq-font-weight) !important;
        line-height: var(--faq-line-height) !important;
    }

    .faq-accordion-wrapper {
        margin: 20px auto;
        padding: 0 10px;
    }
}