/* ---------- автор ---------- */
.author-head { display: grid; gap: var(--s4); align-items: start; padding-block: var(--s4) var(--s5); }
.author-head__pic { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: var(--purple); display: grid; place-items: center; font: 600 40px var(--font-text); }
.author-head__pic img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 720px) { .author-head { grid-template-columns: 160px 1fr; gap: var(--s6); } .author-head__pic { width: 160px; height: 160px; font-size: 54px; } }
.bio.is-clamped .bio__text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bio__text p + p { margin-top: .6em; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--s4); font-weight: 800; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- темы ---------- */
.tile__link { color: inherit; text-decoration: none; }
.tile__link::after { content: ""; position: absolute; inset: 0; }
.tile { position: relative; }
.tile .chips { position: relative; z-index: 2; }

/* ---------- поиск: подсказки и подсветка ---------- */
mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.header-search .search, .hero__search .search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70; }
.suggest:empty { display: none; }
.hero__search { position: relative; }
.suggest__list, .suggest__empty { list-style: none; margin: 0; padding: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.suggest__empty { padding: var(--s3) var(--s4); color: var(--ink-soft); font-weight: 700; }
.suggest__list a { display: flex; gap: var(--s2); align-items: baseline; min-height: 44px; padding: var(--s2) var(--s3); text-decoration: none; color: var(--ink); border-radius: var(--r-sm); font-weight: 700; }
.suggest__list a:hover, .suggest__list a:focus-visible { background: #f3f2ea; }
.suggest__kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); min-width: 5.2em; }

/* Список раздела: ряд тем сверху, остальные фильтры свёрнуты */
.page-head--section h1, .page-head--section h2 { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.page-head__icon { width: 34px; height: 34px; color: var(--accent); }
.quick-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.quick-filters__label { font-weight: 800; font-size: 14px; color: var(--ink-soft); margin-right: var(--s1); }
.quick-filters .chip { min-height: 40px; padding-inline: var(--s4); font-size: 15px; font-weight: 700; text-decoration: none; }
.more-filters { margin-bottom: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.more-filters > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s4); font-weight: 800; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary .icon { width: 20px; height: 20px; color: var(--accent); }
.more-filters__n { margin-left: auto; font-weight: 600; font-size: 14px; }
.more-filters__body { padding: 0 var(--s4) var(--s4); border-top: 1px solid var(--line); }
.more-filters .filters { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); padding-top: var(--s4); }
.active-filters { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); }
.catalog { display: block; }
.letters-nav { margin-bottom: var(--s5); }
.section--tight { padding-top: 0; }
.letter-h { margin-bottom: var(--s3); }
.tile__chips { margin-top: 10px; }
.subtopics { margin-bottom: var(--s4); }
.collection-text { max-width: 68ch; margin-bottom: var(--s5); color: var(--ink-soft); }
@media (max-width: 480px) { .page-head--section h1 { flex-wrap: nowrap; gap: 10px; } .page-head__icon { width: 28px; height: 28px; flex: none; } }

/* Компактная шапка страниц-каталогов: небольшой заголовок, без значка и числа, мелкий подзаголовок */
.page-head--section { padding-block: var(--s3) var(--s3); }
.page-head--section h1, .page-head--section h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
.page-head--section .page-head__icon, .page-head--section .count-h1 { display: none; }
.page-head--section p { margin-top: 2px; font-size: 13.5px; line-height: 1.45; max-width: 70ch; }
.wrap--list > .page-head--section:first-child { padding-top: var(--s4); }

