/* ============================================
   阿欽好房推推 — Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap');

:root {
  --primary:       #7B5B3A;
  --primary-hover: #6B4D30;
  --primary-light: #A07850;
  --accent:        #E8847A;
  --yellow:        #F5C842;
  --bg:            #FDF8F2;
  --bg-card:       #FFFFFF;
  --bg-filter:     #FBF4EB;
  --text:          #3D2B1F;
  --text-muted:    #8B7060;
  --border:        #E8D8C8;
  --tag-bg:        #F5EBE0;
  --shadow:        0 2px 8px rgba(90,60,30,.08);
  --shadow-hover:  0 8px 24px rgba(90,60,30,.14);
  --radius:        12px;
  --radius-sm:     8px;
  --line-green:    #00B900;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(90,60,30,.06);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.logo-text {
  font-weight: 800;
  font-size: 17px;
  color: var(--primary);
  white-space: nowrap;
}
nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all .2s;
  white-space: nowrap;
}
nav a:hover, nav a.active { color: var(--primary); background: var(--tag-bg); }
.nav-cta {
  background: var(--line-green) !important;
  color: #fff !important;
  font-weight: 700;
}
.nav-cta:hover { opacity: .88; }

/* ── Page wrapper ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  flex: 1;
}

/* ── Listing layout ── */
.listing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.listing-top h1 { font-size: 20px; font-weight: 700; }
.listing-top h1 span { color: var(--primary); }

.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all .2s;
}
.mobile-filter-btn:hover { border-color: var(--primary); }

.listing-layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Filter Panel ── */
.filter-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filter-panel-header h2 { font-size: 15px; font-weight: 700; }
.filter-reset {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
}

.filter-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.filter-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}

.filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.radio-group input { accent-color: var(--primary); cursor: pointer; }

