/* The blog: the post page (template blog-post) and the lists (partials/blog-list.hbs: home, topics, more, search).
   Same look as the Smartico Labs pages (css/labs.css): navy hero, Lexend Deca, coral accents, a left rail with plain
   text links, calm headings. Everything is scoped under .blog-post (the lists carry it too). */
.blog-post {
  --blog-ink: #1c2135;
  --blog-text: #2b3048;
  --blog-muted: #6a7190;
  --blog-line: #e4e7ef;
  --blog-soft: #f5f6fa;
  --blog-navy: #171b2a;
  --blog-coral: #f15851;
  --blog-teal: #0a7f86;
  --blog-teal-light: #11ced7;
}

/* ---------------------------------------------------------------- hero */
.blog-hero { position: relative; overflow: hidden; background: var(--blog-navy); color: #fff; }
.blog-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 75%);
}
.blog-hero > * { position: relative; }
/* the menu is fixed over the page: start below it (js/subnav.js measures it into --nav-fixed-h) */
.blog-hero > .padding-global { padding-top: calc(var(--nav-fixed-h, 4.5rem) + 2.5rem); padding-bottom: 4rem; }
.blog-crumbs { width: 100%; display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: #c9cee3; }
.blog-crumbs a { color: #fff; font-weight: 500; text-decoration: none; }
.blog-crumbs a:hover { color: var(--blog-teal-light); }
.blog-crumbs_sep { color: #5d6485; }
/* the post's topics above its title (content/blog-topics.json), linked to the topic pages */
.blog-topics { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.blog-topic { padding: .3rem .8rem; border-radius: 999px; border: 1px solid rgba(17, 206, 215, .35); background: rgba(17, 206, 215, .08); font-size: .8125rem; font-weight: 500; line-height: 1.3; color: var(--blog-teal-light); text-decoration: none; transition: background .2s, border-color .2s; }
.blog-topic:hover { background: rgba(17, 206, 215, .18); border-color: var(--blog-teal-light); color: #fff; }
.blog-hero_grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center; padding-top: 1.75rem; }
.blog-hero_title { margin: 0; font-size: 2.75rem; font-weight: 600; line-height: 1.15; color: #fff; }
.blog-hero_lead { margin: 1.25rem 0 0; font-size: 1.1875rem; line-height: 1.55; color: #c9cee3; }
.blog-hero_meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.5rem; font-size: .875rem; color: #9aa1bd; }
.blog-hero_meta span + span::before { content: "·"; margin-right: 1.25rem; color: #5d6485; }
/* covers come in many shapes (wide banners, old square pictures): keep the whole picture, limit its height */
.blog-hero_cover { display: flex; justify-content: flex-end; }
.blog-hero_img { display: block; width: auto; max-width: 100%; height: auto; max-height: 22rem; border-radius: 1.25rem; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 2rem 4rem rgba(0, 0, 0, .4); }

/* ---------------------------------------------------------------- rail + article */
.blog-main { background: #fff; padding-block: 4rem 5rem; }
.blog-grid { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 4.5rem; align-items: start; }
/* the whole rail stays in view while the article scrolls; a rail taller than the window scrolls on its own */
.blog-rail { position: sticky; top: calc(var(--nav-fixed-h, 6rem) + 1.5rem); max-height: calc(100vh - var(--nav-fixed-h, 6rem) - 3rem); overflow-y: auto; scrollbar-width: thin; padding-right: .5rem; }
.blog-rail_inner { display: grid; gap: 2rem; }
.blog-rail_block { display: grid; gap: .75rem; }
.blog-rail_block + .blog-rail_block { padding-top: 1.5rem; border-top: 1px solid var(--blog-line); }
.blog-rail_title { margin: 0; font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blog-muted); }

.blog-toc { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-left: 2px solid var(--blog-line); }
.blog-toc a { display: block; margin-left: -2px; padding: .35rem 0 .35rem 1rem; border-left: 2px solid transparent; font-size: .875rem; line-height: 1.4; color: var(--blog-muted); text-decoration: none; transition: color .2s, border-color .2s; }
.blog-toc a:hover { color: var(--blog-ink); }
.blog-toc a.is-active { color: var(--blog-ink); font-weight: 500; border-left-color: var(--blog-coral); }

.blog-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.blog-links a { display: grid; gap: .2rem; text-decoration: none; }
.blog-links_t { font-size: .875rem; font-weight: 500; line-height: 1.4; color: var(--blog-ink); transition: color .2s; }
.blog-links a:hover .blog-links_t { color: var(--blog-coral); }
.blog-links_d { font-size: .75rem; color: var(--blog-muted); }

.blog-share_row { display: flex; flex-wrap: wrap; gap: .5rem; }
.blog-share_btn {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem; padding: 0 .75rem; border-radius: 999px;
  border: 1px solid var(--blog-line); background: #fff; color: var(--blog-ink); font: inherit; font-size: .8125rem; cursor: pointer; text-decoration: none;
}
.blog-share_btn:hover { border-color: var(--blog-ink); }
.blog-share_btn.is-icon { width: 2.25rem; padding: 0; justify-content: center; }
.blog-share_btn svg { width: 1rem; height: 1rem; flex: none; }
.blog-share_btn.is-done { border-color: var(--blog-teal); color: var(--blog-teal); }

/* ---------------------------------------------------------------- article text */
.blog-body { min-width: 0; max-width: 46rem; }
.blog-article { font-size: 1.125rem; line-height: 1.7; color: var(--blog-text); }
.blog-article > :first-child { margin-top: 0; }
.blog-article h2, .blog-article h3, .blog-article h4 { color: var(--blog-ink); font-weight: 600; scroll-margin-top: calc(var(--nav-fixed-h, 6rem) + 1.5rem); }
.blog-article h2 { margin: 3rem 0 1rem; font-size: 1.75rem; line-height: 1.25; }
.blog-article h3 { margin: 2.25rem 0 .75rem; font-size: 1.3125rem; line-height: 1.35; }
.blog-article h4, .blog-article h5, .blog-article h6 { margin: 1.75rem 0 .5rem; font-size: 1.125rem; line-height: 1.4; }
.blog-article p, .blog-article ul, .blog-article ol { margin: 0 0 1.15rem; }
.blog-article ul, .blog-article ol { padding-left: 1.4rem; }
.blog-article li { margin-bottom: .5rem; }
.blog-article li::marker { color: var(--blog-coral); }
.blog-article strong, .blog-article b { color: var(--blog-ink); font-weight: 600; }
.blog-article a { color: var(--blog-teal); text-decoration: underline; text-underline-offset: .15em; }
.blog-article a:hover { color: var(--blog-coral); }
.blog-article img { display: block; max-width: 100%; height: auto; margin: 2rem auto; border-radius: .75rem; }
.blog-article p > img:only-child { margin: 0 auto; }
/* a small drawing at the start of a paragraph: floats beside the text (right, or left with is-left) */
.blog-article img.blog-spot { float: right; width: 42%; max-width: 20rem; margin: .35rem 0 1rem 1.75rem; border-radius: 1.25rem; }
.blog-article img.blog-spot.is-left { float: left; margin: .35rem 1.75rem 1rem 0; }
.blog-article h2, .blog-article h3 { clear: both; }
.blog-article figure, .blog-article.w-richtext figure { max-width: 100%; margin: 2rem 0; }
.blog-article figure img { margin: 0 auto; }
.blog-article figcaption { margin-top: .5rem; font-size: .875rem; color: var(--blog-muted); text-align: center; }
.blog-article blockquote { margin: 2rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--blog-coral); font-size: 1.1875rem; color: var(--blog-ink); }
.blog-article hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--blog-line); }
.blog-article iframe { display: block; width: 100%; max-width: 100%; border: 0; border-radius: .75rem; }
.blog-article iframe[src*="youtube"], .blog-article iframe[src*="vimeo"] { height: auto; aspect-ratio: 16 / 9; }
.blog-article code { padding: .1em .35em; border-radius: .3rem; background: var(--blog-soft); font-size: .9em; }
/* tables scroll sideways on phones instead of widening the page */
.blog-article table { display: block; max-width: 100%; overflow-x: auto; margin: 2rem 0; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.blog-article th, .blog-article td { padding: .6rem .9rem; border-bottom: 1px solid var(--blog-line); text-align: left; vertical-align: top; }
.blog-article th { color: var(--blog-ink); font-weight: 600; background: var(--blog-soft); }
.blog-article .blog-cta { margin: 2.5rem 0; }

.blog-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--blog-line); }
.blog-tags_label { margin-right: .25rem; font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blog-muted); }
.blog-tag { padding: .25rem .75rem; border-radius: 999px; background: var(--blog-soft); font-size: .8125rem; color: var(--blog-ink); text-decoration: none; transition: background .2s, color .2s; }
.blog-tag:hover { background: #fdeeed; color: var(--blog-coral); }

.blog-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.blog-pager_item { display: grid; gap: .4rem; align-content: start; padding: 1.25rem 1.5rem; border: 1px solid var(--blog-line); border-radius: 1rem; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.blog-pager_item:hover { border-color: var(--blog-ink); box-shadow: 0 .75rem 2rem rgba(23, 27, 42, .06); }
.blog-pager_item.is-newer { text-align: right; }
.blog-pager_dir { font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blog-coral); }
.blog-pager_t { font-size: 1rem; font-weight: 500; line-height: 1.4; color: var(--blog-ink); }

/* ---------------------------------------------------------------- blog lists (partials/blog-list.hbs) */
.blog-hero.is-list > .padding-global { padding-bottom: 3.5rem; }
.blog-hero_list { width: 100%; max-width: 48rem; margin-right: auto; padding-top: 1.25rem; }
.blog-hero_list:first-child { padding-top: 0; }
.blog-hero_count { margin: 1rem 0 0; font-size: .875rem; color: #9aa1bd; }
.blog-searchbox { display: flex; align-items: center; gap: .5rem; max-width: 36rem; margin-top: 2rem; padding: .375rem .375rem .375rem 1.125rem; border-radius: 999px; background: #fff; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .25); }
.blog-searchbox svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--blog-muted); }
.blog-searchbox input { flex: 1; min-width: 0; height: 2.75rem; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--blog-ink); }
.blog-searchbox input::-webkit-search-cancel-button { cursor: pointer; }
.blog-searchbox button { flex: none; height: 2.75rem; padding: 0 1.375rem; border: 0; border-radius: 999px; background: var(--blog-coral); font: inherit; font-size: .9375rem; font-weight: 500; color: #fff; cursor: pointer; }
.blog-searchbox button:hover { background: #e2453e; }
.blog-searchbox:focus-within { box-shadow: 0 0 0 3px rgba(17, 206, 215, .5), 0 1rem 2.5rem rgba(0, 0, 0, .25); }
.blog-lists .blog-main { padding-block: 3.5rem 4.5rem; }
.blog-sec + .blog-sec, .blog-featured + .blog-sec { margin-top: 4rem; }
.blog-sec_head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.blog-sec_title { margin: 0; font-size: 1.75rem; font-weight: 600; line-height: 1.25; color: var(--blog-ink); }
.blog-sec_desc { margin: .4rem 0 0; font-size: .9375rem; color: var(--blog-muted); }
.blog-sec_link { flex: none; font-size: .9375rem; font-weight: 500; color: var(--blog-coral); text-decoration: none; }
.blog-sec_link:hover { text-decoration: underline; }

/* post cards */
.blog-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.75rem; }
.blog-card { display: flex; flex-direction: column; gap: 1rem; color: var(--blog-ink); text-decoration: none; }
.blog-card_img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 1rem; background: var(--blog-navy); border: 1px solid var(--blog-line); }
.blog-card_pic { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.blog-card:hover .blog-card_pic { transform: scale(1.03); }
.blog-card_ph { position: absolute; inset: 0; background: linear-gradient(135deg, #22283d, var(--blog-navy)); }
.blog-card_body { display: grid; gap: .5rem; }
.blog-card_topic { font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blog-coral); }
.blog-card_t { font-size: 1.125rem; font-weight: 600; line-height: 1.35; color: var(--blog-ink); transition: color .2s; }
.blog-card:hover .blog-card_t { color: var(--blog-coral); }
.blog-card_d { font-size: 1rem; line-height: 1.55; color: var(--blog-text); }
.blog-card_meta { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--blog-muted); }
.blog-card_dot { width: .25rem; height: .25rem; border-radius: 50%; background: var(--blog-coral); }
/* home: the newest post big, the next two beside it */
.blog-featured { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 2.5rem; align-items: stretch; }
/* the next four posts fill the height of the big one */
.blog-featured_side { display: grid; grid-template-rows: repeat(4, auto); align-content: space-between; gap: 1.25rem; }
.blog-card.is-big .blog-card_t { font-size: 1.75rem; line-height: 1.25; }
.blog-featured_side .blog-card { flex-direction: row; gap: 1.25rem; }
.blog-featured_side .blog-card_img { flex: none; width: 40%; align-self: flex-start; }
.blog-featured_side .blog-card_body { gap: .35rem; align-content: start; }
.blog-featured_side .blog-card_t { font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* home: topic cards */
.blog-topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.blog-topic-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.375rem 1.5rem; border: 1px solid var(--blog-line); border-radius: 1rem; background: #fff; color: var(--blog-ink); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.blog-topic-card:hover { border-color: var(--blog-ink); box-shadow: 0 .75rem 2rem rgba(23, 27, 42, .06); }
.blog-topic-card_name { font-size: 1.0625rem; font-weight: 600; color: var(--blog-ink); text-decoration: none; }
a.blog-topic-card:hover .blog-topic-card_name, a.blog-topic-card_name:hover { color: var(--blog-coral); }
.blog-topic-card_desc { flex: 1; font-size: .875rem; line-height: 1.5; color: var(--blog-muted); }
.blog-topic-card_count { font-size: .8125rem; font-weight: 500; color: var(--blog-teal); }
.blog-topic-card.is-more { background: var(--blog-soft); border-color: transparent; }
.blog-topic-card_list { display: grid; gap: .35rem; }
.blog-topic-card_list a { font-size: .875rem; color: var(--blog-text); text-decoration: none; }
.blog-topic-card_list a:hover { color: var(--blog-coral); }
.blog-topic-card_list i { font-style: normal; color: var(--blog-muted); }

/* page links */
.blog-pages { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--blog-line); }
.blog-pages_step { min-width: 6rem; font-size: .9375rem; font-weight: 500; color: var(--blog-ink); text-decoration: none; }
.blog-pages_step.is-next { text-align: right; }
a.blog-pages_step:hover { color: var(--blog-coral); }
.blog-pages_nums { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .25rem; }
.blog-pages_n { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border-radius: 999px; font-size: .875rem; color: var(--blog-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.blog-pages_n:hover { background: var(--blog-soft); }
.blog-pages_n[aria-current="page"] { background: var(--blog-navy); color: #fff; }
.blog-pages_gap { font-style: normal; color: var(--blog-muted); padding: 0 .25rem; }

/* search page (js/search.js) */
.blog-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.blog-chip { padding: .45rem .95rem; border: 1px solid var(--blog-line); border-radius: 999px; background: #fff; font: inherit; font-size: .875rem; color: var(--blog-ink); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.blog-chip:hover { border-color: var(--blog-ink); }
.blog-chip[aria-pressed="true"] { background: var(--blog-navy); border-color: var(--blog-navy); color: #fff; }
.blog-search_status { margin: 0 0 1.5rem; font-size: .9375rem; color: var(--blog-muted); }
.blog-search_more { display: flex; justify-content: center; margin-top: 2.5rem; }
.blog-search_more button { height: 2.75rem; padding: 0 1.5rem; border: 1px solid var(--blog-ink); border-radius: 999px; background: #fff; font: inherit; font-size: .9375rem; color: var(--blog-ink); cursor: pointer; }
.blog-search_more button:hover { background: var(--blog-ink); color: #fff; }

/* ---------------------------------------------------------------- tablet and phone: the rail goes under the article */
@media screen and (max-width: 991px) {
  .blog-hero_grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .blog-hero_cover { justify-content: flex-start; }
  .blog-grid { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .blog-body { max-width: none; }
  .blog-rail { order: 2; position: static; max-height: none; overflow: visible; padding-right: 0; }
  .blog-rail_block.is-toc { display: none; }
  .blog-rail_block.is-toc + .blog-rail_block { padding-top: 0; border-top: 0; }
  .blog-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-featured { grid-template-columns: minmax(0, 1fr); }
  .blog-featured_side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: 1.5rem; }
  .blog-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 767px) {
  .blog-hero > .padding-global { padding-bottom: 2.5rem; }
  .blog-hero_title { font-size: 2rem; }
  .blog-hero_lead { font-size: 1.0625rem; }
  .blog-main { padding-block: 2.5rem 3.5rem; }
  .blog-article { font-size: 1.0625rem; }
  .blog-article h2 { margin-top: 2.5rem; font-size: 1.5rem; }
  .blog-article h3 { font-size: 1.1875rem; }
  .blog-pager { grid-template-columns: minmax(0, 1fr); }
  .blog-pager_item.is-newer { text-align: left; }
  .blog-cards { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .blog-card.is-big .blog-card_t { font-size: 1.375rem; }
  .blog-featured_side { grid-template-columns: minmax(0, 1fr); }
  .blog-featured_side .blog-card_img { width: 38%; }
  .blog-sec_title { font-size: 1.375rem; }
  .blog-sec_head { flex-direction: column; align-items: flex-start; }
  .blog-pages_step { min-width: 0; }
  .blog-pages_step span, .blog-pages_step { font-size: .875rem; }
  .blog-searchbox button { padding: 0 1rem; }
}
@media screen and (max-width: 479px) {
  .blog-article img.blog-spot { width: 40%; margin-left: 1rem; border-radius: .875rem; }
  .blog-article img.blog-spot.is-left { margin: .35rem 1rem 1rem 0; }
  .blog-topic-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-featured_side { grid-template-columns: minmax(0, 1fr); }
  .blog-featured_side .blog-card { flex-direction: column; }
  .blog-featured_side .blog-card_img { width: 100%; }
  .blog-hero_meta { gap: .25rem 1rem; }
  .blog-hero_meta span + span::before { content: none; }
}
