/* Kutter blog (scripts/site/blog.mjs) — on top of styles.css + help/help.css (steps, tips, shots).
   Owner 2026-10-25: should look and read like a magazine — covers everywhere, a real article header, contents,
   comfortable reading text and "more to read". */

/* ---------- cards (index, related) ---------- */
.bcard { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; color: var(--text-1); text-decoration: none; transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.bcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.bcard-img { display: block; aspect-ratio: 1200 / 630; background: var(--surface-2); overflow: hidden; }
.bcard-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.bcard:hover .bcard-img img { transform: scale(1.03); }
.bcard-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.bcard-body strong { font: 700 19px/1.4 var(--font-display); color: var(--navy); text-wrap: balance; }
.bcard-ex { color: var(--text-2); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.bcard-body small { margin-top: auto; padding-top: 4px; color: var(--text-3); font-size: 13.5px; }
.bchip { align-self: flex-start; padding: 4px 11px; border-radius: 999px; background: var(--tint-blue); color: var(--blue-ink); font: 800 12.5px/1.3 var(--font-body); }

.bcard-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }
.bcard-feature .bcard-img { aspect-ratio: auto; min-height: 100%; }
.bcard-feature .bcard-body { justify-content: center; gap: 12px; padding: 32px 36px; }
.bcard-feature .bcard-body strong { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.3; }
.bcard-feature .bcard-ex { -webkit-line-clamp: 4; font-size: 16.5px; }
.bcard-feature .bcard-body small { margin-top: 6px; }

.bgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }

/* ---------- blog home ---------- */
.blog-home { padding: 0 0 72px; }
.bhome-head { padding: 52px 0 28px; text-align: center; }
.bhome-head h1 { margin: 0 0 12px; font-size: clamp(32px, 4.6vw, 52px); }
.bhome-head .lead { max-width: 680px; margin: 0 auto; }
.bhome { margin-top: 8px; }

/* ---------- article ---------- */
.bpost-head { max-width: 820px; margin: 0 auto; padding: 8px 24px 0; text-align: center; }
.bpost-head .crumbs { margin-bottom: 14px; }
.bpost-head h1 { margin: 0 0 14px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.25; text-wrap: balance; }
.bpost-dek { margin: 0 auto 22px; max-width: 700px; color: var(--text-2); font-size: clamp(17px, 1.7vw, 19.5px); line-height: 1.7; }
.bpost-by { display: inline-flex; align-items: center; gap: 12px; margin: 0; text-align: left; }
.bpost-by img { width: 40px; height: 40px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.bpost-by b { display: block; font: 700 15.5px/1.3 var(--font-display); color: var(--navy); }
.bpost-by small { display: block; color: var(--text-3); font-size: 13.5px; }
.bpost-cover { max-width: 1000px; margin: 34px auto 8px; padding: 0 24px; }
.bpost-cover img { display: block; width: 100%; height: auto; border-radius: 24px; box-shadow: 0 24px 60px rgba(14,27,77,.16); }

.blog-col { max-width: 760px; }
.bpost-body { padding-top: 26px; }
.blog .bpost-body p, .blog .bpost-body li { font-size: 18px; line-height: 1.85; }
.blog .bpost-body > p:first-of-type { font-size: 19.5px; color: var(--navy); }
.blog .bpost-body h2 { position: relative; margin: 52px 0 14px; padding-top: 18px; font-size: clamp(23px, 2.4vw, 28px); line-height: 1.35; scroll-margin-top: calc(var(--nav-height) + 20px); }
.blog .bpost-body h2::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 4px; border-radius: 4px; background: var(--grad-brand); }
.blog .bpost-body h3 { margin: 30px 0 8px; font-size: 20.5px; }
.blog .shot { margin: 28px 0; }
.blog .shot img { border-radius: 16px; width: auto; max-width: 100%; max-height: 540px; margin: 0 auto; } /* portrait (9:16) pictures stay a sensible height */
.blog .shot figcaption { margin-top: 10px; color: var(--text-3); font-size: 14.5px; line-height: 1.55; text-align: center; }
.blog .tip { font-size: 17px; }

.btoc { margin: 0 0 30px; padding: 18px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.btoc b { display: block; margin-bottom: 8px; font: 700 15px/1.3 var(--font-display); color: var(--navy); }
.btoc ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.btoc li { font-size: 15.5px !important; line-height: 1.55 !important; color: var(--text-3); }
.btoc a { color: var(--text-2); text-decoration: none; }
.btoc a:hover { color: var(--blue-ink); text-decoration: underline; }

.blog-table { margin: 24px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.blog-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.blog-table th, .blog-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.blog-table thead th { background: var(--surface-2); font: 700 15px/1.4 var(--font-display); color: var(--navy); white-space: nowrap; }
.blog-table tbody th { font-weight: 700; color: var(--navy); }
.blog-table tr:last-child > * { border-bottom: 0; }

.blog-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 52px 0 0; padding: 22px 24px; border-radius: 22px; background: linear-gradient(135deg, rgba(0,198,255,.12), rgba(180,60,240,.12)); border: 1px solid var(--line); }
.blog-cta b { display: block; font: 700 20px/1.3 var(--font-display); color: var(--navy); }
.blog-cta span { display: block; color: var(--text-2); font-size: 15px; }
.blog-cta .btn { flex: none; }

.brelated { margin-top: 64px; padding: 52px 0 8px; border-top: 1px solid var(--line); }
.brelated h2 { margin: 0; font-size: clamp(24px, 2.6vw, 30px); }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bcard-feature { grid-template-columns: minmax(0, 1fr); }
  .bcard-feature .bcard-img { aspect-ratio: 1200 / 630; }
  .bcard-feature .bcard-body { padding: 22px 22px 24px; }
}
@media (max-width: 620px) {
  .bgrid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bhome-head { padding: 36px 0 18px; }
  .bpost-head { text-align: left; padding-top: 0; }
  .bpost-dek { margin-left: 0; }
  .bpost-cover { margin-top: 24px; padding: 0 16px; }
  .bpost-cover img { border-radius: 16px; }
  .blog .bpost-body p, .blog .bpost-body li { font-size: 17px; line-height: 1.8; }
  .blog .bpost-body > p:first-of-type { font-size: 18px; }
  .blog-cta { flex-direction: column; align-items: stretch; }
  .blog-cta .btn { width: 100%; }
}
