/* Генератор тем: topics, topics/{предмет}, topics/{n}-klass. Общие блоки страницы — works.css */

.topics-head {
    margin-bottom: 2.5rem;
}

/* Генератор */

.topics-gen {
    margin-bottom: 4rem;
    padding: 2rem;
    border-radius: 1rem;
    background: #F5F6F8;
}

.topics-gen__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.topics-gen__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1 1 10rem;
    min-width: 0;
    margin: 0;
}

.topics-gen__field_wide {
    flex: 2 1 16rem;
}

.topics-gen__label {
    font-size: 0.875rem;
    color: #7C7C7D;
}

/* Поля и кнопка — одной высоты: у .btn сайта свои отступы под 54px, у .form-control — 38px */
.topics-gen .form-control,
.topics-gen__submit {
    height: 2.875rem;
}

.topics-gen .form-control {
    padding: 0 2.25rem 0 0.875rem;
    border: 1px solid #E0E0E0;
    border-radius: 0.625rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237C7C7D' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
    -webkit-appearance: none;
    appearance: none;
    font-size: 1rem;
    color: #303030;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topics-gen .form-control:hover {
    border-color: #B8C2CC;
}

.topics-gen .form-control:focus {
    border-color: #1AA7EC;
    box-shadow: 0 0 0 3px rgba(26, 167, 236, 0.15);
    outline: 0;
}

.topics-gen__submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.75rem;
    border-radius: 0.625rem;
    font-weight: 500;
    line-height: 1;
}

.topics-gen__result {
    margin-top: 1.5rem;
    transition: opacity 0.15s ease;
}

.topics-gen__result.is-loading {
    opacity: 0.5;
}

.topics-gen__placeholder {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.625rem;
    color: #5A5A5A;
}

/* Карточка темы из генератора */

.topics-card {
    padding: 1.75rem;
    border: 1px solid #E0E0E0;
    border-radius: 0.875rem;
    background: #fff;
}

.topics-card__meta,
.topics-idea__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.topics-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    background: #EDEEF0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #303030;
    text-decoration: none;
}

.topics-pill_subject {
    background: #1AA7EC;
    color: #fff;
}

a.topics-pill_subject:hover {
    background: #128bc7;
    color: #fff;
    text-decoration: none;
}

.topics-pill_kind {
    background: #E8F6FD;
    color: #1487c0;
}

.topics-pill_muted {
    background: transparent;
    border: 1px solid #E0E0E0;
    color: #7C7C7D;
}

.topics-card__title {
    margin: 0 0 1.25rem;
    font-weight: 500;
    font-size: 1.75rem;
    line-height: 2.25rem;
    color: #000;
}

.topics-card__label {
    margin: 0 0 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #7C7C7D;
}

.topics-card__text {
    max-width: 48rem;
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.topics-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    color: #1AA7EC;
}

.topics-card__works {
    margin-bottom: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #F0F1F3;
}

.topics-card__works-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 1rem;
    line-height: 1.625rem;
}

.topics-card__works-list a {
    color: #1AA7EC;
}

.topics-card__works-grade {
    color: #7C7C7D;
}

.topics-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.topics-card__save.is-on {
    border-color: #F2A100;
    color: #B87A00;
    background: #FFF8E6;
}

.topics-card__submit {
    margin-left: auto;
    font-size: 1rem;
    color: #1AA7EC;
}

.topics-card__count {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: #9A9A9A;
}

/* Сохранённые темы */

.topics-saved {
    margin-top: 1.5rem;
}

.topics-saved__title {
    margin: 0 0 0.75rem;
    font-weight: 500;
    font-size: 1.125rem;
}

.topics-saved__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.topics-saved__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    background: #fff;
}

.topics-saved__name {
    flex: 1 1 16rem;
    font-weight: 500;
}

.topics-saved__meta {
    font-size: 0.875rem;
    color: #7C7C7D;
}

.topics-saved__remove {
    padding: 0 0.25rem;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: #9A9A9A;
}

.topics-saved__remove:hover {
    color: #000;
}

.topics-saved__note {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #9A9A9A;
}

/* Списки тем */

.topics-area {
    margin: 2rem 0 1rem;
    font-weight: 500;
    font-size: 1.125rem;
    color: #7C7C7D;
}

.topics-area a {
    color: inherit;
}

.topics-area_big {
    margin-top: 2.5rem;
    font-size: 1.375rem;
    color: #000;
}

.topics-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1rem;
}

