/* ===================================================
   員林市公所納骨塔便民服務網 - 共用設計系統
   色調：沉穩莊重（深藍/灰色系）
   =================================================== */

/* --- CSS 變數 --- */
:root {
    --tp-primary:   #1e3a5f;   /* 深藍 */
    --tp-primary-dark: #162f4d;
    --tp-accent:    #b8975a;   /* 金色 */
    --tp-bg:        #f4f6f8;   /* 頁面底色 */
    --tp-surface:   #ffffff;
    --tp-text:      #2c3e50;
    --tp-muted:     #6c757d;
    --tp-border:    #dee2e6;
}

/* --- 基礎 --- */
body {
    background-color: var(--tp-bg);
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    color: var(--tp-text);
    font-size: 0.95rem;
}

main {
    min-height: 60vh;
}

/* --- 頁面標題列（取代舊 GIF 圖片） --- */
.page-header {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 100%);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 0 0 4px 4px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.page-header i {
    color: var(--tp-accent);
    font-size: 1.1rem;
}

/* --- 卡片 --- */
.card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07) !important;
}

/* 卡片標題列（Bootstrap 5 現有頁面使用 .tag-header，統一為深藍） */
.tag-header {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 100%);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

/* --- 按鈕 --- */
.btn-primary {
    background-color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--tp-primary-dark) !important;
    border-color: var(--tp-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--tp-primary) !important;
    color: #fff !important;
}

/* --- 服務入口卡片（首頁） --- */
.service-card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.1) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    background: var(--tp-surface);
    color: var(--tp-text) !important;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(30, 58, 95, 0.18) !important;
    color: var(--tp-primary) !important;
}
.service-card .svc-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.service-card .svc-icon.accent {
    background: linear-gradient(135deg, var(--tp-accent) 0%, #c8a96e 100%);
}
.service-card .svc-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--tp-primary);
}
.service-card .svc-desc {
    font-size: 0.83rem;
    color: var(--tp-muted);
    text-align: center;
}

/* --- 麵包屑 --- */
.breadcrumb-item a {
    color: var(--tp-primary);
    text-decoration: none;
}
.breadcrumb-item.active {
    color: var(--tp-muted);
}

/* --- 表格 --- */
.table thead th {
    background-color: #eef1f5 !important;
    color: var(--tp-text) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--tp-border) !important;
}

/* --- 分頁器 --- */
.pagination .page-link {
    color: var(--tp-primary);
    border-radius: 6px !important;
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background-color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}

/* --- 自治條例條文 --- */
.rule-chapter {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 100%);
    color: #fff;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}
.rule-article {
    display: flex;
    border-bottom: 1px solid var(--tp-border);
}
.rule-article:last-child {
    border-bottom: none;
}
.rule-no {
    flex: 0 0 5.5rem;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--tp-primary);
    font-size: 0.9rem;
    border-right: 1px solid var(--tp-border);
    background: #f8f9fc;
}
.rule-content {
    flex: 1;
    padding: 10px 16px;
    line-height: 1.8;
    font-size: 0.9rem;
}

/* --- 下載清單 --- */
.download-list .list-group-item {
    border: none;
    border-bottom: 1px solid var(--tp-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    font-size: 0.93rem;
}
.download-list .list-group-item:last-child {
    border-bottom: none;
}
.download-list .list-group-item:hover {
    background: #eef1f5;
}
.download-list .list-group-item i {
    color: var(--tp-accent);
    font-size: 1.3rem;
    flex-shrink: 0;
}
.download-list .list-group-item a {
    color: var(--tp-text);
    text-decoration: none;
    flex: 1;
}
.download-list .list-group-item a:hover {
    color: var(--tp-primary);
}

/* --- 表單卡片（Manage 頁面） --- */
.form-card {
    max-width: 480px;
    margin: 0 auto;
}
.form-card .card-header-custom {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px 12px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- 行事曆資訊列（Header 上方）--- */
.cal-info {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.85);
    background: var(--tp-primary-dark);
    padding: 5px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cal-info .date-highlight { color: #f0d080; font-weight: 600; }
.cal-info .lunar-highlight { color: #90cda8; margin-left: 10px; }
.cal-info .sha-highlight { margin-left: 10px; }

/* --- Hero Banner（首頁上方橫幅）--- */
.hero-banner {
    background: linear-gradient(135deg, var(--tp-primary) 0%, #2d5490 60%, #3a6db5 100%);
    color: #fff;
    padding: 2.5rem 1rem;
    text-align: center;
}
.hero-banner h1 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}
.hero-banner p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
}
.hero-banner .accent-line {
    width: 60px;
    height: 3px;
    background: var(--tp-accent);
    margin: 0.75rem auto;
    border-radius: 2px;
}

/* === Header / Navbar === */
#header.navbar {
    background-color: var(--tp-primary) !important;
}
.nav-link {
    font-weight: 500;
    font-size: 0.97rem;
    position: relative;
    color: rgba(255,255,255,0.88) !important;
    transition: color 0.2s;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--tp-accent);
    left: 0;
    bottom: 0;
    transition: width 0.3s;
}
.nav-link:hover,
.nav-link:focus { color: #fff !important; }
.nav-link:hover::after { width: 100%; }
.navbar-toggler { border-color: rgba(255,255,255,0.4) !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* === Site Hero（頁首三層式：滿版橫幅圖片）=== */
.site-hero {
    width: 100%;
    line-height: 0;
}
.site-logo {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}
.site-logo:hover { opacity: 0.92; }

/* --- RWD 微調 --- */
@media (max-width: 576px) {
    .rule-no {
        flex: 0 0 4rem;
        font-size: 0.82rem;
    }
    .rule-content {
        font-size: 0.85rem;
    }
    .service-card {
        padding: 1.5rem 1rem;
    }
    .service-card .svc-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}
