/* Public bookshelf (books/), on top of style.css. The avatar sits as on the start page. */
main.bookshelf { max-width: 900px; }
.shelf-head { text-align: center; }
.shelf-head h1 { font-size: 16px; margin: 0 0 4px; }
.shelf-head small { color: var(--muted); font-size: 12px; }
.shelf-tools { display: flex; gap: 8px; margin: 22px 0 8px; }
.shelf-tools input, .shelf-tools select {
  font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--rule); background: rgba(0, 0, 0, .2); color: var(--text);
}
.shelf-tools input { flex: 1; min-width: 0; font-size: 16px; } /* 16 px stops iPhone zooming in */
.shelf-tools input:focus, .shelf-tools select:focus { outline: none; border-color: var(--accent); }
.shelf-formats { display: flex; flex-wrap: wrap; gap: 6px; }
.shelf-formats button {
  font: inherit; font-size: 11px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: rgba(0, 0, 0, .12); color: var(--muted);
}
.shelf-formats button.on { border-color: var(--accent); color: var(--accent); }
.shelf-label { font-size: 12px; color: var(--muted); margin: 24px 0 6px; }
.shelf-label b { color: var(--text); }
.shelf-none { color: var(--muted); font-size: 12px; margin: 20px 0 0; }

/* A shelf: every book stands on its own piece of board with no gap in between, so a row
   reads as one shelf, and the rest of the last row is filled with board */
