/* public/components/blog.css - blog article template (issue #110, WORK-ORDER.md).
   Ported from docs/design/wireframe-blog-post-v1.html blocks 2-10, 13 (the owner-accepted draft),
   class names and values kept as-is. NOT ported: .wfbar / .bnote / #wf (wireframe-only dev chrome),
   nav/mega (site's real shared header, Base.astro), .faq/.acc/.book/.close/.foot (already sitewide
   in public/site.css - Faq.astro and the accordion behaviour in site.js work unmodified here; see
   [...slug].astro's own FAQ section, which reuses those classes directly rather than importing
   Faq.astro - see the report for why).
   Site tokens (--paper/--ink/--green/--amber/--wrap/--pad/--r-card/--sec/...) already exist in
   public/site.css, loaded before this file on every page (Base.astro) - reused here, not redefined. */

/* ===== reading-progress bar (block 2) ===== */
/* Round 3: measured on the live preview - `position: sticky` inside <main> sits UNDER the fixed
   nav (public/site.css .nav { position: fixed; z-index: 100 }), so the bar filled but
   elementFromPoint at its own row always hit the nav instead - it was rendering, just fully
   covered. `position: fixed` takes it out of <main>'s stacking context entirely, pinned to the
   viewport's own top edge regardless of scroll, with a z-index above the nav's 100 (not editing
   site.css - reading its value only). Amber-on-solid-green (the nav) and amber-on-paper (the rest
   of the page, once the bar clears the nav on scroll) both already have strong contrast - the site
   uses this exact pairing elsewhere (e.g. .btn-amber on the green nav/book/close sections). */
.progress { height: 3px; background: rgba(16, 32, 27, .08); position: fixed; top: 0; left: 0; right: 0; z-index: 110; }
.progress i { display: block; height: 100%; width: 0%; background: var(--amber); transition: width .1s linear; }
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }

/* ===== article meta: category chip + reading time + H1 + byline (blocks 3-5) ===== */
.art-meta { padding: 22px var(--pad) 0; max-width: var(--wrap); margin-inline: auto; }
.cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.cat-tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--green); color: var(--paper); font-size: 12.5px; font-weight: 600; }
.readtime { display: inline-flex; align-items: center; gap: 6px; }
.art-h1 { margin-top: 16px; font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.28; color: var(--ink); letter-spacing: -.01em; }
.byline { margin-top: 14px; font-size: 13.5px; color: var(--mute); }

