/* =========================================================
   2026 新北好茶－新版首頁樣式
   檔案：inc/home.css
   說明：色彩與版面沿用舊版視覺（主色 #4A6741），
         但移除重複規則，改以共用元件呈現。
   ========================================================= */

:root {
  --primary: #4a6741;
  --primary-dark: #37502f;
  --secondary: #8ba888;
  --accent: #6daca7;
  --ink: #333333;
  --muted: #666666;
  --light: #f5f5f5;
  --line: #e3e8de;
  --paper: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.05);
  --nav-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft JhengHei", "微軟正黑體", "Noto Sans TC", "PingFang TC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

/* ---------------------------------------------------------
   導覽列
   --------------------------------------------------------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 14px 20px;
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

.site-nav.is-scrolled,
.site-nav.is-open {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.08);
  padding-block: 10px;
}

.nav-inner {
  width: min(1280px, 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 2px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  transition: color 0.2s ease;
}

.site-nav.is-scrolled .nav-links a {
  color: var(--ink);
  text-shadow: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #d8f0cf;
}

.site-nav.is-scrolled .nav-links a:hover,
.site-nav.is-scrolled .nav-links a:focus-visible {
  color: var(--primary);
}

/* 下拉選單 */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 190px;
  margin: 8px 0 0;
  padding: 8px;
  list-style: none;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.nav-links > li:hover > .nav-dropdown,
.nav-links > li:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  color: var(--ink) !important;
  text-shadow: none;
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 8px;
}

.nav-dropdown a:hover {
  background: #f1f6ec;
  color: var(--primary) !important;
}

/* 漢堡選單 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #ffffff;
}

.site-nav.is-scrolled .nav-toggle,
.site-nav.is-open .nav-toggle {
  color: var(--primary);
}

.nav-toggle span {
  position: relative;
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: background 0.2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.nav-toggle span::before {
  top: -7px;
}

.nav-toggle span::after {
  top: 7px;
}

.site-nav.is-open .nav-toggle span {
  background: transparent;
}

.site-nav.is-open .nav-toggle span::before {
  transform: translateY(7px) rotate(45deg);
}

.site-nav.is-open .nav-toggle span::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------
   主視覺
   --------------------------------------------------------- */
.hero {
  position: relative;
  margin: 0;
  line-height: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 160px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: 1;
}

.hero img {
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------
   區塊
   --------------------------------------------------------- */
.section {
  position: relative;
  padding: 76px 0;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.section--tint {
  background: #f7f9f4;
}

.section--tight {
  padding-top: 40px;
}

.section-title {
  position: relative;
  z-index: 2;
  margin: 0 0 42px;
  text-align: center;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 12px auto 0;
  background: var(--primary);
  border-radius: 2px;
}

.section-icon {
  position: absolute;
  top: 34px;
  width: 150px;
  max-width: 14vw;
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.section-icon--left {
  left: clamp(60px, 6vw, 150px);
}

.section-icon--right {
  right: clamp(60px, 6vw, 150px);
}

/* ---------------------------------------------------------
   分頁（活動／旅遊／好禮／交通／店家共用）
   --------------------------------------------------------- */
.tabs {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin-inline: auto;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--primary);
}

.tab-btn {
  appearance: none;
  border: 2px solid transparent;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: transparent;
  color: #5b5b5b;
  padding: 12px 30px;
  font: inherit;
  font-size: 1.08rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary);
  background: #f1f6ec;
}

.tab-btn.is-active {
  background: var(--paper);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
  animation: fade-up 0.35s ease both;
}

/* 子分頁：膠囊樣式 */
.tabs--sub {
  margin-top: 6px;
}

.tabs--sub .tab-buttons {
  gap: 10px;
  margin-bottom: 28px;
  border-bottom: 0;
}

.tabs--sub .tab-btn {
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--paper);
  color: var(--primary);
  padding: 8px 22px;
  font-size: 1rem;
}

.tabs--sub .tab-btn:hover {
  background: #eef4e9;
}

.tabs--sub .tab-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ---------------------------------------------------------
   活動卡片
   --------------------------------------------------------- */
.theme-card {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 30px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.theme-card--wide {
  display: block;
}

.theme-body {
  flex: 1;
  min-width: 0;
}

.theme-media {
  flex: 0 0 40%;
  width: 40%;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--light);
}

.theme-media img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* 直式／橫式大圖：放在內容下方，不裁切 */
.theme-media--full {
  flex: none;
  width: 100%;
  margin-top: 26px;
}

.theme-media--full img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
}

.theme-title {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.3;
}

.theme-title a {
  text-decoration: none;
}

.theme-title a:hover {
  text-decoration: underline;
}

.theme-desc {
  margin: 0 0 16px;
  color: var(--muted);
}

.meta-list,
.info-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: #444444;
}

.meta-list li,
.info-list li {
  position: relative;
  margin: 6px 0;
  padding-left: 1.15em;
}

.meta-list li::before,
.info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 3px 13px;
  border-radius: 999px;
  background: #eef4e9;
  color: var(--primary);
  font-size: 0.9rem;
}

.price {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 14px;
  border-radius: 8px;
  background: #f0f6ec;
  color: var(--primary);
  font-weight: 700;
}

.callout {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--secondary);
  border-radius: 0 10px 10px 0;
  background: #f7f9f4;
  color: #4f5a4b;
  font-size: 0.95rem;
}

/* 按鈕 */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 26px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--paper);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 1px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn--solid {
  background: var(--primary);
  color: #ffffff;
}

.btn--solid:hover {
  background: var(--primary-dark);
}

/* ---------------------------------------------------------
   資料表
   --------------------------------------------------------- */
