/* 慶和家具新版：全站樣式。色票依慶和品牌手冊 */
:root {
	--cg-terra: #AB4222;
	--cg-terra-dark: #8a3519;
	--cg-ink: #231f1c;
	--cg-ink-2: #3a322c;
	--cg-mute: #6e655d;
	--cg-line: #ECE7E0;
	--cg-soft: #FBFAF8;
	--cg-sand: #F4EBDD;
	--cg-green: #00433F;
	--cg-gold: #E8C9A0;
	--cg-chip: #EFEAE3;
	--cg-r: 20px;
	--cg-font: 'Noto Sans TC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	--cg-mbar-h: 68px;
}

/* 頁首、頁尾在所有頁面都用；主要內容只有新版頁面套用 */
.cg-header, .cg-footer, .cg-mbar, .cg-new #cg-main { font-family: var(--cg-font); color: var(--cg-ink); -webkit-font-smoothing: antialiased; }
.cg-new { margin: 0; background: #fff; }
:where(.cg-new #cg-main img) { display: block; max-width: 100%; height: auto; }
:where(.cg-new #cg-main a) { text-decoration: none; }
.cg-skip { position: absolute; left: -9999px; }
.cg-skip:focus { left: 12px; top: 12px; z-index: 1000; background: #fff; padding: 8px 12px; }

/* 頁首 */
.cg-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 248, 0.94); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--cg-line); }
.cg-header__inner { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 20px; max-width: 1100px; margin: 0 auto; box-sizing: border-box; }
.cg-header__logo img, .woocommerce .cg-header__logo img { height: 22px !important; width: auto !important; max-width: none; display: block; }
.cg-header__logo span { font-weight: 700; color: var(--cg-ink); }
.cg-nav { display: none; }
.cg-menu { position: relative; }
.cg-menu summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-end; cursor: pointer; color: var(--cg-ink); }
.cg-menu summary::-webkit-details-marker { display: none; }
.cg-menu__panel { position: fixed; left: 0; right: 0; top: 52px; background: var(--cg-soft); border-bottom: 1px solid var(--cg-line); padding: 8px 24px 24px; display: flex; flex-direction: column; }
.cg-menu__panel a { font-size: 22px; font-weight: 700; color: var(--cg-ink); padding: 12px 0; text-decoration: none; }
.cg-menu__panel .cg-menu__book { color: var(--cg-terra); }
.cg-fs { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cg-line); }
.cg-fs__label { flex: 1; font-size: 15px; color: var(--cg-ink-2); }
.cg-fs button { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--cg-chip); color: var(--cg-ink); font: inherit; font-weight: 700; line-height: 1; cursor: pointer; }
.cg-fs button[data-cg-fs="-"] { font-size: 14px; }
.cg-fs button[data-cg-fs="+"] { font-size: 20px; }
.cg-fs button:disabled { opacity: .35; cursor: default; }
.cg-fs__pct { min-width: 48px; text-align: center; font-size: 14px; color: var(--cg-ink-2); }

/* 文字大小：內容與頁尾一起放大，頁首與底部按鈕不變 */
#cg-main, .cg-footer { zoom: var(--cg-fs, 1); }

/* 區塊 */
.cg-tile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px 0; overflow: hidden; }
.cg-tile--pad { padding-bottom: 56px; }
.cg-tile--soft { background: var(--cg-soft); }
.cg-tile--sand { background: var(--cg-sand); }
.cg-tile--green { background: var(--cg-green); }
.cg-tile--green .cg-h2 { color: #F7F4EF; }
.cg-tile--green .cg-lk { color: var(--cg-gold); }
.cg-eb { font-size: 14px; font-weight: 700; color: var(--cg-terra); margin-bottom: 6px; }
.cg-h, .cg-h2 { margin: 0; font-weight: 700; color: var(--cg-ink); letter-spacing: 0.01em; }
.cg-h { font-size: 32px; line-height: 1.25; }
.cg-h2 { font-size: 28px; line-height: 1.3; }
.cg-sub { margin: 10px 0 0; font-size: 17px; line-height: 1.6; color: var(--cg-ink-2); }
/* 中文斷行：.cg-nw 是一個短句（functions.php 的 cg_phrase_wrap 自動加），只在短句之間換行；比畫面寬時在裡面自然換行。標題各行排得差不多長 */
.cg-nw { display: inline-block; max-width: 100%; }
.cg-h, .cg-h2 { text-wrap: balance; }
.cg-sub { text-wrap: pretty; }
.cg-price { margin: 8px 0 0; font-size: 15px; color: var(--cg-ink-2); }
.cg-small { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--cg-mute); }
.cg-note { margin: 24px 0 0; font-size: 13px; line-height: 1.7; color: var(--cg-mute); }
.cg-links { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: center; margin-top: 20px; }
.cg-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 22px; background: var(--cg-terra); color: #fff !important; font-size: 15px; }
.cg-pill:hover { background: var(--cg-terra-dark); }
.cg-lk { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; color: var(--cg-terra); }
.cg-lk::after { content: '›'; margin-left: 4px; font-size: 18px; line-height: 1; }
.cg-room .cg-lk { min-height: 0; }

/* 主打 */
.cg-hero__img, .cg-wide { width: calc(100% + 48px); margin-top: 32px; }
.cg-hero__img img, .cg-wide img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }

