/* AJAW Trade blog (2026-09-19). The file shipped as a 43-byte stub ("filled by the blog
   agent"), so every blog-* class in public/blog.js rendered unstyled: the category tabs ran
   together as one line of text and the cards had no grid. Layout follows the Alibaba "Reads"
   audit in docs/blog/alibaba-blog-reference.md - featured story, category tabs, card grid,
   then a narrow reading column for the article.

   Only blog-* classes are defined here. .wrap, .empty, .btn, .panel, .field, .eyebrow and
   .text-btn are existing global components and are deliberately left alone. */

.blog-page { padding-bottom: 64px; }

/* ---------------------------------------------------------------- hub header + tabs */
.blog-hub-head { padding: 32px 0 20px; }
.blog-hub-head h1 { font-size: 38px; margin: 0 0 10px; }
.blog-hub-head p { font-size: 16px; line-height: 1.55; color: var(--gray); max-width: 680px; }

/* Scrolls sideways on a phone rather than wrapping into a ragged block. */
.blog-cat-tabs {
  display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none;
  padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.blog-cat-tabs::-webkit-scrollbar { display: none; }
.blog-cat-tabs a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--gray); background: #fff;
  transition: border-color .15s, color .15s, background .15s;
}
.blog-cat-tabs a:hover { border-color: var(--soft); color: var(--ink); }
.blog-cat-tabs a.is-on { background: var(--violet); border-color: var(--violet); color: #fff; }
.blog-cat-tabs a small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.blog-cat-tabs a.is-on small { color: #cfcbff; }

/* ---------------------------------------------------------------- featured story */
.blog-featured { margin-bottom: 32px; }
.blog-featured-card {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.blog-featured-card:hover { border-color: var(--soft); box-shadow: 0 6px 24px rgba(37, 31, 149, .08); }
/* The image is taken out of flow so the cell's height comes from min-height and the grid row,
   not from the source image's own aspect ratio - otherwise a portrait cover stretches the
   whole card to 500px+. */
.blog-featured-photo { position: relative; display: block; background: var(--canvas); min-height: 300px; }
.blog-featured-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.blog-featured-copy { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 32px; }
.blog-featured-copy h2 { font-size: 27px; margin: 0; letter-spacing: -.03em; }
.blog-featured-copy p {
  font-size: 15px; line-height: 1.55; color: var(--gray); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-featured-copy small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- card grid */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.blog-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.blog-card > a { display: flex; flex-direction: column; gap: 10px; }
.blog-card-photo { display: block; border-radius: 12px; overflow: hidden; background: var(--canvas); }
.blog-card-photo img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  transition: transform .25s ease;
}
.blog-card > a:hover .blog-card-photo img { transform: scale(1.03); }
.blog-card-cat {
  display: block; font-size: 11px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--violet);
}
.blog-card h3 {
  font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -.02em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card > a:hover h3 { color: var(--violet); }
.blog-card > p {
  font-size: 14px; line-height: 1.5; color: var(--gray); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card > small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- pagination + CTAs */
.blog-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px;
}
.blog-pagination a { display: inline-flex; align-items: center; gap: 6px; color: var(--violet); font-weight: 550; }
.blog-pagination a .icon { width: 16px; height: 16px; }
.blog-page-count { color: var(--muted); font-size: 13px; }
.blog-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.blog-cta-row .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- article */
/* 880px centred reading column, matching the approved legal/info pages in legal.css. */
.blog-article-page { max-width: 880px; margin-left: auto; margin-right: auto; }
.blog-crumbs { padding: 26px 0 14px; font-size: 13px; color: var(--muted); }
.blog-crumbs a { color: var(--gray); }
.blog-crumbs a:hover { color: var(--violet); }
.blog-article > h1 { font-size: 40px; line-height: 1.12; margin: 0 0 14px; }
.blog-byline { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.blog-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 30px; background: var(--canvas); }

.blog-body { font-size: 16px; line-height: 1.72; color: var(--ink); }
.blog-body p { font-size: 16px; line-height: 1.72; color: var(--ink); margin: 0 0 18px; }
.blog-body h2 { font-size: 24px; letter-spacing: -.025em; margin: 36px 0 12px; }
.blog-body h3 { font-size: 18px; font-weight: 650; margin: 28px 0 10px; }
.blog-body ul, .blog-body ol { padding-left: 22px; margin: 0 0 18px; }
.blog-body li { margin-bottom: 8px; }
.blog-body a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.blog-body blockquote {
  margin: 24px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--soft);
  color: var(--gray); font-style: italic;
}
.blog-body blockquote p { color: inherit; margin: 0; }
.blog-body img { border-radius: 10px; margin: 24px 0; }
.blog-body strong { font-weight: 650; }

/* ---------------------------------------------------------------- article FAQ + related */
.blog-faq-view { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.blog-faq-view h2 { font-size: 24px; margin: 0 0 18px; }
.blog-faq-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.blog-faq-item:last-child { border-bottom: 0; }
.blog-faq-item h3 { font-size: 16px; font-weight: 650; margin: 0 0 6px; color: var(--ink); }
.blog-faq-item p { font-size: 15px; line-height: 1.6; color: var(--gray); margin: 0; }

.blog-related { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.blog-related h2 { font-size: 22px; margin: 0 0 20px; }
.blog-related .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------------------------------------------------------------- admin editor (/admin/blog) */
.blog-editor { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.blog-ai-panel h2 { font-size: 18px; margin: 0 0 4px; }
.blog-ai-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.blog-ai-row input { flex: 1; min-width: 0; }
.blog-ai-row .btn { flex-shrink: 0; }
.blog-ai-row .icon { width: 16px; height: 16px; }
.blog-cover-field img { max-width: 260px; border-radius: 10px; margin: 8px 0; }
.blog-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.blog-body-grid textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; }
.blog-preview-pane {
  border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  max-height: 520px; overflow: auto; background: #fff;
}
.blog-preview-pane > b { display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.blog-preview-pane .blog-body { font-size: 14px; }
.blog-preview-pane .blog-body p { font-size: 14px; margin-bottom: 12px; }
.blog-preview-pane .blog-body h2 { font-size: 19px; margin: 20px 0 8px; }
.blog-preview-pane .blog-body h3 { font-size: 16px; margin: 16px 0 6px; }

.blog-faq-block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.blog-faq-empty { font-size: 13px; color: var(--muted); margin: 8px 0; }
.blog-faq-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.blog-faq-row .text-btn { align-self: flex-start; }
.blog-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 8px; }

/* Inline confirm bar - the owner banned browser confirm() popups and cramped modals. */
.blog-confirm-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 12px; padding: 14px 16px; border: 1px solid #f1c9c9; border-radius: 10px;
  background: #fdf6f6; font-size: 14px; color: var(--ink);
}
.blog-confirm-bar[hidden] { display: none; }
.blog-confirm-bar > span { flex: 1; min-width: 200px; }
.blog-btn-danger { background: #c0392b; color: #fff; }
.blog-btn-danger:hover { background: #a93226; }
.blog-danger-text { color: #c0392b; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .blog-grid, .blog-related .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .blog-featured-card { grid-template-columns: 1fr; }
  .blog-featured-photo { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-featured-copy { padding: 22px; }
  .blog-featured-copy h2 { font-size: 22px; }
  .blog-body-grid { grid-template-columns: 1fr; }
  .blog-preview-pane { max-height: 320px; }
}
@media (max-width: 700px) {
  .blog-hub-head { padding: 22px 0 16px; }
  .blog-hub-head h1 { font-size: 27px; }
  .blog-hub-head p { font-size: 15px; }
  .blog-grid, .blog-related .blog-grid { grid-template-columns: 1fr; gap: 26px; }
  .blog-article > h1 { font-size: 28px; }
  .blog-body, .blog-body p { font-size: 15px; line-height: 1.68; }
  .blog-body h2 { font-size: 20px; margin-top: 28px; }
  .blog-cover { margin-bottom: 22px; border-radius: 10px; }
  .blog-cta-row .btn { flex: 1 1 100%; justify-content: center; }
  .blog-pagination { font-size: 13px; }
}
