/* ABN Software — blog + Bengali typography */

@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-bengali-bengali-var.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1, U+11DF0-11DF1;
}

:root {
  /* Latin glyphs keep the brand face; Bengali falls through to Noto Sans Bengali. */
  --font-bn: "Plus Jakarta Sans", "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Kohinoor Bangla", "Bangla Sangam MN", ui-sans-serif, system-ui, sans-serif;
}

/* body sets the Latin brand font explicitly, so Bengali pages must override it on body too. */
[lang="bn"],
html[lang="bn"] body {
  font-family: var(--font-bn);
  line-height: 1.8;
}
/* English chrome (header/footer/skip link) inside Bengali pages keeps the site's Latin setting. */
html[lang="bn"] [lang="en"] {
  font-family: var(--font);
  line-height: 1.65;
}
[lang="bn"] h1, [lang="bn"] h2, [lang="bn"] h3 {
  line-height: 1.4;
  letter-spacing: 0;
}
[lang="bn"] .eyebrow[lang="en"] { font-family: var(--font); }

.btn-sm { min-height: 40px; padding: 8px 14px; font-size: .875rem; }

/* ---------- Homepage section header with action ---------- */
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  max-width: none;
}
.section-head-row > div { max-width: 680px; }

/* ---------- Cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.post-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.post-card[hidden] { display: none; }
.post-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card:focus-within { border-color: var(--brand); }

.post-card-media {
  aspect-ratio: 1 / 1;
  background: #F3F4FF;
  border-bottom: 1px solid var(--line);
}
.post-card-media img { width: 100%; height: 100%; object-fit: contain; }

.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }

.post-cat {
  margin: 0 0 8px;
  color: var(--brand-ink);
  font-size: .875rem;
  font-weight: 700;
}
.post-cat a { text-decoration: none; }
.post-cat a:hover { text-decoration: underline; }

.post-card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.post-card-title a { color: var(--navy-950); text-decoration: none; }
/* Stretched link: whole card is clickable through the one title link. */
.post-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card-title a:focus-visible { outline: none; }
.post-card-title a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; }
.post-card:hover .post-card-title a { color: var(--brand-ink); }

.post-excerpt { color: var(--slate-600); font-size: .9688rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0;
  row-gap: 2px;
  margin: 14px 0 0;
  color: var(--slate-500);
  font-size: .875rem;
}
.meta-item { white-space: nowrap; }
.meta-item + .meta-item::before { content: "·"; margin: 0 8px; color: var(--line-strong); }
.post-read {
  margin-top: auto;
  padding-top: 16px;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: .9375rem;
}
.post-read .arrow { display: inline-block; transition: transform .2s ease; }
.post-card:hover .post-read .arrow { transform: translateX(3px); }

/* Featured: image beside text on wide screens */
.featured-wrap { margin-bottom: 28px; }
.featured-wrap[hidden] { display: none; }
.post-card-featured { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: stretch; }
.post-card-featured .post-card-media { border-bottom: 0; border-right: 1px solid var(--line); }
.post-card-featured .post-card-body { justify-content: center; padding: 36px 40px; }
.post-card-featured .post-card-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.post-card-featured .post-excerpt { font-size: 1.0625rem; }
.post-card-featured .post-read { margin-top: 20px; }

/* ---------- Blog hero + breadcrumbs ---------- */
.blog-hero {
  padding: 40px 0 36px;
  background:
    radial-gradient(50% 80% at 90% 0%, rgba(204, 117, 255, .10), transparent 70%),
    radial-gradient(40% 70% at 70% 100%, rgba(35, 175, 255, .07), transparent 70%),
    #fff;
}
.blog-hero h1 { font-size: clamp(2.25rem, 4.6vw, 3.25rem); font-weight: 800; }
.blog-hero .lead { margin-top: 12px; }
.not-found { padding: 72px 0 80px; }
.not-found .hero-actions { margin-top: 28px; }

.breadcrumbs { margin-bottom: 22px; font-size: .875rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; }
.breadcrumbs li { display: inline-flex; align-items: center; color: var(--slate-500); min-width: 0; }
.breadcrumbs li + li::before { content: "/"; margin: 0 10px; color: var(--line-strong); }
.breadcrumbs a { color: var(--navy-700); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--slate-500); }

/* ---------- Listing tools ---------- */
.blog-listing { padding: 8px 0 96px; }

.blog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
}
.blog-tools > nav { min-width: 0; max-width: 100%; }

.grid-heading { margin: 8px 0 20px; font-size: 1.375rem; font-weight: 700; }
.grid-heading.is-results { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--navy-700);
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip[aria-current="true"] { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }
.chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--brand-ink);
  font-size: .8125rem;
}
.chip[aria-current="true"] .chip-count { background: rgba(255, 255, 255, .16); color: #fff; }

.chips-hint { display: none; }
.search-field { position: relative; flex: 0 1 340px; min-width: 0; }
.search-field svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 20px; height: 20px;
  margin-top: -10px;
  fill: none; stroke: var(--slate-500); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--navy-950);
  font: inherit;
  font-size: 1rem;
}
.search-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(46, 0, 255, .14); }

