/* ============================================================
   Hanatimes Theme — Warm Editorial Wellness
   Cream + Warm Brown, Playfair Display + DM Sans + Noto Sans TC
   Reference: nutritionstripped.com
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=DM+Sans:ital,wght@0,400;0,500;1,400&family=Noto+Sans+TC:wght@300;400;500&display=swap');

/* ── Variables ── */
[data-theme="hanatimes"] {
  /* 主色 */
  --han-cream: #FAF8F5;
  --han-sand: #F0EDE8;
  --han-white: #FFFFFF;

  /* 品牌色 */
  --han-warm-brown: #8B7355;
  --han-rose: #C4A58A;
  --han-sage: #7B8C6F;
  --han-sage-light: #E8ECE3;

  /* 文字 */
  --han-dark: #2C2520;
  --han-text: #3D3530;
  --han-text-light: #8A7E74;

  /* 邊框 */
  --han-border: rgba(0, 0, 0, 0.08);

  /* 圓角 — 此設計不用圓角 */
  --han-radius: 0px;

  /* 字體 */
  --han-ff-display: 'Playfair Display', Georgia, serif;
  --han-ff-body: 'DM Sans', 'Noto Sans TC', sans-serif;

  /* Bridge variables for shared template compat */
  --color-primary: #8B7355;
  --color-primary-dk: #6B5740;
  --color-primary-lt: #FAF8F5;
  --color-bg: #FAF8F5;
  --color-bg-alt: #F0EDE8;
  --color-text: #3D3530;
  --color-muted: #8A7E74;
  --color-border: rgba(0, 0, 0, 0.08);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui: 'DM Sans', 'Noto Sans TC', sans-serif;
  --radius: 0px;
  --shadow-card: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
  --transition: 0.25s ease;

  --color-surface: #FAF8F5;
  --color-surface-alt: #F0EDE8;
  --color-primary-dark: #2C2520;
  --color-primary-light: #C4A58A;
  --color-accent: #8B7355;
  --color-accent-light: #F0EDE8;
  --color-text-primary: #2C2520;
  --color-text-secondary: #3D3530;
  --color-text-muted: #8A7E74;
  --color-text-on-dark: #FFFFFF;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', 'Noto Sans TC', sans-serif;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --header-bg: #FAF8F5;
  --header-text: #2C2520;
  --footer-bg: #2C2520;
  --footer-text: rgba(255,255,255,0.5);
  --card-shadow: 0 1px 4px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
  --reading-progress-color: #8B7355;
}

/* ── Reading progress ── */
[data-theme="hanatimes"] .reading-progress-bar {
  background: var(--han-warm-brown);
  height: 3px;
}

/* ── Breadcrumb ── */
[data-theme="hanatimes"] .breadcrumb,
[data-theme="hanatimes"] .breadcrumb a {
  font-family: var(--han-ff-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--han-text-light);
  text-decoration: none;
}

[data-theme="hanatimes"] .breadcrumb a:hover {
  color: var(--han-warm-brown);
}

/* ── Pill tag (article page category label) ── */
[data-theme="hanatimes"] .pill-tag {
  display: inline-block;
  font-family: var(--han-ff-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--han-warm-brown);
  border: 1px solid var(--han-rose);
  padding: 4px 12px;
}

/* ── Article content prose ── */
[data-theme="hanatimes"] .prose-premium {
  font-family: var(--han-ff-body);
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.9;
  color: var(--han-text);
}

[data-theme="hanatimes"] .prose-premium h2 {
  font-family: var(--han-ff-display);
  font-size: 22px;
  font-weight: 400;
  margin-top: 32px;
  margin-bottom: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--han-border);
  color: var(--han-dark);
}

[data-theme="hanatimes"] .prose-premium h3 {
  font-family: var(--han-ff-display);
  font-size: 18px;
  font-weight: 500;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--han-dark);
}

[data-theme="hanatimes"] .prose-premium p {
  margin-bottom: 16px;
}

[data-theme="hanatimes"] .prose-premium ul,
[data-theme="hanatimes"] .prose-premium ol {
  font-size: 14.5px;
  line-height: 1.8;
  margin-left: 20px;
  margin-bottom: 16px;
}

[data-theme="hanatimes"] .prose-premium blockquote {
  border-left: 3px solid var(--han-warm-brown);
  padding: 16px 24px;
  background: var(--han-sand);
  font-style: italic;
  font-size: 15px;
  margin: 24px 0;
  color: var(--han-text);
}

[data-theme="hanatimes"] .prose-premium a {
  color: var(--han-warm-brown);
  text-decoration: none;
}

[data-theme="hanatimes"] .prose-premium a:hover {
  text-decoration: underline;
}

[data-theme="hanatimes"] .prose-premium img {
  max-width: 100%;
  border-radius: 0;
}

/* ── Scroll reveal ── */
[data-theme="hanatimes"] .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-theme="hanatimes"] .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero (fallback for shared template usage) ── */
[data-theme="hanatimes"] .hero-no-image {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  padding-top: 70px;
  overflow: hidden;
  background: var(--han-cream);
}

