/**
 * Секция "Больше, чем конвертер": колонка с описанием возможностей
 * и демо-панель с автопереключением вкладок.
 *
 * Разметка: template-parts/more-results.php, поведение: assets/js/more-results.js.
 * Стиль и скрипт подключаются из самого шаблона.
 */

.mres {
    background: linear-gradient(180deg, rgba(235, 235, 250, 0) 0%, var(--lilac) 50%, rgba(235, 235, 250, 0) 100%);
    padding: 88px 0;
    position: relative;
    z-index: 1;
}

.mres-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 56px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.mres-text,
.mres-ui {
    min-width: 0;
}

.mres-kicker {
    font-weight: 500;
    font-size: 16px;
    line-height: 140%;
    color: var(--blue);
    margin: 0 0 10px;
}

.mres-title {
    font-weight: 700;
    font-size: 44px;
    line-height: 108%;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0;
}

.mres-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 26px;
}

.mres-row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    align-items: start;
}

.mres-row-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #EBEBF5;
    display: grid;
    place-items: center;
}

.mres-row-icon img {
    width: auto;
    max-width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.mres-row-title {
    font-weight: 500;
    font-size: 20px;
    line-height: 120%;
    color: var(--ink);
    margin: 0 0 3px;
}

.mres-row-desc {
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: var(--muted);
}

/* ── демо-панель: табы с автопереключением ── */

.mres-ui {
    background: #FFFFFF;
    border: 1px solid #EBEBF5;
    border-radius: 22px;
    box-shadow: 0 34px 70px -34px rgba(51, 51, 255, .32);
}

.mres-ui-tabs {
    padding: 14px 16px;
    border-bottom: 1px solid #EBEBF5;
    border-radius: 22px 22px 0 0;
}

.mres-pillbar {
    display: flex;
    gap: 4px;
    padding: 5px;
    border-radius: 16px;
    background: #F7F7FC;
}

.mres-tab {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 6px;
    border-radius: 12px;
    color: var(--muted-2);
    transition: background .25s ease, color .25s ease;
}

.mres-tab img {
    width: 20px;
    height: 20px;
    display: block;
}

.mres-tab.is-active {
    background: #FFFFFF;
    color: var(--blue);
    box-shadow: 0 6px 16px -10px rgba(51, 51, 255, .4);
}

.mres-tab::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 9px 16px;
    border: 1px solid #EBEBF5;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 12px 26px -12px rgba(28, 28, 31, .28);
    color: var(--ink);
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 5;
}

.mres-tab.is-active::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mres-ui-body {
    position: relative;
    min-height: 200px;
    padding: 26px 28px 30px;
}

.mres-pane {
    display: none;
}

.mres-pane.is-active {
    display: block;
    animation: vttMoreFade .35s ease;
}

@keyframes vttMoreFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── таб 1: транскрипт ── */

.mres-turn {
    margin-bottom: 16px;
}

.mres-turn:last-child {
    margin-bottom: 0;
}

.mres-turn-who {
    font-size: 16px;
    line-height: 140%;
    color: var(--muted-2);
    margin: 0 0 5px;
}

.mres-turn-line {
    font-size: 16px;
    line-height: 150%;
    color: #2A2A33;
    margin: 0;
}

