/* =========================
   Публичный FAQ
   ========================= */

.faq-sections {
    --faq-accent: #d9ad54;
    --faq-accent-line: #e4bd68;
    --faq-text: #383838;
    --faq-muted: #777777;
    --faq-border: #a8a8a8;
    width: 100%;
    color: var(--faq-text);
}

.faq-sections__heading {
    margin: 0 0 30px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--faq-text);
}

.faq-sections__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 22px;
    margin: 0 0 8px;
}

.faq-sections__tab {
    min-width: 162px;
    min-height: 41px;
    padding: 10px 22px;
    border: 1px solid var(--faq-border);
    border-radius: 4px;
    background: transparent;
    color: #666666;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.faq-sections__tab:hover,
.faq-sections__tab:focus-visible {
    border-color: var(--faq-accent);
    outline: none;
}

.faq-sections__tab.is-active {
    border-color: var(--faq-accent);
    background: var(--faq-accent);
    color: #ffffff;
    font-weight: 600;
}

.faq-sections__panel[hidden] {
    display: none;
}

.faq-sections__item {
    border-bottom: 1px solid var(--faq-accent-line);
}

.faq-sections__question {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 77px;
    padding: 22px 0;
    border: 0;
    background: transparent;
    color: var(--faq-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.faq-sections__question:focus-visible {
    outline: 2px solid rgba(217, 173, 84, .45);
    outline-offset: 4px;
}

.faq-sections__icon {
    position: relative;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-right: 29px;
}

.faq-sections__icon::before,
.faq-sections__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--faq-accent);
    transform: translate(-50%, -50%);
    transition: opacity .25s ease, transform .25s ease;
}

.faq-sections__icon::before {
    width: 20px;
    height: 2px;
}

.faq-sections__icon::after {
    width: 2px;
    height: 20px;
}

.faq-sections__item.is-open .faq-sections__icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

.faq-sections__question-title {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
}

.faq-sections__answer {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .35s ease, opacity .28s ease;
}

.faq-sections__item.is-open .faq-sections__answer {
    grid-template-rows: 1fr;
    opacity: 1;
}

.faq-sections__answer-clip {
    min-height: 0;
    overflow: hidden;
}

.faq-sections__answer-content {
    padding: 0 18px 27px 97px;
    color: var(--faq-muted);
    font-size: 14px;
    line-height: 1.65;
}

.faq-sections__answer-content > :first-child {
    margin-top: 0;
}

.faq-sections__answer-content > :last-child {
    margin-bottom: 0;
}

.faq-sections__answer-content p {
    margin: 0 0 17px;
}

.faq-sections__answer-content ul,
.faq-sections__answer-content ol {
    margin: 0 0 17px;
    padding-left: 22px;
}

@media (max-width: 767px) {
    .faq-sections__heading {
        margin-bottom: 22px;
        font-size: 26px;
    }

    .faq-sections__tabs {
        flex-wrap: nowrap;
        gap: 10px;
        margin-right: -15px;
        padding-right: 15px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .faq-sections__tab {
        flex: 0 0 auto;
        min-width: 150px;
    }

    .faq-sections__question {
        min-height: 68px;
        padding: 19px 0;
    }

    .faq-sections__icon {
        margin-right: 18px;
    }

    .faq-sections__answer-content {
        padding: 0 0 23px 38px;
        font-size: 13px;
    }
}

/* =========================
   Редактор пользовательского поля в админке
   ========================= */

.faq-uf-editor {
    width: min(1100px, 100%);
}

.faq-uf-editor__list {
    display: grid;
    gap: 18px;
}

.faq-uf-editor__item {
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.faq-uf-editor__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.faq-uf-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.faq-uf-editor__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.faq-uf-editor__field {
    display: grid;
    gap: 7px;
}

.faq-uf-editor__field > span {
    font-weight: 600;
}

.faq-uf-editor__field input[type='text'] {
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
}

.faq-uf-editor__field--wide {
    width: 100%;
}

.faq-uf-editor__html-editor {
    overflow: hidden;
    border: 1px solid #b7b7b7;
    border-radius: 4px;
    background: #ffffff;
}

.faq-uf-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 7px;
    border-bottom: 1px solid #d3d3d3;
    background: #f5f5f5;
}

.faq-uf-editor__toolbar button {
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid #c6c6c6;
    border-radius: 3px;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
}

.faq-uf-editor__toolbar button:hover,
.faq-uf-editor__toolbar button.is-active {
    border-color: #8a8a8a;
    background: #e9e9e9;
}

.faq-uf-editor__visual,
.faq-uf-editor__source {
    box-sizing: border-box;
    width: 100%;
    min-height: 230px;
    padding: 14px;
    border: 0;
    outline: none;
    background: #ffffff;
    color: #333333;
    font: 14px/1.55 Arial, sans-serif;
}

.faq-uf-editor__visual {
    overflow: auto;
}

.faq-uf-editor__visual:empty::before {
    content: 'Введите текст вопроса…';
    color: #9a9a9a;
    pointer-events: none;
}

.faq-uf-editor__source {
    display: none;
    resize: vertical;
    font-family: Consolas, Monaco, monospace;
}

.faq-uf-editor__html-editor.is-source .faq-uf-editor__visual {
    display: none;
}

.faq-uf-editor__html-editor.is-source .faq-uf-editor__source {
    display: block;
}

.faq-uf-editor__add {
    margin-top: 16px;
}

@media (max-width: 900px) {
    .faq-uf-editor__fields {
        grid-template-columns: 1fr;
    }
}
