/* ════════════════════════════════════════════════════════════
   入口站「宜蘭鄉鎮最新消息」頁（news/index.php）
   上方選單、頁尾沿用首頁 style.css／footer.css；本檔只管 .nw 內容區，類別一律 nw- 開頭。
   ════════════════════════════════════════════════════════════ */
.nw-body { --nw-deep: #31451f; --nw-green: #526c2f; --nw-gold: #a98947; --nw-card: #fffdf8; --nw-line: #e4dac6; }
.nw section { padding: 0; }
.nw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw a { text-decoration: none; }

/* ── 主圖與搜尋 ── */
.nw-hero {
  position: relative;
  padding: clamp(46px, 7vw, 92px) 18px clamp(52px, 7vw, 86px);
  background:
    linear-gradient(180deg, rgba(25, 36, 16, .52) 0%, rgba(25, 36, 16, .30) 45%, rgba(25, 36, 16, .55) 100%),
    url("../images/news-hero.jpg") center 58% / cover no-repeat;
  color: #fff;
  text-align: center;
}
.nw-hero-inner { max-width: 860px; margin: 0 auto; }
.nw-crumb { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: rgba(255,255,255,.88); }
.nw-crumb a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.5); }
.nw-crumb i { font-size: 11px; opacity: .8; }
.nw-hero h1 {
  margin: 0;
  font: 700 clamp(34px, 5.4vw, 60px)/1.25 "Noto Serif TC", serif;
  letter-spacing: .12em;
  text-shadow: 0 3px 18px rgba(0,0,0,.35);
}
.nw-hero-lead { margin: 14px auto 28px; font-size: clamp(14px, 1.6vw, 17px); line-height: 1.9; letter-spacing: .04em; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.nw-search {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 780px;
  margin: 0 auto;
  padding: 7px 7px 7px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 248, .97);
  box-shadow: 0 16px 40px rgba(20, 30, 10, .28);
}
.nw-search label { display: flex; align-items: center; gap: 10px; color: var(--nw-deep); }
.nw-search i { color: var(--nw-green); }
.nw-search-q { flex: 1; min-width: 0; }
.nw-search-d { flex: 0 0 auto; padding-left: 14px; border-left: 1px solid var(--nw-line); }
.nw-search input, .nw-search select {
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
.nw-search select { width: auto; padding-right: 6px; cursor: pointer; }
.nw-search input::placeholder { color: #9a937f; }
.nw-search button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--nw-deep);
  color: #fff;
  font: 700 15px "Noto Sans TC", sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
}
.nw-search button i { color: #e7d6a4; }
.nw-search button:hover { background: #253516; }
.nw-search label:focus-within { outline: 2px solid rgba(82,108,47,.35); outline-offset: 4px; border-radius: 8px; }

/* ── 內容外框 ── */
.nw-wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }

/* ── 分類頁籤 ── */
.nw-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 26px 0 0;
  padding: 8px;
  border: 1px solid var(--nw-line);
  border-radius: 999px;
  background: var(--nw-card);
  box-shadow: 0 8px 22px rgba(70, 62, 40, .06);
}
.nw-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 8px;
  border-radius: 999px;
  color: var(--nw-deep);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.nw-tabs a + a { position: relative; }
