/*
==============================================================================
Project: 臺南左鎮行 LIFF 官方網站｜視覺設計系統
Author: Ray (施睿皇) - Jingrui Design Studio
Version: 1.1.0
Copyright (c) 2026 Jingrui Design Studio. All rights reserved.
==============================================================================
*/

:root {
  --bg: #FBF9F4;
  --paper: #FFFFFF;
  --ink: #1C2421;
  --muted: #53635C;
  --line: #E5DFC4;
  --primary: #21352E;
  --primary-deep: #162520;
  --primary-light: #2A453C;
  --accent: #C85A32;
  --gold: #D4A838;
  --gold-light: #F4E8C1;
  --shadow: 0 16px 40px rgba(28, 36, 33, 0.08);
  --shadow-hover: 0 20px 48px rgba(28, 36, 33, 0.14);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Noto Serif TC', "PingFang TC", serif;
  font-weight: 700;
}

button, a, input {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   Hero 首頁區塊
   ========================================================================== */
.hero {
  min-height: 85vh;
  padding: max(18px, env(safe-area-inset-top)) 20px 40px;
  color: #FFFFFF;
  background:
    linear-gradient(180deg, rgba(16, 26, 23, 0.68) 0%, rgba(16, 26, 23, 0.42) 40%, rgba(16, 26, 23, 0.92) 100%),
    url("https://fossil.tnc.gov.tw/ufiles/0/ba000030.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

/* Logo image in navbar */
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px;
  box-shadow: 0 0 0 1.5px var(--gold), 0 2px 12px rgba(201, 162, 39, 0.3);
  flex-shrink: 0;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.brand:hover .brand-logo {
  box-shadow: 0 0 0 2px var(--gold), 0 4px 20px rgba(201, 162, 39, 0.5);
  transform: scale(1.06);
}


.brand-text strong,
.brand-text small {
  display: block;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: 0.5px;
}

.brand-text small {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 1px;
}

.icon-button {
  width: 44px;
  height: 44px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.icon-button:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.28);
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 0 20px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-copy {
  max-width: 580px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ==========================================================================
   按鈕樣式 (Buttons)
   ========================================================================== */
.primary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
}

.primary-button {
  color: #FFFFFF;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(200, 90, 50, 0.35);
}

.primary-button:hover,
.primary-button:active {
  background: #B34B25;
  transform: translateY(-1px);
}

.ghost-button {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
}

.ghost-button:hover,
.ghost-button:active {
  background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   LIFF 狀態條
   ========================================================================== */
.status-band {
  width: min(1080px, calc(100% - 32px));
  margin: -24px auto 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-band strong {
  font-size: 15px;
  color: var(--ink);
}

.status-band p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 56, 0.2);
}

.status-dot.ready {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.error {
  background: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.text-button {
  color: #FFFFFF;
  background: var(--primary);
  white-space: nowrap;
  font-size: 13px;
  padding: 8px 16px;
}

/* ==========================================================================
   區塊通用與搜尋列
   ========================================================================== */
.section {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section h2 {
  margin: 0;
  font-size: clamp(24px, 5vw, 36px);
  color: var(--primary);
  line-height: 1.2;
}

.result-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #EFECE4;
  padding: 4px 12px;
  border-radius: 999px;
}

/* 搜尋框 */
.search-bar {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 46px;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(28, 36, 33, 0.04);
  transition: all 0.2s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 53, 46, 0.12);
}

.search-clear {
  position: absolute;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: #EFECE4;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* 分類卡籤 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.route-card {
  padding: 14px 16px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.route-card:hover {
  border-color: var(--primary);
}

.route-card.active {
  color: #FFFFFF;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(33, 53, 46, 0.25);
}

.card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.route-card.active .card-tag {
  color: var(--gold);
}

.route-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}

/* ==========================================================================
   店家卡片列表 (Place Cards - 徹底解決文字疊加圖片閱讀性問題)
   ========================================================================== */
.place-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.place-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.place-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.place-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #EFECE4;
}

.place-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.place-card:hover .place-image {
  transform: scale(1.05);
}

/* ---- 無圖片佔位底紋 ---- */
.place-placeholder,
.modal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #1C2B24;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(201, 162, 39, 0.06) 0px,
      rgba(201, 162, 39, 0.06) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(201, 162, 39, 0.06) 0px,
      rgba(201, 162, 39, 0.06) 1px,
      transparent 1px,
      transparent 18px
    );
  color: var(--gold-light);
  font-family: 'Noto Serif TC', serif;
  text-align: center;
  padding: 20px;
  position: relative;
}

/* 底紋中央：分類標籤小字 */
.place-placeholder::before,
.modal-placeholder::before {
  content: attr(data-tag);
  font-size: 11px;
  font-family: 'Noto Sans TC', sans-serif;
  letter-spacing: 2px;
  color: rgba(201, 162, 39, 0.5);
  text-transform: uppercase;
}

/* 底紋中央：店名大字 */
.place-placeholder::after,
.modal-placeholder::after {
  content: attr(data-label);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1.4;
  max-width: 90%;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  padding-top: 10px;
  margin-top: 2px;
}


/* 圖片左上角標籤：採用模糊高對比膠囊深色底，絕非直接混雜於圖片之上 */
.place-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-light);
  background: rgba(22, 37, 32, 0.86);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.place-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.place-meta {
  margin-bottom: 6px;
}

.place-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.place-title {
  margin: 4px 0 8px;
  font-size: 19px;
  line-height: 1.3;
  color: var(--primary);
}

.place-summary {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.place-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.small-button,
.small-ghost-button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
}

.small-button {
  color: #FFFFFF;
  background: var(--primary);
}

.small-button:hover {
  background: var(--primary-deep);
}

.small-ghost-button {
  color: var(--primary);
  background: #EFECE4;
  border: 1px solid var(--line);
}

.small-ghost-button:hover {
  background: #E5E0D5;
}

/* 無搜尋結果提示 */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ==========================================================================
   行動轉化服務區塊
   ========================================================================== */
.action-section {
  padding-bottom: 56px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: start;
}

.action-header h2 {
  margin-top: 6px;
}

.action-header p {
  color: var(--muted);
  font-size: 15px;
}

.action-list {
  display: grid;
  gap: 12px;
}

.action-row {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(28, 36, 33, 0.04);
  transition: all 0.2s ease;
}

.action-row:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.action-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: #F4EFE6;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.action-row strong {
  display: block;
  font-size: 16px;
  color: var(--primary);
}

.action-row small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.action-row .arrow {
  margin-left: auto;
  color: var(--gold);
  font-weight: 700;
}

/* ==========================================================================
   店家詳情 Modal 彈窗
   ========================================================================== */
.detail-modal {
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  max-width: 560px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.detail-modal::backdrop {
  background: rgba(16, 26, 23, 0.68);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  backdrop-filter: blur(4px);
}

.modal-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #EFECE4;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-tag {
  position: absolute;
  bottom: 12px;
  left: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(22, 37, 32, 0.86);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 24px;
}

.modal-body h2 {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--primary);
}

.modal-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.modal-info-list {
  background: #F8F5EE;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--ink);
}

.info-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-btn {
  width: 100%;
}

/* 頁尾 */
.site-footer {
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
  background: #F4F0E6;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 4px 0;
}

/* ==========================================================================
   響應式適配 (RWD)
   ========================================================================== */
@media (max-width: 900px) {
  .place-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 75vh;
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .place-list {
    grid-template-columns: 1fr;
  }

  .status-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
