/* /books shelf (_inc/books.php), "Case File" design. Tokens from style.css. */

.books-intro { color: var(--ink-2); max-width: var(--measure); }

.further-reading { margin: 1.6rem 0 2rem; }
ol.fr-shelf { list-style: none; margin: 0; padding: 0; }
.fr-shelf > li { margin: 0; }

/* Subject tabs: folder tabs */
.book-tabs { margin: 1.6rem 0 0; border-bottom: 3px solid var(--manila); }
.book-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.book-tabs li { margin: 0; }
.book-tabs a {
  display: block; padding: .55rem 1rem .45rem;
  background: var(--rule-2); color: var(--ink-2);
  border-radius: 5px 5px 0 0;
  font-size: .9rem; font-weight: 700; text-decoration: none;
}
.book-tabs a:hover { background: var(--manila-2); color: var(--ink); }
.book-tabs a[aria-current="page"] { background: var(--manila); color: var(--ink); }
.book-tabs-n { font-family: var(--type); font-weight: 400; font-size: .72rem; color: var(--manila-ink); margin-left: .2rem; }
.book-tabs + .books-intro { margin-top: 1.2rem; }
@media (max-width: 520px) { .book-tabs a { padding: .45rem .7rem .35rem; font-size: .8rem; } }

/* Topic heading rows */
.fr-topic { padding: 2.2rem 0 .4rem; }
.fr-topic:first-child { padding-top: .4rem; }
.fr-topic h2 { margin: 0 0 .35rem; }
.fr-topic p { margin: 0 0 .4rem; color: var(--ink-2); max-width: var(--measure); font-size: .98rem; }

.fr-book {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 1.2rem;
  margin: .7rem 0 0 !important;
  background: var(--paper-2);
  box-shadow: 0 1px 0 var(--rule);
}
.fr-shelf--flat .fr-book { margin-top: .6rem !important; }

/* Cover: a real cover, or a drawn one like a buckram-bound library volume */
.fr-cover {
  display: block;
  width: 84px; height: 126px;
  text-decoration: none;
  box-shadow: 1px 1px 0 var(--rule), 0 5px 12px rgba(29,35,31,.22);
}
.fr-cover img { width: 84px; height: 126px; object-fit: cover; display: block; }
.fr-cover--type {
  display: flex; flex-direction: column; justify-content: space-between; text-align: center;
  padding: .7rem .45rem .55rem .65rem;
  background: linear-gradient(90deg, rgba(0,0,0,.25) 0 5px, transparent 5px), var(--green);
  outline: 1px solid rgba(220,203,159,.5);
  outline-offset: -6px;
  overflow: hidden;
}
.fr-cover-title {
  font-family: var(--sans);
  font-size: .64rem; line-height: 1.2; font-weight: 700;
  color: var(--manila);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.fr-cover-author {
  font-family: var(--type);
  font-size: .48rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-pale);
}
.fr-cover:hover { box-shadow: 0 0 0 2px var(--accent), 0 5px 12px rgba(29,35,31,.22); }

.fr-text { position: relative; }
.fr-text p { margin: 0; }
.fr-title { font-family: var(--head); font-size: 1rem; line-height: 1.35; font-weight: 700; letter-spacing: -.02em; padding-right: 4.4rem; }
.fr-title a { color: var(--ink); text-decoration: none; }
.fr-title a:hover { color: var(--accent); text-decoration: underline; }
.fr-meta { font-family: var(--type); font-size: .8rem; color: var(--muted); margin-top: .2rem !important; }
.fr-cited { color: var(--accent); }
.fr-note { font-size: .95rem; line-height: 1.55; color: var(--ink-2); margin-top: .45rem !important; max-width: 38rem; }
.fr-buy {
  display: inline-block; margin-top: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  color: var(--accent); text-decoration: none;
}
.fr-buy:hover { text-decoration: underline; }

.fr-disclosure {
  margin: 1.6rem 0 0; padding-top: .8rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--type); font-size: .76rem; color: var(--muted);
}

