/* =========================================================
   BOOKS PAGE
   Designed to sit on top of the shared site.css.
   ========================================================= */

.books-hero {
  position: relative;
  min-height: 570px;
  padding: 175px 0 95px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 30%, rgba(77, 176, 215, .18), transparent 27%),
    linear-gradient(115deg, #fff 0 34%, #eff8fc 62%, #d7edf6 100%);
}

.books-hero::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 190px;
  right: -160px;
  bottom: -110px;
  border: 3px solid rgba(25, 127, 169, .12);
  border-radius: 50%;
  transform: rotate(-10deg);
  box-shadow:
    0 -28px 0 rgba(85, 169, 207, .045),
    0 -56px 0 rgba(85, 169, 207, .025);
}

.books-hero__flow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.books-hero__flow svg {
  width: 100%;
  height: 100%;
}

.books-hero__flow path {
  fill: none;
  stroke-linecap: round;
}

.books-hero__flow path:nth-child(1) {
  stroke: rgba(35, 55, 65, .38);
  stroke-width: 5;
}

.books-hero__flow path:nth-child(2) {
  stroke: rgba(61, 163, 207, .56);
  stroke-width: 3;
}

.books-hero__flow path:nth-child(3) {
  stroke: rgba(61, 163, 207, .24);
  stroke-width: 2;
}

.books-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 60px;
  align-items: center;
}

.books-hero__copy {
  max-width: 830px;
}

.books-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: .98;
  letter-spacing: -.04em;
  font-weight: 500;
}

.books-hero__copy > p:last-child {
  max-width: 760px;
  color: #445057;
  font-size: 1.14rem;
}

.books-hero__stack {
  position: relative;
  width: 280px;
  height: 310px;
  justify-self: center;
}

.book-shape {
  position: absolute;
  width: 170px;
  height: 245px;
  border-radius: 5px;
  box-shadow: 0 24px 38px rgba(18, 57, 75, .18);
}

.book-shape::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 5px;
  background: rgba(255,255,255,.25);
}

