/* ==========================================================================
   明健 MING JIAN - 生活誌與食譜單篇專屬樣式 (ARTICLE & RECIPE DETAIL STYLES)
   參考 GREEN SPOON 單篇文章內頁 (/news/280) 排版標準，兼具雜誌美感與導購轉換
   ========================================================================== */

/* --- 1. 內頁主容器 --- */
.article-page {
  background-color: #FAFBF9;
  padding: 32px 0 80px;
}

.article-container {
  max-width: 820px;
  margin: 0 auto;
  background-color: #FFFFFF;
  border: 1px solid #E8EFEA;
  border-radius: 20px;
  padding: 48px 48px 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* 麵包屑導航 */
.article-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: #728078;
  margin-bottom: 28px;
}

.article-breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-breadcrumb .separator {
  opacity: 0.4;
}

.article-breadcrumb .current {
  color: #2D3A33;
  font-weight: 600;
}

/* --- 2. 文章頂部 Meta 與標題 --- */
.article-header {
  margin-bottom: 28px;
}

.article-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.article-badge-cat {
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.article-badge-calcium {
  background: #F4EEDF;
  color: #8C621E;
  border: 1px solid #E8DCBD;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
}

.article-date-time {
  font-size: 0.84rem;
  color: #75857D;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.article-title {
  font-family: 'Noto Serif TC', 'Songti TC', serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #1A261F;
  line-height: 1.35;
  margin: 0 0 16px;
}

.article-quick-specs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 18px;
  background: #F5F8F6;
  border-radius: 10px;
  font-size: 0.86rem;
  color: #4A5850;
}

.spec-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spec-item strong {
  color: var(--color-primary);
}

/* --- 3. 首圖主視覺 (EYECATCH HERO) --- */
.article-eyecatch {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  background-color: #F0F4F2;
}

.article-eyecatch-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- 4. 正文故事引言 --- */
.article-lead {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #38463E;
  margin-bottom: 40px;
  padding: 0 4px;
}

/* 段落小標題 */
.article-section-title {
  font-family: 'Noto Serif TC', 'Songti TC', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 2px solid #E0ECE5;
  padding-bottom: 12px;
  margin: 44px 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* --- 5. 食材表格清單 (INGREDIENTS CARD) --- */
.article-ingredients-card {
  background: #F8FAF8;
  border: 1px solid #DFE8E2;
  border-radius: 16px;
  padding: 28px 28px;
  margin-bottom: 40px;
}

.ingredients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #D3E0D8;
}

.ingredients-header h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #24332B;
  margin: 0;
}

.ingredients-servings {
  font-size: 0.85rem;
  color: #6C7D73;
}

.ingredients-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #EDF3EF;
  font-size: 0.92rem;
  line-height: 1.45;
}

.ingredient-name {
  color: #2F3D35;
  flex: 1;
  padding-right: 12px;
}

.ingredient-qty {
  color: #627269;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 括號備註說明：強制獨立斷行呈現，結構整齊不擁擠 */
.ingredient-sub {
  display: block;
  font-size: 0.78rem;
  font-weight: normal;
  color: #728279;
  line-height: 1.35;
  margin-top: 3px;
}

.ingredient-row.highlight {
  background: #EBF5F0;
  padding: 10px 12px;
  border-radius: 8px;
  border-bottom: none;
}

.ingredient-row.highlight .ingredient-name {
  color: var(--color-primary);
  font-weight: 700;
}

.ingredient-row.highlight .ingredient-qty {
  color: var(--color-primary);
  font-weight: 700;
}

.ingredient-row.highlight .ingredient-sub {
  color: #2F6B49;
  font-weight: 500;
}

/* --- 6. 步驟條列 (STEP BY STEP) --- */
.article-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 44px;
}

.step-card {
  display: flex;
  gap: 20px;
  background: #FFFFFF;
  border: 1px solid #E6EFE9;
  border-radius: 14px;
  padding: 24px 22px;
  transition: all var(--transition-fast);
}

