/*
 * The free classics for everyone (/classics): the shelf, the easiest-first list, a
 * book, a chapter and a book's vocabulary. Book cards borrow the library shelf's look
 * from classics.css; the underlines and the word card come from extension.css, shared
 * with /extension/try.
 */

.pub-classics {
  max-width: 64rem;
}

.pub-classics__intro {
  max-width: 46rem;
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.pub-classics__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

.pub-classics__lead {
  margin: 0.9rem 0 0;
  color: var(--dim);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.pub-classics__links {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
}

.pub-classics a:not(.btn),
.pub-chapter a:not(.btn) {
  color: var(--accent);
}

.pub-classics__note {
  max-width: 46rem;
  margin: 2rem 0 0;
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Book cards -------------------------------------------------------------- */

.pub-card .classic-card__title a {
  color: var(--ink);
  text-decoration: none;
}

.pub-card .classic-card__title a:hover {
  color: var(--accent);
}

.pub-card__cover {
  flex: none;
  line-height: 0;
}

.pub-card__position {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.pub-card__difficulty {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font-size: 0.8125rem;
}

.pub-ranked {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 0.75rem;
  list-style: none;
}

/* A book ------------------------------------------------------------------ */

.pub-book__head {
  display: flex;
  margin-top: 1rem;
  align-items: flex-start;
  gap: clamp(1rem, 4vw, 2rem);
}

.pub-book__cover {
  flex: none;
  width: clamp(6rem, 22vw, 9rem);
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.pub-book__cover--blank {
  display: grid;
  aspect-ratio: 2 / 3;
  place-items: center;
  background: var(--panel);
  color: var(--dim);
  font-family: var(--font-serif);
  font-size: 2.5rem;
}

.pub-book__title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  font-weight: 400;
  line-height: 1.12;
}

.pub-book__author {
  margin: 0.4rem 0 0;
  color: var(--dim);
}

.pub-book__blurb {
  margin: 0.9rem 0 0;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.pub-book__difficulty {
  margin: 0.75rem 0 0;
  color: var(--dim);
  font-size: 0.875rem;
}

.pub-book__actions {
  display: flex;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pub-book__account,
.pub-book__pack,
.pub-book__source {
  margin: 1rem 0 0;
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pub-book__add {
  padding: 0;
  min-height: 0;
  color: var(--accent);
  font-size: inherit;
  vertical-align: baseline;
}

.pub-book__contents {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pub-book__contents h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
}

.pub-contents {
  display: grid;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pub-contents li {
  display: flex;
  padding: 0.55rem 0;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.pub-contents__words {
  flex: none;
  color: var(--dim);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* A chapter --------------------------------------------------------------- */

.pub-chapter__crumbs {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.pub-chapter__crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.pub-chapter__title {
  margin: 0 0 1rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 400;
  line-height: 1.15;
}

.pub-chapter__meet {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.pub-chapter__meet summary {
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.pub-meet {
  display: grid;
  margin: 0.75rem 0 0;
  gap: 0.5rem;
}

.pub-meet div {
  display: grid;
  grid-template-columns: minmax(6rem, 10rem) 1fr;
  gap: 0.75rem;
}

.pub-meet dt {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
}

.pub-meet dd {
  margin: 0;
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* The book's own text, as sanitized: headings, paragraphs, quotes, lists, tables. */
.pub-chapter__text {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.pub-chapter__text :is(h1, h2, h3, h4, h5, h6) {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.pub-chapter__text p {
  margin: 0 0 1rem;
}

.pub-chapter__text blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
}

.pub-chapter__text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.pub-chapter__pager {
  display: flex;
  margin-top: 1.5rem;
  justify-content: space-between;
  gap: 1rem;
}

.pub-chapter__pager a {
  display: inline-flex;
  max-width: 48%;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.pub-chapter__next {
  margin-left: auto;
  text-align: right;
}

.pub-chapter__save {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.ext-page .pub-chapter__save h2 {
  font-size: 1.5rem;
}

.pub-chapter__save p {
  margin: 0.6rem 0 0;
  color: var(--dim);
  line-height: 1.6;
}

/* A book's vocabulary ----------------------------------------------------- */

.pub-vocab__actions {
  display: flex;
  margin: 1.25rem 0 0;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pub-vocab__chapter {
  margin-top: 2rem;
}

.pub-vocab__chapter h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.pub-vocab__chapter h2 a {
  text-decoration: none;
}

.pub-vocab__list {
  margin: 0.5rem 0 0;
}

.pub-vocab__word {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.pub-vocab__word dt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-vocab__term {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.pub-vocab__times {
  color: var(--dim);
  font-size: 0.8125rem;
}

.pub-vocab__word dd {
  margin: 0.35rem 0 0;
}

.pub-vocab__meanings {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink);
  line-height: 1.5;
}

.pub-vocab__sentence {
  margin: 0.5rem 0 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--line);
  color: var(--dim);
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.55;
}

.pub-vocab__sentence b {
  color: var(--ink);
  font-style: normal;
}

@media (max-width: 639.98px) {
  .pub-book__head {
    flex-direction: column;
  }

  .pub-meet div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}