.topics-idea {
    padding: 1.25rem 1.5rem;
    border: 1px solid #E0E0E0;
    border-radius: 0.75rem;
    background: #fff;
}

.topics-idea[hidden],
.topics-group[hidden] {
    display: none;
}

.topics-idea__meta {
    margin-bottom: 0.75rem;
}

.topics-idea__title {
    margin: 0 0 0.5rem;
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.5rem;
    color: #000;
}

.topics-idea__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5rem;
    color: #505050;
}

.topics-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topics-filter button {
    background: #fff;
    cursor: pointer;
}

.topics-filter button.is-active {
    background: #1AA7EC;
}

.topics-off {
    color: #B0B0B0;
}

/* Предметы с примерами тем на /topics */

.topics-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1rem;
}

.topics-subject {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    background: #F5F6F8;
}

.topics-subject__title {
    margin: 0 0 0.75rem;
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.5rem;
}

.topics-subject__title a {
    color: #000;
}

.topics-subject__list {
    margin: 0 0 0.75rem;
    padding-left: 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.5rem;
}

.topics-subject__list li + li {
    margin-top: 0.375rem;
}

.topics-subject__grade {
    white-space: nowrap;
    color: #9A9A9A;
}

.topics-subject__more {
    margin-top: auto;
    font-size: 0.9375rem;
    color: #1AA7EC;
}

.topics-subject__empty {
    margin: 0;
    font-size: 0.9375rem;
    color: #9A9A9A;
}

/* Как выбрать тему */

.topics-howto__list {
    max-width: 50rem;
    margin: 0 0 1rem;
    padding-left: 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.75rem;
}

.topics-howto__list li + li {
    margin-top: 0.75rem;
}

.topics-howto__more {
    max-width: 50rem;
    margin: 0;
    color: #5A5A5A;
}

/* Страница темы topics/{предмет}/{id}-{slug}: вопрос, план, что понадобится, что получится, ошибки */
.topics-idea__title a {
    color: inherit;
    text-decoration: none;
}

.topics-idea__title a:hover {
    color: #1AA7EC;
}

.topics-page__question {
    margin: 0 0 2.5rem;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid #1AA7EC;
    border-radius: 0 0.75rem 0.75rem 0;
    background: #E8F6FD;
}

.topics-page__label {
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #1487c0;
}

.topics-page__question p {
    margin: 0;
    font-size: 1.1875rem;
    line-height: 1.75rem;
    color: #000;
}

.topics-page__text {
    margin: 0 0 2.5rem;
    font-size: 1.0625rem;
    line-height: 1.75rem;
}

.topics-steps {
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
    counter-reset: topics-step;
}

.topics-steps li {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 3rem;
    font-size: 1.0625rem;
    line-height: 1.75rem;
    counter-increment: topics-step;
}

.topics-steps li::before {
    content: counter(topics-step);
    position: absolute;
    top: 0;
    left: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #1AA7EC;
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 2rem;
    text-align: center;
    color: #fff;
}

.topics-mistakes {
    margin: 0 0 2.5rem;
    padding-left: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.75rem;
}

.topics-mistakes li {
    margin-bottom: 0.5rem;
}

.topics-mistakes li::marker {
    color: #E5484D;
}

.topics-page__works {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.75rem;
}

.topics-page__works li {
    margin-bottom: 0.375rem;
}

.topics-page__works a {
    color: #1AA7EC;
}

.topics-page__works span {
    color: #7C7C7D;
}

.topics-card__more {
    display: inline-block;
    margin: 0 0 1.25rem;
    font-weight: 500;
    color: #1AA7EC;
}

@media (max-width: 767px) {
    .topics-gen {
        margin-bottom: 3rem;
        padding: 1.25rem 1rem;
        border-radius: 0.75rem;
    }

    .topics-gen__field,
    .topics-gen__field_wide,
    .topics-gen__submit {
        flex: 1 1 100%;
    }

    .topics-card {
        padding: 1.25rem;
    }

    .topics-card__title {
        font-size: 1.375rem;
        line-height: 1.875rem;
    }

    .topics-card__text {
        font-size: 1.0625rem;
        line-height: 1.625rem;
    }

    .topics-card__actions .btn {
        flex: 1 1 auto;
    }

    .topics-card__submit {
        margin-left: 0;
    }

    .topics-list,
    .topics-subjects {
        grid-template-columns: 1fr;
    }

    .topics-page__question p {
        font-size: 1.0625rem;
        line-height: 1.625rem;
    }

    .topics-steps li {
        padding-left: 2.5rem;
    }
}
