/* =========================================================================
   书架 — front page. Depends on base.css + content.css.
   ========================================================================= */

/* ---------- hero: one book on its shelf, the summary beside it ---------- */
.dj-home-hero { border-bottom: 1px solid var(--line); }
.dj-home-hero__inner {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: center;
	padding-top: 40px; padding-bottom: 72px;
}
.dj-home-hero__stage {
	display: flex; align-items: flex-end; justify-content: center;
	min-height: 440px; padding: 48px 40px 0;
	background: var(--paper); border-bottom: 6px solid var(--oak); position: relative;
}
.dj-home-hero__stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(to top, rgba(194, 153, 106, .12), rgba(194, 153, 106, 0)); pointer-events: none; }
.dj-home-hero__img { position: relative; z-index: 1; height: min(60vh, 520px); width: auto; max-width: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 22px 18px rgba(30, 27, 24, .26)); transition: transform .2s ease; }
.dj-home-hero__stage:hover .dj-home-hero__img { transform: translateY(-4px); }
.dj-home-hero__title { font: 600 clamp(30px, 3.4vw, 44px)/1.28 var(--serif); letter-spacing: .02em; margin: 0 0 10px; }
.dj-home-hero__title a:hover { color: var(--walnut); }
.dj-home-hero__body .dj-byline { font-size: 16px; color: var(--muted); margin: 0; }
.dj-home-hero__body .dj-byline b { font-weight: 500; color: var(--ink); }
.dj-home-hero__lead { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font: 400 19px/1.7 var(--serif); max-width: 30em; }
.dj-home-hero__price { margin: 22px 0 0; font: 500 24px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.dj-home-hero__price .woocommerce-Price-currencySymbol { font-size: .62em; margin-right: .12em; }
.dj-home-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.dj-home-hero__actions .dj-btn { min-width: 180px; }

/* ---------- shelves ---------- */
.dj-home-shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.dj-home-shelf__head .dj-label { margin-bottom: 40px; }
.dj-more-link { font-size: 14px; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid transparent; white-space: nowrap; }
.dj-more-link:hover { color: var(--ink); border-bottom-color: var(--oak); }
.dj-home-shelf__tools { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.dj-authors__shuffle {
	border: 1px solid var(--ink); border-radius: 2px; background: var(--paper); color: var(--ink);
	padding: 6px 14px; font: 500 13px/1 var(--sans); letter-spacing: .08em; cursor: pointer;
	transition: background-color .15s ease;
}
.dj-authors__shuffle:hover { background: var(--beige); }
.dj-authors__item[hidden] { display: none; }
.dj-books--home { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dj-home-best .dj-books--home, .dj-home-audio .dj-books--home, .dj-home-ebook .dj-books--home { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- categories ---------- */
.dj-cats { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.dj-cat a { display: block; background: var(--paper); border: 1px solid var(--line); padding: 18px 18px 16px; transition: border-color .15s ease; }
.dj-cat a:hover { border-color: var(--oak); color: inherit; }
.dj-cat__img { display: block; height: 120px; margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 2px solid var(--oak); background: linear-gradient(to top, rgba(194, 153, 106, .10), rgba(194, 153, 106, 0) 60%); }
.dj-cat__img img { max-height: 100%; width: auto; object-fit: contain; }
.dj-cat__img:empty { height: 0; border: 0; margin: 0; }
.dj-cat__name { display: block; font: 500 17px/1.4 var(--serif); }
.dj-cat__count { display: block; font-size: 12px; letter-spacing: .08em; color: var(--muted); margin-top: 2px; }

/* ---------- authors ---------- */
.dj-authors { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 28px 18px; }
.dj-authors__item { text-align: center; min-width: 0; }
.dj-authors__avatar { display: block; width: 100%; max-width: 112px; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--beige); box-shadow: 0 10px 18px -14px rgba(30, 27, 24, .5); transition: transform .2s ease; }
.dj-authors__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.dj-authors__item a:hover .dj-authors__avatar { transform: translateY(-3px); }
.dj-authors__name { display: block; margin-top: 12px; font: 500 14px/1.5 var(--serif); }
.dj-authors__item a:hover .dj-authors__name { color: var(--walnut); }

/* ---------- posts ---------- */
.dj-posts--home { max-width: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.dj-posts--home .dj-posts__item { border: 0; padding: 0; }
.dj-posts--home .dj-post-card, .dj-posts--home .dj-post-card:has(.dj-post-card__media) { grid-template-columns: 1fr; gap: 14px; }
.dj-posts--home .dj-post-card__title { font-size: 19px; }

/* ---------- visit ---------- */
.dj-home-visit { background: var(--paper); border-top: 1px solid var(--line); }
.dj-home-visit__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; }
.dj-home-visit__title { font: 600 24px/1.3 var(--serif); margin: 0 0 14px; }
.dj-home-visit__address { font-style: normal; line-height: 1.8; margin: 0 0 12px; }
.dj-home-visit__hours { line-height: 1.8; margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.dj-home-visit__actions { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
	.dj-home-hero__inner { gap: 40px; }
	.dj-books--home, .dj-home-best .dj-books--home, .dj-home-audio .dj-books--home, .dj-home-ebook .dj-books--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.dj-authors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.dj-home-hero__inner { grid-template-columns: 1fr; gap: 28px; padding: 16px var(--gutter) 48px; }
	.dj-home-hero__stage { min-height: 0; padding: 32px 24px 0; }
	.dj-home-hero__img { height: min(52vh, 420px); }
	.dj-home-hero__title { font-size: clamp(26px, 7vw, 34px); }
	.dj-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.dj-posts--home { grid-template-columns: 1fr; gap: 24px; }
	.dj-home-visit__grid { grid-template-columns: 1fr; gap: 24px; }
	.dj-home-visit__actions { flex-direction: row; flex-wrap: wrap; }
	.dj-books--home, .dj-home-best .dj-books--home, .dj-home-audio .dj-books--home, .dj-home-ebook .dj-books--home { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
	.dj-authors { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; }
	.dj-authors__name { font-size: 13px; }
}
@media (max-width: 700px) {
	/* the 700px rule in base.css turns .dj-books into a swipe strip — keep the home shelves as grids */
	.dj-books--home { display: grid; overflow: visible; margin: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dj-books--home .dj-book { flex: none; }
	.dj-authors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
