/* Style Link — shared design for static pages + blog (v3.2, 20/11/2026).
   Decisions (user: tự quyết dàn trang): desktop gets real width — list pages
   1040px, article reading stays 720px but with a sticky TOC sidebar on wide
   screens; food photos at 3:2 (their native ratio) so nothing gets cropped.
   v3.1: card/demo images get FIXED heights (200/220px, YouTube-thumbnail style)
   because aspect-ratio alone rendered portrait-tall in real browsers.
   v3.2: tables/lists are NOT wrapped in .prose (68ch squeezed the pricing table
   left in a 900px column); small red text uses --brand-d for 4.5:1 contrast;
   card titles are h2; pagination 9/page. Rules: reuse site.css tokens; one
   small file; no JS; no extra fonts. */

/* ---- page frame ---- */
.doc.page { max-width: 760px; padding-top: 8px; padding-bottom: 64px; }
.doc.page.article { max-width: 1080px; }   /* article + long docs: prose + TOC sidebar */
.doc.page.wide { max-width: 1040px; }      /* blog index, demo grid */
.doc.page.mid { max-width: 900px; }        /* FAQ, pricing */
.page-hero { padding: 32px 0 8px; }
.page-hero .eyebrow { font: 700 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-d); margin: 0 0 10px; }
.page-hero h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
.page-hero .lede { font-size: 17px; line-height: 1.65; color: var(--mute); margin: 0 0 14px; max-width: 60ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--mute); margin: 0 0 8px; }
.meta-row b { color: var(--ink); font-weight: 600; }

/* ---- cover image: fixed height (v3.5 20/11: aspect-ratio + max-height kept the phone box at 460px tall instead of 3:2 — Chrome sizes height from max-width then clamps; explicit height min(460px, 62vw) gives ~214px on phone, 460px desktop) ---- */
.cover { display: block; width: 100%; max-width: 760px; height: min(460px, 62vw); object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: #e9e2d3; margin: 20px auto 8px; }
.cover-cap { font-size: 13px; color: var(--mute); max-width: 760px; margin: 0 auto 24px; }

/* ---- article layout: prose + sticky TOC sidebar on wide screens ---- */
.article-layout { display: block; }
@media (min-width: 1100px) {
  .article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
  .article-layout .prose { grid-column: 1; grid-row: 1; }
  .article-layout .toc-side { grid-column: 2; grid-row: 1; position: sticky; top: 84px; }
  .article-layout .toc-side .toc { margin-top: 8px; }
}

/* ---- reading prose: narrow measure, calm rhythm ---- */
.prose { max-width: 68ch; }
.prose p { line-height: 1.8; margin: 0 0 18px; }
.prose h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 12px; scroll-margin-top: 84px; }
.prose h3 { font-size: 17px; margin: 28px 0 8px; scroll-margin-top: 84px; }
.prose ul, .prose ol { margin: 6px 0 18px; padding-left: 22px; }
.prose li { line-height: 1.75; margin-bottom: 6px; }
.prose li::marker { color: var(--brand); }
.prose a { color: var(--brand-d); text-underline-offset: 3px; }
.prose a:hover { color: var(--brand-d); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 24px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }

/* ---- table of contents ---- */
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 24px 0 8px; }
.toc b { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; line-height: 1.6; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

/* ---- call to action card ---- */
.cta-card { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; margin: 32px 0; }
.cta-card p { margin: 0 0 12px; line-height: 1.65; }
.cta-card p:last-child { margin-bottom: 0; }
.cta-card .btn { margin-top: 2px; }

/* ---- blog card grid: 1 / 2 / 3 columns ---- */
.cards { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
/* Card images: FIXED height (YouTube-thumbnail style) — aspect-ratio alone
   did not hold in real browsers, images rendered portrait-tall. 200px mobile,
   220px desktop; object-fit: cover crops the sides, never stretches tall. */
.card img { width: 100%; height: 200px; object-fit: cover; background: #e9e2d3; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag { align-self: flex-start; font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-d); background: var(--brand-l); border-radius: 999px; padding: 6px 10px; }
.card h2 { font-size: 18px; line-height: 1.35; margin: 0; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--brand-d); }
.card p { font-size: 14px; line-height: 1.65; color: var(--mute); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 13px; color: var(--mute); margin-top: auto; padding-top: 4px; }

/* ---- pagination: 9 articles per page, numbered + prev/next ---- */
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 32px 0 8px; }
.pager a, .pager span { display: inline-block; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.pager a:hover { border-color: var(--ink); }
.pager .pg-cur { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- related articles ---- */
.related { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.related h2 { font-size: 20px; margin: 0 0 16px; }
.related .cards { margin-top: 0; }

/* ---- FAQ as collapsible cards ---- */
.faq-list details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.faq-list summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--brand); font-weight: 800; }
.faq-list details[open ] summary::after { content: '–'; }
.faq-list details p { padding: 0 16px 14px; margin: 0; line-height: 1.7; }

/* ---- pricing table ---- */
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.price-table tr:last-child th, .price-table tr:last-child td { border-bottom: 0; }
.price-table td:last-child { font-weight: 700; white-space: nowrap; text-align: right; }
.price-table th { font-size: 17px; }

/* ---- demo cards: 1 / 2 / 3 columns, 8th tile is a CTA ---- */
.demo-grid { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 700px) { .demo-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .demo-grid { grid-template-columns: 1fr 1fr 1fr; } }
.demo-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); }
.demo-card:hover { border-color: var(--ink); }
.demo-card img { width: 100%; height: 200px; object-fit: cover; background: #e9e2d3; display: block; }
@media (min-width: 1024px) { .card img, .demo-card img { height: 220px; } }
.demo-card div { padding: 14px 16px; }
.demo-card b { display: block; font-size: 16px; margin-bottom: 4px; }
.demo-card span { font-size: 14px; color: var(--mute); line-height: 1.6; }
.demo-card.cta { display: flex; flex-direction: column; justify-content: center; background: var(--paper); border-style: dashed; padding: 20px; }
.demo-card.cta b { font-size: 17px; }
.demo-card.cta p { font-size: 14px; color: var(--mute); line-height: 1.65; margin: 6px 0 14px; }

/* ---- small screens: keep breathing room, never cram ---- */
@media (max-width: 560px) {
  .page-hero { padding-top: 24px; }
  .page-hero .lede { font-size: 16px; }
  .prose h2 { font-size: 20px; margin-top: 32px; }
  .card-body { padding: 14px 16px; }
}

/* v3.3 (20/11 tối): link chữ nhỏ .fine dùng đỏ đậm cho đủ tương phản */
.fine a { color: var(--brand-d); }
