/* Preloved Bookstore
   One idea carries the page: a secondhand book is judged by its spine and the
   price pencilled on a sticker inside the cover. Every row is a spine (colour =
   genre family, the same colours as the genre filter) plus a price sticker.
   Everything else is kept quiet so those two things read first. */

:root {
  /* from the logo: its own black, the salmon / mustard / brown of the book stack */
  --black: #000;
  --salmon: #e4a890;
  --sticker: #f0cc60;
  --sticker-held: #e4a890;
  --sticker-sold: #dcdcd4;

  --ink: #1d2b2b;
  --ink-soft: #4b5c5b;
  --page: #e4eae5;
  --paper: #fffdf7;
  --line: #c3cfc7;
  --line-soft: #d8e0da;
  --accent: #a4472d;
  --focus: #12616b;

  /* spine colours, one per genre family */
  --c-romance: #e0907e;
  --c-mystery: #4f7777;
  --c-historical: #b97f3f;
  --c-fantasy: #8a82b8;
  --c-ya: #6ba3cb;
  --c-contemporary: #c4ae94;
  --c-literary: #9c4e61;
  --c-nonfiction: #7f9a5b;
  --c-horror: #3d3944;
  --c-children: #eda55c;
  --c-world: #c26a3b;
  --c-humor: #e9c44f;
  --c-adventure: #4d8f6f;
  --c-none: #c9c9c0;

  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --side: 17.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1rem/1.45 var(--sans);
}

body.lock { overflow: hidden; }

img { display: block; max-width: 100%; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--paper); color: var(--ink); padding: .5rem .9rem; border-radius: 3px;
}
.skip:focus { top: 1rem; }

/* ---- masthead -------------------------------------------------------------- */

.mast {
  background: var(--black);
  color: #fff;
  padding: 1.1rem var(--gutter) 1.5rem;
}

.mast__inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.mast__logo {
  flex: none;
  width: clamp(5.5rem, 14vw, 8.5rem);
  height: auto;
  aspect-ratio: 1;
}

.mast__body { flex: 1; min-width: 0; }

.mast__title {
  margin: 0 0 .6rem;
  font: italic 500 clamp(1.6rem, 4.2vw, 2.6rem)/1.1 var(--serif);
  letter-spacing: -.005em;
}

.search { position: relative; max-width: 36rem; }

.search__input {
  width: 100%;
  height: 3.1rem;
  padding: 0 2.6rem 0 1rem;
  border: 2px solid transparent;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.15rem;
}
.search__input::placeholder { color: #6b7a79; }
.search__input:focus-visible { outline: 3px solid var(--salmon); outline-offset: 2px; }
.search__input::-webkit-search-cancel-button { appearance: none; }

.search__clear {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 2.3rem; height: 2.3rem; border: 0; border-radius: 3px;
  background: transparent; color: var(--ink-soft); font-size: 1.4rem; line-height: 1;
}
.search__clear[hidden] { display: none; }

/* ---- layout ----------------------------------------------------------------- */

.layout {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  gap: 2rem 2.25rem;
  align-items: start;
}

/* ---- filters ---------------------------------------------------------------- */

.filters {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .25rem;
  scrollbar-width: thin;
}

.filters__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  margin-bottom: .25rem;
}

.filters__title { margin: 0; font: 700 1.35rem/1.2 var(--serif); }

.filters__close { display: none; }

