/*
Theme Name:   Bookshop Child
Theme URI:    https://example.com/bookshop-child
Description:  码头书店子主题。基于 Storefront，重做首页与图书详情页，封面走 2:3 比例，出版信息成表。
Author:       YG
Template:     storefront
Version:      1.1.0
License:      GPL-2.0-or-later
Text Domain:  bookshop-child
*/

/* =========================================================
   1. 变量
   ========================================================= */
:root {
	--ink: #202321;
	--ink-2: #45484a;
	--ink-3: #656963;
	--line: rgba(32, 35, 33, .22);
	--line-2: rgba(32, 35, 33, .1);
	--paper: #f4f1e9;
	--paper-2: #e9e4d8;
	--card: #fbf8f1;
	--accent: #315969;
	--accent-dark: #24434f;
	--accent-tint: #dfeaf0;
	--blue: #b9d7e5;
	--red: #b5493b;
	--gold: #d6b35b;
	--ok: #2f6b4f;
	--ok-tint: #e3efe8;
	--bad: #b5493b;
	--bad-tint: #f6e6e3;
	--radius: 3px;
	--shadow-sm: 0 1px 2px rgba(32, 35, 33, .06);
	--shadow-md: 0 8px 24px rgba(32, 35, 33, .09);
	--shadow-lg: 0 18px 48px rgba(32, 35, 33, .14);
	--serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
	--sans: Inter, "Helvetica Neue", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
	--wrap: 1180px;
}

/* =========================================================
   2. 基础
   ========================================================= */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body,
body.woocommerce,
.woocommerce-page {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--ink);
}

body a {
	color: var(--accent);
	transition: color .15s ease, border-color .15s ease;
}

body a:hover,
body a:focus {
	color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
}

/* 容器统一宽度 */
.col-full,
.dsh-wrap {
	max-width: var(--wrap);
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
	box-sizing: border-box;
}

/* 首页整幅铺开：hero 和色块要到边，内容宽度交给 .dsh-wrap */
.dsh-front #content > .col-full {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.dsh-front #content > .col-full > .woocommerce {
	display: none;
}

/* =========================================================
   3. 顶部信息条
   ========================================================= */
.dsh-topbar {
	background: var(--ink);
	color: #efece6;
	font-size: 13px;
	line-height: 1;
	letter-spacing: .01em;
}

body.admin-bar .dsh-topbar {
	margin-top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .dsh-topbar { margin-top: 46px; }
}

.dsh-topbar__inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 11px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	box-sizing: border-box;
}

.dsh-topbar__mail {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #efece6;
	text-decoration: none;
	border-bottom: 1px solid rgba(239, 236, 230, .28);
	padding-bottom: 1px;
	word-break: break-all;
}

.dsh-topbar__mail:hover,
.dsh-topbar__mail:focus {
	color: #fff;
	border-bottom-color: #fff;
}

.dsh-topbar__icon {
	width: 15px;
	height: 15px;
	fill: currentColor;
	flex: none;
}

.dsh-lang {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.dsh-lang__item {
	display: inline-block;
	padding: 5px 10px;
	color: #cdc8bf;
	text-decoration: none;
	border-radius: 2px;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	transition: background .15s ease, color .15s ease;
}

.dsh-lang__item:hover,
.dsh-lang__item:focus {
	color: #fff;
	background: rgba(255, 255, 255, .1);
}

.dsh-lang__item.is-active {
	color: var(--ink);
	background: #efece6;
	font-weight: 600;
}

/* =========================================================
   4. 页头
   ========================================================= */
.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	box-shadow: none;
}

.site-header .col-full {
	padding-top: 22px;
	padding-bottom: 22px;
}

.site-branding {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* 品牌区：B 标记 + 公司名 + 副标 */
.dsh-brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--ink);
}

.dsh-brand__mark {
	display: grid;
	width: 36px;
	height: 36px;
	flex: none;
	place-items: center;
	border: 1px solid var(--ink);
	border-radius: 50%;
	font: 20px/1 var(--serif);
	color: var(--ink);
	transition: background .15s ease, color .15s ease;
}

.dsh-brand:hover .dsh-brand__mark {
	background: var(--ink);
	color: var(--paper);
}

.dsh-brand__text {
	display: flex;
	flex-direction: column;
}

.dsh-brand__name {
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .01em;
	line-height: 1.2;
	color: var(--ink);
}

