/* 本檔由 build/tools/build_footer_v2.py 從 footer-v2.src.css 產生（每條宣告補 !important，切開行以下不補），請改原始檔再重產。 */
/*
 * 全站頁尾 v2 樣式 — 規格 build-parking-map/SPEC_footer-v2.md
 * 由 mu-plugin gp-contact-footer.php（v2.0）在每一頁載入 gp-footer/footer.css。
 *
 * 這是原始檔；部署檔 build/deploy-footer/gp-footer/footer.css 由 build_footer_v2.py 產生：
 * 每一條宣告都自動補上 !important（自訂屬性 --x 除外）。
 *
 * 為什麼全部 !important ＋ id 層級前綴：站上「額外 CSS」對 .site-footer a 用 8 個 id 的 :not() 設色，
 * palyul-color-a11y 與 baiyu-hero-grid 對 .site-footer a、a:hover 用 !important 設色，都排在本檔之後。
 * 本檔規則掛在 .gp-footer:not(#_#_)（2-1-0）底下再加 !important，蓋得過它們。
 * 深色漸層底和上緣 3px 紅金線在站上「額外 CSS」，本檔不動。
 * 門檻用容器查詢：container gp-footer＝.gp-footer（滿版，寬＝視窗內寬 W）。內容寬 F＝min(1040, W − 40)，
 * 所以「F ≥ 720」寫成 (min-width: 760px)、「F ≥ 900」寫成 (min-width: 940px)。
 * 掛在滿版那層是為了讓 cqw 等於視窗內寬（不含捲軸），社群列讓位給「回到頂端」按鈕要用（規格 4.5 裁定）。
 */

/* 規格 7：Astra 白底版權列不顯示（做法 B；改主題設定的做法 A 見 deploy-footer/README.md） */
#colophon .site-below-footer-wrap {
	display: none !important;
}

.gp-footer:not(#_#_) {
	--f-tx: rgba(232, 226, 216, 0.82);
	--f-link: #D4AF6A;
	--f-line: rgba(232, 226, 216, 0.16);
	--f-ease: cubic-bezier(0.2, 0, 0, 1);
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	text-align: left !important;
	container: gp-footer / inline-size !important;
}
.gp-footer:not(#_#_) .gp-footer__in {
	box-sizing: border-box !important;
	max-width: 1080px !important;
	margin: 0 auto !important;
	padding: 40px 20px calc(24px + env(safe-area-inset-bottom)) !important;
}
.gp-footer:not(#_#_) :is(p, nav, div, span, a) {
	text-align: left !important;
	letter-spacing: normal !important;
}
.gp-footer:not(#_#_) p {
	margin: 0 !important;
	padding: 0 !important;
}

