/* ============================================================
   泰國台灣會舘 — 品牌設計優化層 (theme.css)
   在 style.css 之後載入，統一品牌色系與元件視覺
   品牌色：深藍 #1d2c6a（藍瓦）+ 金 #ffd400（金字）+ 國旗紅 #d80000
   ============================================================ */
:root {
    /* 覆蓋 style.css 的自訂變數（一次改全站主色）*/
    --primary-color: #1d2c6a;
    --secondary-color: #5b6478;

    /* 品牌 token（取樣自官方會徽：深藍 + 紅「台」+ 黃）*/
    --brand: #1a2c6a;          /* 會徽深藍（上：藍天/中華民國）*/
    --brand-dark: #12204f;
    --brand-light: #2f3f8f;
    --brand-red: #e71b24;      /* 會徽紅「台」字（中央主體：鄉親團結）★焦點色 */
    --brand-red-dark: #c11119;
    --brand-yellow: #e5e044;   /* 會徽黃（下：黃金佛邦泰國）*/
    --brand-gold: #e5e044;     /* 相容舊命名 */
    --ink: #1f2430;
    --muted: #6b7280;
    --line: #e9ecf1;
    --radius: .8rem;
    --shadow-sm: 0 2px 10px rgba(20, 30, 70, .06);
    --shadow: 0 8px 28px rgba(20, 30, 70, .10);

    /* Bootstrap 對齊品牌 */
    --bs-primary: #1d2c6a;
    --bs-primary-rgb: 29, 44, 106;
    --bs-link-color: #1d2c6a;
    --bs-link-color-rgb: 29, 44, 106;
    --bs-link-hover-color: #16214f;
    --bs-body-color: #1f2430;
    --bs-border-color: #e9ecf1;
}

body { color: var(--ink); letter-spacing: .01em; }

/* ---------- 主色 utility 對齊 ---------- */
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
.badge.bg-primary { background-color: var(--brand) !important; }
.badge.bg-secondary { background-color: #6b7280 !important; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ---------- 按鈕 ---------- */
.btn { border-radius: .6rem; font-weight: 600; padding: .55rem 1.25rem; transition: all .2s ease; }
.btn-lg { padding: .8rem 1.8rem; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-focus-shadow-rgb: 29, 44, 106;
    box-shadow: 0 4px 14px rgba(29, 44, 106, .25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29, 44, 106, .32); }
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
}
.btn-warning {
    --bs-btn-bg: var(--brand-gold); --bs-btn-border-color: var(--brand-gold);
    --bs-btn-color: #3a2f00; --bs-btn-hover-color: #3a2f00;
    --bs-btn-hover-bg: #ffdf33; --bs-btn-hover-border-color: #ffdf33;
    font-weight: 700;
}

/* ---------- 導覽列 ---------- */
.navbar { box-shadow: 0 1px 0 var(--line), 0 4px 18px rgba(20, 30, 70, .04); }
.navbar .nav-link { font-weight: 600; color: #333d52 !important; position: relative; }
.navbar .nav-link::after {
    content: ""; position: absolute; left: .5rem; right: .5rem; bottom: 2px; height: 2px;
    background: var(--brand-red); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--brand) !important; }
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }

/* ---------- section 標題（金色底線 accent）---------- */
.section-title { margin-bottom: 2.5rem; }
.section-title h2 {
    font-weight: 800; color: var(--brand); letter-spacing: .02em; position: relative;
    display: inline-block; padding-bottom: .6rem;
}
.section-title h2::after {
    content: ""; position: absolute; left: 50%; bottom: 0; width: 60px; height: 4px;
    transform: translateX(-50%); border-radius: 2px;
    background: linear-gradient(90deg, var(--brand) 0 40%, var(--brand-red) 40% 70%, var(--brand-yellow) 70% 100%);
}
.section-title p { color: var(--muted); }

/* ---------- 卡片 ---------- */
.card { border-radius: var(--radius); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; transition: transform .22s ease, box-shadow .22s ease; }
.card.shadow-sm:hover { transform: translateY(-4px); box-shadow: var(--shadow) !important; }
.list-group-item.active { background: var(--brand); border-color: var(--brand); }

/* ---------- 徽章 ---------- */
.badge { font-weight: 600; letter-spacing: .02em; padding: .38em .7em; }

