/* ==== Books Archive & Single Styles (assets/css/books.css) ==== */

/* ==========================================================================
   1. Shared Hero (Archive + Single)
   ========================================================================== */
.books-hero {
  padding: 100px 0 90px;
  position: relative;
  overflow: hidden;
}

.books-hero__inner {
  max-width: 860px;
}

.books-hero__title {
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.055em;
  color: #fff;
  margin: 0;
}

.books-hero__lead {
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 19px;
  line-height: 1.7;
}

.books-hero__strip {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.books-hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-orange-500);
  flex: 0 0 auto;
}

/* ==========================================================================
   2. Books Grid, Card, Empty State & Pagination
   ========================================================================== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.book-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease-brand);
}

.book-card:hover {
  transform: translateY(-4px);
}

.book-card__link {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.book-card__cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  aspect-ratio: 2 / 3;
  transition: box-shadow 0.2s var(--ease-brand);
}

.book-card:hover .book-card__cover {
  box-shadow: 0 12px 30px rgba(7, 21, 34, 0.10);
}

.book-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-brand);
}

.book-card:hover .book-card__cover img {
  transform: scale(1.04);
}

.book-card__cover--empty {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  background: var(--color-navy-900);
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.book-card__body {
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1;
}

.book-card__title {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--color-navy-900);
  margin: 0;
}

.book-card__author {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-steel);
  margin: 0;
}

.book-card__meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.book-card__pages {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.book-card__price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-navy-900);
  white-space: nowrap;
}

.book-card__price i {
  font-style: normal;
  color: var(--color-orange-500);
}

.books-empty {
  margin-top: 8px;
  padding: 44px 36px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-steel);
  font-size: 15px;
  line-height: 1.7;
}

.books-pagination {
  margin-top: 56px;
}

.books-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.books-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-graphite);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.2s var(--ease-brand), color 0.2s var(--ease-brand);
}

.books-pagination a.page-numbers:hover {
  border-color: var(--color-navy-900);
  color: var(--color-navy-900);
}

.books-pagination .page-numbers.current {
  background: var(--color-navy-900);
  border-color: var(--color-navy-900);
  color: #fff;
  font-weight: 700;
}

.books-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--color-muted);
}

/* ==========================================================================
   3. Single Book Detail
   ========================================================================== */
.book-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 64px;
  align-items: start;
}

.book-detail__cover {
  max-width: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.book-detail__cover img {
  display: block;
  width: 100%;
  height: auto;
}

.book-detail__cover--empty {
  max-width: 420px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  background: var(--color-navy-900);
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.book-spec {
  margin: 0;
  display: grid;
}

.book-spec-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-line);
}

.book-spec-row__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding-top: 4px;
}

.book-spec-row__value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-graphite);
  word-break: break-word;
}

.book-data {
  margin-top: 32px;
  padding: 32px;
  background: var(--color-navy-900);
  color: #fff;
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.book-data__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.book-data__num i {
  font-style: normal;
  font-size: 0.45em;
  color: var(--color-orange-500);
  margin-left: 4px;
  letter-spacing: 0;
}

.book-data__label {
  display: block;
  margin-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.book-data__note {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.book-content {
  margin-top: 44px;
  max-width: 780px;
}

.book-content h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--color-navy-900);
  margin: 34px 0 12px;
}

.book-content h3 {
  font-size: 19px;
  color: var(--color-navy-900);
  margin: 28px 0 10px;
}

.book-content p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-graphite);
  margin: 0 0 16px;
}

.book-content ul,
.book-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.book-content ul {
  list-style: disc;
}

.book-content ol {
  list-style: decimal;
}

.book-content li {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-graphite);
}