.dsh-brand__sub {
	display: block;
	margin-top: 3px;
	font-size: 9px;
	font-weight: 500;
	letter-spacing: .06em;
	color: var(--ink-3);
	text-transform: uppercase;
}

@media screen and (min-width: 700px) {
	.dsh-brand__mark { width: 40px; height: 40px; font-size: 22px; }
	.dsh-brand__name { font-size: 13px; }
	.dsh-brand__sub { font-size: 9.5px; }
}

.site-title {
	font-family: var(--serif);
	font-size: clamp(24px, 3.4vw, 34px);
	line-height: 1.15;
	margin: 0;
	letter-spacing: -.02em;
}

.site-title a {
	color: var(--ink);
	text-decoration: none;
}

.site-title a:hover {
	color: var(--accent);
}

.site-description {
	color: var(--ink-3);
	font-size: 13px;
	margin: 0;
	letter-spacing: .04em;
}

/* 搜索框 */
.site-search .widget_product_search form,
.site-search .woocommerce-product-search {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--line);
	background: #fff;
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.site-search .widget_product_search form:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(138, 90, 43, .12);
}

.site-search input[type="search"] {
	border: 0;
	background: transparent;
	padding: 10px 14px;
	font-size: 14px;
	width: 100%;
	color: var(--ink);
}

.site-search button[type="submit"] {
	border: 0;
	background: var(--ink);
	color: #fff;
	padding: 0 18px;
	font-size: 13px;
	letter-spacing: .04em;
	cursor: pointer;
	transition: background .15s ease;
}

.site-search button[type="submit"]:hover {
	background: var(--accent);
}

/* 主导航 */
.storefront-primary-navigation {
	background: transparent;
	border-top: 1px solid var(--line);
	margin-top: 20px;
	padding-top: 0;
}

.main-navigation {
	padding: 0;
}

.main-navigation ul.menu,
.main-navigation div.menu > ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}

.main-navigation ul.menu > li > a,
.main-navigation div.menu > ul > li > a {
	display: inline-block;
	padding: 13px 14px;
	color: var(--ink-2);
	text-decoration: none;
	font-size: 13px;
	letter-spacing: .07em;
	text-transform: uppercase;
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.main-navigation ul.menu > li > a:hover,
.main-navigation div.menu > ul > li > a:hover,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-item > a {
	color: var(--ink);
	border-bottom-color: var(--accent);
}

/* 购物车 */
#site-header-cart {
	margin: 0;
}

#site-header-cart .cart-contents {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	color: var(--ink);
	text-decoration: none;
	font-size: 13px;
	box-shadow: var(--shadow-sm);
	transition: border-color .15s ease, box-shadow .15s ease;
}

#site-header-cart .cart-contents:hover {
	border-color: var(--accent);
	box-shadow: var(--shadow-md);
}

#site-header-cart .count {
	color: var(--ink-3);
}

/* =========================================================
   5. 首页 Hero
   ========================================================= */
.dsh-home {
	padding: 0;
}

