/* ==========================================================================
   The blog (F-19, docs/BLOG.md) — ours, not the designer's. The design has no
   blog, so these pages are built from its own parts: features.css's hero,
   legal.css's article layout ("On this page" beside the text), site.css's
   tokens and buttons. Prefixed bl- so no class here can collide with an
   export (docs/MARKETING_SITE.md rule 3).
   ========================================================================== */

/* ---------- Hero and breadcrumbs ---------- */
.bl-hero { padding-bottom: clamp(36px, 4vw, 56px); }
.bl-crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.bl-crumbs li + li::before { content: "/"; margin-right: 6px; color: #C9C2B9; }
.bl-crumbs a { color: var(--muted); text-decoration: none; }
.bl-crumbs a:hover { color: var(--orange-600); }
.bl-crumbs [aria-current="page"] { color: var(--charcoal); font-weight: 600; }

/* ---------- Filters ---------- */
.bl-body { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(56px, 7vw, 96px); }
.bl-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 40px); }
.bl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--charcoal); font-weight: 500; font-size: .92rem; text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}
.bl-chip:hover { border-color: var(--orange); color: var(--orange-600); }
.bl-chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.bl-chip__count { font-size: .78rem; opacity: .65; }
.bl-empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.bl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.bl-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow .2s, transform .2s var(--ease);
}
.bl-card:hover { box-shadow: 0 18px 40px -24px rgba(18, 20, 22, .35); transform: translateY(-2px); }
.bl-card__media { display: block; aspect-ratio: 1200 / 630; background: var(--orange-50); overflow: hidden; }
.bl-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-card__placeholder {
  display: block; width: 100%; height: 100%;
  background: radial-gradient(120% 90% at 85% 10%, var(--orange-100), transparent 60%), linear-gradient(135deg, var(--cream), var(--orange-50));
}
.bl-card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; }
.bl-card__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.bl-card__meta a { color: var(--orange-600); font-weight: 600; text-decoration: none; }
.bl-card__title { margin: 0; font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.015em; }
.bl-card__title a { color: var(--ink); text-decoration: none; }
.bl-card__title a:hover { color: var(--orange-600); }
.bl-card__excerpt { margin: 0; color: var(--body, var(--charcoal)); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Sinhala sits taller than Latin; give it room (the font comes from site.css's [lang="si"]). */
[lang="si"] .bl-card__title, [lang="si"].bl-card .bl-card__title { line-height: 1.5; letter-spacing: 0; }

/* ---------- Pager and feed ---------- */
.bl-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: clamp(32px, 4vw, 48px); flex-wrap: wrap; }
.bl-pager__status { color: var(--muted); font-size: .92rem; }
.bl-feed { text-align: center; margin: 28px 0 0; font-size: .88rem; }
.bl-feed a { color: var(--muted); }

/* ---------- A post ---------- */
.bl-post-hero h1 { max-width: 24ch; }
html[lang="si"] .bl-post-hero h1 { line-height: 1.3; letter-spacing: -0.01em; }
.bl-byline { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 18px 0 0; color: var(--muted); font-size: .92rem; }
.bl-translation { margin: 14px 0 0; }
.bl-translation a { color: var(--orange-600); font-weight: 600; text-decoration: none; }
.bl-cover { margin-top: clamp(-8px, -1vw, 0px); }
.bl-cover img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: calc(var(--radius) + 4px); }