.mres-hl {
    background: linear-gradient(90deg, #3333FF 0%, #FF5C33 100%);
    border-radius: 6px;
    padding: 1px 4px;
    color: #FFFFFF;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/*.mres-fade {*/
/*    color: #C7C4D4;*/
/*}*/

/* ── таб 2: субтитры ── */

.mres-subrow {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 6px 8px;
    border-radius: 8px;
}

.mres-subrow-tc {
    font-size: 16px;
    line-height: 140%;
    color: var(--muted-2);
    padding-top: 1px;
}

.mres-subrow-tx {
    font-size: 16px;
    line-height: 140%;
    color: #3A3A45;
}

.mres-subrow.is-current {
    background: rgba(214, 51, 132, .07);
}

.mres-subrow.is-current .mres-subrow-tc {
    font-weight: 500;
    color: #D63384;
}

.mres-subrow.is-current .mres-subrow-tx {
    color: var(--ink);
}

/* ── таб 3: главы ── */

.mres-chapter {
    border: 1px solid #EBEBF5;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.mres-chapter:last-child {
    margin-bottom: 0;
}

.mres-chapter.is-playing {
    border: 1.5px solid transparent;
    background: linear-gradient(#FFFFFF, #FFFFFF) padding-box,
                linear-gradient(90deg, #3333FF 0%, #FF5C33 100%) border-box;
}

.mres-chapter-top {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.mres-chapter-tc {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 16px;
    color: var(--ink);
    flex: none;
}

.mres-chapter-title {
    font-weight: 500;
    font-size: 16px;
    color: var(--ink);
}

.mres-chapter-desc {
    font-size: 16px;
    line-height: 145%;
    color: var(--muted);
    margin: 0;
}

/* ── таб 4: саммари ── */

.mres-sum-title {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 14px;
}

.mres-sum-table {
    display: flex;
    flex-direction: column;
}

.mres-sum-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #F7F7FC;
}

.mres-sum-row:last-child {
    border-bottom: 0;
}

.mres-sum-row.is-head {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--muted-2);
}

.mres-sum-cell {
    font-size: 16px;
    line-height: 135%;
    color: #2A2A33;
}

.mres-sum-cell.is-stage {
    font-weight: 500;
    color: var(--ink);
}

/*!* последняя строка «обрывается» — намёк, что документ длиннее *!*/
/*.mres-sum-row.is-fade .mres-sum-cell,*/
/*.mres-sum-row.is-fade .mres-sum-cell.is-stage {*/
/*    color: #C7C4D4;*/
/*}*/

/* ── таб 5: квиз ── */

.mres-quiz-num {
    font-size: 16px;
    line-height: 140%;
    color: var(--muted-2);
    margin: 0 0 6px;
}

.mres-quiz-q {
    font-weight: 500;
    font-size: 16px;
    line-height: 130%;
    color: var(--ink);
    margin: 0 0 14px;
}

.mres-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mres-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1.5px solid #EBEBF5;
    border-radius: 14px;
    font-size: 16px;
    line-height: 135%;
    color: #2A2A33;
}

.mres-quiz-radio {
    width: 18px;
    height: 18px;
    flex: none;
    border: 1.5px solid #EBEBF5;
    border-radius: 50%;
    background: #F7F7FC;
}

.mres-quiz-option.is-correct {
    border-color: #2FBF71;
    background: rgba(47, 191, 113, .05);
}

.mres-quiz-option.is-correct .mres-quiz-radio {
    position: relative;
    border-color: transparent;
    background: conic-gradient(from 180deg, #3333FF, #8A3FD1, #FF5C33, #3333FF);
}

.mres-quiz-option.is-correct .mres-quiz-radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #FFFFFF;
}

.mres-quiz-option.is-wrong {
    border-color: #FF5C5C;
    background: rgba(255, 92, 92, .05);
}

.mres-quiz-x {
    margin-left: auto;
    flex: none;
    font-weight: 500;
    font-size: 15px;
    color: #FF5C5C;
}

.mres-quiz-link {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
    color: #D63384;
}

@media screen and (max-width: 1024px) {
    .mres {
        padding: 60px 0;
    }

    .mres-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

@media screen and (max-width: 862px) {
    .mres-title {
        font-size: 36px;
    }

    .mres-row-title {
        font-size: 18px;
    }

    .mres-ui-body {
        padding: 20px 18px 24px;
    }

    .mres-sum-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mres-sum-row.is-head {
        display: none;
    }
}

@media screen and (max-width: 648px) {
    .mres-container {
        padding: 0 16px;
    }

    /* тултип держится над своим табом; у крайних прижимаем его к краю таба,
       иначе на узких экранах он вылезает за карточку */
    .mres-tab:first-child::after {
        left: 0;
        transform: translateX(0) translateY(4px);
    }

    .mres-tab:first-child.is-active::after {
        transform: translateX(0) translateY(0);
    }

    .mres-tab:last-child::after {
        left: auto;
        right: 0;
        transform: translateX(0) translateY(4px);
    }

    .mres-tab:last-child.is-active::after {
        transform: translateX(0) translateY(0);
    }
}
