/**
 * FAQ / Content Spoilers Accordion v2
 * Стили для FAQ-аккордеона и BCR-спойлеров с rich content.
 * Универсальные — работают на светлом и тёмном фоне.
 */

/* --- Section wrapper --- */
.faq-section {
    padding: 60px 20px;
}

.bcr-section {
    padding-left: 20px;
    padding-right: 20px;
}

.faq-section .faq-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.8rem;
    font-weight: 700;
}

/* --- Accordion list --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-list + .faq-list {
    margin-top: 24px;
}

/* --- Accordion item --- */
.faq-item {
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(128, 128, 128, 0.4);
}

.faq-item.faq-open {
    border-color: rgba(128, 128, 128, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Question (clickable header) --- */
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    background: transparent;
    transition: background-color 0.2s ease;
    gap: 12px;
}

.faq-question:hover {
    background-color: rgba(128, 128, 128, 0.08);
}

.faq-question h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

/* --- Arrow icon --- */
.faq-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.5;
}

.faq-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
}

.faq-item.faq-open .faq-arrow {
    transform: rotate(180deg);
    opacity: 0.9;
}

/* --- Answer (collapsible content) --- */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}

.faq-item.faq-open .faq-answer {
    padding: 0 20px 20px;
}

/* FAQ short answers */
.faq-answer > p:only-child {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- Rich content inside spoilers (BCR) --- */
.faq-answer p {
    margin: 0 0 12px;
    font-size: 0.95rem;
    line-height: 1.7;
}

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

.faq-answer h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 20px 0 10px;
    line-height: 1.3;
}

.faq-answer h2:first-child {
    margin-top: 0;
}

.faq-answer h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 16px 0 8px;
    line-height: 1.3;
}

.faq-answer h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 12px 0 6px;
    line-height: 1.3;
}

.faq-answer ul,
.faq-answer ol {
    margin: 8px 0 12px;
    padding-left: 24px;
}

.faq-answer li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 4px;
}

.faq-answer strong {
    font-weight: 600;
}

.faq-answer table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.9rem;
}

.faq-answer table th,
.faq-answer table td {
    padding: 8px 12px;
    border: 1px solid rgba(128, 128, 128, 0.25);
    text-align: left;
}

.faq-answer table th {
    font-weight: 600;
    background: rgba(128, 128, 128, 0.08);
}

.faq-answer table tr:hover {
    background: rgba(128, 128, 128, 0.05);
}

.faq-answer blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 3px solid rgba(128, 128, 128, 0.35);
    font-style: italic;
}

/* --- BCR Navigation (pills inside spoiler) --- */
.bcr-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.bcr-nav a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(128, 128, 128, 0.25);
    text-decoration: none;
    color: inherit;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bcr-nav a:hover {
    background-color: rgba(128, 128, 128, 0.12);
    border-color: rgba(128, 128, 128, 0.4);
}

/* --- BCR Content Sections --- */
.bcr-block {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
}

.bcr-block:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* --- Reviews --- */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-card {
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    transition: border-color 0.3s ease;
}

.review-card:hover {
    border-color: rgba(128, 128, 128, 0.4);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.review-name {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #f5a623;
    flex-shrink: 0;
}

.review-stars svg {
    display: block;
}

.review-text {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .faq-section {
        padding: 40px 16px;
    }

    .bcr-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .faq-section .faq-title {
        font-size: 1.4rem;
        margin-bottom: 24px;
    }

    .faq-list {
        gap: 6px;
    }

    .faq-question {
        padding: 14px 16px;
    }

    .faq-question h3 {
        font-size: 0.9rem;
    }

    .faq-answer {
        padding: 0 16px;
    }

    .faq-item.faq-open .faq-answer {
        padding: 0 16px 16px;
    }

    .faq-answer p,
    .faq-answer li {
        font-size: 0.875rem;
    }

    .faq-answer h2 {
        font-size: 1.1rem;
    }

    .faq-answer h3 {
        font-size: 1rem;
    }

    .faq-answer table {
        font-size: 0.8rem;
    }

    .faq-answer table th,
    .faq-answer table td {
        padding: 6px 8px;
    }

    .toc-header {
        padding: 12px 16px;
    }

    .toc-list {
        padding: 0 16px;
    }

    .toc-block.toc-open .toc-list {
        padding: 0 16px 12px;
    }

    .toc-list a {
        font-size: 0.875rem;
        padding: 5px 0;
    }

    .review-card {
        padding: 14px 16px;
    }

    .review-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .review-text {
        font-size: 0.85rem;
    }
}
