/**
 * Каталог Литрес — витрина партнёрской программы.
 * Переиспует базовые классы карточки книги (.ebr-pd__*), добавляя своё:
 * сетку плиток, кнопки перехода на Литрес и блок маркировки рекламы.
 */

.ebr-lt {
    margin: 40px 0 60px;
}

.ebr-lt__title {
    margin: 14px 0 8px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: #11142D;
}

.ebr-lt__lead,
.ebr-lt__count {
    max-width: 720px;
    margin: 0 0 26px;
    font-size: 16px;
    line-height: 1.6;
    color: #55527A;
}

.ebr-lt__author {
    font-size: 16px;
    font-weight: 600;
    color: #4A4863;
}

/* ── Кнопки перехода ─────────────────────────────────────── */
.ebr-lt__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 26px;
    border-radius: 10px;
    background: #EAA451;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ebr-lt__btn:hover {
    background: #d8933f;
    color: #fff;
}

.ebr-lt__btn--ghost {
    background: #fff;
    border: 1px solid #E3E0F3;
    color: #11142D;
}

.ebr-lt__btn--ghost:hover {
    background: #F7F6FF;
    border-color: #C9C6E4;
    color: #11142D;
}

/* ── Сетка книг ──────────────────────────────────────────── */
.ebr-lt__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 26px 20px;
}

.ebr-lt__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.ebr-lt__tile_img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: #F4F3FA;
    box-shadow: 0 8px 20px rgba(17, 20, 45, 0.10);
}

 /* Названия разной длины: обрезаем до двух строк, иначе цены пляшут по сетке. */
.ebr-lt__tile_name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 12px;
    min-height: 2.7em;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #11142D;
}

.ebr-lt__tile_author {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-size: 13px;
    color: #8B89A6;
}

.ebr-lt__tile_price {
    margin-top: auto;
    padding-top: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #11142D;
}

 /* На пёстрых обложках бейдж терялся — добавляем тень и плотный фон. */
.ebr-lt__tile .ebr-age--tile {
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(17, 20, 45, 0.28);
    border-color: transparent;
}

/* Длинные значения (список форматов) занимают всю строку и переносятся. */
.ebr-lt .ebr-pd__fact--wide {
    grid-column: 1 / -1;
}

.ebr-lt .ebr-pd__fact_value {
    overflow-wrap: anywhere;
}

/* ── Жанры ───────────────────────────────────────────────── */
.ebr-lt__cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.ebr-lt__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid #EFEEF7;
    border-radius: 10px;
    background: #FBFAFF;
    text-decoration: none;
    color: #11142D;
}

.ebr-lt__cat:hover {
    border-color: #EAA451;
    color: #11142D;
}

.ebr-lt__cat_name {
    font-size: 15px;
    font-weight: 600;
}

.ebr-lt__cat_count {
    flex: none;
    font-size: 13px;
    color: #8B89A6;
}

/* ── Пагинация и подвал раздела ──────────────────────────── */
.ebr-lt__pager {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 34px;
    font-size: 15px;
    color: #55527A;
}

.ebr-lt__pager a {
    color: #11142D;
    font-weight: 600;
}

.ebr-lt__related {
    margin-top: 56px;
}

.ebr-lt__related h2 {
    margin: 0 0 22px;
    font-size: 24px;
    font-weight: 700;
}

/* Маркировка рекламы обязательна по 38-ФЗ — её не прячем, но и не кричим. */
.ebr-lt__legal {
    max-width: 780px;
    margin: 34px 0 0;
    padding-top: 16px;
    border-top: 1px solid #F0EEFF;
    font-size: 13px;
    line-height: 1.6;
    color: #9A98AF;
}

@media screen and (max-width: 768px) {
    .ebr-lt__title {
        font-size: 24px;
    }

    .ebr-lt__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px 14px;
    }
}