.range-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}
.range-row span { text-align: center; color: var(--text-muted); font-size: 13px; }
.range-input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
}
.range-input:focus { outline: none; border-color: var(--primary); }
.range-unit { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── Results bar ── */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.results-count { font-size: 14px; color: var(--text-muted); }
.results-count strong { color: var(--primary); font-size: 20px; font-weight: 700; }

.sort-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--tag-bg);
  border-radius: 20px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.active-chip:hover { background: #EDD9C8; }
.active-chip svg { flex-shrink: 0; }

/* ── Project Grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

/* ── Project Card ── */
.project-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all .25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-presale    { background: #FEF3C7; color: #92400E; }
.badge-new        { background: #D1FAE5; color: #065F46; }
.badge-secondhand { background: #EDE9FE; color: #4C1D95; }

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-date-label {
  font-size: 11px;
  color: var(--text-muted);
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title { font-size: 18px; font-weight: 800; color: var(--text); }

.card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.spec-item { display: flex; flex-direction: column; gap: 2px; }
.spec-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.spec-value { font-size: 14px; font-weight: 700; color: var(--text); }
.spec-value.price { color: var(--primary); font-size: 15px; }

.card-mrt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.tag {
  padding: 2px 8px;
  background: var(--tag-bg);
  border-radius: 4px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results svg { margin: 0 auto 12px; opacity: .25; }
.no-results p { font-size: 15px; }

/* ── Nav Search ── */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-search-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.nav-search-btn:hover { background: var(--tag-bg); color: var(--primary); }
.nav-search-input {
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: width .25s ease, opacity .2s, padding .2s;
}
.nav-search-wrap.open .nav-search-input {
  width: 150px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  opacity: 1;
  pointer-events: auto;
  background: white;
}
@media (max-width: 640px) {
  .nav-search-wrap.open .nav-search-input { width: 110px; }
}

/* ── Pagination ── */
.pagination-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0 8px;
}
.perpage-group {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.perpage-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.perpage-btn:hover { border-color: var(--primary); color: var(--primary); }
.perpage-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.page-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  color: var(--text);
}
.page-arrow:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.page-arrow[disabled] { opacity: .35; cursor: default; }
.page-num {
  min-width: 32px; height: 32px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.page-num:hover { background: var(--tag-bg); color: var(--primary); }
.page-num.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-size: 13px; }
.page-info { font-size: 12px; color: var(--text-muted); }

/* ── Footer ── */
footer {
  background: var(--text);
  color: #A09080;
  padding: 40px 20px 28px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-logo { font-size: 18px; font-weight: 800; color: white; }
.footer-tagline { font-size: 13px; color: #7A6A60; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.footer-nav a { text-decoration: none; font-size: 13px; color: #A09080; transition: color .2s; }
.footer-nav a:hover { color: white; }
.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  font-size: 12px;
  color: #5A4A40;
  text-align: center;
}


/* 建案完整資訊 raw text */
.raw-project-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  margin: 0;
  word-break: break-word;
}

/* ═══════════════════════════
   PROJECT DETAIL PAGE
═══════════════════════════ */
.project-detail {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 22px;
  transition: color .2s;
}
.back-link:hover { color: var(--primary); }

/* Hero */
.project-hero {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}
.project-hero-img {
  height: 260px;
  background: linear-gradient(135deg, #F5EBE0, #EDD9C8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  opacity: .5;
}
.project-hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }

.project-hero-body { padding: 24px; }
.project-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.project-title { font-size: 30px; font-weight: 800; }

.status-pill {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 8px;
}

.project-addr { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

.project-key-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.key-spec { text-align: center; }
.ks-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ks-value { font-size: 20px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.ks-unit { font-size: 11px; color: var(--text-muted); }

.project-highlights { display: flex; flex-wrap: wrap; gap: 6px; }
.highlight-tag {
  padding: 4px 12px;
  background: var(--tag-bg);
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

/* Info cards grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.info-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}
.info-card.full { grid-column: 1 / -1; }

.info-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--bg-filter);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.ir-label { color: var(--text-muted); flex-shrink: 0; }
.ir-value { color: var(--text); font-weight: 600; text-align: right; }

/* Layouts table */
.layouts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.layouts-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.layouts-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.layouts-table tr:last-child td { border-bottom: none; }

/* Payment flow */
.payment-flow { display: flex; flex-direction: column; gap: 8px; }
.payment-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.ps-pct { font-size: 22px; font-weight: 800; color: var(--primary); min-width: 52px; }
.ps-info {}
.ps-label { font-size: 14px; font-weight: 600; }
.ps-estimate { font-size: 12px; color: var(--text-muted); }

/* CTA box */
.booking-cta {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
}
.booking-cta h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.booking-cta .cta-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}
.cta-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--line-green);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.btn-line:hover {
  background: #009900;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0,185,0,.28);
}

/* ═══════════════════════════
   ABOUT PAGE
═══════════════════════════ */
.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.about-hero {
  text-align: center;
  margin-bottom: 40px;
}
.about-hero img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 4px solid var(--border);
  object-fit: cover;
}
.about-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.about-hero .tagline { font-size: 15px; color: var(--text-muted); }

.about-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 16px;
}
.about-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.about-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.about-card ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.about-card ul li {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.7;
}
.about-card ul li::before { content: '▪'; color: var(--primary); flex-shrink: 0; margin-top: 3px; }

/* Social links */
.social-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 32px 0 14px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.social-links { display: flex; flex-direction: column; gap: 10px; }
.social-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
}
.social-link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.social-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.social-link-text {}
.sl-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.sl-desc { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════
   UTILITIES
═══════════════════════════ */
.hidden { display: none !important; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0e8df 25%, #e8ddd4 50%, #f0e8df 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ═══════════════════════════
   RESPONSIVE
═══════════════════════════ */
@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }

  .filter-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    border-radius: 0;
    border: none;
    overflow-y: auto;
    max-height: none;
    top: 0;
  }
  .filter-panel.open { display: block; }

  .filter-panel-close-btn {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin-bottom: 16px;
  }

  .mobile-filter-btn { display: flex; }
  .project-key-specs { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 12px; gap: 8px; }
  /* 手機導覽列可橫向滑動 */
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 1;
    min-width: 0;
    gap: 2px;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a {
    white-space: nowrap;
    font-size: 12px;
    padding: 5px 10px;
    flex-shrink: 0;
  }
  .nav-cta { flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { align-items: flex-start; }
  .listing-top h1 { font-size: 17px; }
  .project-title { font-size: 24px; }
  .project-hero-top { flex-direction: column; gap: 8px; }
}


/* ── Two-button CTA ── */
.cta-two-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cta-btn-comm, .cta-btn-offic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .2s;
  text-align: center;
}
.cta-btn-comm {
  background: #06C755;
  color: white;
  border: 2px solid #06C755;
}
.cta-btn-comm:hover { background: #05a849; border-color: #05a849; }
.cta-btn-offic {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.cta-btn-offic:hover { background: var(--tag-bg); }
.cta-btn-title { font-size: 15px; font-weight: 700; }
.cta-btn-desc  { font-size: 12px; opacity: .82; }
@media (max-width: 480px) {
  .cta-two-btns { grid-template-columns: 1fr; }
}

/* ── earlyBirdNote highlight ── */
.ir-highlight {
  color: var(--accent) !important;
  font-weight: 600;
}

/* ═══════════════════════════
   DARK MODE
═══════════════════════════ */

/* ── Theme toggle button ── */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--tag-bg); color: var(--primary); }

/* Light mode: show moon, hide sun */
.icon-sun  { display: none; }
.icon-moon { display: block; }
/* Dark mode: show sun, hide moon */
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ── Dark mode CSS variables ── */
[data-theme="dark"] {
  --primary:       #D4825A;
  --primary-hover: #BE7249;
  --primary-light: #E89A78;
  --accent:        #E89A78;
  --yellow:        #F0C040;
  --bg:            #1b1917;
  --bg-card:       #242220;
  --bg-filter:     #2a2826;
  --text:          #ede8e2;
  --text-muted:    #9a8f85;
  --border:        #3d3835;
  --tag-bg:        #2e2b28;
  --shadow:        0 2px 8px rgba(0,0,0,.4);
  --shadow-hover:  0 8px 24px rgba(0,0,0,.55);
  --line-green:    #00a800;
}

/* ── Element overrides (hardcoded whites) ── */
[data-theme="dark"] header { background: #1f1d1b; border-color: var(--border); }

[data-theme="dark"] .project-card,
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .info-card,
[data-theme="dark"] .project-hero,
[data-theme="dark"] .booking-cta,
[data-theme="dark"] .about-card,
[data-theme="dark"] .pagination-area .perpage-btn,
[data-theme="dark"] .page-arrow,
[data-theme="dark"] .page-num,
[data-theme="dark"] .sort-select,
[data-theme="dark"] .filter-select,
[data-theme="dark"] .range-input { background: var(--bg-card); color: var(--text); border-color: var(--border); }

[data-theme="dark"] .social-link { background: var(--bg-card); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .social-link:hover { border-color: var(--primary); }

[data-theme="dark"] .chip { background: var(--bg-filter); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .chip:hover { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .chip.active { background: var(--primary); border-color: var(--primary); color: white; }

[data-theme="dark"] .card-specs { background: var(--bg-filter); }
[data-theme="dark"] .project-key-specs { background: var(--bg-filter); }

[data-theme="dark"] .nav-search-wrap.open .nav-search-input { background: var(--bg-card); color: var(--text); border-color: var(--border); }

[data-theme="dark"] .active-chip { background: var(--bg-filter); }

[data-theme="dark"] .layouts-table th { background: var(--bg-filter); color: var(--text-muted); }
[data-theme="dark"] .layouts-table td { border-color: var(--border); color: var(--text); }

[data-theme="dark"] .info-row { border-color: var(--bg-filter); }
[data-theme="dark"] .ir-label { color: var(--text-muted); }
[data-theme="dark"] .ir-value { color: var(--text); }

[data-theme="dark"] .raw-project-text { color: var(--text); }

[data-theme="dark"] .cta-btn-offic { background: var(--bg-card); color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .cta-btn-offic:hover { background: var(--bg-filter); }

[data-theme="dark"] footer { background: #111010; }

[data-theme="dark"] .project-disclaimer { background: #2a2520; border-color: #4a3828; color: #b8a898; }

/* Schedule page dark */
[data-theme="dark"] .schedule-items { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .schedule-item { border-color: var(--bg-filter); color: var(--text); }
[data-theme="dark"] .schedule-item:hover { background: var(--bg-filter); }
[data-theme="dark"] .schedule-cta { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .event-sale { background: #3d2e00; color: #f5c842; }
[data-theme="dark"] .event-view { background: #0f2a1a; color: #4ade80; }

/* ── Disclaimer ── */
.project-disclaimer {
  background: #FEF9F0;
  border: 1px solid #F0DFC0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: #8B7060;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ── Gallery (建案詳情頁) ── */
.img-gallery { background: #0f0f0f; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; user-select: none; }
.gal-main-wrap { position: relative; width: 100%; min-height: 200px; max-height: 460px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #0f0f0f; }
.gal-main-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; display: block; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.82); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; transition: background .2s; }
.gal-nav:hover { background: white; }
.gal-nav.prev { left: 10px; }
.gal-nav.next { right: 10px; }
.gal-counter { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: white; font-size: 13px; padding: 3px 14px; border-radius: 20px; white-space: nowrap; }
.gal-thumbs-strip { display: flex; gap: 3px; padding: 5px; background: rgba(0,0,0,.75); overflow-x: auto; scrollbar-width: none; }
.gal-thumbs-strip::-webkit-scrollbar { display: none; }
.gal-thumb { flex: 0 0 80px; height: 58px; border: 2px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; opacity: 0.5; transition: opacity .2s, border-color .2s; }
.gal-thumb:hover { opacity: .82; }
.gal-thumb.active { border-color: var(--yellow); opacity: 1; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-hero-img-placeholder { height: 220px; background: linear-gradient(135deg, #F5EBE0, #EDD9C8); display: flex; align-items: center; justify-content: center; color: var(--primary-light); opacity: .45; border-radius: var(--radius) var(--radius) 0 0; }
[data-theme="dark"] .project-hero-img-placeholder { background: linear-gradient(135deg, #2a2826, #1e1c1a); }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.93); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; animation: lb-in .2s ease; }
@keyframes lb-in { from { opacity:0; } to { opacity:1; } }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 4px; cursor: default; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.3); color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,.28); }

/* ═══════════════════════════
   ANIMATIONS
═══════════════════════════ */

/* 卡片進場：淡入 + 往上滑 */
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-card {
  animation: card-in .35s ease both;
}
/* 依序錯開：JS 會設 --i，CSS 計算 delay */
.project-card { animation-delay: calc(var(--card-i, 0) * 60ms); }

/* Chip 點選彈跳 */
@keyframes chip-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(.88); }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.chip.active { animation: chip-pop .25s ease; }

/* 篩選條件標籤（active-chip）滑入 */
@keyframes chip-in {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}
.active-chip { animation: chip-in .2s ease; }

/* 頁面整體淡入 */
@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
main { animation: page-in .3s ease; }

/* hover 時卡片陰影加大、左邊加品牌色邊條 */
.project-card:hover {
  border-left-color: var(--primary);
  border-left-width: 3px;
}

/* 建案詳情頁 hero 淡入 */
.project-hero {
  animation: card-in .4s ease both;
}
.info-card {
  animation: card-in .35s ease both;
}

/* 減少動態（使用者有設定）*/
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
