/*
Theme Name: 栗子文創 kuri-tt5
Template: twentytwentyfive
Description: 栗子文創官網的 Twenty Twenty-Five 子佈景。色、字、間距在 theme.json；這支檔只放 theme.json 寫不出來的版面規則。規格見 專案/栗智文創/網站/DESIGN.md。
Version: 0.1.8
Requires at least: 6.7
Text Domain: kuri-tt5
*/

/* 斷點跟著核心區塊走：1024（書架 5→3、內文 18→17）、782（欄區塊疊起，核心預設）、600（導覽收成選單鈕，核心預設）。 */

html { -webkit-text-size-adjust: 100%; }
/* 書介裡嵌的影片（舊內容常寫死 width=500）跟著欄寬縮，不讓手機左右捲動 */
.wp-block-post-content :is(iframe, video, embed, object), .woocommerce-Tabs-panel :is(iframe, video, embed, object) { max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
body { overflow-wrap: anywhere; }
@media (min-width: 1024px) { body { font-size: 18px; } }

/* 按鈕：高 48、手機點得到 */
.wp-element-button, .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.is-style-outline > .wp-block-button__link, .wp-block-button__link.is-style-outline { background: transparent; color: var(--wp--preset--color--brown); border: 1.5px solid var(--wp--preset--color--brown); }
.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--brown); color: #fff; }
:where(a, button, input, summary):focus-visible { outline: 3px solid var(--wp--preset--color--brown); outline-offset: 3px; }
.has-brown-background-color :focus-visible, .has-ink-background-color :focus-visible { outline-color: #fff; }

/* 頁首 */
.kuri-header { min-height: 88px; }
.kuri-logo img { height: 72px; width: auto; display: block; margin-left: -14px; }
.kuri-nav .wp-block-navigation-item__content { display: flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--wp--preset--color--ink); border-bottom: 2px solid transparent; }
.kuri-nav .current-menu-item > .wp-block-navigation-item__content { border-bottom-color: var(--wp--preset--color--brown); }
.kuri-nav .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--brown); text-decoration: none; }
.kuri-nav .wp-block-navigation__container { gap: 8px; }
/* 「購物車」只在商店、分類、單書頁出現 */
.kuri-nav .kuri-nav-cart { display: none; }
body.post-type-archive-product .kuri-nav .kuri-nav-cart, body.tax-product_cat .kuri-nav .kuri-nav-cart, body.single-product .kuri-nav .kuri-nav-cart { display: flex; }
.kuri-nav .wp-block-navigation__responsive-container-open { font-weight: 700; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--wp--preset--color--ink); border-radius: 4px; }
.kuri-nav .wp-block-navigation__responsive-container-open svg { display: none; }
.kuri-nav .wp-block-navigation__responsive-container-open::after { content: "選單"; }
.kuri-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { min-height: 56px; font-size: 18px; border-bottom: 1px solid var(--wp--preset--color--line); width: 100%; }

/* 結帳頁首 */
.kuri-checkout-header .kuri-logo img { height: 48px; margin-left: -9px; }

/* 首頁開場：米杏底，左直排標語、中公司介紹、右上下兩行 LOGO */
.kuri-hero__wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px clamp(24px, 5vw, 88px); align-items: center; }
.kuri-motto { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 14px; border-right: 4px solid var(--wp--preset--color--gold); padding-right: clamp(12px, 2vw, 28px); margin: 0; }
.kuri-motto img { display: block; width: clamp(40px, 5.6vw, 72px); height: auto; }
.kuri-motto-sub { writing-mode: vertical-rl; font-family: var(--wp--preset--font-family--sans) !important; font-weight: 700; font-size: clamp(20px, 2.5vw, 32px); line-height: 1.4; letter-spacing: .1em; color: var(--wp--preset--color--gray); margin: 0 !important; }
.kuri-hero-side p { font-size: clamp(17px, 1.7vw, 22px); }
.kuri-hero-logo img { width: clamp(160px, 24vw, 300px); height: auto; display: block; }