/* ── Главная раздела: герой с поиском ────────────────────── */
.ebr-lt__hero {
    margin: 10px 0 46px;
    padding: 54px 48px;
    border-radius: 18px;
    background: linear-gradient(135deg, #171A3A 0%, #2B2560 60%, #3A2E73 100%);
    color: #fff;
}

.ebr-lt__hero_in {
    max-width: 720px;
}

.ebr-lt__hero_kicker {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ebr-lt__hero_title {
    margin: 0 0 14px;
    font-size: 40px;
    line-height: 1.15;
    font-weight: 700;
    color: #fff;
}

.ebr-lt__hero_lead {
    margin: 0 0 26px;
    font-size: 17px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.ebr-lt__hero_links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 18px;
}

.ebr-lt__hero_links a {
    color: #EAA451;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(234, 164, 81, 0.45);
}

.ebr-lt__hero_links a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* ── Поиск ───────────────────────────────────────────────── */
.ebr-lt__search {
    display: flex;
    gap: 10px;
    max-width: 640px;
    margin: 0 0 22px;
}

.ebr-lt__search_input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    border: 1px solid #E3E0F3;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    color: #11142D;
}

.ebr-lt__search_input:focus {
    outline: none;
    border-color: #EAA451;
}

.ebr-lt__search_btn {
    flex: none;
    height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 10px;
    background: #EAA451;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.ebr-lt__search_btn:hover {
    background: #d8933f;
}

.ebr-lt__search--big .ebr-lt__search_input,
.ebr-lt__search--big .ebr-lt__search_btn {
    height: 58px;
}

.ebr-lt__h2 {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 700;
    color: #11142D;
}

@media screen and (max-width: 768px) {
    .ebr-lt__hero {
        padding: 32px 22px;
        border-radius: 14px;
    }

    .ebr-lt__hero_title {
        font-size: 26px;
    }

    .ebr-lt__hero_lead {
        font-size: 15px;
    }

    .ebr-lt__search {
        flex-direction: column;
    }

    .ebr-lt__search_btn {
        width: 100%;
    }
}

/* ── Жанры карточками с фотографией ──────────────────────── */
.ebr-lt__genres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.ebr-lt__genre {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 168px;
    padding: 18px;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #2B2560, #3A2E73);
    isolation: isolate;
}

/* Фото — отдельным слоем, чтобы можно было его масштабировать на наведении. */
.ebr-lt__genre_img {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

.ebr-lt__genre::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(17, 20, 45, 0.28) 0%, rgba(17, 20, 45, 0.58) 45%, rgba(17, 20, 45, 0.92) 100%);
}

.ebr-lt__genre:hover .ebr-lt__genre_img {
    transform: scale(1.07);
}

.ebr-lt__genre:hover {
    color: #fff;
}

.ebr-lt__genre_body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ebr-lt__genre_name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.ebr-lt__genre_count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.ebr-lt__genre--plain::after {
    background: linear-gradient(180deg, rgba(17, 20, 45, 0.1), rgba(17, 20, 45, 0.55));
}

/* Маркировка рекламы в конце страницы — тише основного текста. */
.ebr-lt__legal--soft {
    max-width: 100%;
    margin-top: 46px;
    color: #B6B4C6;
}

@media screen and (max-width: 576px) {
    .ebr-lt__genres {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .ebr-lt__genre {
        min-height: 130px;
        padding: 14px;
    }

    .ebr-lt__genre_name {
        font-size: 15px;
    }
}

/* ── Заголовок раздела со ссылкой ────────────────────────── */
.ebr-lt__h2row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ebr-lt__h2row .ebr-lt__h2 {
    margin: 0;
}

.ebr-lt__h2link {
    flex: none;
    font-size: 15px;
    font-weight: 600;
    color: #EAA451;
    text-decoration: none;
}

.ebr-lt__h2link:hover {
    color: #d8933f;
}

.ebr-lt__h2--sep {
    margin: 46px 0 18px;
}

/* ── Шапка страницы жанра ────────────────────────────────── */
.ebr-lt__head {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 220px;
    margin: 12px 0 30px;
    padding: 28px 32px;
    border-radius: 16px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #2B2560, #3A2E73);
    isolation: isolate;
}

.ebr-lt__head_img {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
}

.ebr-lt__head::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(17, 20, 45, 0.3) 0%, rgba(17, 20, 45, 0.62) 45%, rgba(17, 20, 45, 0.92) 100%);
}

.ebr-lt__head_title {
    margin: 0 0 6px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.ebr-lt__head_count {
    margin: 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

@media screen and (max-width: 768px) {
    .ebr-lt__head {
        min-height: 160px;
        padding: 20px;
    }

    .ebr-lt__head_title {
        font-size: 22px;
    }
}
