/* ---------- Books (the books page, its tiles and the book sheet) ---------- */


.book-tile { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.book-tile__cover { width: 100%; }
.book-tile__blank {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    padding: 12px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 35%, var(--surface-2)), var(--surface-2));
    overflow: hidden;
}
.book-tile__cover .book-tile__image { position: absolute; inset: 0; }
.book-tile__blank strong { font-size: var(--text-md); line-height: 1.2; overflow-wrap: anywhere; }
.book-tile__blank small { color: var(--ink-muted); }
.book-tile__who { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px rgb(0 0 0 / 60%); }
.book-tile .tile__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.books-person { display: flex; align-items: center; gap: 8px; }
.books-person__shelf { margin: 14px 0 8px; font-size: 0.9rem; color: var(--ink-muted); font-weight: 600; }

/* The search under the page title: icon, field, where to look, search (like YouTube's). */
.books-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); width: 100%; }
.books-search > .icon { flex: none; font-size: 1.2rem; color: var(--ink-muted); }
.books-search input[type="search"] { flex: 1 1 220px; min-width: 0; }
.books-search select { flex: 0 0 auto; width: auto; }

/* Goodreads: icon, what to do, the button on the right (under it on phones). */
.books-import { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-6); padding: var(--space-4) var(--space-5); }
.books-import__icon {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--area, var(--accent)) 14%, var(--surface-2));
    color: var(--area, var(--accent));
}
.books-import__icon .icon { width: 22px; height: 22px; }
.books-import__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.books-import__text h2 { margin: 0; font-size: 1rem; }
.books-import__text p { margin: 0; color: var(--ink-muted); line-height: 1.5; font-size: 0.9rem; }
.books-import__text .books-import__done { color: var(--ink); }
.books-import__pick { flex: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); }

.book-sheet { width: min(640px, 100%); }
.book-sheet__about { display: flex; gap: 16px; align-items: flex-start; }
.book-sheet__cover { width: 110px; flex: none; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--tile-radius, 10px); border: 1px solid var(--line); }
.book-sheet__facts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.book-sheet__facts p { margin: 0; }
.book-sheet__subtitle { color: var(--ink-muted); }
.book-sheet__genres { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px !important; }
.book-sheet__description {
    margin: 0;
    color: var(--ink-muted);
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-sheet__description.is-open { display: block; }
.book-sheet__states { flex-wrap: wrap; }
.book-sheet__pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.book-sheet__pages label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--ink-muted); }
.book-sheet__pages input { width: 7.5em; }
.book-progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.book-progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.2s ease; }
.book-sheet__stars { display: flex; align-items: center; gap: 2px; }
.book-sheet__stars > span { margin-right: 8px; color: var(--ink-muted); font-size: 0.9rem; }
.book-sheet__note { display: flex; flex-direction: column; gap: 4px; }
.book-sheet__note > span { font-size: 0.9rem; color: var(--ink-muted); }
.book-sheet__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.book-sheet__others-title { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: var(--text-md); }
.book-sheet__others { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.book-sheet__others li { display: flex; align-items: center; gap: 10px; }
.book-sheet__others li > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.book-sheet__others small { color: var(--ink-muted); }

@media (max-width: 600px) {
    .books-import { flex-wrap: wrap; }
    .books-import__pick { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .book-sheet__cover { width: 84px; }
}

/* The reading tab of the statistics: books, then manga and light novels, each under a heading. */
.stats-section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 1.15rem; }
.stats-section-title:first-child { margin-top: 0; }

/* Wrapped: the year in books. */
.wrapped__card--books { --w1: #2a1608; --w2: #b5651d; --w3: #f3d9a4; }

/* A cover that didn't load is hidden by shani.js (the tile's own img rule would show it anyway). */
img[data-book-cover][hidden] { display: none !important; }

/* Discover: the shelves as chips, the language switch beside them. */
.books-discover__shelves { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.books-discover__shelves .chips { flex: 1 1 480px; }
.books-discover__shelves .chip .icon { width: 1em; height: 1em; }

/* The book dialog: in Kavita, on its way, or a request. */
.book-sheet__request { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--ink-muted); }
.book-sheet__kavita, .book-sheet__request-button { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-2); }
.book-sheet .prowlarr-search { margin: 0; }

/* ---------- The collection (Shani's own database of titles) ---------- */

.collection-kinds { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.collection-kind { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.collection-kind.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
.collection-note { margin: var(--space-3) 0 var(--space-5); font-size: var(--text-sm); }
.collection-tile { color: inherit; text-decoration: none; }
.collection-tile__sources { font-size: var(--text-xs); }
.collection-more { display: flex; justify-content: center; margin-top: var(--space-5); }