/* ---------- Hero ---------- */
.hero-banner .swiper-slide { position: relative; }
.hero-banner .swiper-slide::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15, 22, 55, .78) 0%, rgba(15, 22, 55, .45) 55%, rgba(15, 22, 55, .15) 100%);
}
.hero-banner h2 { font-weight: 800; letter-spacing: .02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero-banner p { line-height: 2; max-width: 640px; }

/* ---------- 頁尾 ---------- */
footer a:hover { color: var(--brand-gold) !important; }

/* ---------- 頁面標題區（bg-light header）---------- */
section.bg-light h1 { color: var(--brand); font-weight: 800; }

/* ---------- 標題中文可讀性 ---------- */
h1, h2, h3, h4, h5 { line-height: 1.35; }

/* ---------- 會徽三色品牌飾條（深藍/黃/紅）---------- */
body {
    border-top: 4px solid;
    border-image: linear-gradient(90deg,
        var(--brand) 0 34%, var(--brand-yellow) 34% 67%, var(--brand-red) 67% 100%) 1;
}
footer { border-top: 3px solid var(--brand-red); }

/* ---------- 紅色焦點強調（會徽「台」字）---------- */
.btn-danger {
    --bs-btn-bg: var(--brand-red); --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-bg: var(--brand-red-dark); --bs-btn-hover-border-color: var(--brand-red-dark);
}
.badge.bg-danger { background-color: var(--brand-red) !important; }
.text-danger { color: var(--brand-red) !important; }
.btn-warning { --bs-btn-hover-bg: #eee85f; --bs-btn-hover-border-color: #eee85f; }

/* ============================================================
   第二階段：全站頁面級精修
   ============================================================ */

/* ---------- 導覽列：避免招牌與選單擠壓 ---------- */
.navbar-brand img { height: 42px !important; }
.navbar-brand .site-title { font-size: 1.1rem !important; }
@media (min-width: 992px) and (max-width: 1299.98px) {
    .navbar .navbar-nav .nav-link { padding-left: .55rem; padding-right: .55rem; font-size: .93rem; }
    .navbar-brand .site-title { font-size: .98rem !important; }
    .navbar-brand small { font-size: .48rem !important; }
}
@media (min-width: 1300px) {
    .navbar .navbar-nav .nav-link { padding-left: .8rem; padding-right: .8rem; }
}

/* ---------- 分類篩選 pill ---------- */
.category-filter .btn { font-weight: 600; }
.category-filter .btn .opacity-75 { font-weight: 400; font-size: .8em; }

/* ---------- 頁面標題區（bg-light header）統一 ---------- */
section.bg-light > .container > h1 { letter-spacing: .02em; }
section.py-5.bg-light { border-bottom: 1px solid var(--line); }

/* ---------- 長文內容可讀性（會舘簡介/主席/新聞/影音詳情）---------- */
.about-content, .president-content, .post-content, .article-content,
.news-content, .entry-content, article .card-body {
    font-size: 1.06rem; line-height: 2; color: #2b323d;
}
.about-content p, .president-content p, .post-content p { margin-bottom: 1.1rem; }
.about-content img, .president-content img, .post-content img,
.article-content img, .news-content img {
    max-width: 100%; height: auto; border-radius: .6rem;
    margin: 1.2rem auto; box-shadow: var(--shadow-sm); display: block;
}
.about-content h2, .about-content h3, .post-content h2, .post-content h3 {
    color: var(--brand); font-weight: 700; margin: 1.6rem 0 .8rem;
}
.about-content table, .post-content table { max-width: 100%; }

/* ---------- 表單控制項焦點（品牌色）---------- */
.form-control:focus, .form-select:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 .2rem rgba(29, 44, 106, .15);
}

/* ---------- 無障礙：鍵盤 focus 可見（會徽黃高亮）---------- */
a:focus-visible, .btn:focus-visible, .nav-link:focus-visible,
.form-control:focus-visible, .page-link:focus-visible {
    outline: 3px solid var(--brand-yellow); outline-offset: 2px; border-radius: 4px;
}

/* ---------- 分頁 ---------- */
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.pagination .page-link { color: var(--brand); }

/* ---------- 麵包屑 ---------- */
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb-item.active { color: var(--muted); }

/* ---------- 圖片載入前的底色（避免跳動）---------- */
img { background: #f3f4f6; }

/* ============================================================
   首頁 Hero 精修（排版 + 資訊密度）
   ============================================================ */
.hero-banner .swiper { height: 560px; }
.hero-banner .slide-content {
    left: 8%; right: 8%; bottom: auto; top: 50%; transform: translateY(-50%);
    max-width: 680px;
}
.hero-banner .slide-content h2 {
    font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: .02em; margin-bottom: 1rem;
}
.hero-banner .slide-content p { font-size: 1.12rem; line-height: 1.95; opacity: .95; margin-bottom: 1.6rem; }

/* Eyebrow 品牌小標 */
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255, 255, 255, .14); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff; font-weight: 600; font-size: .9rem; letter-spacing: .03em;
    padding: .35rem .9rem .35rem .4rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero-eyebrow-emblem { width: 26px; height: 26px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }

/* 雙 CTA */
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-cta .btn-light { color: var(--brand); font-weight: 700; }
.hero-cta .btn-outline-light { border-width: 2px; font-weight: 700; }

/* Hero 數據帶 */
.hero-stats-band {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%);
    color: #fff; padding: 1.4rem 0;
    border-bottom: 4px solid; border-image: linear-gradient(90deg, var(--brand-yellow) 0 50%, var(--brand-red) 50% 100%) 1;
}
.hero-stats-band .stat-item { padding: .5rem .5rem; position: relative; }
.hero-stats-band .stat-item::after {
    content: ""; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: rgba(255, 255, 255, .22);
}
.hero-stats-band .col-md-3:last-child .stat-item::after,
.hero-stats-band .col-6:nth-child(2) .stat-item::after { }
.hero-stats-band .stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: .02em; }
.hero-stats-band .stat-num span { color: var(--brand-yellow); }
.hero-stats-band .stat-label { font-size: .85rem; opacity: .85; margin-top: .15rem; }