.bl-layout--single { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.bl-toc--l3 { padding-left: 14px; font-size: .92em; }

.bl-doc h3 { font-size: 1.25rem; line-height: 1.3; margin: 32px 0 10px; }
.bl-doc h4 { font-size: 1.05rem; margin: 24px 0 8px; }
.bl-doc h2, .bl-doc h3, .bl-doc h4 { scroll-margin-top: calc(var(--header-h) + 24px); }
html[lang="si"] .bl-doc { line-height: 1.85; }
html[lang="si"] .bl-doc h2, html[lang="si"] .bl-doc h3 { letter-spacing: 0; line-height: 1.45; }
.bl-doc mark { background: var(--orange-100); padding: 0 .15em; border-radius: 3px; }
.bl-doc code { font-size: .9em; background: var(--cream); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }

.bl-figure { margin: 28px 0; }
.bl-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.bl-figure figcaption, .bl-video figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); text-align: center; }
.bl-quote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--orange); }
.bl-quote p { font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 0; }
.bl-quote cite { display: block; margin-top: 8px; font-style: normal; color: var(--muted); font-size: .92rem; }
.bl-rule { border: 0; height: 1px; background: var(--line); margin: 40px 0; }
.bl-table { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 12px; }
.bl-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bl-table th, .bl-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.bl-table thead th { background: var(--cream); font-weight: 700; }
.bl-table tr:last-child td { border-bottom: 0; }
.bl-code { overflow-x: auto; margin: 24px 0; padding: 16px 18px; border-radius: 12px; background: var(--ink); color: #F4F1EC; font-size: .9rem; line-height: 1.6; }
.bl-code code { background: none; border: 0; padding: 0; color: inherit; }
.bl-callout { margin: 28px 0; padding: 18px 20px; border-radius: 12px; background: var(--orange-50); border: 1px solid var(--orange-100); }
.bl-callout p { margin: 0; }
.bl-callout p + p { margin-top: 6px; }
.bl-callout__title { font-weight: 700; color: var(--ink); }
.bl-video { margin: 28px 0; }
.bl-video__frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: var(--ink);
}
.bl-video__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bl-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bl-video__play {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; cursor: pointer;
  border: 0; background: linear-gradient(180deg, rgba(18, 20, 22, 0) 40%, rgba(18, 20, 22, .35));
  display: grid; place-items: center;
}
.bl-video__icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); position: relative;
  transition: transform .15s var(--ease), background-color .15s;
}
.bl-video__icon::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent #fff;
}
.bl-video__play:hover .bl-video__icon, .bl-video__play:focus-visible .bl-video__icon { transform: scale(1.06); background: var(--orange-600); }
.bl-video__notice { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
.bl-video__notice a { color: var(--muted); }

.bl-cta {
  margin: 40px 0 0; padding: clamp(22px, 3vw, 32px); border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, var(--cream), var(--orange-50)); border: 1px solid var(--orange-100); text-align: center;
}
.bl-cta__title { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -0.015em; }
.bl-cta__body { margin: 8px 0 18px; }
/* Two classes, so it outranks legal.css's `.lg-doc a`, which would paint the label orange on orange. */
.bl-cta .btn, .bl-cta .btn:hover { color: #fff; text-decoration: none; }
.bl-cta .btn { padding: 14px 28px; font-size: 1rem; }

.bl-share { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.bl-share__title { margin: 0 0 10px; font-weight: 700; color: var(--ink); font-size: .95rem; }
.bl-share ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bl-share li { margin: 0; }
.bl-share a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--charcoal); font-size: .9rem; }
.bl-share a:hover { border-color: var(--orange); color: var(--orange-600); }
/* Each network's own colour, so the button is recognised before it is read. */
.bl-share__icon { flex: none; }
.bl-share__icon--whatsapp { color: #25d366; }
.bl-share__icon--facebook { color: #1877f2; }
.bl-share__icon--linkedin { color: #0a66c2; }
.bl-share__icon--x { color: #000; }

.bl-related { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.bl-related h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 24px; }
.bl-related__all { margin: 28px 0 0; text-align: center; }
.bl-related__all a { color: var(--orange-600); font-weight: 600; text-decoration: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bl-filters { flex-direction: column; }
}
@media (max-width: 620px) {
  .bl-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .bl-card, .bl-card:hover { transition: none; transform: none; }
}

/* ---------- The editor's Preview (admin only) ---------- */
.bl-preview-bar {
  position: sticky; top: var(--header-h); z-index: 40; margin: 0;
  padding: 10px var(--gutter); text-align: center; font-weight: 600; font-size: .92rem;
  background: var(--ink); color: #fff;
}

/* ---------- /blog/follow: the page the "Follow by RSS" link opens ---------- */
.bl-follow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.bl-follow h2 { font-size: 1.35rem; margin-bottom: 16px; }
.bl-follow__box { padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: #fff; }
.bl-follow__steps { margin: 0 0 22px; padding-left: 1.3em; line-height: 1.7; }
.bl-follow__steps li + li { margin-top: 6px; }
.bl-follow__label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 8px; color: var(--ink); }
.bl-follow__copy { display: flex; gap: 8px; }
.bl-follow__copy input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--cream); color: var(--charcoal);
}
.bl-follow__status { min-height: 1.4em; margin: 8px 0 0; font-size: .88rem; color: var(--orange-600); font-weight: 600; }
.bl-follow__note { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.bl-follow__list { margin: 0; padding: 0; list-style: none; }
.bl-follow__list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bl-follow__list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.bl-follow__list a:hover { color: var(--orange-600); }
.bl-follow__list time { font-size: .85rem; color: var(--muted); }
@media (max-width: 860px) { .bl-follow { grid-template-columns: minmax(0, 1fr); } }