/* ---------- Каталог: вкладки порядка, вид, колонка фильтров справа (как «друзья» во ВКонтакте) ---------- */
.catalog-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.sort-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.sort-tabs::-webkit-scrollbar { display: none; }
.sort-tab { padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.sort-tab:hover { color: var(--ink); }
.sort-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 800; }
.view-toggle { display: flex; gap: 2px; flex: none; }
.view-toggle__btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-soft); }
.view-toggle__btn .icon { width: 20px; height: 20px; }
.view-toggle__btn:hover { background: #efeee4; }
.view-toggle__btn.is-on { background: var(--mint); color: var(--accent); }
.catalog-layout { display: flex; flex-direction: column; }
.catalog-filters { order: -1; }
.cards--list { grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 560px) {
  .cards--list .card { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
  .cards--list .card__cover { aspect-ratio: auto; height: 100%; min-height: 120px; }
  .cards--list .card__lead { display: block; }
}
@media (min-width: 1100px) {
  .catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s5); align-items: start; }
  .catalog-filters { order: 0; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
  .catalog-filters .more-filters { border: 0; background: none; margin: 0; }
  .catalog-filters .more-filters > summary { display: none; }
  .catalog-filters .more-filters__body { border: 0; padding: 0; }
  .catalog-filters .more-filters .filters { grid-template-columns: 1fr; padding: 0; gap: var(--s3); background: none; border: 0; }
  .catalog-filters .filters fieldset { margin: 0; }
  .catalog-filters .filters legend { font-size: 13px; color: var(--ink-soft); margin-bottom: 2px; }
  .catalog-filters .check { min-height: 30px; font-size: 14px; font-weight: 600; }
  .wrap--list .catalog-main .cards { grid-template-columns: repeat(3, 1fr); }
  .wrap--list .catalog-main .cards--list { grid-template-columns: 1fr; }
}

/* Длинные фильтры: первые 6, остальное за кнопкой; при большом числе — поиск внутри фильтра */
.facet-list .is-extra { display: none; }
[data-facet].is-open .facet-list { max-height: 260px; overflow-y: auto; }
[data-facet].is-open .facet-list .is-extra:not(.is-hidden), [data-facet].is-searching .facet-list .is-extra:not(.is-hidden) { display: flex; }
.facet-list .check.is-hidden { display: none !important; }
.facet-find { min-height: 32px; height: 32px; font-size: 14px; margin: 2px 0 6px; }
.facet-more { border: 0; background: none; padding: 4px 0; font: 700 13px var(--font-ui); color: var(--link); cursor: pointer; text-align: left; }
.facet-more:hover { text-decoration: underline; }

/* ---------- Авторы и темы в каркасе каталога: поиск и буквы справа ---------- */
.side-find .facet-find { width: 100%; margin: 0 0 var(--s3); }
.side-find .side-h { margin: var(--s3) 0 var(--s2); font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.letters-side { display: flex; flex-wrap: wrap; gap: 4px; }
.letters-side a { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.letters-side a:hover { border-color: var(--accent); color: var(--accent); }
.authors--cat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }
.authors--cat .author-pill { padding: var(--s2) var(--s3); gap: var(--s3); height: 100%; }
.authors--cat .author-pill__pic { width: 44px; height: 44px; font-size: 16px; }
.authors--cat .author-pill b { font-size: 14.5px; font-weight: 700; }
.authors--cat .author-pill .muted { font-size: 13px; }
.letter-h { font-size: 20px; margin-bottom: var(--s2); }
.catalog-main .section--tight { padding-block: 0; }
.topic-tiles { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
.topic-tile { padding: var(--s3) var(--s4); display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: var(--s3); align-content: start; }
.topic-tile .tile__img { grid-row: 1 / span 3; width: 72px; height: 72px; aspect-ratio: 1; margin: 0; }
.topic-tile:not(:has(.tile__img)) { grid-template-columns: minmax(0, 1fr); }
.topic-tile b { font-size: 16px; }
.topic-tile .tile__chips { margin-top: 6px; }
[data-live-item][hidden], [data-live-group][hidden] { display: none !important; }
@media (min-width: 640px) { .topic-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .authors--cat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .letters-side { max-width: 220px; }
}
.sort-tab .tab-n { margin-left: 3px; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
.sort-tab.is-on .tab-n { color: inherit; }
@media (min-width: 1100px) { .wrap--list > .cards--list { grid-template-columns: 1fr; } }

/* Страница автора в общем виде: компактная шапка, вкладки и плитки как в каталоге */
.author-head { padding-block: var(--s3) var(--s4); gap: var(--s4); }
.author-head__pic { width: 88px; height: 88px; font-size: 30px; }
.author-head h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
.author-head .work-lead { font-size: 15px; }
@media (min-width: 720px) { .author-head { grid-template-columns: 88px 1fr; gap: var(--s5); } .author-head__pic { width: 88px; height: 88px; font-size: 30px; } }
@media (min-width: 1100px) { .wrap--list > .cards--list { grid-template-columns: 1fr; } }

/* ---------- Азбука, цифры, слоги, прописи: тот же каркас, что у каталога (вкладки сверху, колонка справа) ---------- */
.hub-side { order: 1; margin-top: var(--s4); }
.hub-side .side-sec { margin-bottom: var(--s4); }
.hub-side .side-h { margin: 0 0 var(--s2); font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font: 600 14px var(--font-ui); }
.side-link:hover { background: #efeee4; }
.side-link .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }
.hub-side .learn-progress { margin: 0; font-size: 14px; padding: 0 8px; }
.learn-legend--col { display: grid; gap: 6px; margin: 0; padding: 0 8px; font-size: 14px; font-weight: 600; }
.learn-legend--col .learn-dot { margin-right: 6px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.18); }
.hub-sec { margin: 0 0 var(--s5); padding: 0; }
.hub-sec > h2 { font-size: 20px; margin: 0 0 var(--s3); }
.hub-sec[hidden], [data-hub-kind][hidden] { display: none !important; }
@media (min-width: 1100px) {
  .hub-side { order: 0; margin-top: 0; position: sticky; top: 76px; align-self: start; }
  .learn-grid--hub { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
@media (min-width: 1100px) {
  .learn-grid--digits.learn-grid--hub { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
.learn-grid--hub .learn-tile__sub { font-size: 11.5px; overflow-wrap: anywhere; hyphens: auto; }
@media (min-width: 1100px) {
  .learn-grid--letters.learn-grid--hub, .learn-grid--digits.learn-grid--hub.learn-grid--print { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