/* ---------- 手機微調 ---------- */
@media (max-width: 575.98px) {
    .section-title h2 { font-size: 1.5rem; }
    .hero-banner .swiper { height: 480px; }
    .hero-banner .slide-content { left: 5%; right: 5%; max-width: 100%; }
    .hero-banner h2 { font-size: 1.7rem; }
    .hero-eyebrow { font-size: .78rem; }
    .hero-cta .btn { flex: 1 1 auto; }
    .hero-stats-band .stat-num { font-size: 1.3rem; }
    .hero-stats-band .stat-item { border-bottom: 1px solid rgba(255,255,255,.12); }
    .about-content, .president-content, .post-content { font-size: 1rem; line-height: 1.9; }
}

/* ============================================================
   藝術指導層：人文宋體標題 + 「台」印章母題 + 縮圖統一
   ============================================================ */

/* ---------- 宋體標題（傳承 · 人文氣質）---------- */
.hero-banner .slide-content h2,
.section-title h2,
section.py-5.bg-light > .container > h1,
.about-content h2, .president-content h1, .post-content h2,
article h1.h3, article h1.h4 {
    font-family: 'Noto Serif TC', 'Noto Sans TC', serif;
    font-weight: 700;
    letter-spacing: .03em;
}
.hero-banner .slide-content h2 { font-weight: 900; }
.section-title h2 { font-weight: 900; }

/* ---------- 「台」印章視覺母題 ---------- */
/* 內頁頁首：右側淡印章浮水印 */
section.py-5.bg-light {
    position: relative; overflow: hidden;
    background-image: url("/public/uploads/home/seal_watermark.png");
    background-repeat: no-repeat;
    background-position: right -30px center;
    background-size: 190px;
}
section.py-5.bg-light > .container { position: relative; z-index: 1; }
/* section 標題左側小印章點綴 */
.section-title { position: relative; }
.section-title::before {
    content: ""; display: block; width: 34px; height: 34px; margin: 0 auto .6rem;
    background: url("/public/uploads/home/seal_navy.png") center/contain no-repeat;
    opacity: .9;
}

/* ---------- 縮圖統一處理（收攏雜亂素材）---------- */
.card-img-top {
    filter: saturate(.94) contrast(1.03);
    transition: filter .35s ease, transform .35s ease;
}
.card:hover .card-img-top { filter: saturate(1.05) contrast(1); transform: scale(1.03); }
/* 卡片圖容器裁切一致 */
.card > .card-img-top,
a > .card > .card-img-top { object-fit: cover; }
