/* =====================================================================
   Hinet Blog Hub — blog.html / blog-en.html
   Markup: _blog-tools/build_hub.py · Design: Hinet Blue Design Language
   Namespaced .hnb-* (never collides with Bootstrap / templatemo / shell)
   ===================================================================== */
.hnb {
  --b-blue: #145adc; --b-blue-h: #0f48b8; --b-tint: #e8f0fd; --b-tint2: #f3f7fe; --b-navy: #0b2a6b;
  --b-ink: #1a1d23; --b-body: #3d4250; --b-muted: #6c7280; --b-line: #e4e7ec; --b-surface: #f7f8fa; --b-gold: #ffc857;
  --b-shadow: rgba(20,30,60,.03) 0 0 0 1px, rgba(20,30,60,.05) 0 2px 6px 0, rgba(20,30,60,.10) 0 4px 12px 0;
  font-family: 'IBM Plex Sans Thai', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color: var(--b-body); line-height: 1.7; background: #fff;
}
.hnb *, .hnb *::before, .hnb *::after { box-sizing: border-box; }
/* templatemo forces p,a {font-family:Kanit !important; font-weight:200} */
.hnb, .hnb a, .hnb p, .hnb span, .hnb b, .hnb small, .hnb h1, .hnb h2, .hnb button, .hnb input, .hnb time {
  font-family: 'IBM Plex Sans Thai', -apple-system, 'Segoe UI', Tahoma, sans-serif !important;
}
.hnb a { text-decoration: none !important; }
.hnb p { font-weight: 400 !important; font-size: 1rem; margin: 0; }
.hnb img { display: block; max-width: 100%; }
.hnb button { font: inherit; }
.hnb :focus-visible { outline: 3px solid var(--b-blue); outline-offset: 2px; border-radius: 8px; }
.hnb-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hnb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hnb-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem !important; font-weight: 600 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--b-blue); background: var(--b-tint); padding: 5px 14px; border-radius: 999px; }
.hnb-h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.02em; color: var(--b-ink); line-height: 1.15; margin: 16px 0 12px; }
.hnb-h1-sub { display: block; font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--b-navy); letter-spacing: -.01em; margin-top: 6px; }
.hnb-h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 600; color: var(--b-ink); line-height: 1.3; margin: 0; }
.hnb-lead { color: var(--b-body); font-size: 1.08rem !important; max-width: 560px; }

/* ---------- hero ---------- */
.hnb-hero { background: linear-gradient(180deg, var(--b-tint2) 0%, #fff 100%); padding: 56px 0 48px; border-bottom: 1px solid var(--b-line); }
.hnb-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hnb-search { position: relative; margin-top: 26px; max-width: 560px; }
.hnb-search i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.35rem; color: var(--b-muted); }
.hnb-search input { width: 100%; height: 56px; border: 1px solid var(--b-line); border-radius: 999px; padding: 0 22px 0 52px; font-size: 1rem; color: var(--b-ink); background: #fff; box-shadow: var(--b-shadow); }
.hnb-search input:focus { outline: none; border: 2px solid var(--b-blue); padding-left: 51px; }
.hnb-stats { display: flex; gap: 36px; margin-top: 28px; }
.hnb-stats b { display: block; font-size: 1.9rem; font-weight: 700; color: var(--b-blue); line-height: 1.1; letter-spacing: -.02em; }
.hnb-stats span { font-size: .88rem; color: var(--b-muted); }
.hnb-latest { position: relative; }
.hnb-latest-label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--b-navy); margin-bottom: 10px; }
.hnb-latest-label i { color: var(--b-gold); }

/* ---------- category cards ---------- */
.hnb-section { padding: 64px 0; }
.hnb-section-cats { padding-bottom: 48px; }
.hnb-section-alt { background: var(--b-surface); border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line); }
.hnb-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 24px; }
.hnb-cat { text-align: left; background: #fff; border: 1px solid var(--b-line); border-radius: 16px; padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.hnb-cat:hover { box-shadow: var(--b-shadow); transform: translateY(-2px); border-color: #c9daf8; }
.hnb-cat-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--b-tint); color: var(--b-blue); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 6px; }
.hnb-cat-h { font-weight: 600; color: var(--b-ink); font-size: 1.02rem; }
.hnb-cat-p { font-size: .86rem; color: var(--b-muted); line-height: 1.55; flex: 1; }
.hnb-cat-n { font-size: .82rem; font-weight: 600; color: var(--b-blue); margin-top: 6px; }