.book-shape--1 {
  left: 5px;
  top: 40px;
  transform: rotate(-13deg);
  background: linear-gradient(150deg, #0a1b24, #111 68%, #3e0f0f);
}

.book-shape--2 {
  right: 5px;
  top: 45px;
  transform: rotate(12deg);
  background:
    radial-gradient(circle at 55% 36%, rgba(255,255,255,.8), transparent 8%),
    linear-gradient(150deg, #c8edf9, #50add3 58%, #126a91);
}

.book-shape--3 {
  left: 56px;
  top: 8px;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 24%),
    linear-gradient(150deg, #fff3ca, #d9a032 58%, #8b4d13);
}

.books-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 60px;
  align-items: center;
}

.books-hero__art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.books-hero__art img {
  width: 70%;
  max-width: 400px;
  height: auto;
  display: block;
  filter: drop-shadow(0 22px 34px rgba(18, 57, 75, .18));
}


/* Search / tools */

.books-tools {
  position: relative;
  z-index: 10;
  margin-top: -38px;
}

.books-tools__panel {
  padding: 24px 26px;
  border: 1px solid #d7e8ef;
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 40px rgba(24, 68, 88, .12);
  backdrop-filter: blur(12px);
}

.books-search {
  max-width: 760px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.books-search input {
  min-width: 0;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #b9d8e5;
  border-radius: 999px;
  outline: 0;
  background: #fff;
}

.books-search input:focus {
  border-color: var(--rh-blue-deep);
  box-shadow: 0 0 0 4px rgba(55,154,196,.12);
}

.books-jumps {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.books-jump {
  padding: 7px 11px;
  border: 1px solid #cfe2eb;
  border-radius: 999px;
  color: #3a6679;
  background: #f8fcfd;
  font-size: .79rem;
  font-weight: 800;
  cursor: pointer;
}

.books-jump:hover,
.books-jump.is-active {
  color: #fff;
  border-color: var(--rh-blue-deep);
  background: var(--rh-blue-deep);
}

.books-count {
  min-height: 1.2em;
  margin: 14px 0 0;
  color: #68757c;
  text-align: center;
  font-size: .84rem;
}


/* Sections */

.book-sections {
  padding: 60px 0 115px;
}

.book-section {
  padding: 58px 0 20px;
  scroll-margin-top: 115px;
}

.book-section + .book-section {
  margin-top: 25px;
  border-top: 1px solid #e0ebf0;
}

.book-section[hidden] {
  display: none !important;
}

.book-section__heading {
  max-width: 920px;
  margin-bottom: 30px;
}

.book-section__heading h2 {
  font-size: clamp(1.8rem, 3.3vw, 2.65rem);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}


/* Individual book cards */

.book-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 340px auto;
  border: 1px solid #dce9ef;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 11px 30px rgba(19, 65, 86, .07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.book-card:hover {
  transform: translateY(-5px);
  border-color: #acd5e6;
  box-shadow: 0 20px 42px rgba(19, 65, 86, .12);
}

.book-card__cover-wrap {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 25px;
  background:
    radial-gradient(circle at 50% 45%, rgba(100,190,224,.11), transparent 36%),
    linear-gradient(145deg, #fbfeff, #eef8fb);
}

.book-card__cover-wrap::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 80px;
  right: -90px;
  bottom: -42px;
  border: 2px solid rgba(42,144,184,.11);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.book-card__cover {
  position: relative;
  z-index: 2;
  width: auto;
  max-width: 100%;
  max-height: 290px;
  object-fit: contain;
  box-shadow: 0 15px 28px rgba(15,46,60,.2);
}

.book-card__placeholder {
  position: relative;
  z-index: 2;
  width: 185px;
  aspect-ratio: 8.5 / 11;
  padding: 18px;
  display: grid;
  align-content: center;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.34), transparent 20%),
    linear-gradient(145deg, var(--rh-blue), #0d6c96 70%, #073c5a);
  box-shadow: 0 15px 28px rgba(15,46,60,.2);
}

.book-card__placeholder span,
.modal-cover-placeholder span {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.book-card__placeholder strong,
.modal-cover-placeholder strong {
  margin-top: 8px;
  font-size: 1.15rem;
}

.book-card__body {
  position: relative;
  padding: 23px 23px 25px;
}

.book-card__type {
  margin: 0 0 7px;
  color: var(--rh-red);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.book-card__title {
  margin: 0;
  font-size: 1.3rem;
}

.book-card__author {
  margin: 8px 0 13px;
  color: #687178;
  font-size: .86rem;
  font-weight: 700;
}

.book-card__description {
  display: -webkit-box;
  overflow: hidden;
  color: #4e585d;
  font-size: .91rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.book-card__meta {
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.book-card__meta .meta-pill {
  font-size: .7rem;
}

.book-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-card__actions .button {
  min-height: 39px;
  padding: .66rem .9rem;
  font-size: .82rem;
}


/* Empty state */

.books-empty {
  padding: 80px 20px;
  text-align: center;
}

.books-empty p {
  color: #66737a;
}


/* Browse-all CTA */

.browse-all-books {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(110deg, #0d2733, #17536c 65%, #217ea3);
}

.browse-all-books::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 180px;
  left: -160px;
  bottom: -125px;
  border: 3px solid rgba(111,207,242,.22);
  border-radius: 50%;
  box-shadow:
    0 -28px 0 rgba(111,207,242,.07),
    0 -56px 0 rgba(111,207,242,.035);
}

.browse-all-books__inner {
  position: relative;
  z-index: 2;
  min-height: 250px;
  padding-block: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.browse-all-books h2 {
  max-width: 720px;
  margin-bottom: 9px;
}

.browse-all-books p:last-child {
  margin: 0;
  color: #d5e9f1;
}


/* Modal extras */

.modal-cover-wrap {
  display: grid;
  place-items: start center;
}

.modal-cover-placeholder {
  width: 210px;
  aspect-ratio: 8.5 / 11;
  padding: 20px;
  display: grid;
  align-content: center;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.34), transparent 20%),
    linear-gradient(145deg, var(--rh-blue), #0d6c96 70%, #073c5a);
  box-shadow: 0 16px 30px rgba(11,45,59,.18);
}

.modal-keywords {
  margin: 2px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-keyword {
  padding: 5px 8px;
  border-radius: 999px;
  color: #5c6d74;
  background: #f0f5f7;
  font-size: .72rem;
}


/* Responsive */

@media (max-width: 980px) {
  .books-hero__inner {
    grid-template-columns: 1fr 300px;
  }

  .books-hero__art img {
    max-width: 280px;
  }
}

@media (max-width: 720px) {
  .books-hero {
    min-height: 600px;
    padding-top: 145px;
  }

  .books-hero__inner {
    grid-template-columns: 1fr;
  }

  .books-hero__art {
    margin-top: 10px;
    justify-content: center;
  }

  .books-hero__art img {
    max-width: 260px;
  }

  .books-hero__stack {
    position: absolute;
    right: -100px;
    bottom: -25px;
    opacity: .28;
  }

  .books-tools {
    margin-top: -25px;
  }

  .books-search {
    grid-template-columns: 1fr;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-card {
    grid-template-rows: 315px auto;
  }

  .browse-all-books__inner {
    min-height: 320px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
}
