.lp-top-books,
.lp-top-books * {
  box-sizing: border-box;
}

.lp-top-books {
  --navy: #1b2a4a;
  --ink: #3a3a3a;
  --body: #4a4a4a;
  --muted: #8a9a9a;
  --grey: #5a6a6a;
  --accent: #2a6354;
  --accent-dark: #1a4439;
  --white: #fff;
  --cream: #f7f4ef;
  --sand: #f0ece4;
  --sand-line: #d8d2c6;
  --line: #e8e4df;
  --gold: #c9a84c;
  --teal: #2a4a5e;
  --purple: #533c8e;
  --lavender: #d0c4e6;
  --cart: #e3285a;
  --cart-dark: #c41d4b;
  --max: 90%;
  --cols: 70px 120px minmax(0, 1fr) 160px;
  --gap: 20px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, sans-serif;

  color: var(--ink);
  background: var(--white);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: clip;
}

.lp-top-books img {
  max-width: 100%;
  display: block;
  height: auto;
}

.lp-top-books h1,
.lp-top-books h2 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.6em;
}

.lp-top-books p {
  margin: 0 0 14px;
  color: var(--body);
}

.lp-top-books .inner {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

.lp-top-books .text-link {
  color: var(--accent);
  text-decoration: underline;
}

.lp-top-books .text-link:hover {
  color: var(--accent-dark);
}

/* ---- Promo Banner ---- */
.lp-top-books .promo {
  --promo-h: 220px;
  --promo-tilt: -30deg;
  --promo-scale: 1;

  background: var(--purple);
  color: var(--white);
  overflow: hidden;
}

.lp-top-books .promo-grid {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: var(--promo-h);
}

.lp-top-books .promo-books {
  position: relative;
  flex: 0 0 520px;
  align-self: stretch;
  min-height: var(--promo-h);
  overflow: hidden;
}

/* Wall is taller than the banner on purpose: .promo clips top/bottom. */
.lp-top-books .promo-wall {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 3px;
  transform: translate(-50%, -50%) rotate(var(--promo-tilt)) scale(var(--promo-scale));
}

.lp-top-books .promo-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lp-top-books .promo-book,
.entry-content .lp-top-books .promo-book,
.article-panel .entry-content .lp-top-books .promo-book,
.legal-body .entry-content .lp-top-books .promo-book {
  width: 80px;
  max-width: none !important;
  height: 120px !important;
  margin: 0 !important;
  padding: 0;
  object-fit: cover;
  border-radius: 2px !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  display: block;
}

.lp-top-books .promo-copy {
  flex: 1;
  min-width: 0;
  padding: 32px 0;
}

.lp-top-books .promo-copy h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--white);
  margin-bottom: 14px;
}

.lp-top-books .promo-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--lavender);
}

/* ---- Intro ---- */
.lp-top-books .intro {
  padding: 40px 0;
}

.lp-top-books .intro h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  margin-bottom: 18px;
  text-align: center;
}

.lp-top-books .intro p {
  max-width: 60rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.85em;
  text-align: center;
}

/* ---- Ranking ---- */
.lp-top-books .ranking {
  padding: 0 0 60px;
}

.lp-top-books .rank-head {
  display: grid;
  grid-template-columns: var(--cols);
  gap: var(--gap);
  align-items: center;
  padding: 0 10px 10px;
  border-bottom: 2px solid var(--navy);
}

.lp-top-books .rank-head span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.lp-top-books .rank-head-book {
  grid-column: 2 / 4;
}

.lp-top-books .book-list {
  list-style: none;
  margin: 0;
  padding: 0 !important;
}

.lp-top-books .book-entry {
  display: grid;
  grid-template-columns: var(--cols);
  grid-template-areas:
    "rank cover info rating"
    "rank cover desc cart";
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
  row-gap: 10px;
  align-items: start;
  padding: 24px 10px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease;
}

@media (hover: hover) {
  .lp-top-books .book-entry:hover {
    background: var(--cream);
  }
}

.lp-top-books .book-rank {
  grid-area: rank;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--muted);
  padding-top: 2px;
}

.lp-top-books .book-cover {
  grid-area: cover;
}

