/* =============================================================
   mp_theme-tw.css — 新東西市集 (MP) 首頁主題
   風格: shadcn/ui 風格 token 系統 + 溫馨暖色調
   主色: #cc783a
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  --mp-primary: #cc783a;
  --mp-primary-dark: #a85f2b;
  --mp-primary-light: #f3e3d3;
  --mp-primary-foreground: #fffaf5;

  --mp-bg: #fbf5ee;
  --mp-card: #ffffff;
  --mp-foreground: #2f2014;
  --mp-muted: #f3ece2;
  --mp-muted-foreground: #8a7361;
  --mp-border: #ece0d2;
  --mp-ring: rgba(204, 120, 58, 0.35);

  --mp-radius-lg: 1rem;
  --mp-radius: 0.625rem;
  --mp-radius-sm: 0.5rem;
  --mp-radius-full: 999px;

  --mp-shadow-sm: 0 1px 2px rgba(47, 32, 20, 0.06);
  --mp-shadow: 0 4px 16px rgba(47, 32, 20, 0.08);
  --mp-shadow-lg: 0 10px 28px rgba(47, 32, 20, 0.14);

  --mp-max: 1168px;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mp-bg);
  color: var(--mp-foreground);
  font-family: 'Inter', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', sans-serif;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--mp-primary);
  outline-offset: 2px;
  border-radius: var(--mp-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Page wrap ---------- */
.mp-page-wrap {
  max-width: var(--mp-max);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- Buttons ---------- */
.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--mp-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
  white-space: nowrap;
}
.mp-btn-primary { background: var(--mp-primary); color: var(--mp-primary-foreground); }
.mp-btn-primary:hover { background: var(--mp-primary-dark); }
.mp-btn-outline { background: transparent; color: var(--mp-foreground); border-color: var(--mp-border); }
.mp-btn-outline:hover { background: var(--mp-muted); }
.mp-btn-block { width: 100%; }

/* =============================================================
   廣告區 (Ad blocks)
   ============================================================= */
.mp-ads {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.mp-ad-main { flex: 1 1 auto; max-width: 820px; min-width: 0; overflow: hidden; }
.mp-ad-side { flex: 0 0 320px; max-width: 320px; min-width: 0; overflow: hidden; }
.mp-ad-main ins, .mp-ad-main img,
.mp-ad-side ins, .mp-ad-side img, .mp-ad-side a img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block;
}
@media (max-width: 767px) {
  .mp-ads { flex-wrap: wrap; }
  .mp-ad-main { flex: 1 1 100%; max-width: 100%; }
  .mp-ad-side { display: none !important; }
}

/* =============================================================
   主內容 + 側欄 兩欄佈局
   ============================================================= */
.mp-below-ads { display: flex; gap: 24px; align-items: flex-start; }
.mp-below-main { flex: 1 1 auto; max-width: 820px; min-width: 0; }
@media (max-width: 1023px) {
  .mp-below-ads { display: block; }
  .mp-below-main { max-width: 100%; }
}

/* ---------- Section head ---------- */
.mp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mp-section-head-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #555;
  background: #e3bb39;
  padding: 7px 16px;
  border-radius: var(--mp-radius-sm);
}
.mp-section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color .15s;
}
.mp-section-more:hover { color: var(--mp-primary); }
.mp-section-more svg { width: 14px; height: 14px; }

.mp-swiper-block { margin-bottom: 16px; }
.mp-swiper-block--featured { margin-bottom: 16px; }
.mp-swiper-body {
  position: relative;
  background: #f1f1f1;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  padding: 16px;
}

/* ---------- Swiper chrome ---------- */
.mp-swiper-body .swiper { padding-bottom: 38px; }
.mp-swiper-body .swiper-slide { height: auto; }
.mp-swiper-body .swiper-button-next,
.mp-swiper-body .swiper-button-prev {
  width: 34px; height: 34px;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: 50%;
  box-shadow: var(--mp-shadow-sm);
  color: var(--mp-primary) !important;
  top: 40%;
}
.mp-swiper-body .swiper-button-next::after,
.mp-swiper-body .swiper-button-prev::after {
  font-size: 13px !important;
  font-weight: 900;
}
.mp-swiper-body .swiper-pagination-bullet { background: var(--mp-border); opacity: 1; }
.mp-swiper-body .swiper-pagination-bullet-active { background: var(--mp-primary); }

/* ---------- Card (standard) ---------- */
.mp-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mp-card);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  box-shadow: var(--mp-shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.mp-card:hover { box-shadow: var(--mp-shadow-lg); transform: translateY(-3px); border-color: #e7caa8; }
.mp-card-img-wrap { position: relative; padding-top: 62%; background: var(--mp-muted); overflow: hidden; }
.mp-card-img-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.mp-card:hover .mp-card-img-wrap img { transform: scale(1.04); }
.mp-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.mp-card-title {
  font-size: 14.5px; font-weight: 700; color: var(--mp-foreground); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.mp-card:hover .mp-card-title { color: var(--mp-primary); }
.mp-card-meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--mp-muted-foreground);
  padding-top: 8px; border-top: 1px dashed var(--mp-border);
}
.mp-card-views { display: inline-flex; align-items: center; gap: 4px; }
.mp-card-views svg { width: 13px; height: 13px; }

/* ---------- Card (featured) ---------- */
.mp-card--featured { border-radius: var(--mp-radius-lg); box-shadow: var(--mp-shadow); }
.mp-card--featured .mp-card-img-wrap { padding-top: 54%; }
.mp-card--featured .mp-card-body { padding: 16px; gap: 10px; }
.mp-card--featured .mp-card-title { font-size: 16px; -webkit-line-clamp: 2; }
.mp-card-desc {
  font-size: 13px; color: var(--mp-muted-foreground); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-card-badge {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(47, 32, 20, 0.72);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--mp-radius-full);
  backdrop-filter: blur(2px);
}
.mp-card-badge svg { width: 11px; height: 11px; }

/* =============================================================
   Footer
   ============================================================= */
.mp-footer { margin-top: 40px; background: #2f2014; color: #ead9c6; }
.mp-footer-inner {
  max-width: var(--mp-max); margin: 0 auto;
  padding: 22px 16px; text-align: center;
  font-size: 12.5px; color: #c7ad94;
}
.mp-footer-inner a { color: #ead9c6; }
.mp-footer-inner a:hover { color: var(--mp-primary-light); }

/* =============================================================
   Responsive helpers
   ============================================================= */
@media (max-width: 767px) {
  .mp-page-wrap { padding: 16px 12px 36px; }
}
