/*
Theme Name: FY Assoc（會務系統 B 版 現代臨床）
Template: twentytwentyfive
Author: 豐遠資訊
Description: 會務系統產品線前台主題。B 版「現代臨床」：淺灰藍底、青綠主色、深藍文字、圓角卡片。
Version: 0.1.0
Text Domain: fy-assoc
*/

:root {
	--fy-primary: #0E9F8E;
	--fy-primary-dark: #0B7F72;
	--fy-navy: #1E3A5F;
	--fy-amber: #F59E0B;
	--fy-surface: #F4F7F9;
	--fy-muted: #5B6B7F;
	--fy-line: #E2E8EE;
	--fy-radius: 12px;
	--fy-shadow: 0 6px 24px rgba(30, 58, 95, .08);
	--fy-gutter: clamp(16px, 4vw, 40px);
}

body { -webkit-font-smoothing: antialiased; }
.fy-main { padding-left: var(--fy-gutter); padding-right: var(--fy-gutter); padding-bottom: 72px; }
.fy-main > * + * { margin-block-start: 0; }

/* ===== 按鈕、膠囊 ===== */
.fy-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .6rem 1.2rem; border-radius: 999px; background: var(--fy-primary); color: #fff !important; font-weight: 700; font-size: .92rem; text-decoration: none !important; border: 1.5px solid var(--fy-primary); transition: background .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.fy-btn:hover { background: var(--fy-primary-dark); border-color: var(--fy-primary-dark); box-shadow: 0 6px 16px rgba(14, 159, 142, .25); }
.fy-btn--ghost { background: transparent; color: var(--fy-primary-dark) !important; }
.fy-btn--ghost:hover { background: rgba(14, 159, 142, .08); box-shadow: none; }
.fy-btn--lg { padding: .9rem 1.7rem; font-size: 1rem; }
.fy-btn--white { background: #fff; color: var(--fy-primary-dark) !important; border-color: #fff; }
.fy-btn--block { width: 100%; }
.fy-pill { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: rgba(14, 159, 142, .1); color: var(--fy-primary-dark); font-size: .78rem; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.fy-pill--pin { background: var(--fy-primary); color: #fff; margin-right: .35rem; }
.fy-pill--date { background: var(--fy-navy); color: #fff; }
.fy-eyebrow { color: var(--fy-primary-dark); font-size: .8rem !important; font-weight: 800; letter-spacing: .12em; margin: 0 0 .4rem; }

/* ===== Header ===== */
.fy-header { position: sticky; top: 0; z-index: 50; background: transparent; border-bottom: 1px solid var(--fy-line); padding: 0 var(--fy-gutter); }
/* 毛玻璃放在背景層：backdrop-filter 若直接加在 header，展開的選單（position:fixed）會被關在 header 裡 */
.fy-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* 展開的選單：全螢幕、項目直排、字放大好點 */
.fy-nav .wp-block-navigation__responsive-container.is-menu-open { padding: max(20px, env(safe-area-inset-top, 0px)) var(--fy-gutter) 32px !important; background: #fff !important; }
.fy-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 56px !important; }
.fy-nav .is-menu-open .wp-block-navigation__container { flex-direction: column !important; align-items: flex-start !important; gap: 0 !important; width: 100%; }
.fy-nav .is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid var(--fy-line); }
.fy-nav .is-menu-open .wp-block-navigation-item__content { display: block; width: 100%; padding: 16px 4px !important; font-size: 1.15rem; }
.admin-bar .fy-header { top: 32px; }
.fy-header__bar { min-height: 72px; gap: 20px; }
.fy-brand { gap: 10px; flex-shrink: 0; }
.fy-brand__logo img { display: block; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.fy-brand__name, .fy-brand__name a { font-size: 1.05rem !important; font-weight: 800; color: var(--fy-navy) !important; text-decoration: none !important; white-space: nowrap; margin: 0; }
.fy-nav { font-size: .95rem; font-weight: 600; gap: 28px !important; }
.fy-nav a { color: var(--fy-navy) !important; text-decoration: none !important; }
.fy-nav a:hover { color: var(--fy-primary) !important; }
.fy-header__actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 1000px) {
	.fy-header__actions .fy-btn--ghost { display: none; }
	.fy-nav { order: 3; }
}
@media (max-width: 600px) {
	.fy-brand__name, .fy-brand__name a { font-size: .95rem !important; }
	.fy-header__actions .fy-btn { padding: .45rem .9rem; font-size: .85rem; }
}

/* ===== 首頁 Hero ===== */
.fy-main--home { padding-top: 0; }
.fy-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); }
.fy-hero__title { font-size: clamp(2.3rem, 5vw, 3.8rem) !important; line-height: 1.15 !important; letter-spacing: -.01em; margin: .2rem 0 1rem; }
.fy-hero__lead { color: var(--fy-muted); font-size: 1.08rem; max-width: 30em; margin: 0 0 1.8rem; }
.fy-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fy-hero__media { position: relative; }
.fy-hero__media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; box-shadow: var(--fy-shadow); }
.fy-float { position: absolute; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: 0 12px 32px rgba(30, 58, 95, .16); font-size: .82rem; line-height: 1.35; }
.fy-float small { display: block; color: var(--fy-muted); }
.fy-float strong { color: var(--fy-navy); }
.fy-float--paid { top: -18px; right: -12px; }
.fy-float--cme { bottom: -22px; left: -18px; }
.fy-float__icon { width: 32px; height: 32px; border-radius: 50%; background: var(--fy-navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.fy-ring { --p: 50; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--fy-primary) calc(var(--p) * 1%), #E3EEF0 0); }
.fy-ring b { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .7rem; color: var(--fy-navy); }
@media (max-width: 860px) {
	.fy-hero { grid-template-columns: 1fr; }
	.fy-float--paid { right: 8px; }
	.fy-float--cme { left: 8px; }
}

/* ===== 統計列 ===== */
.fy-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px auto 0 !important; }
.fy-stat { background: #fff; border-radius: var(--fy-radius); box-shadow: var(--fy-shadow); padding: 22px 24px; }
.fy-stat small { display: block; color: var(--fy-muted); font-size: .85rem; }
.fy-stat strong { font-size: 2rem; font-weight: 800; color: var(--fy-navy); }
.fy-stat em { font-style: normal; color: var(--fy-primary); margin-left: 2px; }
@media (max-width: 700px) { .fy-stats { grid-template-columns: 1fr; gap: 12px; } }

/* ===== 區塊與卡片 ===== */
.fy-section { margin-top: clamp(48px, 7vw, 88px) !important; }
.fy-section__head { margin-bottom: 20px; gap: 12px; }
.fy-section__title { font-size: clamp(1.5rem, 2.6vw, 2rem) !important; margin: 0; }
.fy-more { margin: 0; font-weight: 700; }
.fy-more a { text-decoration: none; }
.fy-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.fy-card { background: #fff; border-radius: var(--fy-radius); box-shadow: var(--fy-shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.fy-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(30, 58, 95, .13); }
.fy-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.fy-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.fy-card__body h3 { font-size: 1.12rem; margin: 4px 0 0; }
.fy-card__meta, .fy-card__seats { color: var(--fy-muted); font-size: .85rem; margin: 0; }
.fy-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fy-card .fy-btn { margin-top: auto; }
.fy-bar { height: 6px; border-radius: 6px; background: #E3EEF0; overflow: hidden; }
.fy-bar span { display: block; height: 100%; background: var(--fy-primary); border-radius: 6px; }
@media (max-width: 900px) { .fy-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .fy-cards { grid-template-columns: 1fr; } }

/* ===== 消息列表 ===== */
.fy-newslist .wp-block-post-template { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fy-newsitem { background: #fff; border-radius: var(--fy-radius); box-shadow: 0 2px 10px rgba(30, 58, 95, .05); padding: 16px 20px; gap: 14px !important; transition: box-shadow .15s; }
.fy-newsitem:hover { box-shadow: var(--fy-shadow); }
.fy-newsitem__date { color: var(--fy-muted); font-size: .88rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fy-newsitem .wp-block-shortcode, .fy-newsitem > p:not([class]) { margin: 0; flex-shrink: 0; }
.fy-newsitem__title { font-size: 1rem !important; font-weight: 700; margin: 0; }
.fy-newsitem__title a { color: var(--fy-navy); text-decoration: none; }
.fy-newsitem__title a:hover { color: var(--fy-primary-dark); }
.fy-newsitem__text { flex: 1; min-width: 0; }
.fy-newsitem__excerpt { color: var(--fy-muted); font-size: .88rem; margin: .2rem 0 0; }
.fy-newsitem__excerpt p { margin: 0; }
.fy-newsitem__excerpt .wp-block-post-excerpt__more-text { display: none; }
@media (max-width: 640px) { .fy-newsitem { flex-wrap: wrap !important; } .fy-newsitem__title { flex-basis: 100%; } }
.fy-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fy-chip { padding: .4rem 1rem; border-radius: 999px; background: #fff; border: 1px solid var(--fy-line); color: var(--fy-navy); font-size: .9rem; font-weight: 600; text-decoration: none; }
.fy-chip:hover { border-color: var(--fy-primary); color: var(--fy-primary-dark); }
.fy-chip.is-active { background: var(--fy-primary); border-color: var(--fy-primary); color: #fff; }
.wp-block-query-pagination { margin-top: 28px; gap: 6px; }
.wp-block-query-pagination a, .wp-block-query-pagination .current { padding: .3rem .8rem; border-radius: 8px; background: #fff; text-decoration: none; }
.wp-block-query-pagination .current { background: var(--fy-primary); color: #fff; }

/* ===== CTA ===== */
.fy-cta { margin-top: clamp(48px, 7vw, 88px) !important; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px); border-radius: 20px; background: linear-gradient(120deg, #0E9F8E, #0A6E80); color: #fff; }
.fy-cta h2 { color: #fff; margin: 0 0 .3rem; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.fy-cta p { margin: 0; opacity: .92; }

/* ===== 內頁 ===== */
.fy-pagehead { padding: clamp(32px, 5vw, 56px) 0 24px; }
.fy-pagehead__title { font-size: clamp(1.9rem, 3.6vw, 2.8rem) !important; margin: 0; }
.fy-pagehead__sub { color: var(--fy-muted); margin: .4rem 0 0; }
.fy-page-body { background: #fff; border-radius: var(--fy-radius); box-shadow: var(--fy-shadow); padding: clamp(24px, 4vw, 48px) !important; }
.fy-page-body h2 { font-size: 1.4rem; margin-top: 2rem; padding-left: 12px; border-left: 4px solid var(--fy-primary); }
.fy-page-body table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.fy-page-body th, .fy-page-body td { border-bottom: 1px solid var(--fy-line); padding: .6rem .8rem; text-align: left; }
.fy-page-body th { background: var(--fy-surface); }
.fy-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.fy-subnav a { display: block; padding: .4rem 1rem; border-radius: 999px; background: var(--fy-surface); text-decoration: none; color: var(--fy-navy); font-weight: 600; font-size: .9rem; }
.fy-subnav a[aria-current] { background: var(--fy-primary); color: #fff; }
.fy-article { background: #fff; border-radius: var(--fy-radius); box-shadow: var(--fy-shadow); padding: clamp(24px, 4vw, 48px); margin-top: clamp(32px, 5vw, 56px) !important; }
.fy-article__meta { gap: 10px; color: var(--fy-muted); font-size: .9rem; }
.fy-article__meta p { margin: 0; }
.fy-article__title { font-size: clamp(1.5rem, 3vw, 2.1rem) !important; margin: .6rem 0 1.2rem; }
.fy-article__back { margin-top: 2rem; font-weight: 700; }

/* ===== Footer ===== */
.fy-footer { background: var(--fy-navy); color: #C9D6E4; padding: 56px var(--fy-gutter) 28px; font-size: .92rem; }
.fy-footer a { color: #fff; text-decoration: none; }
.fy-footer a:hover { color: #7FE0D3; }
.fy-footer__name, .fy-footer__name a { color: #fff !important; font-size: 1.15rem !important; font-weight: 800; }
.fy-footer__h { color: #fff; font-size: 1rem !important; margin: 0 0 .8rem; }
.fy-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.fy-footer__muted { color: #C9D6E4; line-height: 1.9; }
.fy-footer__copy { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 18px; margin-top: 36px !important; font-size: .82rem; color: #9FB3C8; }

/* ===== 開發中提示 ===== */
.fy-soon { text-align: center; padding: 40px 16px; }
.fy-soon h2 { border: 0 !important; padding: 0 !important; margin: .8rem 0 .4rem !important; }
.fy-soon p { color: var(--fy-muted); max-width: 34em; margin: 0 auto; }
.fy-note { color: var(--fy-muted); font-size: .88rem; }

/* 修正：卡片圖與按鈕尺寸 */
.fy-btn, .fy-card, .fy-stat, .fy-newsitem { box-sizing: border-box; }
.fy-card img, .fy-hero__media img { height: auto !important; max-width: 100%; }
.fy-card > img { aspect-ratio: 16 / 9; }
@media (max-width: 640px) { .fy-newsitem__text { flex-basis: 100%; } }
/* 分類膠囊（core/post-terms）與置頂標示（post_class 的 .sticky） */
.fy-terms { margin: 0; flex-shrink: 0; font-size: 0; }
.fy-terms a { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: rgba(14, 159, 142, .1); color: var(--fy-primary-dark); font-size: .78rem; font-weight: 700; line-height: 1.6; text-decoration: none; white-space: nowrap; }
.fy-terms .wp-block-post-terms__separator { display: none; }
.wp-block-post-template .sticky .fy-terms::before { content: "置頂"; display: inline-block; padding: .15rem .65rem; margin-right: .35rem; border-radius: 999px; background: var(--fy-primary); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.6; }
.fy-newslist .wp-block-post-template > li { margin: 0 !important; }

/* 首頁 LINE 官方帳號區塊 */
.fy-linebox { margin-top: clamp(48px, 7vw, 88px) !important; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px); border-radius: 20px; background: #fff; border: 1px solid var(--fy-line, #E2E8EE); box-shadow: 0 8px 28px rgba(30,58,95,.06); }
.fy-linebox__txt { flex: 1 1 320px; }
.fy-linebox__tag { display: inline-block; padding: 3px 12px; border-radius: 99px; background: #E6F9EE; color: #05A847; font-weight: 700; font-size: .82rem; }
.fy-linebox h2 { margin: .6rem 0 .8rem; font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.fy-linebox ul { margin: 0 0 1.2rem; padding-left: 1.2rem; color: var(--fy-muted, #5B6B7F); }
.fy-linebox li { margin: .25rem 0; }
.fy-linebox__btn { background: #06C755 !important; color: #fff !important; }
.fy-linebox__qr { flex: none; text-align: center; }
.fy-linebox__qr img { display: block; width: 168px; height: 168px; border-radius: 12px; border: 1px solid var(--fy-line, #E2E8EE); padding: 8px; background: #fff; }
.fy-linebox__qr small { display: block; margin-top: 6px; color: var(--fy-muted, #5B6B7F); }
@media (max-width: 640px) { .fy-linebox__qr { display: none; } }

/* tap-target：手機漢堡選單與關閉鈕至少 44px */
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
/* 1100px 以下選單放不下一行：平板也改用漢堡選單（WordPress 預設只在 600px 以下才收合） */
@media (max-width: 1100px) {
	.fy-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.fy-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.fy-nav { order: 3; flex: none; }
	.fy-header__bar > .fy-header__actions { margin-left: auto !important; }
	.fy-header__actions .fy-btn--ghost { display: none; }
}
/* 窄螢幕＋大字級：學會名稱與會員按鈕可縮，漢堡選單不被擠出畫面 */
@media (max-width: 600px) {
	.fy-header__bar { gap: 10px; }
	.fy-brand { flex-shrink: 1; min-width: 0; }
	.fy-brand__name, .fy-brand__name a { overflow: hidden; text-overflow: ellipsis; }
	.fy-brand .fy-brand__name { min-width: 0; }
	.fy-header__actions { flex-shrink: 1; min-width: 0; }
	.fy-header__actions .fy-btn { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.fy-nav { flex-shrink: 0; }
}
