/* ══════════════════════════════════════════
   Books / Detail page
   Requires: shared-detail.css, comments.css
   ══════════════════════════════════════════ */

/* ── Card ── */

.bk {
  max-width: 1120px;
  margin: 0 auto 48px;
  padding: 0 32px;
  animation: cardReveal 0.6s var(--ease) both;
}
.bk__card {
  background: var(--card);
  border-radius: var(--card-radius);
  box-shadow:
    0 1px 2px rgba(var(--shadow-c), 0.04),
    0 4px 12px rgba(var(--shadow-c), 0.04),
    0 16px 40px rgba(var(--shadow-c), 0.06);
  display: grid;
  grid-template-columns: auto 1fr;
  overflow: hidden;
  min-height: 480px;
}

/* ── Cover ── */

.bk__cover-col {
  position: relative;
  background: var(--surface);
  width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bk__cover-link {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
  cursor: zoom-in;
}
.bk__blur {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.bk__cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  padding: 32px;
  transition: transform 0.5s var(--ease);
}
.bk__cover-col:hover .bk__cover-img {
  transform: scale(1.03);
}

.bk__cover-col:hover .zoom-hint {
  opacity: 1;
  transform: scale(1);
}

.bk__cover-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--placeholder);
  opacity: 0.5;
}

/* ── Info ── */

.bk__info {
  padding: 36px 36px 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 85vh;
}
.bk__sections {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

/* ── Title + author ── */

.bk__title {
  font-family: "Lora", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.bk__author {
  margin-top: 8px;
  font-size: 16px;
  color: var(--text-2);
}

/* ── Rating ── */

.bk__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.rating-stars {
  display: flex;
  gap: 2px;
}
.star {
  width: 18px;
  height: 18px;
  fill: var(--border);
  stroke: none;
}
.star--full {
  fill: #f59e0b;
}
.star--half {
  fill: url(#half-star-gradient);
}
.rating-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.rating-count {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Tags ── */

.bk__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.tag--genre {
  background: #ede9fe;
  color: #6d28d9;
}
.tag--genre .tag__icon {
  stroke: #6d28d9;
}

.tag--type {
  background: #dbeafe;
  color: #2563eb;
}
.tag--type .tag__icon {
  stroke: #2563eb;
}

.tag--diff {
  background: var(--surface);
  color: var(--text-2);
}
.tag--diff .tag__icon {
  stroke: var(--text-2);
}

.tag--diff-easy {
  background: #d1fae5;
  color: #065f46;
}
.tag--diff-easy .tag__icon {
  stroke: #065f46;
}
.tag--diff-medium {
  background: #fef3c7;
  color: #92400e;
}
.tag--diff-medium .tag__icon {
  stroke: #92400e;
}
.tag--diff-hard {
  background: #fee2e2;
  color: #991b1b;
}
.tag--diff-hard .tag__icon {
  stroke: #991b1b;
}
.tag--diff-expert {
  background: #2c2520;
  color: #fff;
}
.tag--diff-expert .tag__icon {
  stroke: #fff;
}

/* ══════════════ Artworks grid ══════════════ */

.bk-artworks {
  max-width: 1120px;
  margin: 0 auto 48px;
  padding: 0 32px;
  animation: cardReveal 0.6s 0.1s var(--ease) both;
}
.bk-artworks__heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bk-artworks__all {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--dur) var(--ease);
}
.bk-artworks__all:hover {
  opacity: 0.7;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.art-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface);
  text-decoration: none;
  display: block;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.art-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(var(--shadow-c), 0.1);
}
.art-card__blur {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.art-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.art-card__ph {
  width: 100%;
  height: 100%;
  background: var(--surface);
}

.art-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.art-card:hover .art-card__overlay {
  opacity: 1;
}

.art-card__bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: #fff;
  font-size: 12px;
}
.art-card__user {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.art-card__likes {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.art-card__likes svg {
  fill: var(--liked);
  stroke: none;
}

/* ══════════════ Book shelf ══════════════ */

.bk-shelf {
  max-width: 1120px;
  margin: 0 auto 48px;
  padding: 0 32px;
  animation: cardReveal 0.6s 0.15s var(--ease) both;
}
.bk-shelf__heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.shelf-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.shelf-card {
  flex-shrink: 0;
  width: 130px;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  transition: transform var(--dur) var(--ease);
}
.shelf-card:hover {
  transform: translateY(-3px);
}
.shelf-card__cover {
  width: 130px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(var(--shadow-c), 0.1);
}
.shelf-card__cover--ph {
  background: linear-gradient(145deg, var(--surface), var(--border));
  display: grid;
  place-items: center;
  color: var(--placeholder);
}
.shelf-card__title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.shelf-card__author {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  .bk__cover-col {
    width: 300px;
  }
  .bk__info {
    padding: 28px 28px 24px;
  }
  .bk__title {
    font-size: 24px;
  }
  .art-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 700px) {
  .bk {
    padding: 0 16px;
    margin-bottom: 32px;
  }
  .bk__card {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .bk__cover-col {
    width: 100%;
    max-height: 420px;
  }
  .bk__cover-img {
    padding: 24px;
  }
  .zoom-hint {
    opacity: 0.8;
    transform: scale(1);
  }
  .bk__info {
    padding: 24px 20px 20px;
    max-height: none;
    overflow-y: visible;
  }
  .bk__title {
    font-size: 22px;
  }

  .bk-artworks,
  .bk-shelf {
    padding: 0 16px;
  }
  .art-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  .shelf-card {
    width: 110px;
  }
  .shelf-card__cover {
    width: 110px;
    height: 152px;
  }
}

@media (max-width: 400px) {
  .bk {
    padding: 0 8px;
  }
  .bk__card {
    border-radius: 16px;
  }
  .bk__info {
    padding: 20px 16px 16px;
  }
  .bk-artworks,
  .bk-shelf {
    padding: 0 8px;
  }
}
