/* Рубрикатор каталога в модальном окне (кнопка «Открыть весь каталог»).
   Облик — тот же язык, что у окна входа (landingcss/auth.css): затемнение
   с размытием, карточка с крупным радиусом, круглая кнопка закрытия.
   Переменные --dt-* приходят из landingcss/home.css. */

html.dt-cat-open,
html.dt-cat-open body { overflow: hidden; }

.dt-cat {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    font-family: 'Manrope', 'Inter', var(--dt-font, Arial, sans-serif);
    color: var(--dt-text, #475569);
}
.dt-cat[hidden] { display: none; }
.dt-cat * { box-sizing: border-box; }
/* На странице живёт глобальное «* { margin: 0 auto }»: во флекс-строке
   auto-маржины расталкивают иконку, название и счётчик по всей ширине,
   а текст съезжает в центр. Гасим горизонтальные маржины на весь блок. */
.dt-cat *,
.dt-cat *::before,
.dt-cat *::after { margin-left: 0; margin-right: 0; }
.dt-cat,
.dt-cat__card,
.dt-cat__head,
.dt-cat__body { text-align: left; }

.dt-cat__overlay {
    position: absolute;
    inset: 0;
    margin: 0;
    background: rgba(15, 23, 42, .28);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    animation: dt-cat-fade .24s ease both;
}

.dt-cat__card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    max-height: min(88vh, 860px);
    margin: auto auto;
    padding: 26px 30px 8px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 40px 90px -50px rgba(15, 23, 42, .6);
    animation: dt-cat-rise .28s cubic-bezier(.22, 1, .36, 1) both;
    text-align: left;
}

.dt-cat__close {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--dt-border, #e2e8f0);
    border-radius: 9999px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease;
}
.dt-cat__close:hover { border-color: #cbd5e1; color: var(--dt-accent, #2563eb); }
.dt-cat__close svg { display: block; margin: 0; }

.dt-cat__head { flex: none; padding-right: 52px; }
.dt-cat__title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--dt-ink, #0f172a);
}
.dt-cat__lead { margin: 6px 0 0; font-size: 14px; color: var(--dt-muted, #64748b); }

/* прокручивается только список, шапка с крестиком остаётся на месте */
.dt-cat__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 18px -8px 0;
    margin-left: -8px;
    margin-right: -8px;
    padding: 0 8px 22px;
    scrollbar-width: thin;
}
.dt-cat__sec + .dt-cat__sec { margin-top: 22px; }
.dt-cat__h {
    margin: 0 0 10px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--dt-border, #e2e8f0);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--dt-dim, #94a3b8);
    text-shadow: none;
}
.dt-cat__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 12px;
}
.dt-cat__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--dt-text, #475569);
    text-decoration: none;
}
.dt-cat__item:hover {
    background: #f1f5f9;
    color: var(--dt-ink, #0f172a);
    text-decoration: none;
}
.dt-cat__ico { flex: none; color: var(--dt-accent, #2563eb); }
.dt-cat__flag { flex: none; width: 20px; font-size: 16px; line-height: 1; text-align: center; }
.dt-cat__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.dt-cat__count {
    flex: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dt-dim, #94a3b8);
}
.dt-cat__item:hover .dt-cat__count { color: var(--dt-muted, #64748b); }

@keyframes dt-cat-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes dt-cat-rise {
    from { opacity: 0; transform: translateY(14px) scale(.99) }
    to   { opacity: 1; transform: none }
}

@media (max-width: 767px) {
    .dt-cat { padding: 0; align-items: stretch; }
    .dt-cat__card {
        max-width: none;
        max-height: none;
        height: 100%;
        border: 0;
        border-radius: 0;
        padding: 18px 16px 4px;
    }
    .dt-cat__title { font-size: 20px; }
    .dt-cat__grid { grid-template-columns: 1fr; }
    .dt-cat__item { padding: 11px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .dt-cat__overlay, .dt-cat__card { animation: none; }
}

/* Источник рубрикатора: ссылки живут в разметке ради перелинковки,
   а показывает их модальное окно. */
.dt-cat-src { display: none; }

/* «Все предметы» в шапке внутренней рубрики — вместо бокового блока. */
.dt-cat-hero__nav { margin: 10px 0 0; }
.dt-cat-hero__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--dt-border, #e2e8f0);
    border-radius: 9999px;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    color: var(--dt-ink, #0f172a);
    text-decoration: none;
}
.dt-cat-hero__all:hover {
    border-color: #cbd5e1;
    color: var(--dt-accent, #2563eb);
    text-decoration: none;
}
.dt-cat-hero__all svg { flex: none; color: var(--dt-muted, #64748b); }
.dt-cat-hero__all:hover svg { color: var(--dt-accent, #2563eb); }

/* Боковая колонка «Предметы и разделы» убрана — грид каталога
   (home.css: 300px + 1fr) становится одноколоночным, список анкет
   занимает всю ширину. Класс span9 у контента оставлен: на него завязаны
   мобильные правила home.css. */
.catalog-container.container {
    grid-template-columns: minmax(0, 1fr);
    max-width: 1400px !important;
    margin: 0 auto !important;
}