.results-status { margin: 0 0 16px; color: var(--slate-600); font-weight: 600; }
.results-status:empty { display: none; }

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--tint);
}
.empty-state[hidden] { display: none; }
.empty-title { color: var(--navy-950); font-size: 1.125rem; font-weight: 700; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Article ---------- */
.article { padding-bottom: 72px; }
.article-header { max-width: 820px; padding-top: 36px; padding-bottom: 28px; }
.article-header h1 { font-size: clamp(1.875rem, 4.4vw, 2.75rem); font-weight: 800; }
.article-excerpt { margin-top: 16px; color: var(--slate-600); font-size: clamp(1.0625rem, 1.8vw, 1.1875rem); }
.article-meta { margin-top: 18px; }

.article-cover { max-width: calc(560px + var(--gutter) * 2); margin: 0 auto 40px; }
.article-cover img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #F3F4FF;
  object-fit: contain;
}

.article-body { max-width: calc(42rem + var(--gutter) * 2); font-size: 1.0938rem; color: var(--navy-900); }
.article-section + .article-section { margin-top: 36px; }
.article-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.375rem, 2.6vw, 1.625rem);
  font-weight: 700;
}
.article-section p { margin-bottom: 1em; }
/* One key sentence a skimming reader should not miss (section `callout`). */
.article-section .article-callout {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--tint);
  color: var(--navy-950);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.7;
}
.article-section ul, .article-section ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.article-section ul { list-style: disc; }
.article-section ol { list-style: none; counter-reset: step; padding-left: 0; }
.article-section li { margin: .45em 0; padding-left: .2em; }
.article-section ul li::marker { color: var(--brand); }
.article-section ol li { position: relative; padding-left: 2.6em; counter-increment: step; }
.article-section ol li::before {
  content: counter(step, bengali);
  position: absolute;
  left: 0; top: .1em;
  display: grid;
  place-items: center;
  width: 1.85em; height: 1.85em;
  border-radius: 50%;
  background: var(--tint-2);
  color: var(--brand-ink);
  font-size: .9em;
  font-weight: 700;
  line-height: 1;
}

.toc {
  margin: 0 0 36px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
  font-size: .9688rem;
}
.toc summary {
  cursor: pointer;
  color: var(--navy-950);
  font-weight: 700;
  list-style-position: outside;
}
.toc ol { margin: 10px 0 0; padding-left: 1.4em; list-style: decimal; }
.toc li { margin: 4px 0; }
.toc a { color: var(--navy-700); text-decoration: none; }
.toc a:hover { color: var(--brand-ink); text-decoration: underline; }

.article-cta {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F4F2FF, #F1F8FF);
}
.article-cta p { color: var(--navy-700); }
.article-cta .btn { margin-top: 4px; white-space: normal; text-align: center; }

.share { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.share-title { margin-bottom: 12px; color: var(--navy-950); font-weight: 700; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-status { margin: 12px 0 0; font-size: .9375rem; font-weight: 600; }
.share-status:empty { display: none; }
.share-status.is-success { color: var(--success); }
.share-status.is-error { color: var(--error); overflow-wrap: anywhere; }

.related h2 { margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card-featured { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .post-card-featured .post-card-body { padding: 28px; }
}

@media (max-width: 760px) {
  .post-card-featured { display: flex; }
  .post-card-featured .post-card-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .post-card-featured .post-card-body { padding: 22px 24px 24px; }
  .search-field { flex: 1 1 100%; }
  .blog-tools > nav { flex: 1 1 100%; }
}

@media (max-width: 640px) {
  .post-grid, .post-grid-2 { grid-template-columns: 1fr; gap: 18px; }
  .post-card-body { padding: 20px; }
  .blog-hero { padding: 28px 0 24px; }
  .blog-listing { padding-bottom: 64px; }
  /* Horizontal chip rail. Edge fades show that more categories are off-screen. */
  .chips-nav { position: relative; margin: 0 calc(var(--gutter) * -1); }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px var(--gutter) 8px;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips li { scroll-snap-align: start; }
  .chip { flex-shrink: 0; }
  .chips-nav::before, .chips-nav::after {
    content: "";
    position: absolute;
    top: 0; bottom: 8px;
    width: 40px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 1;
  }
  .chips-nav::before { left: 0; background: linear-gradient(90deg, #fff 20%, rgba(255, 255, 255, 0)); }
  .chips-nav::after { right: 0; background: linear-gradient(270deg, #fff 20%, rgba(255, 255, 255, 0)); }
  .chips-nav.can-scroll-left::before, .chips-nav.can-scroll-right::after { opacity: 1; }
  .chips-hint {
    display: block;
    margin: 2px 0 0;
    padding: 0 var(--gutter);
    color: var(--slate-500);
    font-size: .8125rem;
  }
  /* Once someone has scrolled the rail, the hint has done its job. */
  .chips-nav:not(.can-scroll-right) .chips-hint, .chips-nav.can-scroll-left .chips-hint { display: none; }
  .article-header { padding-top: 24px; }
  .article-body { font-size: 1.0625rem; }
  .article-cta { padding: 20px; }
  .toc { padding: 14px 16px; }
  .section-head-row .btn { width: 100%; }
}

@media (max-width: 960px) {
  .primary-nav ul a[aria-current="page"] { color: var(--brand-ink); background: var(--tint); }
}
.primary-nav a[aria-current="page"] { color: var(--brand-ink); }