.nw-tabs a i { font-size: 17px; color: var(--nw-green); }
.nw-tabs a:hover { background: rgba(82,108,47,.08); }
.nw-tabs a.on { background: var(--nw-deep); color: #fff; }
.nw-tabs a.on i { color: #e7d6a4; }

/* ── 鄉鎮篩選 ── */
.nw-towns { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 20px 0 0; }
.nw-towns b { margin-right: 4px; color: var(--nw-deep); font: 700 15px "Noto Serif TC", serif; letter-spacing: .06em; }
.nw-towns a {
  padding: 5px 15px;
  border: 1px solid #cdbf9f;
  border-radius: 999px;
  background: var(--nw-card);
  color: #4d4632;
  font-size: 14px;
  font-weight: 500;
}
.nw-towns a:hover { border-color: var(--nw-green); color: var(--nw-deep); }
.nw-towns a.on { border-color: var(--nw-deep); background: var(--nw-deep); color: #fff; }
.nw-result { margin: 16px 0 0; color: #5d5745; font-size: 14px; }
.nw-result b { color: var(--nw-deep); }
.nw-result a { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; color: var(--nw-green); font-weight: 700; border-bottom: 1px solid currentColor; }

/* ── 版面：主欄＋側欄 ── */
.nw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin: 26px 0 0; align-items: start; }
.nw-main { min-width: 0; }
.nw-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nw-noimg { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #dfe6cf, #c7d3ad); color: rgba(49,69,31,.5); font-size: 34px; }
.nw-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(37, 53, 22, .86);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .05em;
}
.nw time { display: inline-flex; align-items: center; gap: 7px; color: #7b745f; font-size: 13px; font-variant-numeric: tabular-nums; }
.nw time i { color: var(--nw-gold); }
.nw-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--nw-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  transition: background .2s ease;
}
.nw-btn:hover { background: #253516; }
.nw-btn i { color: #e7d6a4; font-size: 12px; }
.nw-btn-block { display: flex; justify-content: center; width: 100%; }

/* 頭條 */
.nw-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--nw-line);
  border-radius: 14px;
  background: var(--nw-card);
  box-shadow: 0 14px 34px rgba(70, 62, 40, .08);
}
.nw-lead-img { position: relative; display: block; min-height: 300px; overflow: hidden; }
.nw-lead-img .nw-img { position: absolute; inset: 0; transition: transform .5s ease; }
.nw-lead:hover .nw-lead-img .nw-img { transform: scale(1.03); }
.nw-lead-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: clamp(20px, 2.6vw, 34px); }
.nw-lead h3 { margin: 0; font: 700 clamp(21px, 2vw, 25px)/1.5 "Noto Serif TC", serif; color: #2c2a20; letter-spacing: .03em; }
.nw-lead h3 a:hover { color: var(--nw-green); }
.nw-lead p { margin: 0; color: #5d5745; font-size: 15px; line-height: 1.95; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.nw-lead .nw-btn { margin-top: auto; }

/* 卡片 */
.nw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.nw-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--nw-line);
  border-radius: 12px;
  background: var(--nw-card);
  box-shadow: 0 10px 24px rgba(70, 62, 40, .06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.nw-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(70, 62, 40, .12); }
.nw-card-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e9e2d0; }
.nw-card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px 16px; }
.nw-card h3 { margin: 0; font: 700 17px/1.55 "Noto Serif TC", serif; color: #2c2a20; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-card h3 a:hover { color: var(--nw-green); }
.nw-card p { margin: 0; color: #66604c; font-size: 13.5px; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 5px 16px;
  border: 1px solid #b9ab88;
  border-radius: 999px;
  color: var(--nw-deep);
  font-size: 13px;
  font-weight: 700;
}
.nw-more i { font-size: 11px; color: var(--nw-gold); }
.nw-more:hover { border-color: var(--nw-deep); background: var(--nw-deep); color: #fff; }
.nw-more:hover i { color: #e7d6a4; }

/* 分頁 */
.nw-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 30px 0 0; }
.nw-pager a, .nw-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--nw-line);
  border-radius: 999px;
  background: var(--nw-card);
  color: var(--nw-deep);
  font-weight: 700;
}
.nw-pager a:hover { border-color: var(--nw-green); }
.nw-pager span { border-color: var(--nw-deep); background: var(--nw-deep); color: #fff; }

/* 沒有結果 */
.nw-empty {
  padding: clamp(28px, 4vw, 44px) 20px;
  border: 1px solid var(--nw-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,253,248,.95), rgba(255,253,248,.82)),
    url("../images/footer-landscape.png") center bottom / cover no-repeat;
  text-align: center;
}
.nw-empty h3 { display: inline-flex; align-items: center; gap: 12px; margin: 0; font: 700 24px "Noto Serif TC", serif; color: var(--nw-deep); letter-spacing: .08em; }
.nw-empty h3 i { color: var(--nw-gold); }
.nw-empty p { margin: 14px 0 20px; color: #5d5745; line-height: 1.9; }
.nw-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.nw-empty-actions a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border: 1px solid #b9ab88; border-radius: 999px; background: #fff; color: var(--nw-deep); font-weight: 700; }
.nw-empty-actions a i { color: var(--nw-green); }
.nw-empty-actions a:hover { border-color: var(--nw-deep); }

/* ── 側欄 ── */
.nw-side { display: grid; gap: 18px; }
.nw .nw-box { padding: 18px 18px 20px; border: 1px solid var(--nw-line); border-radius: 14px; background: var(--nw-card); box-shadow: 0 10px 24px rgba(70, 62, 40, .06); }
.nw-box h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 19px/1.4 "Noto Serif TC", serif; color: #2c2a20; letter-spacing: .04em; }
.nw-box h2 i { color: var(--nw-gold); font-size: 20px; }
.nw-map { background: linear-gradient(180deg, #fffdf8 0%, #f5efdf 100%); }
.nw-map > p { margin: 8px 0 4px; color: #6b654f; font-size: 13px; line-height: 1.8; }
.nw-map-svg { display: block; width: 100%; height: auto; margin: 4px 0 14px; overflow: visible; }
.nw-map-svg line { stroke: #8e8a6f; stroke-width: .35; }
.nw-map-svg circle { fill: #fff; stroke: #31451f; stroke-width: .45; }
.nw-map-svg text { font: 700 4.6px "Noto Sans TC", sans-serif; letter-spacing: .1px; }
.nw-map-in text { fill: #fff; paint-order: stroke; stroke: rgba(37, 53, 22, .55); stroke-width: .9px; stroke-linejoin: round; }
.nw-map-out text { fill: #31451f; }
.nw-map-svg a:hover text, .nw-map-svg a:focus text { fill: #f3e2a9; }
.nw-map-out:hover text, .nw-map-out:focus text { fill: #a98947; }
.nw-map-svg a.on text { fill: #f3e2a9; text-decoration: underline; }
.nw-map-out.on text { fill: #a98947; }

.nw-picks ol { list-style: none; margin: 12px 0 0; padding: 0; }
.nw-picks li { display: grid; grid-template-columns: 28px 76px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed #ddd2bd; }
.nw-picks li:first-child { border-top: 0; }
.nw-rank { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(160deg, #c8a95e, #a98947); color: #fff; font: 700 15px "Noto Serif TC", serif; }
.nw-pick-img { display: block; width: 76px; height: 54px; overflow: hidden; border-radius: 6px; }
.nw-picks li div a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #2c2a20; font-size: 13.5px; font-weight: 700; line-height: 1.55; }
.nw-picks li div a:hover { color: var(--nw-green); }
.nw-picks small { display: block; margin-top: 3px; color: #8a836d; font-size: 12px; }

.nw .nw-promo { display: grid; padding: 0; overflow: hidden; }
.nw-promo img { width: 100%; height: 150px; object-fit: cover; }
.nw-promo div { padding: 16px 18px 20px; }
.nw-promo h2 { display: block; font-size: 18px; line-height: 1.55; }
.nw-promo p { margin: 8px 0 14px; color: #6b654f; font-size: 13.5px; line-height: 1.8; }

/* ── 主題快速入口 ── */
.nw-themes {
  margin-top: 46px;
  padding: 34px clamp(14px, 3vw, 28px);
  background: linear-gradient(180deg, #f3ecdc 0%, #ece3cf 100%);
  border-top: 1px solid var(--nw-line);
  border-bottom: 1px solid var(--nw-line);
}
.nw-themes-inner { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; max-width: 1240px; margin: 0 auto; }
.nw-themes h2 { position: relative; margin: 0; padding-bottom: 22px; font: 700 23px/1.55 "Noto Serif TC", serif; color: var(--nw-deep); letter-spacing: .08em; }
.nw-themes h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 12px; border-bottom: 3px solid var(--nw-gold); border-radius: 0 0 50% 50%; }
.nw-theme-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.nw-theme { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; box-shadow: 0 8px 18px rgba(50, 40, 20, .14); }
.nw-theme img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.nw-theme:hover img { transform: scale(1.06); }
.nw-theme span { position: absolute; inset: auto 0 0 0; padding: 26px 12px 10px; background: linear-gradient(180deg, transparent, rgba(20, 28, 12, .78)); color: #fff; }
.nw-theme b { display: block; font: 700 18px/1.3 "Noto Serif TC", serif; letter-spacing: .1em; }
.nw-theme small { display: block; margin-top: 3px; font-size: 11.5px; opacity: .92; letter-spacing: .04em; }

/* 頁尾與主題區之間不留雙重間距 */
.nw-body .footer { margin-top: 0; }

/* ── RWD ── */
@media (max-width: 1180px) {
  .nw-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .nw-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 18px; gap: 4px; }
  .nw-layout { grid-template-columns: minmax(0, 1fr); }
  .nw-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-promo { grid-column: 1 / -1; grid-template-columns: 220px minmax(0, 1fr); }
  .nw-promo img { height: 100%; }
  .nw-themes-inner { grid-template-columns: minmax(0, 1fr); }
  .nw-themes h2 br { display: none; }
}
@media (max-width: 720px) {
  .nw-search { flex-wrap: wrap; padding: 10px; border-radius: 20px; gap: 8px; }
  .nw-search-q { flex: 1 1 100%; padding: 0 8px; border-bottom: 1px solid var(--nw-line); }
  .nw-search-d { flex: 1 1 auto; padding-left: 8px; border-left: 0; }
  .nw-search button { padding: 0 18px; }
  .nw-hero-lead br { display: none; }
  .nw-tabs a { font-size: 14px; gap: 7px; padding: 10px 4px; }
  .nw-lead { grid-template-columns: minmax(0, 1fr); }
  .nw-lead-img { min-height: 0; aspect-ratio: 16 / 10; }
  .nw-side { grid-template-columns: minmax(0, 1fr); }
  .nw-promo { grid-template-columns: minmax(0, 1fr); }
  .nw-promo img { height: 160px; }
}
@media (max-width: 560px) {
  .nw-hero h1 { letter-spacing: .06em; }
  .nw-towns { gap: 7px; }
  .nw-towns b { flex-basis: 100%; }
  .nw-towns a { padding: 5px 12px; font-size: 13.5px; }
  .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nw-card-body { padding: 10px 11px 12px; gap: 6px; }
  .nw-card h3 { font-size: 15px; }
  .nw-card p { font-size: 12.5px; -webkit-line-clamp: 2; }
  .nw-badge { left: 8px; bottom: 8px; padding: 3px 8px; font-size: 11px; }
  .nw-more { padding: 4px 12px; font-size: 12px; }
  .nw-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