.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  min-width: 430px;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.95rem;
}

.data-table caption {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f3f7ef;
  color: var(--primary);
  font-weight: 700;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.data-table thead th {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.data-table tbody tr:nth-child(even) {
  background: #fafcf8;
}

/* 時刻表收合 */
.timetable {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
}

.timetable summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #f3f7ef;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.timetable summary::-webkit-details-marker {
  display: none;
}

.timetable summary::after {
  content: "＋";
  font-weight: 400;
}

.timetable[open] summary::after {
  content: "－";
}

.timetable .table-wrap {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ---------------------------------------------------------
   演出節目
   --------------------------------------------------------- */
.program-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.program-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.program-card img {
  width: 100%;
  height: 170px;
  margin-bottom: 12px;
  border-radius: 10px;
  object-fit: cover;
}

.program-card h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 1.05rem;
}

.program-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   精選好禮
   --------------------------------------------------------- */
.gift-card {
  display: flex;
  align-items: center;
  gap: 38px;
  padding: 30px;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.gift-media {
  flex: 0 0 38%;
  width: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 16px;
  background: #f7f7f2;
}

.gift-media img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.gift-body {
  flex: 1;
  min-width: 0;
}

.gift-body h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
}

.gift-quote {
  margin: 0 0 16px;
  color: var(--secondary);
  font-size: 1.08rem;
  font-weight: 700;
}

.gift-body h4 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 1.05rem;
}

.gift-body p,
.gift-body li {
  color: #4f4f4f;
  font-size: 0.96rem;
}

.gift-body ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}

.gift-note {
  margin: 0;
  color: #7a7a7a;
  font-size: 0.86rem;
  line-height: 1.9;
}

/* ---------------------------------------------------------
   交通資訊
   --------------------------------------------------------- */
.traffic-panel {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.traffic-panel h3 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1.45rem;
}

.traffic-panel h4 {
  margin: 24px 0 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #d3f8e2;
  color: var(--primary);
  font-size: 1.05rem;
}

.traffic-panel h4:first-child {
  margin-top: 0;
}

.note {
  color: #a40002;
  font-size: 0.88rem;
}

.map-frame {
  display: block;
  width: 100%;
  height: 430px;
  margin-top: 20px;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------
   特約店家
   --------------------------------------------------------- */
.shop-panel {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.shop-panel > h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 1.45rem;
  text-align: center;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.shop-grid li {
  padding: 10px 14px;
  border-radius: 10px;
  background: #eff4e1;
  font-size: 0.95rem;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}

.shop-grid a {
  text-decoration: none;
}

.shop-grid a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ---------------------------------------------------------
   散步地圖
   --------------------------------------------------------- */
.map-figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-figure img {
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------
   頁尾
   --------------------------------------------------------- */
.site-footer {
  padding: 26px 20px;
  background: var(--primary);
  color: #ffffff;
  text-align: center;
  font-size: 0.95rem;
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: #ffffff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   動畫
   --------------------------------------------------------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------
   響應式
   --------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .section-icon {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --nav-h: 62px;
  }

  .site-nav {
    padding: 10px 16px;
  }

  .nav-inner {
    justify-content: flex-end;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: 14px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--ink);
    text-shadow: none;
    font-size: 15px;
  }

  .nav-links a:hover {
    background: #f1f6ec;
    color: var(--primary);
  }

  .nav-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    margin: 0;
    padding: 0 0 4px 14px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    display: block;
  }

  .nav-dropdown a {
    padding: 9px 14px;
    font-size: 14px;
    color: #666666 !important;
  }

  .nav-dropdown a:hover {
    color: var(--primary) !important;
  }

  .nav-links > li:hover > .nav-dropdown,
  .nav-links > li:focus-within > .nav-dropdown {
    transform: none;
    display: block;
  }

  .section {
    padding: 56px 0;
  }

  .theme-card,
  .gift-card {
    flex-direction: column;
    gap: 22px;
    padding: 22px;
  }

  .theme-media,
  .gift-media {
    flex: none;
    width: 100%;
  }

  .theme-media img {
    max-height: 300px;
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .program-card img {
    height: 220px;
  }

  .traffic-panel,
  .shop-panel {
    padding: 22px;
  }

  .map-frame {
    height: 320px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: calc(100% - 28px);
  }

  .tab-buttons {
    gap: 4px;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 1rem;
  }

  .tabs--sub .tab-btn {
    padding: 7px 16px;
    font-size: 0.92rem;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .theme-title {
    font-size: 1.4rem;
  }

  .gift-media img {
    max-height: 240px;
  }

  .map-frame {
    height: 260px;
  }
}

/* ---------------------------------------------------------
   報名場次（資料來自 inc/eb.php）
   --------------------------------------------------------- */
.session-box {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafcf8;
}

.session-box__title {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.session-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}

.session-item:last-child {
  border-bottom: 0;
}

.session-date {
  flex: 1 1 auto;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 1px;
}

.session-time {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.session-state {
  flex: 0 0 auto;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(74, 103, 65, 0.1);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.session-state.is-off {
  background: #f0f0f0;
  color: var(--muted);
}

.session-action {
  flex: 0 0 auto;
  padding: 5px 16px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.session-action:hover {
  background: var(--primary);
  color: #ffffff;
}

.session-action.is-disabled {
  border-color: var(--line);
  color: var(--muted);
  background: #f5f5f5;
  cursor: not-allowed;
}

.session-more {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.session-more a {
  margin-left: 4px;
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 560px) {
  .session-box {
    padding: 14px 16px;
  }

  .session-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .session-date {
    flex: 1 1 100%;
  }
}