/* 公司簡表 */
.kuri-facts table { border-collapse: collapse; width: 100%; }
.kuri-facts td { border: 0; border-top: 1px solid var(--wp--preset--color--line); padding: 14px 0; vertical-align: top; font-family: var(--wp--preset--font-family--serif); }
.kuri-facts tr:last-child td { border-bottom: 1px solid var(--wp--preset--color--line); }
.kuri-facts td:first-child { width: 5.5em; color: var(--wp--preset--color--gray); font-family: var(--wp--preset--font-family--sans); }

/* 書架：寬 1024 以上 5 本、600～1023 3 本、600 以下 2 本（核心預設 600 以下 1 欄，這裡蓋掉） */
.kuri-shelf .wp-block-post-template { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 44px 28px; }
.kuri-shelf .wp-block-post-featured-image { margin: 0; }
.kuri-shelf .wp-block-post-featured-image img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; background: var(--wp--preset--color--apricot); }
.kuri-shelf .wp-block-post-featured-image a:hover img { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 3px; }
.kuri-shelf .wp-block-post-title { font-size: 16px; line-height: 1.5; margin-top: 14px; letter-spacing: 0; }
.kuri-shelf .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.kuri-meta { font-family: var(--wp--preset--font-family--sans) !important; font-size: 14px; color: var(--wp--preset--color--gray); margin: 2px 0 0 !important; }
.kuri-tag a, .kuri-tag span { display: inline-block; font-size: 13px; line-height: 1; padding: 5px 8px; border-radius: 3px; background: var(--wp--preset--color--fog); color: var(--wp--preset--color--gray); text-decoration: none; }
.kuri-tag { margin-top: 8px !important; }
.kuri-tag .wp-block-post-terms__separator { display: none; }
.has-apricot-background-color .kuri-tag a { background: #fff; }

/* 試閱引句 */
.kuri-quote { border-left: 4px solid var(--wp--preset--color--gold) !important; padding-left: clamp(16px, 2.4vw, 32px); margin: 0; }
.kuri-quote p { font-weight: 700; font-size: var(--wp--preset--font-size--xx-large); line-height: 1.65; max-width: 21em; }
.kuri-quote cite { font-family: var(--wp--preset--font-family--sans); font-style: normal; font-size: 15px; display: block; margin-top: 28px; }

/* 哪裡買 */
.kuri-buy { border-top: 1px solid var(--wp--preset--color--line); }
.kuri-buy > .wp-block-column { padding-top: 32px; padding-bottom: 32px; }
.kuri-buy > .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--line); padding-left: clamp(20px, 4vw, 56px); }
.kuri-buy p { color: var(--wp--preset--color--gray); }

/* 電子書平台鈕：ink 框、滑過變 ink 底 */
.kuri-plat .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); border: 1.5px solid var(--wp--preset--color--ink); padding: 0 20px; }
.kuri-plat .wp-block-button__link:hover { background: var(--wp--preset--color--ink); color: #fff; }

/* 書目頁上方的電子書平台列 */
.kuri-band { border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); padding: 24px 0; }
.kuri-band p { font-family: var(--wp--preset--font-family--sans); font-size: 14px; color: var(--wp--preset--color--gray); margin: 4px 0 0; }

/* 限制級書區 */
.kuri-gate { border-radius: 6px; }
.kuri-gate .wp-block-button__link { background: var(--wp--preset--color--gold); border-color: var(--wp--preset--color--gold); color: var(--wp--preset--color--ink); }
.kuri-gate p { color: var(--wp--preset--color--line); }
.kuri-gate .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: #fff; }

