/* The Library. Project Gutenberg's catalog as a plain report page: white paper, navy ink, thin rules,
   square corners and one blue for links. No gradients, no shadows. The serif is only for reading. */

:root {
  --page: #FFFFFF;
  --paper: #FFFFFF;
  --ink: #0B1F33;
  --text: #1B2430;
  --muted: #4A5565;
  --faint: #6F7B8A;
  --rule: #D0D7DE;
  --line: #B8C0CC;
  --shade: #F3F5F8;
  --blue: #1A4E9A;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --maxw: 1120px;
  --gutter: 32px;
  --bar: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0A111A; --paper: #0D1520; --ink: #E7ECF2; --text: #D6DDE6; --muted: #A9B4C2; --faint: #8592A3;
    --rule: #233041; --line: #3A4A5E; --shade: #142030; --blue: #7FAAE6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0A111A; --paper: #0D1520; --ink: #E7ECF2; --text: #D6DDE6; --muted: #A9B4C2; --faint: #8592A3;
  --rule: #233041; --line: #3A4A5E; --shade: #142030; --blue: #7FAAE6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--sans); overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: var(--bar); display: flex; align-items: center; gap: 30px; }
.mark { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.mark:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; align-self: stretch; }
.nav a { color: var(--muted); display: flex; align-items: center; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.nav .n { margin-left: 6px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bar-right { margin-left: auto; display: flex; align-items: center; }
.iconbtn { width: 34px; height: 34px; flex: none; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--shade); }

/* ---------- page ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 24px; outline: none; min-height: 62vh; }
.hero { padding-top: 40px; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 650; letter-spacing: -.016em; margin: 6px 0 10px; overflow-wrap: anywhere; }
.lede { max-width: 66ch; color: var(--muted); font-size: 16px; margin: 0; }
.crumbs { font-size: 13px; color: var(--faint); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.note { color: var(--muted); margin: 24px 0 0; }

/* ---------- search row ---------- */
.toolrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; margin-top: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.search { flex: 1 1 440px; display: flex; gap: 8px; min-width: 0; }
.input { height: 34px; border: 1px solid var(--rule); border-radius: 3px; padding: 0 10px; background: var(--paper); color: var(--ink); font-size: 14px; min-width: 0; }
.input:focus { border-color: var(--blue); outline: none; }
input.input { flex: 1 1 auto; width: 100%; }
select.input { flex: none; }
.count { margin-left: auto; padding-left: 8px; font-size: 13px; color: var(--muted); }
.btn { height: 34px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; }
.btn:hover { background: var(--shade); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink); opacity: .88; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px 12px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl td:first-child, .tbl th:first-child { padding-left: 0; }
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl .w { width: 44%; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--shade); }
.tbl tr.row:hover td:first-child { box-shadow: -8px 0 0 var(--shade); }
.tbl tr.row:hover td:last-child { box-shadow: 8px 0 0 var(--shade); }
.tbl a.t { color: var(--ink); font-weight: 600; overflow-wrap: break-word; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; overflow-wrap: break-word; }
.tbl .show-m { display: none; }
.tbl tr.msg td { color: var(--muted); padding: 28px 0; }
.tbl tr.msg .btn { margin-top: 12px; }
.tbl .act { white-space: nowrap; text-align: right; }
.tbl .acts { display: none; }
.tbl .acts button { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font-size: inherit; }
.tbl .act .btn { height: 30px; margin-left: 6px; }
.tbl .cv { width: 64px; padding-left: 12px; padding-right: 12px; }
.tbl .cov { display: block; width: 40px; height: 60px; object-fit: cover; border: 1px solid var(--rule); background: var(--shade); }
.more { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.source { font-size: 12px; color: var(--faint); margin: 14px 0 0; max-width: 90ch; }

/* ---------- a book ---------- */
.book { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 48px; align-items: start; }
.book.bare { grid-template-columns: minmax(0, 1fr); }
.book h1 { margin-top: 12px; max-width: 30ch; }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.place { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.block { margin-top: 34px; max-width: 74ch; }
.block h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.block p { margin: 0 0 10px; line-height: 1.62; }
.list { list-style: none; padding: 0; margin: 0; columns: 2 280px; column-gap: 32px; }
.list li { padding: 3px 0; font-size: 14px; break-inside: avoid; }
.cover { margin: 28px 0 0; }
.cover img { display: block; width: 168px; height: auto; border: 1px solid var(--rule); }

/* ---------- reading ---------- */
/* the reading bar runs edge to edge like the top bar; its contents line up with the page */
.rbar { position: sticky; top: var(--bar); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); margin: 0 calc(50% - 50vw); padding: 8px calc(50vw - 50%); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.rbar .who { flex: 1 1 260px; min-width: 0; font-size: 13.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbar .who a { color: var(--ink); font-weight: 600; }
.rbar select { max-width: 280px; }
.rbar .size { display: flex; }
.rbar .size .btn { width: 36px; justify-content: center; padding: 0; }
.rbar .size .btn + .btn { margin-left: -1px; }
.rbar .pct { min-width: 4.5ch; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.text { max-width: 68ch; margin: 36px auto 0; font-family: var(--serif); font-size: var(--rsize, 19px); line-height: 1.7; color: var(--text); }
.text p { margin: 0 0 1em; }
.text p.v { white-space: pre-line; }
.text h2 { font-family: var(--serif); font-size: 1.3em; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 2.4em 0 .9em; white-space: pre-line; }
.text > :first-child { margin-top: 0; }
.text [data-i] { scroll-margin-top: 130px; }
.reading-note { max-width: 68ch; margin: 36px auto 0; color: var(--muted); }
.reading-note .actions { margin-top: 14px; }
.text-source { max-width: 68ch; margin: 40px auto 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--faint); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); font-size: 13px; padding: 8px 14px; border-radius: 3px; display: none; max-width: calc(100vw - 32px); }
.toast.on { display: block; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); margin-top: 48px; }
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter) 36px; font-size: 12.5px; color: var(--faint); }
.foot-in p { margin: 0 0 6px; max-width: 100ch; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .bar-in { gap: 16px; }
  .nav { gap: 14px; }
  .nav a { font-size: 13.5px; }
  h1 { font-size: 27px; }
  .hero { padding-top: 28px; }
  .search { flex-basis: 100%; flex-wrap: wrap; }
  .search input.input { flex-basis: 100%; }
  .search select.input { flex: 1 1 0; }
  .toolrow > select.input { flex: 1 1 0; }
  .count { flex-basis: 100%; margin-left: 0; padding-left: 0; }
  .tbl .hide-m { display: none; }
  .tbl .show-m { display: block; }
  .tbl .w { width: auto; }
  .book { grid-template-columns: minmax(0, 1fr); }
  .cover { display: none; }
  .list { columns: 1; }
  .rbar .who { flex-basis: 100%; }
  .rbar select { flex: 1 1 0; max-width: none; }
  .tbl .act { display: none; }
  .tbl .cv { width: 54px; padding-left: 10px; padding-right: 10px; }
  .tbl .cov { width: 34px; height: 51px; }
  .tbl .acts { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
}
@media (max-width: 380px) {
  .mark { font-size: 14px; }
  .nav { gap: 12px; }
  .nav .n { display: none; }
}
