/*** Стили карточек книг***/
/* ===== Общие стили ===== */
.abook-card-wrapper {
    margin-bottom: 30px;
}

.abook-card {
    display: flex;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.09);
    transition: all 0.3s ease;
}

.abook-card:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

/* Ссылки */
.abook-card a {
    text-decoration: none;
    color: inherit;
}

.abook-card a:hover {
    text-decoration: underline;
}

/* ===== Десктоп версия ===== */
.desktop-cover {
    flex: 0 0 160px;
    height: 225px;
    margin-right: 30px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff; /* Белый фон вместо серого */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0; /* Тонкая серая рамка */
}

/* Обертка для изображения обложки */
.cover-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Изображение обложки */
.abook-cover-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Счетчик просмотров */
.view-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #ff6b35;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.view-counter .icon-eye {
    margin-right: 0;
    color: white;
    font-size: 0.9rem;
}

.abook-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.abook-header {
    margin-bottom: 15px;
}

.abook-title {
    margin: 0 0 10px 0;
    font-size: 1.35rem;
    color: #2c3e50;
    font-weight: 600;
}

.abook-authors {
    font-size: 1rem;
    color: #495057;
    line-height: 1.5;
}

.abook-authors a:hover {
    color: #3498db;
}

.desktop-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Мобильная версия ===== */
.mobile-cover {
    display: none;
    background: #fff; /* Белый фон */
    border: 1px solid #e0e0e0; /* Тонкая серая рамка */
}

.mobile-content-wrapper {
    display: none;
}

.abook-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .abook-card {
        flex-direction: column;
        padding: 20px;
    }
    
    .desktop-cover {
        display: none;
    }
    
    .desktop-meta {
        display: none;
    }
    
    .mobile-cover {
        display: flex;
        flex: 0 0 33%;
        max-width: 33%;
        height: auto;
        aspect-ratio: 2/3;
        margin-right: 15px;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .mobile-content-wrapper {
        display: flex;
        margin-top: 15px;
    }

    /* Счетчик на мобильных */
    .view-counter {
        bottom: 10px;
        right: 10px;
        padding: 3px 10px;
        font-size: 0.8rem;
    }
}

/* Общие элементы */
.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #555;
}

.icon-calendar,
.icon-folder-open,
.icon-link,
.icon-language,
.icon-eye {
    margin-right: 8px;
    color: #3498db;
}

.meta-item-doi a {
    color: #3498db;
    text-decoration: underline;
    word-break: break-all;
}

.meta-item-doi span {
    margin-right: 5px;
}

/* Мелкие экраны */
@media (max-width: 480px) {
    .mobile-cover {
        flex: 0 0 40%;
        max-width: 40%;
    }
}

.badge {
    background-color: #007bff; /* Синий, как меню */
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* ----------- Строка поиска ----------------- */

/* ===== ОБЩИЕ СТИЛИ ===== */
.js-stools {
  background-color: #f8f9fa;
  padding: 15px;
  margin-bottom: 20px;
  border-left: 4px solid #3498db;
}

.btn-toolbar {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

/* ===== ДЕСКТОП (min-width: 768px) ===== */
@media (min-width: 768px) {
  /* Блок 1 - Поиск (фиксирован в одной строке) */
  .filter-search-bar {
    flex: 1;
    min-width: 0; /* Важно для предотвращения разъезжания */
    display: flex;
  }
  .filter-search-bar .input-group {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
  }
  .filter-search-bar .form-control {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
  }
  .filter-search-bar__button {
    flex-shrink: 0;
    padding: 0 15px;
  }

  /* Блок 2 - Кнопки */
  .filter-search-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 15px;
  }
  .filter-search-actions__button {
    width: 140px;
    padding: 8px 12px;
    box-sizing: border-box;
  }

  /* Блок 3 - Лимит */
  .ordering-select {
    width: 160px;
    margin-left: 15px;
    flex-shrink: 0;
  }
}