[data-theme="hanatimes"] .hero-text-center {
  position: relative;
  z-index: 1;
  padding: 0 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

[data-theme="hanatimes"] .hero-eyebrow {
  font-family: var(--han-ff-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--han-warm-brown);
  margin-bottom: 1rem;
}

[data-theme="hanatimes"] .hero-stat {
  font-family: var(--han-ff-body);
  font-size: 14px;
  color: var(--han-text-light);
}

/* ── Article hero (shared) ── */
[data-theme="hanatimes"] .article-hero-no-img {
  height: 200px;
  background: var(--han-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

[data-theme="hanatimes"] .article-hero-with-img {
  height: 400px;
  position: relative;
  overflow: hidden;
}

[data-theme="hanatimes"] .article-hero-with-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-theme="hanatimes"] .article-hero-with-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,37,32,0.5) 0%, transparent 50%);
}

/* ── Stats bar (fallback) ── */
[data-theme="hanatimes"] .stats-bar {
  background: var(--han-cream);
  border-top: 1px solid var(--han-border);
  border-bottom: 1px solid var(--han-border);
  padding: 2.5rem 2rem;
}

[data-theme="hanatimes"] .stat-number {
  font-family: var(--han-ff-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--han-dark);
  line-height: 1;
}

[data-theme="hanatimes"] .stat-label {
  font-family: var(--han-ff-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--han-text-light);
  margin-top: 0.4rem;
}

/* ── Section titles (fallback) ── */
[data-theme="hanatimes"] .section-eyebrow {
  font-family: var(--han-ff-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--han-warm-brown);
  margin-bottom: 0.4rem;
}

[data-theme="hanatimes"] .section-title {
  font-family: var(--han-ff-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--han-dark);
  margin-bottom: 0.5rem;
}

[data-theme="hanatimes"] .section-rule {
  display: none;
}

/* ── Card (fallback for shared ArticleCard) ── */
[data-theme="hanatimes"] .article-card {
  display: block;
  text-decoration: none;
  background: var(--han-white);
  border: 1px solid var(--han-border);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

[data-theme="hanatimes"] .article-card::before {
  display: none;
}

[data-theme="hanatimes"] .article-card:hover {
  transform: translateY(-2px);
  border-color: var(--han-warm-brown);
}

[data-theme="hanatimes"] .card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--han-sand);
}

[data-theme="hanatimes"] .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

[data-theme="hanatimes"] .article-card:hover .card-img-wrap img {
  transform: scale(1.03);
}

[data-theme="hanatimes"] .card-category-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  background: transparent;
  color: var(--han-warm-brown);
  font-family: var(--han-ff-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--han-rose);
  border-radius: 0;
}

[data-theme="hanatimes"] .card-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--han-sand);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="hanatimes"] .card-body {
  padding: 16px 16px 20px;
}

[data-theme="hanatimes"] .card-title {
  font-family: var(--han-ff-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--han-dark);
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

[data-theme="hanatimes"] .card-excerpt {
  font-family: var(--han-ff-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--han-text-light);
  line-height: 1.6;
}

[data-theme="hanatimes"] .card-date {
  font-family: var(--han-ff-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--han-text-light);
  margin-top: 0.6rem;
}

/* ── Category Cards ── */
[data-theme="hanatimes"] .cat-card {
  background: var(--han-white) !important;
  border-color: var(--han-border) !important;
  border-radius: 0 !important;
}

[data-theme="hanatimes"] .cat-card:hover {
  border-color: var(--han-warm-brown) !important;
  transform: translateY(-1px);
}

[data-theme="hanatimes"] .cat-card .cat-card-number {
  color: var(--han-text-light) !important;
  font-size: 10px !important;
}

[data-theme="hanatimes"] .cat-card .cat-card-name {
  font-family: var(--han-ff-display) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: var(--han-dark) !important;
}

[data-theme="hanatimes"] .cat-card .cat-card-count {
  color: var(--han-text-light) !important;
  font-size: 12px !important;
}

[data-theme="hanatimes"] .cat-card:hover .cat-card-arrow {
  color: var(--han-warm-brown) !important;
}

/* ── Hover states (moved from styled-jsx) ── */
.han-cat-card:hover {
  border-color: var(--han-warm-brown, #8B7355) !important;
  transform: translateY(-1px);
}
.han-cat-card:hover .han-cat-arrow {
  opacity: 1 !important;
}
.han-article-row:hover h3 {
  color: var(--han-warm-brown, #8B7355) !important;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  [data-theme="hanatimes"] .hero-no-image {
    min-height: 380px;
  }

  html, body {
    overflow-x: hidden;
  }

  /* Hero */
  .han-hero {
    grid-template-columns: 1fr !important;
  }
  .han-hero > div:first-child {
    padding: 32px 24px !important;
  }
  .han-hero > div:last-child {
    height: 280px;
  }
  .han-hero h1 {
    font-size: 28px !important;
  }

  /* Category grid */
  .han-category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Featured articles */
  .han-featured-grid {
    grid-template-columns: 1fr !important;
  }

  /* Stats bar */
  .han-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .han-stats-grid > div {
    border-right: none !important;
    border-bottom: 1px solid var(--han-border, rgba(0,0,0,0.08));
  }
  .han-stats-grid > div:nth-child(odd) {
    border-right: 1px solid var(--han-border, rgba(0,0,0,0.08)) !important;
  }

  /* Related articles */
  .han-related-grid {
    grid-template-columns: 1fr !important;
  }

  /* Footer */
  .han-footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }

  /* Article list rows */
  .han-article-row {
    grid-template-columns: 1fr !important;
  }
  .han-article-row > div:first-child {
    width: 100% !important;
    height: 200px !important;
  }
}

@media (max-width: 480px) {
  .han-category-grid {
    grid-template-columns: 1fr !important;
  }
  .han-footer-grid {
    grid-template-columns: 1fr !important;
  }
}
