/**
 * sidebar-top.css — оформление сайдбар-виджета «Топовые переводы» (BookTopWidget).
 *
 * Все правила скоупятся под .sidebar-top-widget, чтобы не задеть другие
 * элементы сайдбара (рядом работают другие правки). Стиль выдержан в духе
 * Bootstrap 2.1.0: радиус 4px, акцент проекта #0088cc.
 *
 * Тёмная тема — здесь же, через body.dark-theme (css/dark-theme.css не трогаем).
 */

.sidebar-top-widget {
    font-family: 'Exo 2', Arial, sans-serif;
    margin-bottom: 14px;
}

.sidebar-top-widget h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.2;
}

/* ---------- Вкладки-пилюли ---------- */
.sidebar-top-widget .stw-tabs {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-top-widget .stw-tab {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f1f3f5;
    color: #2b2f33;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-top-widget .stw-tab:hover,
.sidebar-top-widget .stw-tab:focus {
    background: #e4e7ea;
    color: #1b1f24;
    text-decoration: none;
}

.sidebar-top-widget .stw-tab.is-active {
    background: #1b1f24;
    color: #fff;
}

.sidebar-top-widget .stw-tab.is-active:hover,
.sidebar-top-widget .stw-tab.is-active:focus {
    background: #1b1f24;
    color: #fff;
}

/* ---------- Список книг ---------- */
.sidebar-top-widget .stw-panel {
    display: none;
}

.sidebar-top-widget .stw-panel.is-active {
    display: block;
}

.sidebar-top-widget .stw-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-top-widget .stw-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    line-height: 1.25;
}

.sidebar-top-widget .stw-item + .stw-item {
    border-top: 1px solid #f0f1f3;
}

/* Номер / медаль */
.sidebar-top-widget .stw-num {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #0088cc;
    background: #eef6fb;
    border: 1px solid transparent;
}

.sidebar-top-widget .stw-num.stw-gold {
    color: #9a7400;
    background: #fff7df;
    border-color: #e3b33a;
}

.sidebar-top-widget .stw-num.stw-silver {
    color: #6c7378;
    background: #f4f6f7;
    border-color: #b6bdc2;
}

.sidebar-top-widget .stw-num.stw-bronze {
    color: #8a5320;
    background: #fbf0e6;
    border-color: #cd853f;
}

/* Обложка */
.sidebar-top-widget .stw-cover {
    flex: 0 0 auto;
    width: 32px;
    height: 44px;
    border-radius: 3px;
    object-fit: cover;
    background: #e9ecef;
    border: 1px solid #e0e3e6;
}

/* Заголовок книги */
.sidebar-top-widget .stw-title {
    flex: 1 1 auto;
    min-width: 0;
    color: #6c757d;
    font-size: 13.5px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidebar-top-widget .stw-title:hover,
.sidebar-top-widget .stw-title:focus {
    color: #0088cc;
    text-decoration: none;
}

/* Подвал виджета */
.sidebar-top-widget .stw-footer {
    margin: 12px 0 0;
    font-size: 11px;
    color: #8a9097;
}

.sidebar-top-widget .stw-footer a {
    color: #0088cc;
}

.sidebar-top-widget .stw-footer .stw-footer-extra {
    display: block;
    margin-bottom: 4px;
}

/* ---------- Тёмная тема ---------- */
body.dark-theme .sidebar-top-widget .stw-tab {
    background: #20262c;
    color: #c8cdd2;
}

body.dark-theme .sidebar-top-widget .stw-tab:hover,
body.dark-theme .sidebar-top-widget .stw-tab:focus {
    background: #2a3138;
    color: #fff;
}

body.dark-theme .sidebar-top-widget .stw-tab.is-active {
    background: #0a0c0f;
    color: #fff;
}

body.dark-theme .sidebar-top-widget .stw-item + .stw-item {
    border-top-color: #262c32;
}

body.dark-theme .sidebar-top-widget .stw-num {
    color: #4db6e8;
    background: #16242d;
}

body.dark-theme .sidebar-top-widget .stw-num.stw-gold {
    color: #f0c552;
    background: #2c2410;
    border-color: #b08a26;
}

body.dark-theme .sidebar-top-widget .stw-num.stw-silver {
    color: #c2c8cd;
    background: #23282d;
    border-color: #767d83;
}

body.dark-theme .sidebar-top-widget .stw-num.stw-bronze {
    color: #d99a5e;
    background: #2a1f16;
    border-color: #9c6a3a;
}

body.dark-theme .sidebar-top-widget .stw-cover {
    background: #2a3138;
    border-color: #30373d;
}

body.dark-theme .sidebar-top-widget .stw-title {
    color: #9aa1a8;
}

body.dark-theme .sidebar-top-widget .stw-title:hover,
body.dark-theme .sidebar-top-widget .stw-title:focus {
    color: #4db6e8;
}

body.dark-theme .sidebar-top-widget .stw-footer {
    color: #7a8088;
}

body.dark-theme .sidebar-top-widget .stw-footer a {
    color: #4db6e8;
}