/* ---------- list ---------- */
.hnb-list-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; }
.hnb-showing { color: var(--b-muted); font-size: .92rem !important; }
.hnb-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.hnb-pill { border: 1px solid var(--b-line); background: #fff; color: var(--b-body); border-radius: 999px; padding: 8px 16px; font-size: .92rem; font-weight: 500; cursor: pointer; transition: all .15s ease; }
.hnb-pill span { color: var(--b-muted); font-size: .82rem; margin-left: 2px; }
.hnb-pill:hover { border-color: var(--b-blue); color: var(--b-blue); }
.hnb-pill[aria-pressed="true"] { background: var(--b-blue); border-color: var(--b-blue); color: #fff; }
.hnb-pill[aria-pressed="true"] span { color: #dbe6fb; }

.hnb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.hnb-grid.is-js .hnb-card { display: none; }
.hnb-grid.is-js .hnb-card.is-shown { display: flex; }

/* ---------- card ---------- */
.hnb-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--b-line); border-radius: 16px; overflow: hidden; color: var(--b-body) !important; transition: box-shadow .2s ease, transform .2s ease; }
.hnb-card:hover { box-shadow: var(--b-shadow); transform: translateY(-2px); }
.hnb-thumb { display: block; aspect-ratio: 16 / 10; background: var(--b-tint2); overflow: hidden; }
.hnb-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.hnb-card:hover .hnb-thumb img { transform: scale(1.03); }
.hnb-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.hnb-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: .8rem; color: var(--b-muted); }
.hnb-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--b-tint); color: var(--b-blue); font-weight: 600; border-radius: 999px; padding: 2px 10px; font-size: .78rem; }
.hnb-badge-th { border: 1px solid var(--b-line); border-radius: 999px; padding: 1px 8px; font-size: .72rem; color: var(--b-muted); }
.hnb-title { font-size: 1.06rem; font-weight: 600; color: var(--b-ink); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hnb-excerpt { font-size: .9rem; color: var(--b-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.hnb-more { display: inline-flex; align-items: center; gap: 4px; color: var(--b-blue); font-weight: 600; font-size: .9rem; margin-top: 4px; }
.hnb-card:hover .hnb-more i { transform: translateX(3px); }
.hnb-more i { transition: transform .2s ease; }
/* featured (hero) */
.hnb-featured { box-shadow: var(--b-shadow); }
.hnb-featured .hnb-title { font-size: 1.25rem; }
.hnb-featured .hnb-excerpt { -webkit-line-clamp: 2; }

.hnb-empty { text-align: center; padding: 40px 16px; color: var(--b-muted); background: #fff; border: 1px dashed var(--b-line); border-radius: 16px; }
.hnb-empty[hidden] { display: none; }

/* ---------- pager ---------- */
.hnb-pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 36px; }
.hnb-pager button { min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--b-line); background: #fff; color: var(--b-body); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.hnb-pager button:hover:not([disabled]) { border-color: var(--b-blue); color: var(--b-blue); }
.hnb-pager button[aria-current="page"] { background: var(--b-blue); border-color: var(--b-blue); color: #fff; }
.hnb-pager button[disabled] { opacity: .4; cursor: default; }
.hnb-pager .hnb-gap { color: var(--b-muted); padding: 0 4px; }

/* ---------- knowledge banner + services ---------- */
.hnb-kb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(120deg, #0b2a6b 0%, #145adc 100%); color: #fff !important; border-radius: 16px; padding: 24px 28px; box-shadow: 0 10px 28px rgba(11,42,107,.18); transition: transform .2s ease; }
.hnb-kb:hover { transform: translateY(-2px); }
.hnb-kb b { display: block; font-size: 1.15rem; font-weight: 600; }
.hnb-kb small { display: block; font-size: .92rem; color: #dce6fa; margin-top: 4px; }
.hnb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--b-gold); margin-right: 8px; vertical-align: 1px; }
.hnb-kb-btn { background: #fff; color: var(--b-navy); font-weight: 600; border-radius: 999px; padding: 10px 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.hnb-svc-wrap { margin-top: 56px; text-align: center; }
.hnb-svc-head p { color: var(--b-muted); margin-top: 8px !important; }
.hnb-svc-head .hnb-h2 { margin-top: 12px; }
.hnb-svcs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; text-align: left; }
.hnb-svc { background: #fff; border: 1px solid var(--b-line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 4px; transition: box-shadow .2s ease, transform .2s ease; }
.hnb-svc:hover { box-shadow: var(--b-shadow); transform: translateY(-2px); }
.hnb-svc i { font-size: 1.5rem; color: var(--b-blue); background: var(--b-tint); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; }
.hnb-svc b { color: var(--b-ink); font-weight: 600; }
.hnb-svc small { color: var(--b-muted); font-size: .86rem; }
.hnb-svc-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hnb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 28px; min-height: 48px; font-weight: 500; border: 2px solid transparent; transition: all .2s ease; }
.hnb-btn-primary { background: var(--b-blue); color: #fff !important; }
.hnb-btn-primary:hover { background: var(--b-blue-h); transform: translateY(-1px); box-shadow: var(--b-shadow); }
.hnb-btn-outline { border-color: var(--b-blue); color: var(--b-blue) !important; background: #fff; }
.hnb-btn-outline:hover { background: var(--b-tint); }

/* ---------- responsive ---------- */
@media (max-width: 1099.98px) { .hnb-cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991.98px) {
  .hnb-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hnb-grid { grid-template-columns: repeat(2, 1fr); }
  .hnb-svcs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hnb-wrap { padding: 0 16px; }
  .hnb-hero { padding: 36px 0 32px; }
  .hnb-section { padding: 44px 0; }
  .hnb-cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hnb-cat { padding: 14px; }
  .hnb-cat-p { display: none; }
  .hnb-grid { grid-template-columns: 1fr; gap: 16px; }
  .hnb-stats { gap: 22px; }
  .hnb-stats b { font-size: 1.5rem; }
  .hnb-svcs { grid-template-columns: 1fr; }
  .hnb-pills { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .hnb-pills::-webkit-scrollbar { display: none; }
  .hnb-pill { white-space: nowrap; flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) { .hnb * { transition: none !important; } }
