/* LeTube Books — стили поддомена books.letube.media
   Использует переменные из основного app.css (подключён раньше в header.php),
   плюс собственные компоненты под книги. */

.bk-main { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

/* Шапка */
.bk-top {
  border-bottom: 1px solid var(--line, #e7e0d0);
  background: var(--bg, #fdfaf3);
  position: sticky; top: 0; z-index: 50;
}
.bk-top__inner {
  max-width: 960px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.bk-logo {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: 22px; color: var(--ink, #0c0c0d); text-decoration: none;
}
.bk-logo__sub { color: #f5a623; font-style: normal; font-size: 14px; margin-left: 4px; }
.bk-nav { display: flex; align-items: center; gap: 20px; }
.bk-nav a { color: var(--ink, #0c0c0d); text-decoration: none; font-size: 14px; font-weight: 500; }
.bk-nav__me img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line, #e7e0d0); }

/* Hero / поиск */
.bk-hero { text-align: center; padding: 40px 0 32px; }
.bk-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: clamp(28px, 4vw, 42px); font-weight: 400; margin-bottom: 12px;
}
.bk-hero__lead { color: var(--muted, #8a8578); font-size: 16px; margin-bottom: 24px; }
.bk-search { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.bk-search input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--line, #e7e0d0);
  border-radius: 10px; font-size: 14px; font-family: inherit;
}
.bk-search button {
  padding: 12px 20px; background: var(--ink, #0c0c0d); color: var(--bg, #fff);
  border: none; border-radius: 10px; font-weight: 600; cursor: pointer;
}

/* Сетка книг */
.bk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px; margin-top: 20px;
}
.bk-card { text-decoration: none; color: inherit; display: block; }
.bk-card__cover {
  aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
  background: var(--bg-2, #f3efe6); border: 1px solid var(--line, #e7e0d0); margin-bottom: 10px;
}
.bk-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.bk-card__body h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.bk-card__author { font-size: 13px; color: var(--muted, #8a8578); margin-bottom: 4px; }
.bk-card__rating { font-size: 13px; color: #f5a623; font-weight: 600; }
.bk-card__rating span { color: var(--muted, #8a8578); font-weight: 400; }
.bk-card__rating--empty { color: var(--muted, #8a8578); font-weight: 400; }

.bk-empty { text-align: center; color: var(--muted, #8a8578); padding: 40px 0; grid-column: 1 / -1; }
.bk-empty a { color: var(--ink, #0c0c0d); font-weight: 600; }

/* Карточка книги (детальная) */
.bk-book { display: flex; gap: 32px; margin-bottom: 40px; }
.bk-book__cover {
  width: 220px; flex-shrink: 0; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
  background: var(--bg-2, #f3efe6); border: 1px solid var(--line, #e7e0d0);
}
.bk-book__cover img { width: 100%; height: 100%; object-fit: cover; }
.bk-book__info { flex: 1; min-width: 0; }
.bk-book__info h1 {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic;
  font-size: 32px; font-weight: 400; margin-bottom: 6px;
}
.bk-book__author { color: var(--muted, #8a8578); text-decoration: none; font-size: 14px; }
.bk-book__meta { display: flex; gap: 6px; align-items: center; margin: 14px 0; font-size: 14px; color: #f5a623; font-weight: 600; }
.bk-muted { color: var(--muted, #8a8578); font-weight: 400; }
.bk-book__desc { font-size: 15px; line-height: 1.6; margin-bottom: 20px; white-space: pre-wrap; }
.bk-book__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }

/* Кнопки */
.bk-btn {
  display: inline-block; padding: 10px 20px; border-radius: 10px;
  background: var(--bg-2, #f3efe6); color: var(--ink, #0c0c0d);
  border: 1px solid var(--line, #e7e0d0); font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.bk-btn--primary { background: var(--ink, #0c0c0d); color: var(--bg, #fff); border-color: var(--ink, #0c0c0d); }
.bk-btn--ghost { background: transparent; }
.bk-btn--sm { padding: 7px 14px; font-size: 13px; }
.bk-btn--danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Полка / оценка */
.bk-shelf__select {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line, #e7e0d0);
  font-family: inherit; font-size: 14px; background: #fff; cursor: pointer;
}
.bk-rate { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bk-rate__label { font-size: 14px; color: var(--muted, #8a8578); }
.bk-rate__stars { display: flex; gap: 2px; }
.bk-rate__star {
  background: none; border: none; font-size: 22px; color: var(--line, #e7e0d0);
  cursor: pointer; padding: 0; line-height: 1;
}
.bk-rate__star.is-active { color: #f5a623; }

/* Бейджи */
.bk-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; background: var(--bg-2, #f3efe6); color: var(--muted, #8a8578);
}
.bk-badge--draft { background: #fef3c7; color: #92400e; }
.bk-badge--ok { background: #dcfce7; color: #166534; }

/* Отзывы */
.bk-reviews { border-top: 1px solid var(--line, #e7e0d0); padding-top: 28px; }
.bk-reviews h2 { font-size: 20px; margin-bottom: 16px; }
.bk-review-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.bk-review-form textarea {
  padding: 12px 14px; border: 1px solid var(--line, #e7e0d0); border-radius: 10px;
  font-family: inherit; font-size: 14px; resize: vertical; min-height: 70px;
}
.bk-review-form button { align-self: flex-start; }
.bk-reviews__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }
.bk-review { display: flex; gap: 12px; }
.bk-review__avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.bk-review__user { color: var(--ink, #0c0c0d); font-weight: 600; text-decoration: none; font-size: 14px; }
.bk-review__time { color: var(--muted, #8a8578); font-size: 12.5px; margin-left: 8px; }
.bk-review__body { font-size: 14.5px; line-height: 1.55; margin-top: 4px; }
.bk-review__del { background: none; border: none; color: #b91c1c; font-size: 12.5px; cursor: pointer; padding: 0; margin-top: 4px; }

/* Читалка */
.bk-reader { max-width: 680px; margin: 0 auto; }
.bk-reader__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.bk-reader__back { color: var(--muted, #8a8578); text-decoration: none; font-size: 14px; }
.bk-reader__page { color: var(--muted, #8a8578); font-size: 13px; }
.bk-reader__page-content {
  font-family: 'Instrument Serif', Georgia, serif; font-size: 19px; line-height: 1.8;
  white-space: pre-wrap; min-height: 50vh; padding: 20px 0;
}
.bk-reader__nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line, #e7e0d0);
}
.bk-reader__jump {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line, #e7e0d0);
  font-family: inherit; font-size: 13px;
}

/* Формы (создание/редактирование) */
.bk-form-page { max-width: 560px; margin: 0 auto; }
.bk-form-page h1 { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 30px; margin-bottom: 8px; }
.bk-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.bk-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.bk-form input[type="text"], .bk-form textarea, .bk-form input[type="file"] {
  padding: 12px 14px; border: 1px solid var(--line, #e7e0d0); border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 400;
}
.bk-err { background: #fee2e2; color: #b91c1c; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.bk-msg { background: #dcfce7; color: #166534; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }

/* Редактор страниц */
.bk-editor__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bk-editor__head h1 { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 28px; }
.bk-editor__meta { margin: 20px 0; }
.bk-editor__meta summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.bk-editor__publish { margin: 24px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bk-pages { display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
.bk-page-form {
  border: 1px solid var(--line, #e7e0d0); border-radius: 12px; padding: 16px;
  background: var(--bg-2, #f3efe6);
}
.bk-page-form--new { border-style: dashed; background: transparent; }
.bk-page-form__head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.bk-page-form textarea {
  width: 100%; padding: 12px; border: 1px solid var(--line, #e7e0d0); border-radius: 8px;
  font-family: 'Instrument Serif', Georgia, serif; font-size: 16px; line-height: 1.6; resize: vertical;
}
.bk-page-form__foot { display: flex; gap: 8px; margin-top: 10px; }
.bk-editor__danger { margin-top: 40px; }
.bk-editor__danger summary { cursor: pointer; color: #b91c1c; font-size: 13px; }

/* Моя полка */
.bk-section { margin-bottom: 40px; }
.bk-section__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bk-section h2 { font-size: 20px; }
.bk-mylist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.bk-mylist__item {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border: 1px solid var(--line, #e7e0d0); border-radius: 10px;
}
.bk-mylist__item img { width: 48px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--bg-2, #f3efe6); }
.bk-mylist__info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bk-mylist__info a { color: var(--ink, #0c0c0d); font-weight: 600; text-decoration: none; font-size: 14.5px; }

/* Футер */
.bk-foot { text-align: center; padding: 30px 20px; color: var(--muted, #8a8578); font-size: 13px; border-top: 1px solid var(--line, #e7e0d0); }
.bk-foot a { color: var(--ink, #0c0c0d); }

@media (max-width: 640px) {
  .bk-book { flex-direction: column; }
  .bk-book__cover { width: 160px; }
  .bk-nav { gap: 12px; }
}