.dsh-hero {
	background:
		radial-gradient(1200px 420px at 15% -10%, #f7f1e7 0%, rgba(247, 241, 231, 0) 60%),
		linear-gradient(180deg, #fdfbf8 0%, var(--paper) 100%);
	border-bottom: 1px solid var(--line);
	overflow: hidden;
}

.dsh-hero__inner {
	display: flex;
	align-items: center;
	gap: 56px;
	padding-top: 64px;
	padding-bottom: 64px;
}

.dsh-hero__copy {
	flex: 1 1 52%;
	min-width: 0;
}

.dsh-hero__eyebrow {
	font-size: 12px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--accent);
	margin: 0 0 14px;
}

.dsh-hero__title {
	font-size: clamp(34px, 5.2vw, 58px);
	line-height: 1.05;
	margin: 0 0 18px;
	letter-spacing: -.025em;
}

.dsh-hero__lede {
	font-size: clamp(15px, 1.5vw, 18px);
	color: var(--ink-2);
	max-width: 46ch;
	margin: 0 0 28px;
	line-height: 1.6;
}

.dsh-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.dsh-btn {
	display: inline-block;
	padding: 13px 26px;
	font-size: 14px;
	letter-spacing: .03em;
	text-decoration: none;
	border-radius: var(--radius);
	border: 1px solid transparent;
	transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.dsh-btn--primary {
	background: var(--ink);
	color: #fff;
}

.dsh-btn--primary:hover,
.dsh-btn--primary:focus {
	background: var(--accent);
	color: #fff;
	transform: translateY(-1px);
}

.dsh-btn--ghost {
	border-color: var(--line);
	color: var(--ink-2);
	background: #fff;
}

.dsh-btn--ghost:hover,
.dsh-btn--ghost:focus {
	border-color: var(--ink);
	color: var(--ink);
}

.dsh-hero__spot {
	flex: 0 0 300px;
	position: relative;
}

.dsh-hero__spot a {
	display: block;
	text-decoration: none;
}

.dsh-hero__spot img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 2px;
	box-shadow: var(--shadow-lg);
	transform: rotate(-1.4deg);
	transition: transform .25s ease;
}

.dsh-hero__spot a:hover img {
	transform: rotate(0deg) translateY(-3px);
}

.dsh-hero__spot-title {
	display: block;
	margin-top: 16px;
	font-family: var(--serif);
	font-size: 15px;
	color: var(--ink-2);
	text-align: center;
}

/* =========================================================
   6. 区块 / 书卡
   ========================================================= */
.dsh-section {
	padding: 64px 0;
}

.dsh-section--tint {
	background: var(--paper-2);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.dsh-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.dsh-section__title {
	font-size: clamp(22px, 2.6vw, 30px);
	margin: 0;
}

.dsh-section__more {
	font-size: 13px;
	letter-spacing: .04em;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	white-space: nowrap;
}

.dsh-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 24px;
}

.dsh-card {
	min-width: 0;
}

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

.dsh-card__art {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 340px;
	padding: 10px;
	background: var(--card);
	border-radius: 2px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: box-shadow .2s ease, transform .2s ease;
	box-sizing: border-box;
}

.dsh-card__art img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	box-shadow: 0 4px 14px rgba(32, 35, 33, .16);
}

.dsh-card__link:hover .dsh-card__art {
	box-shadow: var(--shadow-md);
	transform: translateY(-3px);
}

.dsh-card__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.dsh-card__title {
	font-family: var(--serif);
	font-size: 16px;
	line-height: 1.35;
	color: var(--ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dsh-card__author {
	font-size: 12.5px;
	color: var(--ink-3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dsh-card__price {
	font-size: 14px;
	font-weight: 600;
	color: var(--accent);
	margin-top: 2px;
}

.dsh-card__price del {
	color: var(--ink-3);
	font-weight: 400;
	font-size: 12.5px;
	margin-right: 6px;
}

/* =========================================================
   7. 分类入口
   ========================================================= */
.dsh-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 32px;
}

.dsh-links__title {
	font-size: 13px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-3);
	font-family: var(--sans);
	font-weight: 600;
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
}

.dsh-links__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.dsh-links__list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	text-decoration: none;
	color: var(--ink-2);
	font-size: 14.5px;
	padding: 2px 0;
	border-bottom: 1px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.dsh-links__list a:hover {
	color: var(--accent);
	border-bottom-color: var(--accent-tint);
}

.dsh-links__count {
	font-size: 12px;
	color: var(--ink-3);
	font-variant-numeric: tabular-nums;
}

/* =========================================================
   8. 承诺区
   ========================================================= */
.dsh-promise {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 36px;
}

.dsh-promise__item {
	min-width: 0;
}

.dsh-promise__num {
	display: block;
	font-family: var(--serif);
	font-size: 13px;
	color: var(--accent);
	letter-spacing: .1em;
	margin-bottom: 10px;
}

.dsh-promise__item h3 {
	font-size: 18px;
	margin: 0 0 8px;
}

.dsh-promise__item p {
	margin: 0;
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.6;
}

/* =========================================================
   9. 商品详情
   ========================================================= */
.woocommerce div.product div.images,
.woocommerce div.product div.summary {
	margin-bottom: 2.2rem;
}

.woocommerce div.product div.images img {
	width: 100%;
	height: auto;
	height: auto; object-fit: contain;
	box-shadow: var(--shadow-md);
	background: var(--card);
}

.woocommerce div.product .product_title {
	font-size: clamp(26px, 3vw, 38px);
	line-height: 1.2;
	margin-bottom: .35rem;
}

.dsh-subtitle {
	color: var(--ink-2);
	font-size: 1.05rem;
	font-style: italic;
	margin: 0 0 1rem;
}

.dsh-byline {
	font-size: 15px;
	margin: 0 0 1.1rem;
	color: var(--ink-2);
}

.dsh-byline a {
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid rgba(138, 90, 43, .3);
}

.dsh-byline a:hover {
	border-bottom-color: var(--accent);
}

.dsh-spec {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.6rem;
	font-size: 14px;
}

.dsh-spec th,
.dsh-spec td {
	text-align: left;
	padding: .5rem .6rem .5rem 0;
	border-bottom: 1px solid var(--line-2);
	vertical-align: top;
}

.dsh-spec th {
	width: 32%;
	color: var(--ink-3);
	font-weight: 500;
	white-space: nowrap;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--ink);
	font-size: 1.7rem;
	font-weight: 600;
	font-family: var(--serif);
}

.woocommerce div.product form.cart .button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #place_order {
	background-color: var(--ink);
	border-color: var(--ink);
	border-radius: var(--radius);
	color: #fff;
	font-size: 14px;
	letter-spacing: .03em;
	padding: 13px 26px;
	transition: background .15s ease, border-color .15s ease;
}