/* 三個空間 */
.cg-rooms { display: grid; gap: 14px; margin-top: 28px; width: 100%; max-width: 1100px; }
.cg-room { display: flex; flex-direction: column; border-radius: var(--cg-r); overflow: hidden; background: #fff; text-align: left; }
.cg-room__img img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.cg-room__txt { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.cg-room__txt strong { display: block; font-size: 19px; color: var(--cg-ink); }
.cg-room__txt small { display: block; font-size: 13px; color: var(--cg-mute); margin-top: 2px; }

/* 客廳主角 */
.cg-sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; margin-top: 28px; width: 100%; max-width: 1100px; text-align: left; }
.cg-sig { display: flex; flex-direction: column; gap: 6px; }
.cg-sig--big { grid-column: span 2; }
.cg-sig__img img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--cg-r); }
.cg-sig__name { font-size: 15px; font-weight: 700; color: var(--cg-ink); padding: 4px 4px 0; }
.cg-sig--big .cg-sig__name { font-size: 17px; }
.cg-sig__price { font-size: 13px; color: var(--cg-ink-2); padding: 0 4px; }

/* 遊戲、工廠、門市 */
.cg-game { width: calc(100% + 48px); margin-top: 28px; }
.cg-game img { width: 100%; max-width: 640px; margin: 0 auto; }
.cg-finder { width: 100%; max-width: 440px; margin-top: 28px; }
.cg-finder svg { display: block; width: 100%; height: auto; }
.cg-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; width: 100%; max-width: 1100px; }
.cg-pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; }
.cg-list { list-style: none; margin: 24px 0 0; padding: 0; width: 100%; max-width: 520px; }
.cg-list li { font-size: 17px; padding: 16px 0; border-top: 1px solid var(--cg-line); }
.cg-list li:last-child { border-bottom: 1px solid var(--cg-line); }
.cg-store__img { width: 100%; max-width: 760px; margin-top: 28px; }
.cg-rimg { border-radius: var(--cg-r); }
.cg-store__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.cg-store__info { display: flex; flex-direction: column; gap: 4px; margin: 20px 0 0; font-size: 14px; line-height: 1.7; color: var(--cg-ink-2); }

/* 頁尾 */
.cg-footer { background: #F4F1EC; border-top: 1px solid var(--cg-line); color: var(--cg-mute); font-size: 13px; line-height: 1.9; }
.cg-footer__inner { max-width: 1100px; margin: 0 auto; padding: 28px 20px 32px; display: flex; flex-direction: column; gap: 18px; }
.cg-footer a { color: var(--cg-ink-2); text-decoration: none; }
.cg-footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cg-footer__store { display: flex; flex-direction: column; }
.cg-footer__store p { margin: 0; font-weight: 700; color: var(--cg-ink); }
.cg-footer__legal { margin: 0; font-size: 12px; }

/* 手機底部固定按鈕 */
.cg-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); background: rgba(251, 250, 248, 0.96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--cg-line); }
.cg-mbar a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 22px; font-size: 14px; background: var(--cg-chip); color: var(--cg-ink); text-decoration: none; }
.cg-mbar .cg-mbar__main { background: var(--cg-terra); color: #fff; }
body.cg { padding-bottom: calc(var(--cg-mbar-h) + env(safe-area-inset-bottom)); }

/* 平板以上 */
@media (min-width: 700px) {
	.cg-tile { padding: 80px 40px 0; }
	.cg-tile--pad { padding-bottom: 80px; }
	.cg-h { font-size: 48px; }
	.cg-h2 { font-size: 40px; }
	.cg-sub { font-size: 19px; }
	.cg-hero__img, .cg-wide, .cg-game { width: 100%; max-width: 1100px; }
	.cg-hero__img img { height: auto; aspect-ratio: 16 / 9; border-radius: var(--cg-r); }
	.cg-wide img { height: auto; aspect-ratio: 16 / 9; border-radius: var(--cg-r); }
	.cg-rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cg-sigs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cg-pair img { aspect-ratio: 3 / 2; }
	.cg-sig--big { grid-column: auto; }
}

/* 電腦：顯示主選單，拿掉底部按鈕 */
@media (min-width: 900px) {
	.cg-finder { margin-top: 40px; }
	.cg-nav { display: flex; gap: 28px; }
	.cg-nav a { font-size: 14px; color: var(--cg-ink-2); text-decoration: none; }
	.cg-nav a:hover, .cg-nav a[aria-current] { color: var(--cg-ink); }
	.cg-menu { display: none; }
	.cg-mbar { display: none; }
	body.cg { padding-bottom: 0; }
	.cg-footer__inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
	.cg-footer__legal { width: 100%; }
}

/* 標題平均斷行、內文避免最後一行只剩一兩個字 */
.cg-new h1, .cg-new h2, .cg-new h3 { text-wrap: balance; }
.cg-new p, .cg-new li, .cg-new dd { text-wrap: pretty; }
/* WooCommerce 的商品圖燈箱外框，新版頁面用不到 */
.cg-new .pswp:not(.pswp--open) { display: none !important; }

/* 深色門市區塊（文章頁文末） */
.cg-tile--dark { background: var(--cg-ink); }
.cg-tile--dark .cg-h2 { color: #F7F4EF; }
.cg-tile--dark .cg-sub { color: #D8CFC4; }
.cg-tile--dark .cg-lk { color: var(--cg-gold); }
.cg-tile--dark .cg-note, .cg-tile--dark .cg-small { color: #B5AA9D; }

/* 只給螢幕閱讀器看的文字 */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 浮動按鈕外掛（Float Menu Pro）的按鈕：新版頁面用自己的底部按鈕列 */
.floating-menu { display: none !important; }