/* ---------- 上層：單欄（F < 720） */
.gp-footer:not(#_#_) .gp-footer__top {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	row-gap: 24px !important;
}
.gp-footer:not(#_#_) .gp-footer__name {
	font-size: 15px !important;
	line-height: 1.5 !important;
	font-weight: 600 !important;
}
.gp-footer:not(#_#_) .gp-footer__addr,
.gp-footer:not(#_#_) .gp-footer__info {
	font-size: 14px !important;
	line-height: 1.7 !important;
	font-weight: 400 !important;
	color: var(--f-tx) !important;
}
.gp-footer:not(#_#_) .gp-footer__addr {
	margin-top: 6px !important;
}
/* 地址只在「區」「段」後換行：每段各自不斷 */
.gp-footer:not(#_#_) .gp-footer__nw {
	white-space: nowrap !important;
}
.gp-footer:not(#_#_) .gp-footer__ask {
	font-size: 15px !important;
	line-height: 1.5 !important;
	font-weight: 600 !important;
}
.gp-footer:not(#_#_) .gp-footer__info {
	margin-top: 8px !important;
}
.gp-footer:not(#_#_) .gp-footer__row {
	display: block !important;
}
.gp-footer:not(#_#_) .gp-footer__row a[x-apple-data-detectors] {
	color: inherit !important;
	text-decoration: none !important;
	font: inherit !important;
}

/* ---------- 細線與下層（F < 720：版權群 → 12 → 社群圖示，都靠左） */
.gp-footer:not(#_#_) .gp-footer__bottom {
	margin-top: 32px !important;
	padding-top: 20px !important;
	border-top: 1px solid var(--f-line) !important;
}
.gp-footer:not(#_#_) .gp-footer__copy {
	display: flex !important;
	flex-wrap: wrap !important;
	column-gap: 16px !important;
	row-gap: 0 !important;
	font-size: 13px !important;
	line-height: 1.7 !important;
	font-weight: 400 !important;
	color: var(--f-tx) !important;
}
.gp-footer:not(#_#_) .gp-footer__privacy {
	white-space: nowrap !important;
}
/* 社群圖示：點擊框 44 相接。往左凸 12＝點擊框比圖示多出的 11＋第一個圖示（Instagram）描邊外緣在 svg 框內的約 1，
   讓墨跡（含描邊）左緣對齊文字左緣（規格 4.5） */
.gp-footer:not(#_#_) .gp-footer__social {
	display: flex !important;
	flex-wrap: nowrap !important;
	margin: 12px 0 0 -12px !important;
	padding: 0 !important;
}

/* ---------- 連結 */
/* 文字連結：點擊高 ≥44，但不撐開行距——inline-block 上下內距 11、外距 −11（版面高度＝行高） */
.gp-footer:not(#_#_) a.gp-footer__link {
	display: inline-block !important;
	vertical-align: top !important;
	padding: 11px 0 !important;
	margin: -11px 0 !important;
	color: var(--f-link) !important;
	font: inherit !important;
	text-decoration: underline !important;
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.2em !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	transition: text-decoration-thickness 150ms var(--f-ease), opacity 150ms var(--f-ease) !important;
}
.gp-footer:not(#_#_) a.gp-footer__link:hover {
	color: var(--f-link) !important;
}
.gp-footer:not(#_#_) a.gp-footer__fb {
	display: inline-flex !important;
}
.gp-footer:not(#_#_) .gp-footer__fb .gp-footer__t {
	display: inline-flex !important;
	align-items: center !important;
	column-gap: 6px !important;
}
.gp-footer:not(#_#_) .gp-footer__fb svg {
	flex: none !important;
	display: block !important;
	width: 16px !important;
	height: 16px !important;
}
.gp-footer:not(#_#_) .gp-footer__privacy.gp-footer__link {
	font-size: 13px !important;
	font-weight: 400 !important;
}
.gp-footer:not(#_#_) a.gp-footer__icon {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: none !important;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	color: var(--f-tx) !important;
	text-decoration: none !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 4px !important;
	box-shadow: none !important;
	transition: color 150ms var(--f-ease), opacity 150ms var(--f-ease) !important;
}
.gp-footer:not(#_#_) .gp-footer__icon svg {
	display: block !important;
	flex: none !important;
	width: 22px !important;
	height: 22px !important;
}
/* 焦點框圍「看得到的文字」（規格 4.6，主控裁定）：框畫在連結裡的文字 span 上，offset 2 相對文字，
   不圍上下各 11 的點擊延伸，免得切到上下行的字。中心名稱、隱私權的 span 是行內元素，框貼字形高度；
   FB 的 span 是 inline-flex（圖示＋字），框圍圖示和字。 */
.gp-footer:not(#_#_) a.gp-footer__link:focus-visible {
	outline: none !important;
}
/* 主題對連結裡的元素設了 transition: all 0.2s，焦點框會從預設的 3px／0 慢慢變過來；框要立刻到位 */
.gp-footer:not(#_#_) .gp-footer__t {
	transition: none !important;
}
.gp-footer:not(#_#_) a.gp-footer__link:focus-visible .gp-footer__t {
	outline: 2px solid var(--f-link) !important;
	outline-offset: 2px !important;
}
.gp-footer:not(#_#_) a.gp-footer__icon:focus-visible {
	color: var(--f-link) !important;
	outline: 2px solid var(--f-link) !important;
	outline-offset: 3px !important;
}
.gp-footer:not(#_#_) a:focus:not(:focus-visible) {
	outline: none !important;
}
.gp-footer:not(#_#_) a.gp-footer__link:active,
.gp-footer:not(#_#_) a.gp-footer__icon:active {
	opacity: 0.7 !important;
}
@media (hover: hover) {
	.gp-footer:not(#_#_) a.gp-footer__link:hover {
		text-decoration-thickness: 2px !important;
	}
	.gp-footer:not(#_#_) a.gp-footer__icon:hover {
		color: var(--f-link) !important;
	}
}

/* ---------- F ≥ 720：上層三欄、下層一列 */
@container gp-footer (min-width: 760px) {
	.gp-footer:not(#_#_) .gp-footer__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) !important;
		column-gap: 32px !important;
		align-items: start !important;
	}
	.gp-footer:not(#_#_) .gp-footer__bottom {
		margin-top: 40px !important;
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
		column-gap: 24px !important;
	}
	/* 上下 −11：44 高的點擊框不撐開這一列，版權行框在細線下 20、頁底上 24（規格 4.4）。
	   右邊：平常往右凸 11（墨跡右緣＝細線右端）；但點擊框右端不能超過「視窗寬 − 70」
	   （回到頂端按鈕離右 30、寬 32，再空 8；規格 4.5 裁定）。
	   點擊框右端＝W − L − 外距，L＝max(20, (W − 1040) ÷ 2)，所以外距＝max(−11, 70 − L)；W＝100cqw。 */
	.gp-footer:not(#_#_) .gp-footer__social {
		margin: -11px max(-11px, calc(70px - max(20px, (100cqw - 1040px) / 2))) -11px 0 !important;
	}
}
@container gp-footer (min-width: 940px) {
	.gp-footer:not(#_#_) .gp-footer__top {
		column-gap: 48px !important;
	}
}
/* 上內距（紅金線下緣 → 第一行）：F ≥ 720 是 48。.gp-footer__in 上內距 40，再用第一層子元素的外距補 8 */
@container gp-footer (min-width: 760px) {
	.gp-footer:not(#_#_) .gp-footer__top {
		margin-top: 8px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gp-footer:not(#_#_) a.gp-footer__link,
	.gp-footer:not(#_#_) a.gp-footer__icon {
		transition: none !important;
	}
}

/*
 * 回到頂端按鈕（規格 build-parking-map/SPEC_scroll-top-v1.md，2026-11-18）
 * 按鈕是 Astra 輸出的 div#ast-scroll-top，不在 .gp-footer 裡，所以掛 id＋:not(#_#_)（2-1-0）再加 !important，
 * 蓋過 Astra 行內的底色（#ast-scroll-top 1-0-0）和聚焦時的點線框。
 * 不碰 display：Astra 用行內 style.display 切換出現／消失。
 * 大小 32（框 2px 畫在裡面，border-box），內容高 28，箭頭靠 line-height 置中。
 * 點擊範圍 44：::after 透明延伸。絕對定位以內距框（28）為準，所以四邊各 −8 ＝ 44，看得到的仍是 32。
 * 讀屏名稱、Enter／Space、焦點移到頁首、減少動態直接跳：gp-footer/scroll-top.js。
 */
#ast-scroll-top.ast-scroll-top-icon:not(#_#_) {
	width: 32px !important;
	height: 32px !important;
	line-height: 28px !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	background-color: #8B1A1A !important;
	color: #FDFCFA !important;
	border: 2px solid #D4AF6A !important;
	border-radius: 6px !important;
	box-shadow: none !important;
	outline: none !important;
	cursor: pointer !important;
	transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1) !important;
}
#ast-scroll-top.ast-scroll-top-icon:not(#_#_) svg,
#ast-scroll-top.ast-scroll-top-icon:not(#_#_) svg path {
	fill: #FDFCFA !important;
}
#ast-scroll-top.ast-scroll-top-icon:not(#_#_)::after {
	content: "" !important;
	position: absolute !important;
	top: -8px !important;
	right: -8px !important;
	bottom: -8px !important;
	left: -8px !important;
	background: transparent !important;
}
/* 兩色焦點環：外緣先貼 2px 白（outline），再往外 2px 深棕（box-shadow 4px，被白圈蓋掉內側 2px）。只在鍵盤操作時 */
#ast-scroll-top.ast-scroll-top-icon:not(#_#_):focus-visible {
	outline: 2px solid #FDFCFA !important;
	outline-offset: 0 !important;
	box-shadow: 0 0 0 4px #2C2420 !important;
}
#ast-scroll-top.ast-scroll-top-icon:not(#_#_):active {
	background-color: #2C2420 !important;
}
@media (hover: hover) {
	#ast-scroll-top.ast-scroll-top-icon:not(#_#_):hover {
		background-color: #2C2420 !important;
	}
}
@media (prefers-reduced-motion: reduce) {
	#ast-scroll-top.ast-scroll-top-icon:not(#_#_) {
		transition: none !important;
	}
}