.book-content a {
  color: var(--color-blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.book-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.book-content blockquote {
  margin: 24px 0;
  padding-left: 20px;
  border-left: 2px solid var(--color-orange-500);
  color: var(--color-steel);
  font-size: 17px;
  line-height: 1.8;
}

.book-actions {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.book-actions .btn {
  width: auto;
  max-width: 100%;
}

/* ==========================================================================
   Responsive Overrides
   ========================================================================== */
@media (max-width: 1040px) {
  .books-hero {
    padding: 72px 0 64px;
  }
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 24px;
  }
  .book-detail__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .book-detail__cover {
    max-width: 320px;
  }
  .book-detail__cover--empty {
    max-width: 320px;
  }
}

@media (max-width: 680px) {
  .books-hero {
    padding: 56px 0 48px;
  }
  .books-hero__title {
    font-size: 34px;
  }
  .books-hero__lead {
    font-size: 16px;
  }
  .books-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .book-card:hover {
    transform: none;
  }
  .book-detail__cover {
    max-width: 100%;
  }
  .book-detail__cover--empty {
    max-width: 100%;
  }
  .book-spec-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .book-data {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px;
  }
  .books-pagination {
    margin-top: 48px;
  }
}

/* 4. Closing CTA (shared by the archive page) */
.books-cta {
  padding-block: clamp(80px, 9vw, 128px);
}

.books-cta__panel {
  background: var(--color-navy-900);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(48px, 6vw, 76px) clamp(36px, 5vw, 68px);
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 56px;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.books-cta__content h2 {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0;
  font-weight: 700;
}

.books-cta__content p {
  margin-top: 24px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.75;
  max-width: 620px;
}

.books-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-self: end;
}

.books-cta__actions .btn {
  width: auto;
  max-width: 100%;
  min-height: 54px;
  padding: 0 32px;
  font-size: 13px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

@media (max-width: 1040px) {
  .books-cta {
    padding-block: var(--space-24);
  }
  .books-cta__panel {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 32px;
    align-items: start;
  }
  .books-cta__actions {
    justify-self: start;
  }
}

@media (max-width: 680px) {
  .books-cta {
    padding-block: 64px;
  }
  .books-cta__panel {
    padding: 36px 24px;
    gap: 28px;
  }
  .books-cta__content h2 {
    font-size: 28px;
    line-height: 1.2;
  }
  .books-cta__content p {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.65;
  }
  .books-cta__actions .btn {
    width: 100%;
  }
}
/* Price keeps the currency symbol at full size (it is part of the figure,
   unlike the unit words that follow an extent). */
.book-data__num--price i {
  font-size: 1em;
  margin-left: 0;
  margin-right: 2px;
}

/* ==========================================================================
   5. Library toolbar
   The audience dropdown component itself is styled in chrome.css, because the
   header renders the same component on every page.
   ========================================================================== */
.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: -18px 0 40px;
}

/* A term description arrives with its own paragraphs. */
.books-hero__lead p {
  margin: 0;
}

.books-hero__lead p + p {
  margin-top: 14px;
}

@media (max-width: 680px) {
  .library-toolbar {
    margin-top: -14px;
  }
}

/* ==========================================================================
   6. Distinct Taxonomy Term Archive Styles
   ========================================================================== */

/* --- 6.1 book_subject (题材: Engineering Blueprint / Spec layout) --- */
.tax-style-subject .books-hero {
  background: radial-gradient(circle at top right, #12314D 0%, #071522 70%);
  border-bottom: 2px solid var(--color-orange-500);
}

.tax-style-subject .books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.tax-style-subject .book-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 24px;
}

.tax-style-subject .book-card:hover {
  border-color: var(--color-blue-600);
  box-shadow: 0 10px 25px rgba(7, 21, 34, 0.08);
}

.tax-style-subject .book-card__link {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
}

.tax-style-subject .book-card__cover {
  aspect-ratio: 3 / 4;
}

/* Video badge banner in subject hero */
.term-media-banner--video {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(229, 45, 39, 0.15);
  border: 1px solid rgba(229, 45, 39, 0.4);
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  transition: all 180ms ease;
}

.term-media-banner--video:hover {
  background: #E52D27;
  border-color: #E52D27;
}

/* --- 6.2 book_use (用途: Architecture Portfolio / Editorial Catalog) --- */
.tax-style-use .books-hero {
  background: #0B1F33;
  border-left: 8px solid var(--color-blue-500);
}

.tax-style-use .books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 36px;
}

.tax-style-use .book-card {
  background: transparent;
}

.tax-style-use .book-card__cover {
  aspect-ratio: 16 / 10; /* Architectural wide crop */
  border-radius: var(--radius-sm);
}

.tax-style-use .book-card__title {
  font-size: 21px;
  letter-spacing: -0.04em;
}

.term-media-banner--file {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--color-blue-600);
  border-radius: var(--radius-sm);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background-color 180ms ease;
}

.term-media-banner--file:hover {
  background: var(--color-navy-900);
}

/* --- 6.3 book_audience (受众群体: Magazine / Gallery Layout) --- */
.tax-style-audience .books-hero {
  background: linear-gradient(135deg, #071522 0%, #12314D 100%);
}

.tax-style-audience .term-hero-cover {
  margin-bottom: 24px;
  max-width: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tax-style-audience .term-hero-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.tax-style-audience .books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}

.tax-style-audience .book-card__cover {
  aspect-ratio: 2 / 3;
  box-shadow: 0 8px 20px rgba(7, 21, 34, 0.06);
}

@media (max-width: 1040px) {
  .tax-style-subject .books-grid {
    grid-template-columns: 1fr;
  }
  .tax-style-use .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tax-style-audience .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .tax-style-subject .book-card__link {
    grid-template-columns: 1fr;
  }
  .tax-style-use .books-grid,
  .tax-style-audience .books-grid {
    grid-template-columns: 1fr;
  }
}