/* ===== cover picture (block 6) ===== */
.ph-cover { aspect-ratio: 21 / 9; margin: 20px var(--pad) 0; max-width: var(--wrap); margin-inline: auto; border-radius: 16px; overflow: clip; background: var(--paper-2, #E9ECE4); }
.ph-cover picture, .ph-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .ph-cover { aspect-ratio: 16 / 9; } }

/* ===== two-column body layout: sticky TOC (desktop) / details dropdown (phone) (block 7) ===== */
.art-wrap { padding: 32px var(--pad) 0; max-width: var(--wrap); margin-inline: auto; }
.art-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc-card { position: sticky; top: 14px; padding: 20px; border-radius: var(--r-card, 24px); background: var(--white); box-shadow: 0 1px 0 rgba(16, 32, 27, .05); }
.toc-card b { display: block; font-size: 12.5px; letter-spacing: .06em; color: var(--mute); margin-bottom: 10px; }
.toc-card ol { display: grid; gap: 8px; counter-reset: toc; list-style: none; padding: 0; margin: 0; }
.toc-card li { counter-increment: toc; font-size: 13.5px; line-height: 1.5; }
.toc-card li::before { content: counter(toc) ". "; color: var(--amber); font-weight: 700; }
.toc-card a { color: var(--ink); text-decoration: none; }
.toc-card a:hover, .toc-card a.is-active { text-decoration: underline; }
.toc-card a.is-active { color: var(--green-mid, var(--green)); font-weight: 600; }
.toc-details { display: none; }
.article-col { max-width: 65ch; min-width: 0; overflow-wrap: anywhere; } /* a long web address or Latin run never pushes the phone page sideways (pilot B40: 531 px at 390) */
.article-col p { margin-bottom: 18px; color: var(--ink); }
.article-col h2 { margin: 40px 0 16px; scroll-margin-top: 96px; font-family: var(--serif); font-weight: 500; font-size: clamp(21px, 2.1vw, 27px); line-height: 1.32; color: var(--ink); }
.article-col h3 { margin: 26px 0 12px; scroll-margin-top: 96px; font-family: var(--serif); font-weight: 500; font-size: 18px; line-height: 1.35; color: var(--ink); }
.article-col a.inline-link { color: var(--green-mid, var(--green)); text-decoration: underline; text-underline-offset: 3px; }
.article-col .related-line { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: var(--white); font-size: 13.5px; box-shadow: 0 1px 0 rgba(16, 32, 27, .05); list-style: none; }
.article-col .related-line b { font-weight: 600; color: var(--mute); flex: none; }
.article-col .related-line a { color: var(--green-mid, var(--green)); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
  .art-grid { grid-template-columns: 1fr; }
  .toc-card { display: none; }
  .toc-details { display: block; margin-bottom: 24px; background: var(--white); border-radius: var(--r-card, 24px); padding: 6px 18px; }
  .toc-details summary { padding: 14px 0; font-weight: 700; font-size: 14.5px; cursor: pointer; }
  .toc-details ol { padding-bottom: 14px; display: grid; gap: 8px; counter-reset: toc; list-style: none; margin: 0; }
  .toc-details li { counter-increment: toc; font-size: 13.5px; }
  .toc-details li::before { content: counter(toc) ". "; color: var(--amber); font-weight: 700; }
  .toc-details a { color: var(--ink); text-decoration: none; }
}

/* ===== 本文重點 box (block 9) ===== */
.keybox { margin: 8px 0 28px; padding: 22px 24px; border-radius: var(--r-card, 24px); background: var(--sand, #E8DCC3); border: 1px solid rgba(16, 32, 27, .08); }
.keybox b { display: block; font-family: var(--serif); font-weight: 500; font-size: 17px; margin-bottom: 12px; }
.keybox ul { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.keybox li { position: relative; padding-left: 22px; font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.keybox li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ===== CTA banner (block 10a, src/components/blog/ArticleCta.astro) =====
   fix round 1 (issue #112 F3): renamed cta-banner* -> art-cta* (2026-09-29). This block's classes
   used to be the SAME literal names as the sitewide sticky dock banner
   (src/components/shared/CtaBanner.astro's `<aside class="cta-banner">`, its own
   public/components/cta-banner.css). Both stylesheets load on every article page (Base.astro loads
   cta-banner.css first, this file's slotted head loads second), so at equal specificity this
   file's `.cta-banner { position: relative; ... }` beat cta-banner.css's `.cta-banner { position:
   fixed; left: calc(10px+...); right: calc(10px+...); ... }` - the dock aside fell out of fixed
   positioning into normal flow, where its now-inert `left: 10px` offset shifted it 10px past the
   viewport's right edge (measured: documentElement.scrollWidth 400px vs clientWidth 390px at
   390px, 330 vs 320 at 320px - F3's phone sideways scroll). Renamed here so this block never
   collides with that component's names again. */
.art-cta { position: relative; overflow: clip; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; margin: 30px 0; padding: 26px 30px; border-radius: var(--r-card, 24px); background: var(--green); color: var(--paper); }
.art-cta-copy { max-width: 44ch; }
.art-cta-copy .art-cta-headline { font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.3; color: var(--paper); margin: 0; }
.art-cta-copy p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--mute-d, rgba(242, 243, 238, .68)); }
.art-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.art-cta-phone { font-size: 13.5px; color: var(--mute-d, rgba(242, 243, 238, .68)); user-select: text; }
.art-cta-photo { align-self: flex-end; width: 120px; flex: none; }
.art-cta-photo img { width: 100%; height: auto; display: block; }
.cta-wa-btn { position: relative; transition: transform .25s ease; }
.cta-wa-btn:hover, .cta-wa-btn:focus-visible { transform: translateY(-2px); }
.cta-wa-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: ctaPulse 2.4s ease-out infinite; }
@keyframes ctaPulse { 0% { box-shadow: 0 0 0 0 rgba(233, 169, 58, .45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(233, 169, 58, 0); } }
@media (prefers-reduced-motion: reduce) { .cta-wa-btn::after { animation: none; box-shadow: none; } .cta-wa-btn { transition: none; } .cta-wa-btn:hover, .cta-wa-btn:focus-visible { transform: none; } }
@media (max-width: 720px) { .art-cta { grid-template-columns: 1fr; } .art-cta-photo { display: none; } }

/* ===== disclaimer (block 12) ===== */
.disclaimer { padding: 0 var(--pad) 40px; max-width: 900px; margin-inline: auto; }
.disclaimer b { display: block; font-size: 12.5px; letter-spacing: .06em; color: var(--mute); margin-bottom: 10px; }
.disclaimer ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.disclaimer li { font-size: 12px; line-height: 1.6; color: var(--mute); }
.disclaimer li a { color: var(--green-mid, var(--green)); text-decoration: underline; text-underline-offset: 2px; }

/* ===== 延伸閱讀 (block 13) =====
   Edit round R1 (issue #112 row 2, owner: "this section look spammy" - measured in his 1500px
   screenshot: a tall 400x640 portrait, a 400x360 landscape, and an empty white box stretched to
   match, titles at 3 different heights). Ruling: reuse the site's own blog-card look
   (src/components/shared/NumbersBlog.astro's `.post`, public/site.css:390-396 - fixed 4/3 picture
   box, object-fit cover, chip + title) under these `.more-*` names (the only rules this round owns
   in this file; `.post`/`.posts` in site.css are untouched). ArticleMore.astro's markup is `.post`'s
   shape (figure > img, chip, h3) so every card gets the SAME picture-box ratio, the title clamps to
   2 lines (a fixed 2-line height, not a shrink-to-fit one, so a 1-line title never makes its card
   shorter than its neighbours), and all 3 cards come out equal height with titles starting at the
   same y - verified by lab/probe-blog.mjs's `more` class. */
.more-read { padding: 0 var(--pad) var(--sec); max-width: var(--wrap); margin-inline: auto; }
.more-read > h2 { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 22px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.more-card { display: flex; flex-direction: column; }
/* The picture is absolutely placed: an in-flow img's own height is the box's automatic minimum, so a
   portrait thumb stretched its 4/3 box to 400 px next to 301 px ones (probe `more`, round 1). */
.more-card-fig { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; overflow: clip; background: var(--green-2); margin: 0 0 12px; }
.more-card-fig img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* Fix round 2 item 2 (2026-10-01, owner ruling, B09): a kept article with no safe source picture
   (never another article's picture, never generated, never a placeholder icon) renders TEXT-ONLY -
   no picture box at all. This ::before spacer reserves the SAME box height/margin a picture card's
   `.more-card-fig` does (card size rhythm, title start-y) with no background - nothing to see. */
.more-card--text::before { content: ""; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; margin: 0 0 12px; }
.more-card .chip { display: inline-block; font-size: 11.5px; color: var(--mute); margin-bottom: 6px; }
.more-card h3 { height: 2.9em; font-size: 15.5px; line-height: 1.45; font-family: var(--serif); font-weight: 500; color: var(--ink); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 900px) { .more-grid { grid-template-columns: 1fr; } }

/* ===== article-page FAQ heading (own h2, no mask/line split - see report) ===== */
.article-page .faq h2.h2 { font-family: var(--serif); font-weight: 500; color: var(--ink); }