.link-btn {
  border: 0; background: none; padding: .15rem 0;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn[hidden] { display: none; }

.facet {
  margin: 0; padding: 1rem 0 1.1rem;
  border: 0; border-top: 1px solid var(--line);
  min-width: 0;
}
.facet__name {
  padding: 0; margin-bottom: .55rem;
  font: 700 1.05rem/1.2 var(--serif);
}
.facet--first { border-top: 0; }

/* availability: a plain radio list, counts on the right */
.radio {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem 0; cursor: pointer;
}
.radio__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio__dot {
  flex: none; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid var(--ink-soft); background: var(--paper);
  display: grid; place-items: center;
}
.radio__input:checked + .radio__dot { border-color: var(--ink); }
.radio__input:checked + .radio__dot::after {
  content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ink);
}
.radio__input:focus-visible + .radio__dot { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio__label { flex: 1; }
.radio__input:checked ~ .radio__label { font-weight: 700; }
.count { color: var(--ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* price */
.price-fields { display: flex; align-items: end; gap: .5rem; }
.field { flex: 1; min-width: 0; display: block; }
.field__label { display: block; font-size: .88rem; color: var(--ink-soft); margin-bottom: .2rem; }
.field__input {
  width: 100%; height: 2.4rem; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper);
}
.field__input::placeholder { color: #7b8a89; }
.price-dash { padding-bottom: .45rem; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2rem; padding: .15rem .65rem;
  border: 1px solid var(--line); border-radius: 1rem; background: var(--paper);
  font-size: .95rem; line-height: 1.2; text-align: left;
}
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed='true'] .count { color: #c9d6d4; }

/* genre tree */
.tree, .kids { list-style: none; margin: 0; padding: 0; }
.tree { display: flex; flex-direction: column; gap: .15rem; }

.fam__row {
  display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0;
  min-height: 2.15rem; padding: .2rem .5rem .2rem .35rem;
  border: 0; border-radius: 3px; background: transparent; text-align: left;
}
.fam__row:hover { background: rgba(255, 253, 247, .7); }
.fam__row[data-state='in'] { background: var(--ink); color: var(--paper); }
.fam__row[data-state='in'] .count { color: #c9d6d4; }
.fam__row[data-state='out'] { background: #f0d6cd; }
.fam__row[data-state='out'] .fam__name { text-decoration: line-through; text-decoration-thickness: 2px; }
.fam__swatch {
  flex: none; width: .55rem; height: 1.3rem; border-radius: 1px;
  background: var(--spine, var(--c-none));
}
.fam__row[data-state='in'] .fam__swatch { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.fam__name { flex: 1; }
.fam--open .fam__row[data-state=''] { font-weight: 700; }

.kids {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin: .25rem 0 .55rem 1.2rem;
  padding-left: .7rem;
  border-left: 3px solid var(--spine, var(--c-none));
}

/* ---- results ---------------------------------------------------------------- */

.results { min-width: 0; }

.results__head {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  margin-bottom: .75rem;
}
.results__count { margin: 0; font: 700 clamp(1.5rem, 3.4vw, 2rem)/1.1 var(--serif); }
.results__updated { margin: .2rem 0 0; font-size: .92rem; color: var(--ink-soft); }
.results__updated .link-btn { margin-left: .35rem; }

.head-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.sort { display: flex; align-items: center; gap: .45rem; }
.sort__label { color: var(--ink-soft); font-size: .95rem; }
.sort__select {
  height: 2.4rem; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper);
}

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 2.4rem; padding: 0 1rem; border-radius: 3px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 500;
}
.btn--open { display: none; }
.btn__badge {
  min-width: 1.35rem; padding: 0 .35rem; border-radius: .7rem;
  background: var(--salmon); color: var(--ink); font-size: .85rem; text-align: center;
}
.btn__badge[hidden] { display: none; }

.active { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.active:empty { display: none; }
.active .chip { background: var(--paper); }
.active .chip__x { font-size: 1.15rem; line-height: 1; color: var(--ink-soft); }

.list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: .75rem;
}

/* ---- a book ------------------------------------------------------------------ */

.book {
  position: relative;
  display: flex; align-items: stretch;
  min-height: 6.4rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}

.book__spine {
  flex: none; width: .8rem;
  background: var(--spine, var(--c-none));
  position: relative;
}
/* the two binding bands near the head and tail of a spine */
.book__spine::before, .book__spine::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: rgba(255, 255, 255, .55);
}
.book__spine::before { top: .55rem; }
.book__spine::after { bottom: .55rem; }

.book__info { flex: 1; min-width: 0; padding: .75rem .5rem .75rem .9rem; }

.book__title {
  margin: 0;
  font: 700 1.2rem/1.2 var(--serif);
  overflow-wrap: anywhere;
}

.book__author {
  display: inline; margin: .2rem 0 0; padding: 0;
  border: 0; background: none; text-align: left;
  color: var(--ink-soft); font-size: 1rem;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
.book__author:hover { color: var(--accent); text-decoration-color: currentColor; }

.book__format { margin: .1rem 0 0; font-size: .88rem; color: var(--ink-soft); }

.book__genres {
  list-style: none; margin: .4rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0 .85rem;
}
.book__genre {
  padding: .1rem 0; border: 0; background: none;
  font-size: .9rem; color: var(--ink-soft);
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.book__genre:hover { color: var(--accent); }

/* the price sticker: the one memorable thing on the page */
.book__price {
  flex: none; align-self: flex-start;
  margin: .8rem .85rem 0 0;
  min-width: 4.6rem;
  padding: .25rem .6rem .3rem;
  background: var(--sticker);
  color: #33322e;
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .18), 1px 2px 3px rgba(60, 50, 20, .22);
  transform: rotate(var(--tilt, -2deg));
  font-family: var(--hand);
  font-weight: 700;
  line-height: 1;
}
.book:nth-child(2n) { --tilt: 1.5deg; }
.book:nth-child(3n) { --tilt: -3deg; }
.book:nth-child(5n) { --tilt: 2.5deg; }

.price__rs { display: block; font-size: .95rem; font-weight: 600; opacity: .75; }
.price__num { display: block; font-size: 2rem; letter-spacing: .01em; }
.price__state { display: block; margin-top: .1rem; font: 700 .85rem/1.1 var(--sans); }

.book[data-status='reserved'] .book__price { background: var(--sticker-held); }
.book[data-status='sold'] .book__price { background: var(--sticker-sold); color: #5a5a54; box-shadow: none; }
.book[data-status='sold'] .price__num { text-decoration: line-through; text-decoration-thickness: 2px; }
.book[data-status='sold'] .book__title { color: var(--ink-soft); }
.book[data-status='sold'] .book__spine { opacity: .55; }
.book[data-status='available'] .price__state,
.book[data-status='unknown'] .price__state { display: none; }
.book--noprice .price__num { font-size: 1.3rem; }

/* spine colours */
[data-spine='romance'] { --spine: var(--c-romance); }
[data-spine='mystery'] { --spine: var(--c-mystery); }
[data-spine='historical'] { --spine: var(--c-historical); }
[data-spine='fantasy'] { --spine: var(--c-fantasy); }
[data-spine='ya'] { --spine: var(--c-ya); }
[data-spine='contemporary'] { --spine: var(--c-contemporary); }
[data-spine='literary'] { --spine: var(--c-literary); }
[data-spine='nonfiction'] { --spine: var(--c-nonfiction); }
[data-spine='horror'] { --spine: var(--c-horror); }
[data-spine='children'] { --spine: var(--c-children); }
[data-spine='world'] { --spine: var(--c-world); }
[data-spine='humor'] { --spine: var(--c-humor); }
[data-spine='adventure'] { --spine: var(--c-adventure); }

/* the single page-load moment: spines rise onto the shelf, left to right */
@keyframes rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.book--intro .book__spine {
  transform-origin: bottom;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

/* ---- states ------------------------------------------------------------------- */

.more { display: block; margin: 1.5rem auto 0; }
.more[hidden] { display: none; }

.notice {
  padding: 2rem 1.25rem; text-align: center;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 3px;
}
.notice__title { margin: 0 0 .35rem; font: 700 1.3rem/1.2 var(--serif); }
.notice p { margin: 0 auto .9rem; max-width: 30rem; color: var(--ink-soft); }
.notice .btn { margin-top: .2rem; }
.notice[hidden] { display: none; }

.foot {
  max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter) 2.5rem;
  color: var(--ink-soft); font-size: .92rem;
}

.scrim { display: none; }

/* ---- narrow screens: filters become a drawer ------------------------------------ */

@media (max-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 0; gap: 0; }

  .results__head { padding-top: 1rem; align-items: center; }
  body { padding-bottom: 4.5rem; }
  /* the Filters button floats at the bottom edge, in thumb reach */
  .btn--open {
    display: inline-flex; position: fixed; z-index: 15;
    left: 50%; bottom: 1rem; transform: translateX(-50%);
    height: 2.9rem; padding: 0 1.4rem; border-radius: 1.5rem;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .35);
  }
  .sort__label { display: none; }

  .filters {
    position: fixed; z-index: 30; inset: 0 auto 0 0;
    width: min(21rem, 90vw); max-height: none;
    padding: 1rem 1.1rem 6rem;
    background: var(--page);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .3);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .filters.is-open { transform: none; visibility: visible; transition: transform .22s ease; }

  .filters__close { display: inline-flex; }
  .filters__apply {
    position: fixed; left: 0; bottom: 0; width: min(21rem, 90vw); z-index: 31;
    padding: .8rem 1.1rem; background: var(--page); border-top: 1px solid var(--line);
  }
  .filters__apply .btn { width: 100%; justify-content: center; height: 2.8rem; }

  .scrim {
    display: block; position: fixed; inset: 0; z-index: 20;
    background: rgba(0, 0, 0, .5);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
}

@media (min-width: 56.01rem) {
  .filters__apply { display: none; }
}

@media (max-width: 34rem) {
  .mast { padding-bottom: 1.2rem; }
  .mast__inner { align-items: flex-start; }
  .mast__title { font-size: 1.5rem; }
  .book__side { margin-right: .65rem; }
  .book__cover { width: 2.8rem; margin-left: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .book--intro .book__spine { animation: none; }
  .filters, .scrim { transition: none; }
}

label.facet__name { display: block; }

/* a legend inside a bordered fieldset renders in the border; float it out so it
   behaves like the headings of the label-based facets */
legend.facet__name { float: left; width: 100%; }
.facet > :not(legend) { clear: both; }

@media (max-width: 56rem) {
  .results__count { font-size: 1.35rem; white-space: nowrap; }
  .results__updated { font-size: .85rem; }
  .sort__select { max-width: 9rem; }
}


/* ---- genre mode, hint, checkbox ---------------------------------------------------- */

.mode { display: inline-flex; border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; margin-bottom: .4rem; }
.mode__btn { border: 0; background: var(--paper); padding: .3rem .9rem; min-height: 2.1rem; }
.mode__btn + .mode__btn { border-left: 1px solid var(--ink); }
.mode__btn[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.hint { margin: 0 0 .5rem; font-size: .9rem; color: var(--ink-soft); }

.fam__head { display: flex; align-items: center; }
.fam__caret {
  flex: none; width: 2.15rem; height: 2.15rem; border: 0; border-radius: 3px;
  background: transparent; color: var(--ink-soft); font-size: 1rem;
}
.fam__caret:hover { background: rgba(255, 253, 247, .7); }

.chip.kid[data-state='in'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.kid[data-state='in'] .count { color: #c9d6d4; }
.chip.kid[data-state='out'] {
  background: #f0d6cd; border-color: #d9a898; color: var(--ink);
  text-decoration: line-through; text-decoration-thickness: 2px;
}
.chip.kid[data-state='out'] .count { color: var(--ink-soft); }
.chip.kid[data-state=''] { background: var(--paper); color: var(--ink); }
.chip--quiet { border-style: dashed; background: transparent; }

.check { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.check__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: none; width: 1.15rem; height: 1.15rem; border: 2px solid var(--ink-soft); border-radius: 3px;
  background: var(--paper); display: grid; place-items: center;
}
.check__input:checked + .check__box { background: var(--ink); border-color: var(--ink); }
.check__input:checked + .check__box::after {
  content: ''; width: .3rem; height: .6rem; margin-top: -2px;
  border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check__input:focus-visible + .check__box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- buttons, bars, toast ---------------------------------------------------------------- */

.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn--ghost[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.btn__heart { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn--ghost[aria-pressed='true'] .btn__heart { fill: var(--salmon); stroke: var(--salmon); }
.btn--ghost .btn__badge { background: var(--sticker); }
.btn--small { height: 2.2rem; padding: 0 .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.2rem;
  margin: 0 0 1rem; padding: .75rem 1rem;
  background: var(--paper); border-left: 5px solid var(--salmon); border-radius: 3px;
}
.bar[hidden] { display: none; }
.bar--shortlist { border-left-color: var(--sticker); }
.bar__text { margin: 0; flex: 1 1 16rem; }
.bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: .9rem;
  max-width: min(32rem, calc(100vw - 2rem)); padding: .7rem 1rem;
  background: var(--ink); color: var(--paper); border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
.toast[hidden] { display: none; }
.toast__btn { border: 0; background: none; color: var(--sticker); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: .2rem .3rem; }
@media (max-width: 56rem) { .toast { bottom: 5rem; } }

/* ---- book: cover, "New", save and hide ------------------------------------------------------ */

.book__cover {
  flex: none; align-self: flex-start; position: relative;
  width: 3.3rem; aspect-ratio: 2 / 3; margin: .75rem 0 .75rem .8rem;
  display: grid; place-items: center; overflow: hidden; border-radius: 2px;
  background: color-mix(in srgb, var(--spine, var(--c-none)) 24%, var(--paper));
  color: color-mix(in srgb, var(--spine, var(--c-none)) 70%, var(--ink));
}
.book__initial { font: 700 1.7rem/1 var(--serif); }
.book__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.book__cover + .book__info { padding-left: .8rem; }
.book[data-status='sold'] .book__cover img { filter: grayscale(1); opacity: .7; }

.book__new {
  display: inline-block; vertical-align: .15em; margin-left: .3rem; padding: 0 .4rem;
  background: var(--salmon); color: var(--ink); border-radius: 2px;
  font: 700 .78rem/1.5 var(--sans);
}

.book__side {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem;
  margin: .8rem .85rem .5rem 0;
}
.book__price { margin: 0; align-self: flex-end; }
.book__actions { display: flex; gap: .1rem; }

.icon-btn {
  width: 2.3rem; height: 2.3rem; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-soft);
  display: grid; place-items: center;
}
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--page); color: var(--ink); }
.icon-btn--save[aria-pressed='true'] { color: #b8452d; }
.icon-btn--save[aria-pressed='true'] svg { fill: #e08a76; }

@media (max-width: 56rem) {
  .results__head { flex-wrap: wrap; }
  .head-actions { width: 100%; }
  .sort { flex: 1; min-width: 0; }
  .sort__select { width: 100%; max-width: none; }
}

/* ---- socials ------------------------------------------------------------------------- */

.socials { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: .7rem; }
.socials__link {
  color: #fff; font-size: .98rem;
  text-decoration: underline; text-decoration-color: var(--salmon);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.socials__link:hover { color: var(--salmon); }
.socials__link:focus-visible { outline-color: var(--salmon); }

.btn--link { text-decoration: none; }
.btn--link[hidden] { display: none; }

.foot p { margin: 0 0 .6rem; max-width: 60rem; }
.foot a { color: var(--accent); text-underline-offset: 3px; }
.foot__contact { color: var(--ink); }

@media (max-width: 34rem) { .socials { gap: .3rem .8rem; } .socials__link { font-size: .9rem; } }

/* ---- reader rating (Open Library) ---------------------------------------------------- */

.book__rating { margin: .1rem 0 0; font-size: .95rem; font-weight: 500; color: #84590a; }
.book__votes { font-weight: 400; color: var(--ink-soft); font-size: .88rem; }

.book__copies { margin: .15rem 0 0; font-size: .92rem; font-weight: 700; }
