/* ============================================================
   旭光工作室 — Blog / SEO 文章樣式
   沿用 styles.css 的設計變數（--brand-1、--ink、--wrap 等）
   ============================================================ */

/* ---------- 共用版面 ---------- */
.blog-main { padding-top: 74px; }            /* 讓出固定 nav 高度 */
.blog-wrap { width: 100%; max-width: 980px; margin: 0 auto; padding-inline: var(--pad); }
.blog-section { padding-block: clamp(40px, 7vw, 80px); }

/* 麵包屑 */
.crumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--ink-3); margin-bottom: 22px; }
.crumb a { color: var(--ink-3); transition: color .2s; }
.crumb a:hover { color: var(--brand-1); }
.crumb svg { width: 14px; height: 14px; opacity: .5; }

/* 分類膠囊 */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--bg-tint); color: var(--brand-ink, #C2410C); border: 1px solid color-mix(in srgb, var(--brand-1) 20%, transparent); white-space: nowrap; }

/* ---------- Blog Hero（列表頁頂） ---------- */
.blog-hero { padding-block: clamp(48px, 8vw, 96px) clamp(28px, 5vw, 48px); background: var(--bg-tint); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.blog-hero .eyebrow { margin-bottom: 16px; }
.blog-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); }
.blog-hero p { margin-top: 16px; max-width: 56ch; color: var(--ink-2); font-size: clamp(15px, 2vw, 18px); }

/* ---------- 篩選列 + 搜尋 ---------- */
.blog-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 15px; border-radius: var(--radius-pill); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; transition: all .2s; }
.cat-btn:hover { border-color: var(--ink); }
.cat-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.blog-search { position: relative; }
.blog-search input { width: min(280px, 60vw); height: 44px; padding: 0 16px 0 42px; border-radius: var(--radius-pill); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); transition: border-color .2s; }
.blog-search input:focus { outline: none; border-color: var(--brand-1); }
.blog-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }

/* ---------- 文章卡片網格 ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.post-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-2); }
.post-card .cover { aspect-ratio: 16 / 9; position: relative; display: flex; align-items: flex-end; padding: 14px; background: var(--grad-brand); }
.post-card .cover.c1 { background: linear-gradient(125deg, #FF9A3D, #FF6A2C 55%, #FF3D77); }
.post-card .cover.c2 { background: linear-gradient(125deg, #4D8BFF, #2563FF 55%, #00C2D6); }
.post-card .cover.c3 { background: linear-gradient(125deg, #2BC39A, #0E9E7E 55%, #16B8C9); }
.post-card .cover.c4 { background: linear-gradient(125deg, #A06BFF, #7A45FF 55%, #E24DD0); }
.post-card .cover .chip { background: rgba(255,255,255,.92); color: var(--ink); border: 0; backdrop-filter: blur(4px); }
.post-card .cover .ci { position: absolute; right: 16px; bottom: 14px; width: 30px; height: 30px; color: rgba(255,255,255,.92); }
.post-card .body { display: flex; flex-direction: column; flex: 1; padding: 20px 20px 22px; }
.post-card h2 { font-family: var(--font-display); font-size: 19px; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }
.post-card .excerpt { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.post-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.no-result { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--ink-3); }

/* ---------- 文章頁 ---------- */
.article-head { margin-bottom: 30px; }
.article-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 44px); line-height: 1.18; letter-spacing: -.02em; color: var(--ink); margin: 14px 0 0; }
.article-meta { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-3); }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

/* 文章版面：內文 + 側邊目錄 */
.article-layout { display: grid; grid-template-columns: 1fr 240px; gap: 48px; align-items: start; }
.toc { position: sticky; top: 96px; font-size: 14px; border-left: 2px solid var(--line); padding-left: 16px; }
.toc .toc-t { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 12px; }
.toc a { display: block; padding: 6px 0; color: var(--ink-2); line-height: 1.5; transition: color .2s; }
.toc a:hover, .toc a.active { color: var(--brand-1); }
.toc a.lv3 { padding-left: 14px; font-size: 13px; color: var(--ink-3); }

/* 內文排版 */
.article-body { font-size: 17px; line-height: 1.85; color: var(--ink-2); overflow-wrap: break-word; }
.article-body > *:first-child { margin-top: 0; }
.article-body h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 28px); line-height: 1.3; letter-spacing: -.01em; color: var(--ink); margin: 44px 0 16px; scroll-margin-top: 90px; }
.article-body h3 { font-family: var(--font-display); font-size: 19px; color: var(--ink); margin: 30px 0 12px; scroll-margin-top: 90px; }
.article-body p { margin: 0 0 18px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body a { color: var(--brand-1); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 1.4em; }
.article-body li { margin: 8px 0; }
.article-body ul li::marker { color: var(--brand-1); }
.article-body blockquote { margin: 24px 0; padding: 16px 22px; border-left: 4px solid var(--brand-1); background: var(--bg-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.article-body th, .article-body td { border: 1px solid var(--line-2); padding: 11px 14px; text-align: left; vertical-align: top; }
.article-body thead th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
.article-body tbody tr:nth-child(even) { background: var(--bg-soft); }

/* ---------- 文章底部 CTA ---------- */
.blog-cta { margin-top: 48px; padding: clamp(28px, 5vw, 44px); border-radius: var(--radius-lg); background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.blog-cta::after { content: ""; position: absolute; width: 320px; height: 320px; right: -90px; top: -120px; background: var(--grad-sun); opacity: .5; pointer-events: none; }
.blog-cta h2 { font-family: var(--font-display); font-size: clamp(20px, 3vw, 27px); line-height: 1.35; letter-spacing: -.01em; position: relative; }
.blog-cta p { margin-top: 14px; color: rgba(255,255,255,.72); max-width: 52ch; position: relative; }
.blog-cta .cta-row { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
.btn-line { background: #06C755; color: #fff; }
.btn-line:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(6,199,85,.6); }
.btn-line svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- 相關文章 ---------- */
.related { margin-top: 56px; }
.related h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.01em; color: var(--ink); margin-bottom: 22px; }
.related .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 回部落格 ---------- */
.back-blog { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 40px; }
.back-blog:hover { color: var(--brand-1); }
.back-blog svg { width: 16px; height: 16px; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .post-grid, .related .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .post-grid, .related .post-grid { grid-template-columns: 1fr; }
  .blog-tools { flex-direction: column; align-items: stretch; }
  .blog-search input { width: 100%; }
}