.woocommerce div.product form.cart .button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #place_order:hover {
	background-color: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.dsh-stock {
	display: inline-block;
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ok-tint);
	color: var(--ok);
	margin-bottom: .9rem;
	letter-spacing: .02em;
}

.dsh-stock.is-out {
	background: var(--bad-tint);
	color: var(--bad);
}

.woocommerce-tabs .panel {
	max-width: 68ch;
	line-height: 1.75;
}

/* =========================================================
   10. 列表页
   ========================================================= */
.woocommerce ul.products li.product a img {
	height: auto; object-fit: contain;
	background: var(--card);
	box-shadow: var(--shadow-sm);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--serif);
	font-size: 16px;
	line-height: 1.35;
	min-height: 2.7em;
}

.woocommerce ul.products li.product .dsh-list-author {
	display: block;
	color: var(--ink-3);
	font-size: 12.5px;
	margin-top: 2px;
}

.woocommerce .woocommerce-breadcrumb {
	font-size: 12.5px;
	color: var(--ink-3);
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	margin-bottom: 28px;
}

.woocommerce .woocommerce-ordering select {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 8px 10px;
	font-size: 13px;
	background: #fff;
	color: var(--ink-2);
}

/* =========================================================
   11. 页脚
   ========================================================= */
.site-footer {
	background: var(--ink);
	color: #cfcabf;
	border-top: 0;
	padding: 32px 0;
	font-size: 13px;
}

.site-footer a {
	color: #efece6;
}

.site-footer a:hover {
	color: #fff;
}

.site-footer .site-info {
	padding: 0;
	text-align: center;
	letter-spacing: .02em;
}

.storefront-handheld-footer-bar {
	background: var(--ink);
	border-top: 0;
}

/* =========================================================
   12. 响应式
   ========================================================= */
@media screen and (max-width: 1024px) {
	.dsh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dsh-hero__inner { gap: 36px; }
	.dsh-hero__spot { flex-basis: 240px; }
}

@media screen and (max-width: 860px) {
	.dsh-hero__inner {
		flex-direction: column-reverse;
		align-items: flex-start;
		padding-top: 40px;
		padding-bottom: 48px;
		gap: 28px;
	}
	.dsh-hero__spot {
		flex: none;
		width: 190px;
	}
	.dsh-hero__spot img { transform: none; }
	.dsh-promise { grid-template-columns: 1fr; gap: 26px; }
	.dsh-section { padding: 44px 0; }
}

@media screen and (max-width: 700px) {
	.dsh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
	.col-full, .dsh-wrap { padding-left: 18px; padding-right: 18px; }
	.dsh-topbar__inner { padding: 10px 18px; font-size: 12px; }
	.dsh-topbar__inner { justify-content: center; }
	.main-navigation ul.menu > li > a { padding: 11px 10px; font-size: 12px; }
	.woocommerce div.product div.images { float: none; width: 100%; }
	.woocommerce div.product div.summary { float: none; width: 100%; }
}

@media screen and (max-width: 420px) {
	.dsh-hero__actions { flex-direction: column; align-items: stretch; }
	.dsh-btn { text-align: center; }
	.dsh-section__head { flex-wrap: wrap; }
}

/* =========================================================
   13. 动效与可访问性
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

.screen-reader-text:focus {
	background: #fff;
	color: var(--ink);
	padding: 10px 16px;
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
}

/* 打印 */
@media print {
	.dsh-topbar,
	.site-header,
	.site-footer,
	.dsh-hero__actions { display: none !important; }
}