.lp-top-books .book-cover img {
  width: 100%;
  max-width: 110px;
  height: 160px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lp-top-books .book-info {
  grid-area: info;
  min-width: 0;
}

.lp-top-books .book-info h2 {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.lp-top-books .book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lp-top-books .book-author {
  font-size: 14px;
  color: #7a7a7a;
}

.lp-top-books .tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.lp-top-books .tag--gold {
  background: var(--gold);
  color: var(--white);
}

.lp-top-books .tag--blue {
  background: var(--teal);
  color: var(--white);
}

.lp-top-books .tag--outline {
  background: transparent;
  color: var(--grey);
  border: 1px solid #c0c0c0;
}

.lp-top-books .book-rating {
  grid-area: rating;
  padding-top: 4px;
}

/* Rating: set style="--rating: 4.5" on .stars. Left portion = gold, rest = empty. */
.lp-top-books .stars {
  --rating: 5;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  white-space: nowrap;
  vertical-align: middle;
  background: linear-gradient(
    90deg,
    var(--gold) calc(var(--rating) / 5 * 100%),
    #e0d8cc 0
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.lp-top-books .btn-cart {
  grid-area: cart;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--cart);
  color: var(--white);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(227, 40, 90, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lp-top-books .btn-cart:hover {
  background: var(--cart-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.lp-top-books .book-desc {
  grid-area: desc;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #5a5a5a;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .lp-top-books {
    --max: 100%;
  }

  .lp-top-books .promo-grid {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0;
  }

  .lp-top-books .promo-books {
    flex: 0 0 var(--promo-h);
    height: var(--promo-h);
    margin-inline: calc(50% - 50vw);
    overflow: hidden;
  }

  .lp-top-books .promo-copy {
    padding: 24px 0 32px;
  }

  .lp-top-books .promo-source {
    justify-content: center;
  }

  .lp-top-books .rank-head {
    display: none;
  }

  .lp-top-books .book-entry {
    grid-template-columns: 40px 100px minmax(0, 1fr);
    grid-template-areas:
      "rank cover info"
      "rank cover rating"
      "rank cover cart"
      "desc desc desc";
    grid-template-rows: auto auto 1fr auto;
    row-gap: 8px;
    column-gap: 16px;
  }

  .lp-top-books .book-rank {
    font-size: 18px;
  }

  .lp-top-books .book-cover img {
    height: 140px;
  }

  .lp-top-books .book-rating {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .lp-top-books {
    font-size: 14px;
  }

  .lp-top-books .inner {
    width: calc(100% - 32px);
  }

  .lp-top-books .promo {
    --promo-h: 160px;
    --promo-scale: 0.72;
  }

  .lp-top-books .promo-copy {
    padding: 18px 0 24px;
  }

  .lp-top-books .promo-copy h2 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .lp-top-books .promo-source {
    font-size: 13px;
  }

  .lp-top-books .intro {
    padding: 24px 0 20px;
  }

  .lp-top-books .intro h1 {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .lp-top-books .intro p {
    font-size: 14px;
    line-height: 1.65;
  }

  .lp-top-books .ranking {
    padding-bottom: 40px;
    border-top: 2px solid var(--navy);
  }

  /* Rank becomes a badge sitting on the cover's top-left corner. */
  .lp-top-books .book-entry {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas:
      "cover info"
      "cover rating"
      "cover cart"
      "desc desc";
    grid-template-rows: auto auto 1fr auto;
    column-gap: 14px;
    row-gap: 8px;
    padding: 18px 0;
  }

  .lp-top-books .book-rank {
    grid-area: cover;
    align-self: start;
    justify-self: start;
    z-index: 1;
    margin: -6px 0 0 -6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    font-family: var(--sans);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  }

  .lp-top-books .book-cover img {
    max-width: 84px;
    height: 124px;
  }

  .lp-top-books .book-info h2 {
    font-size: 16px;
    margin-bottom: 4px;
  }

  .lp-top-books .book-meta {
    gap: 6px;
  }

  .lp-top-books .book-author {
    flex-basis: 100%;
    font-size: 13px;
    line-height: 1.4;
  }

  .lp-top-books .tag {
    font-size: 10px;
    padding: 2px 8px;
  }

  .lp-top-books .stars {
    font-size: 15px;
    letter-spacing: 1px;
  }

  .lp-top-books .btn-cart {
    align-self: start;
    padding: 9px 16px;
    font-size: 11px;
    letter-spacing: 0.6px;
  }

  .lp-top-books .book-desc {
    font-size: 13.5px;
    line-height: 1.6;
  }
}

@media (max-width: 380px) {
  .lp-top-books .book-entry {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 12px;
  }

  .lp-top-books .book-cover img {
    max-width: 72px;
    height: 106px;
  }

  .lp-top-books .btn-cart {
    justify-self: stretch;
    justify-content: center;
  }
}

/* CSS: modules/blog/blocks/html-region/pages/top-books.css
   Root: lp-top-books */