/* ====== E-books listing (fansipan) ====== */
.ebk-wrap {
    padding: 40px 0 72px;
    font-family: var(--font-shell);
}

/* ---- Hero ---- */
.ebk-hero {
    text-align: center;
    margin-bottom: 32px;
}

.ebk-hero__title {
    margin: 0 0 10px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.3;
    padding-bottom: .12em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #DB1F1F 0%, #9D0B0F 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.ebk-hero__desc {
    margin: 0 auto;
    max-width: 640px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted, #6b7280);
}

/* ---- Toolbar ---- */
.ebk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.ebk-search {
    position: relative;
    flex: 1 1 360px;
    max-width: 480px;
}

.ebk-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted, #6b7280);
    font-size: 14px;
}

.ebk-search input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--line, #e6e8ee);
    border-radius: var(--radius-pill, 999px);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}

.ebk-search input:focus {
    border-color: var(--brand, #db1f1f);
}

.ebk-sort {
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line, #e6e8ee);
    border-radius: var(--radius-pill, 999px);
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.ebk-search__btn {
    height: 46px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-pill, 999px);
    background: var(--brand, #db1f1f);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
}

.ebk-search__btn:hover {
    background: var(--brand-dark, #b3141a);
}

/* ---- Pills lọc chủ đề ---- */
.ebk-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 36px;
}

.ebk-pill {
    padding: 8px 20px;
    border-radius: var(--radius-pill, 999px);
    background: #fff;
    border: 1px solid var(--line, #e6e8ee);
    color: var(--ink, #252525);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}

.ebk-pill:hover {
    border-color: var(--brand, #db1f1f);
    color: var(--brand, #db1f1f);
}

.ebk-pill.is-active {
    background: var(--brand, #db1f1f);
    border-color: var(--brand, #db1f1f);
    color: #fff;
}

/* ---- Grid ---- */
.ebk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ebk-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(10, 21, 41, .06));
    border: 1px solid var(--line, #e6e8ee);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.ebk-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(10, 21, 41, .12));
}

.ebk-card__media {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f3f4f6;
}

.ebk-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ebk-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill, 999px);
    background: rgba(219, 31, 31, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ebk-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

.ebk-card__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink, #252525);
}

.ebk-card__desc {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted, #6b7280);
    flex: 1;
}

.ebk-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ebk-card__meta {
    font-size: 13px;
    color: var(--muted, #6b7280);
    font-weight: 600;
}

.ebk-card__meta i {
    color: var(--brand, #db1f1f);
    margin-right: 4px;
}

.ebk-card__btn {
    padding: 10px 24px;
    border-radius: var(--radius-pill, 999px);
    background: var(--brand, #db1f1f);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}

.ebk-card__btn:hover {
    background: var(--brand-dark, #b3141a);
    color: #fff;
}

.ebk-card__btn.is-disabled {
    background: #cbd0d8;
    cursor: default;
    pointer-events: none;
}

/* ---- Pagination + empty ---- */
.ebk-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.ebk-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--muted, #6b7280);
    font-size: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .ebk-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .ebk-grid { grid-template-columns: 1fr; }
    .ebk-hero__title { font-size: 26px; }
    .ebk-toolbar { flex-direction: column; align-items: stretch; }
    .ebk-search { max-width: none; }
}
