/* Публичный каталог авторов: поиск, карточки и серверная пагинация. */

.authors-intro {
    padding: 72px 0 54px;
    background: linear-gradient(180deg, rgba(10, 209, 201, 0.08), transparent);
}

.authors-intro .eyebrow {
    display: block;
    margin-bottom: 14px;
    color: var(--accent);
}

.authors-intro h1 {
    max-width: 720px;
    margin-bottom: 16px;
    font-family: var(--serif);
    font-size: clamp(34px, 4.6vw, 52px);
    line-height: 1.08;
}

.authors-intro>div>p {
    max-width: 620px;
    color: var(--text-muted);
    font-size: 17px;
}

.author-search {
    max-width: 720px;
    margin-top: 34px;
}

.author-search label {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 600;
}

.author-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-search input {
    min-width: 0;
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border: 1.5px solid rgba(var(--rule-rgb), 0.18);
    border-radius: 10px;
    outline: none;
    background: var(--surface-raised);
    color: var(--text);
    font: inherit;
}

.author-search input:focus {
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 3px rgba(10, 209, 201, 0.14);
}

.author-search .btn {
    height: 46px;
}

.search-reset {
    padding: 10px 4px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.authors-results {
    padding: 48px 0 96px;
}

.authors-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.authors-summary {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 12px;
}

.authors-sort {
    display: flex;
    align-items: baseline;
    flex-shrink: 0;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12px;
}

.authors-sort-label {
    margin-right: 2px;
    color: var(--text-muted);
}

.sort-option {
    padding: 5px 11px;
    border: 1px solid rgba(var(--rule-rgb), 0.15);
    border-radius: 999px;
    color: var(--text-muted);
}

a.sort-option:hover {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}

.sort-option.current {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
    color: var(--text-on-brand);
}

/* Расшифровка формулы собирается из RATING_WEIGHTS во вьюхе: заказчик
   меняет веса настройкой, и подпись обязана меняться вместе с ними. */
.rating-formula {
    max-width: 780px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.authors-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.author-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 210px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(var(--rule-rgb), 0.08);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: 0 18px 38px -30px rgba(22, 26, 51, 0.5);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.author-card:hover {
    transform: translateY(-3px);
    border-color: rgba(10, 168, 162, 0.25);
    box-shadow: 0 24px 42px -28px rgba(22, 26, 51, 0.55);
}

.author-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: var(--text-on-brand);
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
}

.author-card-main {
    min-width: 0;
}

/* Место и баллы — правая колонка карточки. Числа моноширинные, чтобы
   в списке они стояли столбиком и сравнивались взглядом. */
.author-rank {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-left: 8px;
    text-align: right;
}

.author-place,
.author-points {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.author-place {
    padding: 7px 11px 6px;
    border-radius: 10px;
    background: rgba(var(--rule-rgb), 0.06);
    color: var(--text);
    font-family: var(--mono);
    font-size: 19px;
    font-weight: 700;
}

.author-place-caption,
.author-points-caption {
    margin-top: 4px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.author-points {
    padding-right: 2px;
    color: var(--brand-dark);
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
}

/* Тройку лидеров выделяем плашкой, а не медалью: золото-серебро-бронза
   в брендовой палитре выглядит чужеродно, и три оттенка одного акцента
   читаются как «первые» ничуть не хуже. */
.author-card-top {
    border-color: rgba(10, 168, 162, 0.3);
}

.author-card-top .author-place {
    background: var(--brand-dark);
    color: var(--text-on-brand);
}

.author-card-top .author-place .author-place-caption {
    color: var(--text-on-brand);
    opacity: .75;
}

.author-name {
    display: block;
    margin: 3px 0 7px;
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
}

.author-bio {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.author-bio-empty {
    font-style: italic;
    opacity: 0.75;
}

.author-stats {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    align-self: end;
    gap: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(var(--rule-rgb), 0.08);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 11px;
}

.author-stats b {
    color: var(--text);
}

.author-arrow {
    margin-left: auto;
    color: var(--brand-dark);
    font-size: 17px;
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity .2s, transform .2s;
}

.author-card:hover .author-arrow {
    opacity: 1;
    transform: translateX(0);
}

.authors-empty {
    grid-column: 1 / -1;
    padding: 58px 24px;
    border: 1.5px dashed rgba(var(--rule-rgb), 0.2);
    border-radius: var(--radius);
    text-align: center;
}

.authors-empty h2 {
    margin-bottom: 10px;
    font-family: var(--serif);
    font-size: 24px;
}

.authors-empty p {
    margin: 0 auto 22px;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 38px;
}

.page-link,
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(var(--rule-rgb), 0.15);
    border-radius: 9px;
    background: var(--surface-raised);
    color: var(--text-muted);
    font-size: 13px;
}

a.page-link:hover {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}

.page-link.current {
    border-color: var(--brand-dark);
    background: var(--brand-dark);
    color: var(--text-on-brand);
}

.page-direction {
    min-width: auto;
}

.page-ellipsis {
    border-color: transparent;
    background: transparent;
}

/* На одну колонку переходим раньше, чем раньше: в карточке теперь четыре
   блока в ряд — аватар, имя, место и баллы, — и на планшете двум колонкам
   не хватало ширины на само имя автора. */
@media (max-width: 900px) {
    .authors-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .authors-intro {
        padding: 48px 0 40px;
    }

    .author-search-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .author-search input {
        flex-basis: 100%;
    }

    .author-search .btn {
        flex: 1;
        justify-content: center;
    }

    .authors-results {
        padding: 38px 0 64px;
    }

    .authors-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .authors-summary {
        flex-direction: column;
        gap: 5px;
    }

    .author-card {
        min-height: 0;
        padding: 20px;
    }

    /* Место и баллы уезжают в строку под именем: в узкой карточке колонка
       справа съедает половину ширины у самого имени автора. */
    .author-rank {
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        grid-column: 1 / -1;
        gap: 14px;
        padding-left: 0;
        text-align: left;
    }

    .author-place,
    .author-points {
        align-items: baseline;
        flex-direction: row;
        gap: 6px;
    }

    .author-place-caption,
    .author-points-caption {
        margin-top: 0;
    }

    .author-stats {
        gap: 10px;
        justify-content: space-between;
        font-size: 10px;
    }

    .author-arrow {
        display: none;
    }

    .page-direction {
        min-width: 40px;
    }

    .page-direction-label {
        display: none;
    }
}