.step-card:hover {
  border-color: #C8DDD0;
  box-shadow: 0 4px 14px rgba(0, 71, 39, 0.05);
}

.step-badge {
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  background: var(--color-primary);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex-grow: 1;
}

.step-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1F2E25;
  margin: 0 0 8px;
}

.step-desc {
  font-size: 0.93rem;
  line-height: 1.7;
  color: #4D5C53;
  margin: 0;
}

/* --- 7. 營養師私房私語筆記 (INSIGHT CARD) --- */
.article-insight-card {
  background: #FFFDF7;
  border: 1px solid #F2E7CD;
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 48px;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.insight-badge {
  background: #FED141;
  color: #1A1A1A;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.insight-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #523B0F;
  margin: 0;
}

.insight-desc {
  font-size: 0.92rem;
  line-height: 1.75;
  color: #5C4A28;
  margin: 0;
}

/* --- 8. GREEN SPOON 式導購商品卡 (PRODUCT MATCH CTA) --- */
.article-product-cta {
  background: #F5F8F6;
  border: 1px solid #D6E4DC;
  border-radius: 18px;
  padding: 28px 32px;
  margin: 48px 0 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.cta-image-col {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-product-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.08));
}

.cta-text-col {
  flex-grow: 1;
}

.cta-tag {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--color-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.cta-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1E2B23;
  margin: 0 0 6px;
}

.cta-desc {
  font-size: 0.88rem;
  color: #5C6B62;
  line-height: 1.6;
  margin: 0 0 16px;
}

.cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-cta-buy {
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 71, 39, 0.18);
}

.btn-cta-buy:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 71, 39, 0.25);
  color: #FFFFFF;
}

.btn-cta-detail {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 12px;
  transition: color var(--transition-fast);
}

.btn-cta-detail:hover {
  color: var(--color-primary-dark);
}

/* --- 9. 文章底部導航與社群分享 (FOOTER NAV & SHARE) --- */
.article-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  margin-top: 20px;
  border-top: 1px solid #E6EFEA;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-back-journal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #D2E0D8;
  border-radius: 9999px;
  background: #FFFFFF;
  transition: all var(--transition-fast);
}

.btn-back-journal:hover {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.article-share-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-label {
  font-size: 0.82rem;
  color: #728279;
}

.btn-share {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-share-line {
  background: #06C755;
  color: #FFFFFF;
}

.btn-share-line:hover {
  background: #05B34C;
  color: #FFFFFF;
}

.btn-share-fb {
  background: #1877F2;
  color: #FFFFFF;
}

.btn-share-fb:hover {
  background: #1464CA;
  color: #FFFFFF;
}

/* --- 10. 延伸推薦閱讀 (RELATED PROPOSALS) --- */
.article-related-wrap {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid #E8EFEA;
}

.related-heading {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1E2B24;
  margin-bottom: 24px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* --- 11. 響應式佈局 (RWD <= 768px) --- */
@media (max-width: 768px) {
  .article-page {
    padding: 20px 0 60px;
  }

  .article-container {
    padding: 28px 18px 40px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .article-title {
    font-size: 1.65rem;
  }

  .article-date-time {
    margin-left: 0;
    width: 100%;
  }

  .article-ingredients-card {
    padding: 20px 16px;
  }

  .ingredients-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .step-card {
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px;
  }

  .step-badge {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
  }

  .article-product-cta {
    flex-direction: column;
    text-align: center;
    padding: 24px 18px;
    gap: 16px;
  }

  .cta-image-col {
    width: 100%;
  }

  .cta-actions {
    justify-content: center;
    width: 100%;
  }

  .btn-cta-buy {
    width: 100%;
    justify-content: center;
  }

  .article-footer-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .btn-back-journal {
    justify-content: center;
  }

  .article-share-links {
    justify-content: center;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
