/* Страница книги. Акцентный цвет приходит из шаблона в --book-accent,
   фон героя у всех книг одинаковый тёмно-синий. */

.book-page {
  --book-gap: 56px;
  /* Единая ширина контента: к ней приведены все секции, кроме героя */
  --book-content: 900px;
  padding-bottom: 3rem;
}

/* ===== Герой ===== */
.book-hero {
  display: grid;
  grid-template-columns: 1fr 42%;
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
}
.book-hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  background: #0E1A2B;
}
.book-hero-series {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7FA8C9;
}
.book-hero-title {
  margin: 0;
  font-size: 64px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -2px;
  color: #ffffff;
}
.book-hero-rule {
  display: block;
  width: 52px;
  height: 3px;
  margin: 22px 0;
  background: var(--book-accent, #2b96d6);
}
.book-hero-subtitle {
  margin: 0 0 30px;
  max-width: 26em;
  font-size: 20px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}
.book-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.book-hero-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(150deg, #16304D, #0B1524);
}
.book-hero-cover img {
  position: relative;
  z-index: 1;
  display: block;
  width: 190px;
  height: auto;
  border-radius: 2px 6px 6px 2px;
  /* Тень книги и затемнение у корешка */
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 6px 0 12px -6px rgba(0, 0, 0, 0.3);
}
/* Размытый эллипс под книгой */
.book-hero-cover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 200px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  filter: blur(16px);
}
.book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 26px;
  border-radius: 25px;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}
.book-btn--light {
  background: #ffffff;
  color: #0E1A2B;
}
.book-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
}
.book-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.book-btn--light:hover {
  opacity: 0.9;
}
.book-btn--accent {
  background: var(--book-accent, #2b96d6);
  color: #ffffff;
}
.book-btn--accent:hover {
  opacity: 0.92;
}

/* ===== Полоса цифр ===== */
.book-numbers {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  max-width: var(--book-content);
  margin: 28px auto 0;
  border: 0.5px solid #d9dcea;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}
.book-number {
  padding: 22px 24px;
  border-left: 0.5px solid #d9dcea;
}
.book-number:first-child {
  border-left: 0;
}
.book-number-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: #232d5f;
}
.book-number-label {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #9aa0b5;
}

/* ===== Общие отступы секций ===== */
.book-section {
  max-width: var(--book-content);
  margin: var(--book-gap) auto 0;
}
.book-eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #9aa0b5;
}

/* ===== Это про вас, если ===== */
.book-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.book-card {
  margin: 0;
  padding-top: 14px;
  border-top: 2px solid var(--book-accent, #2b96d6);
  font-size: 16px;
  line-height: 1.5;
  color: #232d5f;
}

/* ===== О чём эта книга ===== */
/* Ширину задаёт сама секция, здесь дополнительных ограничений нет */
.book-about-text p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.7;
  color: #5d6588;
}
.book-about-text p:last-child {
  margin-bottom: 0;
}
.book-about-text p.book-lead {
  font-size: 20px;
  line-height: 1.55;
  color: #232d5f;
}

/* ===== Главная идея ===== */
.book-idea {
  padding: 38px 40px;
  border-radius: 18px;
  background: #12233A;
}
.book-idea-label {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7FA8C9;
}
.book-idea-text {
  max-width: 640px;
  margin: 0 0 30px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.35;
  color: #ffffff;
  /* Строки делятся по смыслу, а не по остатку ширины */
  text-wrap: balance;
}
.book-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.book-chain-step {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
}
.book-chain-step.is-last {
  background: var(--book-accent, #2b96d6);
  color: #ffffff;
}
.book-chain-arrow {
  font-size: 16px;
  color: #7FA8C9;
}
.book-chain-loop {
  font-size: 20px;
  color: #7FA8C9;
}

/* ===== Что внутри: таблица 2x2 ===== */
.book-parts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 0.5px solid #d9dcea;
  border-radius: 14px;
  background: #d9dcea;
  overflow: hidden;
}
.book-part {
  padding: 26px 28px;
  background: #ffffff;
}
.book-part-num {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--book-accent, #2b96d6);
}
.book-part-name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: #232d5f;
}
.book-part-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #5d6588;
}