/* 限制級標籤：封面照常顯示，左上角標「限制級」。分級標示慣用紅色，是全站唯一例外的第四個有彩度顏色 */
.kuri-r18 .wp-block-post-featured-image { position: relative; }
.kuri-r18 .wp-block-post-featured-image::after { content: "限制級"; position: absolute; top: 8px; left: 8px; background: #B3261E; color: #fff; font-family: var(--wp--preset--font-family--sans); font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 7px; border-radius: 3px; pointer-events: none; }

/* 單書頁 */
.kuri-single .wp-block-post-featured-image img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }
.kuri-single .wc-block-components-product-price, .kuri-single .wp-block-woocommerce-product-price { font-size: 20px; font-weight: 700; }
.kuri-zone { border: 1px solid var(--wp--preset--color--line); border-radius: 6px; padding: 20px; }
.kuri-zone h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: 0; }
.kuri-zone p { font-family: var(--wp--preset--font-family--sans); font-size: 15px; color: var(--wp--preset--color--gray); }
.kuri-zone .single_add_to_cart_button, .kuri-zone form.cart .button { width: 100%; }
.kuri-zone .stock.out-of-stock { font-family: var(--wp--preset--font-family--sans); color: var(--wp--preset--color--gray); }

/* 文章列表（借 WIRED：一列一篇、細線分隔、灰字日期） */
.kuri-rows .wp-block-post { border-bottom: 1px solid var(--wp--preset--color--line); padding: 20px 0; }
.kuri-rows .wp-block-post-title { font-size: 22px; margin: 0; }
.kuri-rows .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }

/* 頁尾 */
.kuri-footer, .kuri-footer a { color: #fff; }
.kuri-footer h2 { font-size: 17px; color: #fff; letter-spacing: 0; margin-bottom: 8px; }
.kuri-footer p, .kuri-footer li { font-family: var(--wp--preset--font-family--sans); font-size: 15px; }
.kuri-footer ul { list-style: none; margin: 0; padding: 0; }
.kuri-footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.kuri-foot-logo img { width: 220px; height: auto; display: block; margin-left: -17px; }
.kuri-copy { border-top: 1px solid var(--wp--preset--color--gold); padding-top: 16px; font-size: 13px !important; }

/* 1023 以下：書架 3 本 */
@media (max-width: 1023px) {
	.kuri-shelf .wp-block-post-template { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* 781 以下：欄區塊核心會自己疊起來；這裡只收頁首與哪裡買的線 */
@media (max-width: 781px) {
	.kuri-logo img { height: 60px; margin-left: -12px; }
	.kuri-single .wp-block-post-featured-image { max-width: 280px; }
	.kuri-nav .wp-block-navigation-item__content { padding: 0 8px; font-size: 16px; }
	.kuri-buy > .wp-block-column + .wp-block-column { border-left: 0; border-top: 1px solid var(--wp--preset--color--line); padding-left: 0; }
}
/* 599 以下：書架 2 本、按鈕滿寬、開場改成標語與 LOGO 並排 */
@media (max-width: 599px) {
	.kuri-header { min-height: 68px; }
	.kuri-shelf .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 28px 16px; }
	.kuri-home-shelf .wp-block-post-template > li:nth-child(5) { display: none; }
	.kuri-hero__wrap { grid-template-columns: auto minmax(0, 1fr); gap: 24px; }
	.kuri-hero-logo { grid-column: 2; grid-row: 1; justify-self: center; }
	.kuri-motto { grid-row: 1; }
	.kuri-hero-logo img { width: 160px; }
	.kuri-hero-side { grid-column: 1 / -1; grid-row: 2; }
	.kuri-single .wp-block-post-featured-image { max-width: 200px; }
	.kuri-hero-side .wp-block-button, .kuri-full-mobile .wp-block-button { width: 100%; }
	.kuri-hero-side .wp-block-button__link, .kuri-full-mobile .wp-block-button__link { width: 100%; }
	.kuri-plat { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kuri-plat .wp-block-button:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.kuri-plat .wp-block-button__link { width: 100%; padding: 0 8px; }
}