/*
 * 全站清掉 Astra 預設藍（規格 build-about-page/SPEC_astra-blue-v1.md 第三、四節，2026-11-18）
 * A 根源色票、B 選取反白、C 文章內沒指定樣式的區塊按鈕、D 輸入欄 focus 邊框備援。
 * E（行事曆複製欄與複製鈕）在 gp-calendar-subscribe.php，不在本檔。
 */

/*
 * A 根源：Astra 行內在 :root 定義色票 0、1、5（0-1-0）。這裡用 :root＋:not(#_#_)（1-1-0）並手動加 !important
 * （自訂屬性產生器不會自動補）。其他色票（2、3、4、6、7、8）不動。
 */
:root:not(#_#_) {
	--ast-global-color-0: #8B1A1A !important;
	--ast-global-color-1: #A32525 !important;
	--ast-global-color-5: #F7F4EF !important;
}

/*
 * B 選取反白：金底墨字，米色頁底與深棕頁尾上都分得出選取範圍。
 * 同時蓋過 Astra 行內的 ::selection（色票 0 加白字）與 main.min.css 寫死的 #0274be。
 */
::selection {
	background-color: #C9A060 !important;
	color: #2C2420 !important;
}

/*
 * C 文章內沒指定樣式的區塊按鈕：長相照站上 palyul-btn-primary。
 * 範圍：.entry-content 裡，.wp-block-button 沒帶 palyul-btn-（任何一種）、也不是外框樣式 is-style-outline，
 * 連結沒帶 has-background、has-text-color（作者自己挑色的不動）。
 * 權重 1-5-1 以上加 !important，蓋過 baiyu-single-post 的內文連結金色底線（0-2-2／0-3-2 加 !important）
 * 和 Astra 的 :hover、:focus 深藍底。
 * 平時的規則在所有狀態都成立，所以滑鼠或手指點完的 focus 跟平時一樣，觸控裝置的黏住 hover 也是。
 * 陰影不動（沿用區塊預設的淡陰影，跟 palyul-btn-primary 一樣）。
 * 可點範圍 44：行高照 Astra 的 1em（跟 palyul-btn-primary 一樣），看得到的高度約 36，
 * ::after 透明延伸，上下各推出 min(0, 50% − 22px)，總高不足 44 時補到 44，已經夠高就不加。
 */
