/* Страница книги /kniga/{id} — server-render для SEO + читаемый вид для людей.
   Палитра и структура нарочно повторяют модалку каталога (catalog.css), чтобы
   страница ощущалась продолжением каталога, а не отдельным дизайном. */

/* Прижимаем футер к низу viewport, даже если контента книги мало — иначе
   под футером виден белый фон body (main.css задаёт background: white).
   Селектор через body.v3-inner — этот файл подключён только на /kniga/,
   на остальные страницы (post.html, page.html и т.д.) не влияет. */
body.v3-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.v3-inner .book-page-wrap { flex: 1 0 auto; }
body.v3-inner .v3-footer { flex-shrink: 0; }

.book-page-wrap {
  max-width: 900px;
  margin: 36px auto;
  padding: 0 20px 60px;
  width: 100%;
}

.book-page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #0e350e;
  text-decoration: none;
  margin-bottom: 14px;
  opacity: 0.7;
  transition: opacity .18s ease;
}
.book-page-back:hover { opacity: 1; text-decoration: underline; }

.book-page-card {
  display: flex;
  align-items: stretch;
  background: blanchedalmond;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .16);
  overflow: hidden;
}

.book-page-cover {
  width: 240px;
  min-width: 240px;
}

.book-page-cover img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  display: block;
}

.book-page-cover-placeholder {
  width: 100%;
  height: 100%;
  min-height: 340px;
  background: linear-gradient(135deg, #0e350e 0%, #1a3a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 68px;
  font-weight: bold;
  color: #c9a227;
}

.book-page-info {
  padding: 30px 32px 26px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-page-info h1 {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 6px;
  color: #0e350e;
  font-weight: 700;
}

.book-page-author {
  font-size: 15px;
  color: #555;
  font-style: italic;
  margin: 0 0 12px;
}

.book-page-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.book-page-warn-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  color: #ffcccc;
}
.bpw-adult  { background: #6b0d28; }
.bpw-drug   { background: #7a2800; }
.bpw-terror { background: #1a0000; border: 1px solid #6b0000; }
.bpw-agent  { background: #8b1a1a; }

.book-page-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #444;
  border-top: 1px solid #e3ceaf;
  border-bottom: 1px solid #e3ceaf;
  padding: 12px 0;
  margin-bottom: 14px;
}
.book-page-meta-row { display: flex; gap: 8px; }
.book-page-meta-label { color: #8a8172; min-width: 110px; flex-shrink: 0; font-weight: 600; }

.book-page-biblio {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid #e3ceaf;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.book-page-biblio-label {
  font-size: 11px;
  font-weight: 700;
  color: #8a8172;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.book-page-biblio-text {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  margin: 0 0 8px;
}
.book-page-biblio-copy {
  background: none;
  border: 1px solid #2d5016;
  color: #2d5016;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.book-page-biblio-copy:hover { background: #2d5016; color: #fff; }

.book-page-annotation {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  margin: 0 0 20px;
  flex: 1;
}

.book-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.book-page-btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.book-page-btn-primary {
  background: #2d5016;
  color: #fff;
  border: 1.5px solid #2d5016;
}
.book-page-btn-primary:hover { background: #0e350e; border-color: #0e350e; }

.book-page-btn-secondary {
  background: transparent;
  color: #2d5016;
  border: 1.5px solid #2d5016;
}
.book-page-btn-secondary:hover { background: #2d5016; color: #fff; }

@media (max-width: 767px) {
  .book-page-wrap { margin: 20px auto; padding: 0 14px 40px; }
  .book-page-card { flex-direction: column; }
  .book-page-cover { width: 100%; min-width: unset; }
  .book-page-cover img,
  .book-page-cover-placeholder { min-height: 220px; }
  .book-page-info { padding: 22px 20px 24px; }
  .book-page-actions { flex-direction: column; }
  .book-page-btn { width: 100%; }
}
