/* ============================================================
   catalog.css — страницы каталога «Авторы» и «Поэты» (этап 5.4-M)
   Алфавитный список, фильтр по буквам, пагинация.
   Базовые переменные и фон — из styles.css.
   ============================================================ */

html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- Шапка страницы ---------- */
.catalog-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2.2rem, 6vw, 4.2rem) 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(60% 80% at 12% 0%, rgba(240, 178, 122, 0.16), transparent 60%),
        radial-gradient(55% 70% at 88% 10%, rgba(102, 126, 234, 0.18), transparent 60%),
        linear-gradient(160deg, rgba(22, 26, 35, 0.9), rgba(11, 14, 19, 0.96));
}
.catalog-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 35%);
}
.catalog-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
}
.catalog-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(240, 178, 122, 0.35);
    background: rgba(240, 178, 122, 0.08);
    color: #f0b27a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.catalog-title {
    margin: 0.85rem 0 0.4rem;
    font-size: clamp(2rem, 5vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    background: linear-gradient(120deg, #f7f9fc 25%, #f0b27a 70%, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.catalog-subtitle {
    margin: 0;
    max-width: 720px;
    color: #aab7c6;
    font-size: clamp(0.98rem, 1.6vw, 1.12rem);
    line-height: 1.55;
}
.catalog-stats {
    margin-top: 1rem;
    color: #8fa3b8;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}

/* ---------- Контейнер ---------- */
.catalog-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.6rem 1.5rem 3.2rem;
}

/* ---------- Буквы ---------- */
.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.35rem;
}
.catalog-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.catalog-letter {
    min-width: 38px;
    min-height: 38px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #9fb0c1;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.catalog-letter:hover {
    color: #f0d3b0;
    background: rgba(240, 178, 122, 0.1);
    border-color: rgba(240, 178, 122, 0.35);
}
.catalog-letter.is-active {
    color: #131820;
    background: linear-gradient(135deg, #f6c48f, #f0a35f);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(240, 163, 95, 0.28);
}

/* ---------- Сетка карточек ---------- */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}
.catalog-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.15rem 0.9rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(160deg, rgba(28, 33, 43, 0.92), rgba(14, 17, 23, 0.96));
    color: inherit;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.catalog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(240, 178, 122, 0.5);
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.42);
}
.catalog-card:focus-visible {
    outline: 2px solid #f0b27a;
    outline-offset: 3px;
}
.catalog-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(240, 178, 122, 0.3), rgba(102, 126, 234, 0.35));
    border: 2px solid rgba(240, 178, 122, 0.4);
    flex: 0 0 auto;
}
.catalog-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.catalog-avatar-initial {
    color: #fdf3e7;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
/* поэты — портретные карточки */
.catalog-card--poet .catalog-avatar {
    width: 100%;
    max-width: 190px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
}
.catalog-name {
    margin-top: 0.25rem;
    color: #f2f6fa;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.catalog-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #8fa3b8;
    font-size: 0.8rem;
}
.catalog-meta i { color: #f0b27a; }

/* ---------- Состояния ---------- */
.catalog-loading,
.catalog-empty,
.catalog-error {
    grid-column: 1 / -1;
    padding: 2.2rem 1rem;
    text-align: center;
    color: #9fb0c1;
    font-size: 0.98rem;
}
.catalog-loading i { color: #f0b27a; margin-right: 0.45rem; }
.catalog-error { color: #ffb3b3; }
.catalog-empty { display: none; }

/* ---------- Пагинация ---------- */
.catalog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.9rem;
}
.catalog-page-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 0.35rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #b9c6d3;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.catalog-page-btn:hover:not(:disabled) {
    color: #f0d3b0;
    background: rgba(240, 178, 122, 0.1);
    border-color: rgba(240, 178, 122, 0.35);
}
.catalog-page-btn.is-active {
    color: #131820;
    background: linear-gradient(135deg, #f6c48f, #f0a35f);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(240, 163, 95, 0.28);
}
.catalog-page-btn:disabled { opacity: 0.35; cursor: default; }
.catalog-page-gap { color: #6f7f90; padding: 0 0.2rem; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 640px) {
    .catalog-hero { padding: 1.6rem 1rem 1.4rem; }
    .catalog-container { padding: 1.1rem 0.9rem 2.4rem; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .catalog-card { padding: 0.8rem 0.55rem 0.85rem; border-radius: 16px; }
    .catalog-avatar { width: 72px; height: 72px; }
    .catalog-card--poet .catalog-avatar { max-width: 100%; border-radius: 14px; }
    .catalog-name { font-size: 0.92rem; }
    .catalog-meta { font-size: 0.74rem; }
    .catalog-letter { min-width: 34px; min-height: 34px; font-size: 0.82rem; }
    .catalog-page-btn { min-width: 38px; min-height: 38px; }
}

/* ---------- Поиск по имени (B0.2) ---------- */
.catalog-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 200px;
}
.catalog-search > i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8fa0;
    pointer-events: none;
}
.catalog-search input {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.9rem 0.55rem 2.4rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 11, 15, 0.55);
    color: #eef2f6;
    font-size: 0.95rem;
}
.catalog-search input::placeholder { color: #6b7a89; }
.catalog-search input:focus {
    outline: none;
    border-color: rgba(240, 178, 122, 0.7);
    box-shadow: 0 0 0 3px rgba(240, 178, 122, 0.15);
}