.shelf { display: flex; flex-wrap: wrap; align-items: flex-end; }
.shelf .slot { border-bottom: 8px solid #6b4e37; box-shadow: 0 8px 8px -6px rgba(0, 0, 0, .45); }
.shelf .fill { flex: 1; align-self: stretch; border-bottom: 8px solid #6b4e37; box-shadow: 0 8px 8px -6px rgba(0, 0, 0, .45); }
.shelf button { font: inherit; border: 0; background: none; padding: 0; cursor: pointer; display: block; }
.covers .slot { width: 120px; padding: 16px 8px 0; }
.spines .slot { padding: 12px 2px 0; }
@media (max-width: 599px) { .covers .slot { width: 33.33%; } }

/* Cover, or a plate in the format's colour when there is none */
.bk-cv {
  aspect-ratio: 2 / 3; width: 100%; border-radius: 3px; overflow: hidden; color: #2e3a46;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35); padding: 8px 7px; display: flex; flex-direction: column;
  font-size: 10px; line-height: 1.3; text-align: left; overflow-wrap: break-word;
}
.bk-cv b { font-weight: 700; }
.bk-cv i { font-style: normal; margin-top: auto; font-size: 8px; opacity: .85; }
.bk-cv.img { padding: 0; }
.bk-cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spine {
  writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 700;
  padding: 8px 4px; border-radius: 2px 2px 0 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; box-shadow: inset -3px 0 0 rgba(0, 0, 0, .15);
}

/* The book in a box over the page */
.book-pop { position: fixed; inset: 0; z-index: 10; background: rgba(10, 14, 20, .65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.book-pop[hidden] { display: none; }
.book-box {
  position: relative; background: #3a4652; border-radius: 12px; padding: 18px; width: 100%; max-width: 440px;
  display: flex; gap: 16px; align-items: flex-start; box-shadow: 0 20px 40px rgba(0, 0, 0, .5); font-size: 13px;
}
.book-box .bk-cv { width: 120px; flex: none; }
.book-box b { display: block; font-size: 14px; margin-right: 24px; }
.book-box small { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; }
.book-box .stars { color: var(--accent); letter-spacing: 1px; }
.book-box small.sub { color: var(--text); opacity: .85; margin: -2px 0 4px; } /* the subtitle under the title */
.book-box .close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 18px; cursor: pointer; }
@media (max-width: 599px) {
  .book-box { flex-direction: column; align-items: center; text-align: center; }
  .book-box b { margin-right: 0; }
  .book-box .bk-cv { width: 150px; }
}
.book-box small.person { color: var(--text); opacity: .85; } /* one person per line */
.book-box small.series { color: var(--text); opacity: .85; margin-bottom: 2px; } /* "Fabian Risk, del 2" */
.book-box small.series a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.book-box small.series a:hover { color: var(--accent); }
/* Bokserier showing one series (books/?serie=NAME): "Visar bara … · Visa alla serier" */
.shelf-only { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.shelf-only a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* Bokserier on the bookshelf: the number in the series as a yellow bookmark hanging from the
   top of the cover, a little in from the left, with a shadow so it lies on the cover */
.bk-cv { position: relative; }
.bk-cv .bookmark { position: absolute; left: 8px; top: 0; width: 20px; height: 28px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)) drop-shadow(1px 1px 0 rgba(0, 0, 0, .15)); }
.bk-cv .bookmark span {
  display: block; height: 100%; background: #f2d680; color: #2e3a46; font-size: 10px; font-weight: 700;
  line-height: 20px; text-align: center; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.role { font-style: italic; opacity: .8; } /* the roles besides författare, in parentheses */
.book-box small.search a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.book-box small.search.first { margin-top: 4px; }

/* Start page: the book title in the sentence opens the box */
.now .bk, .now .rec, .now .trk, .now .beer, .now .repo { cursor: pointer; }
.now .bk:focus-visible, .now .rec:focus-visible, .now .trk:focus-visible, .now .beer:focus-visible, .now .repo:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* The record box (start page): the square cover above the text, a link to the record on
   Discogs and the notice from Discogs' API terms in small text */
.book-box.above { flex-direction: column; align-items: center; text-align: center; max-width: 360px; }
.book-box.above b { margin-right: 0; }
.rec-cv { width: 200px; aspect-ratio: 1 / 1; flex: none; border-radius: 3px; overflow: hidden; box-shadow: 0 6px 12px rgba(0, 0, 0, .35); background: #2b333c; }
.rec-cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-box small.src { margin-top: 6px; font-size: 11px; }
.book-box small.src.gap { margin-top: 12px; } /* the track box: a little space before the link */
/* Spotify in the track box: artwork corners and the full logo (icon + wordmark, at least 70 px)
   as Spotify's Design Guidelines ask */
.rec-cv.sp { border-radius: 4px; }
.book-box img.sp-logo { display: block; width: 90px; height: auto; margin: 12px auto 2px; }
.book-box small.src a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.book-box small.legal { font-size: 9px; line-height: 1.5; opacity: .7; margin-top: 6px; }

/* The beer box (start page), like the check-in on Untappd: the heading line, the photo, the
   date, and the Untappd icon as the link (yellow on hover, as on the start page) */
.book-box .checkin { font-size: 13px; line-height: 1.6; margin: 0 24px 12px; }
.book-box .checkin b { display: inline; font-size: 13px; margin: 0; }
.book-box .checkin + .rec-cv { margin: 0 auto; }
.book-box small.checkin-date { margin-top: 10px; font-size: 11px; }
.book-box a.checkin-link { display: inline-block; margin-top: 12px; color: var(--muted); }
.book-box a.checkin-link:hover { color: #ffc000; }
.book-box a.checkin-link svg { width: 26px; height: 26px; display: block; fill: currentColor; }

/* The code box (start page): repository with a padlock (closed red = private, open green =
   public), description, language, stars and forks (Octicons),
   latest commit, language split, and the GitHub icon at the bottom */
.book-box .gh b { display: block; font-size: 14px; margin: 0 24px; }
.book-box .gh .gh-state svg { width: 13px; height: 13px; margin-left: 7px; vertical-align: -1px; fill: currentColor; }
.book-box .gh .gh-lock { color: #ff6b6b; }   /* private: closed padlock, red */
.book-box .gh .gh-unlock { color: #7ee787; } /* public: open padlock, green */
.book-box .gh small.gh-sec { margin-top: 10px; }
.book-box .gh small.gh-msg { font-style: italic; color: var(--text); opacity: .85; }
.book-box .gh .oi { width: 12px; height: 12px; fill: currentColor; vertical-align: -1px; margin-right: 3px; }
.book-box .gh .gh-link { display: inline-block; margin-top: 12px; color: var(--muted); }
.book-box .gh a.gh-link:hover { color: #fff; }
.book-box .gh .gh-link svg { width: 24px; height: 24px; display: block; fill: currentColor; }

/* The description in the book box: four lines, then "Läs mer" opens a box that scrolls */
.book-box .desc-block { margin-bottom: 12px; }
/* From 600 px the description is last in the box, over its full width (bookpop.js, placeDesc) */
.book-box.desc-below { flex-wrap: wrap; row-gap: 4px; }
.book-box.desc-below > .desc-block { flex: 0 0 100%; }
/* With wrapping on, a text column wider than the space beside the cover (a long subtitle) would
   drop below the cover; this keeps it beside the cover and lets it wrap its lines instead */
.book-box.desc-below > .bk-cv + div { flex: 1 1 0; min-width: 0; }
.book-box small.desc { color: var(--text); opacity: .85; margin-top: 8px; line-height: 1.6; font-style: italic; white-space: pre-line; }
.book-box small.desc.short { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-box small.desc.open { max-height: 16em; overflow-y: auto; padding-right: 6px; }
.book-box small[hidden] { display: none; }
