/* =============================================================
   hsz.css — 新竹市專案專用樣式
   品牌色、首頁區塊、專案特殊元件
   （由 tao.css 改名而來；換專案時替換此檔）
   ============================================================= */

/* ===== 品牌色變數 ===== */
:root {
    --ty-pink: #e85298;
    --ty-blue: #80c8ef;
    --ty-yellow: #ffd900;
    --ty-green: #64b72f;
    --ty-dark: #333333;
    --ty-bg: #f8fbfd;
}

/* ===== 全域品牌 ===== */
body {
    background-color: var(--ty-bg) !important;
    color: var(--ty-dark);
}

/* ===== Site Header 品牌色（仿新竹市一代：teal 底 + 白字） ===== */
.site-header {
    /* 與 banner 同一張 teal 點點底，消除接縫。背景圖在 Header.html 用 inline style + {% static %} 指定。 */
    background-repeat: repeat;
    border-top: 4px solid var(--ty-pink);
}
.brand { color: #ffffff; }
.brand-copy { color: #ffffff; font-weight: 700; }
.nav-toggle { color: #ffffff; }
.nav-main a { color: #ffffff; }
.nav-main a.nav-active { color: #013252; background-color: #C2DD1E; }
.nav-main a:hover { color: #013252; background-color: #C2DD1E; }

/* ===== rt 左面板品牌色 ===== */
.rt-panel { background-color: rgba(248, 251, 253, 0.9); }

/* ===== Footer 品牌 ===== */
footer { background: transparent !important; }
.footer-logo { max-width: 240px !important; height: auto; }

/* ===== Modal 品牌色 ===== */
.tao-modal-content { box-shadow: 0 20px 48px rgba(97, 77, 57, 0.18); }
.tao-modal-header,
.tao-modal-footer {
    background: linear-gradient(135deg, rgba(232, 82, 152, 0.94), rgba(233, 143, 73, 0.88));
    border: none;
}
.tao-modal-title { color: #ffffff; font-weight: 700; }
.tao-modal-body {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(252, 248, 241, 0.99));
    color: var(--ty-dark);
}
.tao-modal-btn {
    min-width: 6.5rem; border: none; border-radius: 999px;
    padding: 0.55rem 1.5rem;
    background: linear-gradient(90deg, var(--ty-pink), #f06bab);
    color: #ffffff; font-weight: 700;
}
.tao-modal-btn:hover {
    color: #ffffff;
    background: linear-gradient(90deg, #d94589, var(--ty-pink));
}

/* =============================================================
   首頁專用
   ============================================================= */

/* ===== Hero 區 ===== */
.home-hero {
    /* 新竹市 key visual（仿一代）：彩色市政大廳/巴士在前 → 天際線剪影 → teal 點點底。
       背景圖在 Index.html 用 inline style + {% static %} 指定（CSS 檔無法走 {% static %}）。 */
    background-position: bottom center, bottom center, 0 0;
    background-size: auto 130px, 100% auto, auto;
    background-repeat: no-repeat, no-repeat, repeat;
    padding: 0 0 120px;
    text-align: center;
}
/* hero 內容區 = banner 寬度(804px)，讓查詢框可對齊 banner 右緣 */
.home-hero .shell { width: min(804px, calc(100% - 32px)); }
.home-hero-title {
    margin: 0 0 24px;
    text-align: center;
}
.home-hero-title img {
    display: block;
    width: 100%;
    max-width: 804px;
    height: auto;
    margin: 0 auto;
}
.home-hero-text {
    margin: 0 0 40px;
    color: #004a7c;
    font-size: 18px;
    line-height: 1.7;
}

/* ===== 搜尋框 ===== */
.home-search {
    display: flex;
    justify-content: center;
    max-width: 400px;
    /* 靠右：右緣對齊 hero banner 右緣 */
    margin: 0 0 0 auto;
    overflow: hidden;
    border-radius: 50px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.home-search input {
    flex: 1; padding: 12px 20px; border: none; font-size: 15px; outline: none;
}
.home-search button {
    border: none; padding: 0 24px; white-space: nowrap;
    background-color: #90AA1B; color: #ffffff;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background 0.3s ease;
}
.home-search button:hover { background-color: #7c9217; }

/* ===== 功能條帶區（仿一代：白→灰漸層 + 萊姆綠下緣 + 分隔線） ===== */
.home-features {
    padding: 0;
    background: linear-gradient(to bottom, #ffffff 0%, #e9e9e9 90%, #d2d2d2 100%);
    border-bottom: 8px solid #C2DD1E;
}
.home-features .shell { padding-left: 0; padding-right: 0; }
.feature-grid {
    display: flex;
    justify-content: center;
    gap: 0;
}
/* 功能項：icon + 標題，條帶內置中集中、以左右框線分隔 */
.feature-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 150px; min-height: 110px; padding: 12px 16px;
    color: #4d4d4d; text-align: center;
    border-left: 1px solid #cfcfcf;
    transition: color 0.2s ease, background 0.2s ease;
}
.feature-item:last-child { border-right: 1px solid #cfcfcf; }
.feature-item:hover { color: var(--ty-pink); background: rgba(255, 255, 255, 0.6); }
.feature-item h2 { margin: 8px 0 0; font-size: 19px; font-weight: 700; }
.feature-card-image {
    display: block; width: 60px; height: 60px;
    margin: 0 auto; object-fit: contain;
}

/* ===== 首頁新聞區 ===== */
.home-news { padding: 0 0 60px; }
.news-stage { padding-top: 6px; }
.news-stage-head {
    position: relative; margin-bottom: 30px; padding-bottom: 18px;
    border-bottom: 1px solid rgba(51, 51, 51, 0.12);
}
.news-stage-title-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.news-stage-title { margin: 0; color: var(--ty-dark); font-size: 32px; font-weight: 700; line-height: 1.1; }
.news-stage-line { display: block; width: 92px; height: 5px; border-radius: 999px; background: var(--ty-yellow); }
.news-stage-more { position: absolute; right: 0; top: 8px; color: #1f66ff; font-size: 16px; font-weight: 700; }
.news-stage-more:hover { color: var(--ty-pink); }

/* 新聞卡片 */
.news-card {
    align-items: flex-start; text-align: left;
    min-height: 250px; padding: 28px 20px 22px;
}
.news-chip {
    display: inline-flex; align-items: center;
    margin-bottom: 16px; padding: 7px 14px; border-radius: 999px;
    background: rgba(31, 102, 255, 0.08); color: #2d65ce;
    font-size: 14px; font-weight: 700; line-height: 1;
}
.news-card-title {
    display: -webkit-box; margin: 0 0 12px;
    color: var(--ty-dark); font-size: 20px; font-weight: 700; line-height: 1.45;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.news-card-desc {
    display: -webkit-box; margin: 0;
    color: #666; font-size: 15px; line-height: 1.7;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.news-card-date { margin-top: auto; padding-top: 18px; color: #666; font-size: 15px; font-weight: 500; }

/* 新聞 Carousel */
.news-carousel { position: relative; padding: 0 28px 34px; }
.news-carousel-control {
    top: 50%; bottom: auto; width: auto; opacity: 1; transform: translateY(-50%);
}
.news-carousel-control-prev { left: -6px; }
.news-carousel-control-next { right: -6px; }
.news-carousel-control-icon {
    display: inline-grid; place-items: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    color: #8a8a8a; font-size: 20px;
}
.news-carousel-indicators { position: static; gap: 10px; margin: 18px 0 0; }
.news-carousel-indicators [data-bs-target] {
    width: 10px; height: 10px; margin: 0; border: none; border-radius: 50%;
    background-color: rgba(51, 51, 51, 0.18); opacity: 1;
}
.news-carousel-indicators .active { background-color: #2d65ce; }

/* ===== 首頁 RWD ===== */
@media (max-width: 1199.98px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
    /* Hero：手機版只保留搜尋框（標語 + 說明段落都隱藏） */
    .home-hero { padding: 18px 0; border-bottom-width: 3px; }
    .home-hero-title,
    .home-hero-text { display: none; }
    .home-search { flex-direction: row; border-radius: 999px; }
    .home-search input { flex: 1; width: auto; padding: 10px 16px; font-size: 15px; }
    .home-search button { width: auto; padding: 10px 18px; font-size: 15px; white-space: nowrap; }

    /* Feature cards：手機版純 icon（移除卡片視覺：背景/邊框/陰影） */
    .home-features { padding: 20px 0 8px; }
    .home-features .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .home-features .feature-card {
        min-height: 0;
        padding: 10px 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .home-features .feature-card p { display: none; }
    .home-features .feature-card-image {
        width: 96px; height: 96px;
        margin: 0 auto 8px;
    }
    .home-features .feature-card h2 {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
        color: var(--ty-dark);
        line-height: 1.2;
    }
    /* 手機 hover 效果抑制位移與背景圖（避免 touch 觸發閃爍） */
    .home-features .feature-card:hover { transform: none; color: var(--ty-dark); background: transparent; }
    .home-features .feature-card::before,
    .home-features .feature-card::after { display: none; }

    /* 新聞區：手機改條列式 */
    .home-news .feature-grid { grid-template-columns: 1fr; gap: 0; }
    .news-card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        min-height: 0;
        padding: 12px 4px;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        text-align: left;
    }
    .news-card:hover { transform: none; color: var(--ty-dark); background: rgba(0, 0, 0, 0.02); }
    .news-chip,
    .news-card-desc { display: none; }
    .news-card-title {
        flex: 1;
        margin: 0;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.45;
        -webkit-line-clamp: 1;
    }
    .news-card-date {
        flex: none;
        margin: 0;
        padding: 0;
        font-size: 13px;
        color: #999;
        font-weight: 400;
    }
    .news-stage-head { margin-bottom: 14px; padding-bottom: 10px; }
    .news-stage-title { font-size: 24px; }
    .news-stage-more { position: static; display: inline-block; margin-top: 8px; }
    .news-carousel { padding: 0 0 14px; }
    .news-carousel-control { display: none; }
    .news-carousel-indicators { margin-top: 12px; }
}

/* =============================================================
   新竹市政府 footer（仿一代：左 logo / 右版權，上橘線）
   ============================================================= */
.hsz-footer {
    width: 100%;
    background: linear-gradient(to bottom, #ffffff 32%, #bce7ee 99%);
    border-top: 4px solid #FFC602;
}
.hsz-footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.hsz-footer-left {
    flex: 0 0 auto;
    padding-right: 24px;
    border-right: 1px solid #808080;
}
.hsz-footer-left img {
    height: 50px;
    width: auto;
    display: block;
}
.hsz-footer-right {
    color: #808080;
    font-size: 15px;
    line-height: 1.85;
}
@media (max-width: 768px) {
    .hsz-footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .hsz-footer-left { border-right: none; padding-right: 0; }
}