.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color) {
	position: relative !important;
	display: inline-block !important;
	background-color: #8B1A1A !important;
	background-image: none !important;
	color: #FDFCFA !important;
	text-decoration: none !important;
	border: none !important;
	border-radius: 6px !important;
	padding: 0.65rem 1.75rem !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
	outline: none !important;
}
.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color)::after {
	content: "" !important;
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	top: min(0px, calc(50% - 22px)) !important;
	bottom: min(0px, calc(50% - 22px)) !important;
	background: transparent !important;
}
.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color):active {
	background-color: #A32525 !important;
}
@media (hover: hover) {
	.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color):hover {
		background-color: #A32525 !important;
	}
}
/* 鍵盤焦點：2px 朱紅外框往外推 2px，框落在米色頁底上，不貼在同色的按鈕邊 */
.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color):focus-visible {
	outline: 2px solid #8B1A1A !important;
	outline-offset: 2px !important;
}

/*
 * C 的窄版（規格 v1.1）：480 以下跟 palyul-btn-primary 一樣撐滿內文欄寬。
 * 外層 .wp-block-button 是 .wp-block-buttons（flex）的子項，用 :has 只挑裡面連結符合 C 的那一層撐寬，
 * 作者自己挑色的按鈕不受影響。瀏覽器不支援 :has 時外層不撐，按鈕維持依內容寬（退化成 481 以上的樣子）。
 */
@media (max-width: 480px) {
	.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline):has(> .wp-block-button__link:not(.has-background):not(.has-text-color)) {
		width: 100% !important;
		box-sizing: border-box !important;
	}
	.entry-content:not(#_#_) .wp-block-button:not([class*="palyul-btn-"]):not(.is-style-outline) > .wp-block-button__link:not(.has-background):not(.has-text-color) {
		display: block !important;
		width: 100% !important;
		box-sizing: border-box !important;
		text-align: center !important;
	}
}

/* ==== 以下不補 important（產生器在這行切開） ==== */

/*
 * D 輸入欄 focus 邊框備援：Astra 行內對下列輸入欄的 :focus 寫死 #046BD2（0-2-1），這裡用同一組選擇器、
 * 不加 important，靠本檔排在 Astra 行內之後勝出。元件自己寫的 focus 邊框（權重更高、行內 style、
 * 或標了 important）照樣優先，例如搜尋欄的行內邊框。
 * 行事曆的複製欄（.gpcal__copy-input:focus，0-2-0）目前會被這條（跟 Astra 原規則一樣）蓋過，由 E 在行事曆樣式裡處理。
 */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type=reset]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
	border-color: #8B1A1A;
}