@media (max-width: 520px) {
  .fr-book { grid-template-columns: 60px 1fr; gap: .9rem; padding: .9rem; }
  .fr-cover, .fr-cover img { width: 60px; height: 90px; }
  .fr-cover-title { font-size: .5rem; -webkit-line-clamp: 4; }
  .fr-cover-author { display: none; }
}

/* Type + reliability marks, top right of each book */
.fr-marks { position: absolute; top: .1rem; right: 0; display: inline-flex; align-items: center; gap: .55rem; }
.fr-type { display: inline-flex; align-items: center; color: var(--green); }
.fr-quality { display: inline-flex; align-items: center; padding: 0 .1rem; }
.fr-bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.fr-bars i { display: block; width: 4px; background: var(--rule); }
.fr-bars i:nth-child(1) { height: 7px; } .fr-bars i:nth-child(2) { height: 11px; } .fr-bars i:nth-child(3) { height: 15px; }
.fr-q3 .fr-bars i.on { background: #4f7a5a; }
.fr-q2 .fr-bars i.on { background: #b0873a; }
.fr-q1 .fr-bars i.on { background: var(--accent); }
.fr-mark-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fr-type, .fr-quality { position: relative; cursor: help; outline: none; }
.fr-type:hover .fr-mark-label, .fr-type:focus-visible .fr-mark-label,
.fr-quality:hover .fr-mark-label, .fr-quality:focus-visible .fr-mark-label {
  clip: auto; width: auto; height: auto; overflow: visible; z-index: 5;
  bottom: calc(100% + 6px); right: 0;
  padding: .25rem .55rem; background: var(--green); color: #fff;
  font-family: var(--type); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(29,35,31,.25);
}

/* Key: a manila folder */
.fr-keybox { position: relative; margin: 3.4rem 0 0; padding: 1.1rem 1.2rem 1rem; background: var(--manila); border-radius: 0 5px 5px 5px; }
.fr-key-title {
  position: absolute; top: -1.6rem; left: 0; margin: 0;
  background: var(--manila); border-radius: 5px 5px 0 0; padding: .3rem .9rem .15rem;
  font-family: var(--type); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--manila-ink);
}
.fr-key { border-collapse: collapse; width: 100%; font-size: .82rem; }
.fr-key th, .fr-key td { padding: .45rem .7rem; vertical-align: middle; border-top: 1px solid rgba(107,90,46,.25); }
.fr-key tr:first-child > * { border-top: 0; }
.fr-key-split > * { border-top: 2px solid rgba(107,90,46,.45) !important; }
.fr-key th { text-align: left; font-weight: normal; font-family: var(--type); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--manila-ink); white-space: nowrap; }
.fr-key-item { white-space: nowrap; }
.fr-key-row { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; }
.fr-key-row .fr-type, .fr-key-row .fr-quality { width: 18px; justify-content: center; cursor: default; }
.fr-key .fr-mark-label { display: none; }
.fr-why { color: var(--ink-2); }
@media (max-width: 560px) { .fr-key th { display: none; } .fr-why { font-size: .76rem; } }

/* Filter + sort toolbar */
.list-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
  margin: 0 0 1.2rem; padding: .7rem .85rem;
  background: var(--green); color: #e9e6dc;
  font-size: .74rem;
  position: sticky; top: 0; z-index: 4;
}
.lt-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.lt-label { font-family: var(--type); letter-spacing: .12em; text-transform: uppercase; color: var(--green-pale); margin-right: .25rem; }
.list-tools button {
  font: inherit; color: #e9e6dc; background: transparent;
  border: 1px solid rgba(185,194,180,.45); border-radius: 2px; padding: .22rem .55rem; cursor: pointer;
}
.list-tools button:hover { border-color: #fff; color: #fff; }
.list-tools button[aria-pressed="true"] { background: var(--manila); border-color: var(--manila); color: var(--ink); }
.lt-sort { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; }
.lt-sort select { font: inherit; color: var(--ink); background: var(--paper-2); border: 0; border-radius: 2px; padding: .25rem .4rem; }
.list-tools-empty { font-family: var(--type); font-size: .88rem; color: var(--muted); margin: 1rem 0; }