/* ===== Оглавление ===== */
.book-toc {
  border: 0.5px solid #d9dcea;
  border-radius: 16px;
  background: #ffffff;
}
.book-toc > summary {
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--book-accent, #2b96d6);
  cursor: pointer;
  list-style: none;
}
.book-toc > summary::-webkit-details-marker {
  display: none;
}
.book-toc .book-toc-hide {
  display: none;
}
.book-toc[open] .book-toc-show {
  display: none;
}
.book-toc[open] .book-toc-hide {
  display: inline;
}
.book-toc-body {
  padding: 0 24px 24px;
  column-count: 2;
  column-gap: 40px;
}
.book-toc-lead,
.book-toc-part {
  break-inside: avoid;
}
.book-toc-lead {
  margin: 0 0 14px;
  font-size: 15px;
  color: #9aa0b5;
}
.book-toc-part {
  margin-bottom: 18px;
}
.book-toc-part-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #232d5f;
}
.book-toc-list {
  margin: 0;
  padding-left: 22px;
}
.book-toc-list li {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.45;
  color: #5d6588;
}

/* ===== Кому не подойдёт ===== */
.book-warning {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  background: #f2f4fa;
}
.book-warning-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--book-accent, #2b96d6);
}
.book-warning-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #232d5f;
}
.book-warning p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #5d6588;
}

/* ===== Тест и покупка ===== */
.book-test,
.book-buy {
  padding: 32px 40px;
  border-radius: 16px;
  background: #f6f8fc;
  text-align: left;
}
.book-test h2,
.book-buy h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #232d5f;
}
.book-test p,
.book-buy p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.6;
  color: #5d6588;
}
.book-buy-soon {
  display: inline-block;
  margin: 0 0 10px;
  padding: 12px 24px;
  border: 1px dashed #c9cfdf;
  border-radius: 999px;
  color: #5d6588 !important;
}
.book-buy-note {
  margin: 0 !important;
  font-size: 15px !important;
  color: #9aa0b5 !important;
}

/* ===== Автор ===== */
.book-author {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px;
  border: 0.5px solid #e2e6f0;
  border-radius: 16px;
}
.book-author-photo {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  object-fit: cover;
  /* Портрет вертикальный: лицо в верхней трети кадра */
  object-position: center 18%;
  border-radius: 50%;
  background: #0d1220;
}
.book-author-name {
  margin: 0 0 8px;
  font-weight: 600;
  color: #232d5f;
}
.book-author p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: #5d6588;
}
.book-author-link {
  color: var(--book-accent, #2b96d6);
  text-decoration: none;
}
.book-author-link:hover {
  text-decoration: underline;
}

/* ===== Другие книги ===== */
.book-others {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.book-other {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.book-other:hover {
  transform: translateY(-2px);
}
/* Книги стоят на одной нижней линии независимо от своих пропорций.
   flex-shrink: 0 обязателен: иначе карточка с подписью в две строки
   сжимала бы контейнер обложки и низ книг разъезжался */
.book-other-cover {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}
.book-other-cover img {
  display: block;
  width: 100%;
  height: 100%;
  /* Без сброса минимума вытянутая обложка растягивала бы контейнер
     и ломала общую нижнюю линию */
  min-height: 0;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 10px 22px rgba(35, 45, 95, 0.2));
}
.book-other-name {
  display: block;
  margin-top: 14px;
  /* Две строки названия не должны менять высоту карточки */
  min-height: 2.7em;
  font-size: 15px;
  line-height: 1.35;
  color: #232d5f;
}

/* ===== Планшет ===== */
@media screen and (max-width: 1024px) {
  .book-hero-title {
    font-size: 52px;
    letter-spacing: -1.5px;
  }
  .book-numbers {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-columns: auto;
  }
  .book-number:nth-child(odd) {
    border-left: 0;
  }
  .book-number:nth-child(n + 3) {
    border-top: 0.5px solid #d9dcea;
  }
}

@media screen and (max-width: 900px) {
  .book-others {
    grid-template-columns: repeat(3, 1fr);
  }
  .book-parts-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media screen and (max-width: 600px) {
  .book-others {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Мобильный ===== */
@media screen and (max-width: 760px) {
  .book-page {
    --book-gap: 36px;
  }
  /* Сначала обложка, потом текст */
  .book-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .book-hero-cover {
    order: -1;
    padding: 32px 20px 36px;
  }
  .book-hero-cover::after {
    bottom: 40px;
    width: 170px;
  }
  .book-hero-text {
    padding: 28px 20px 32px;
  }
  .book-hero-title {
    font-size: 38px;
    letter-spacing: -1px;
  }
  .book-hero-subtitle {
    font-size: 17px;
  }
  .book-idea {
    padding: 26px 22px;
  }
  .book-idea-text {
    font-size: 22px;
  }
  .book-toc-body {
    column-count: 1;
  }
  .book-author {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
