/* ==========================================================================
   Blog in the homepage design (/blog/, categories, tags, search, posts).
   Loaded by mu-plugins/088-tely-blog.php after main.css, challenges.css
   (crumbs, kicker, report band, link lists) and specialties-hub.css
   (pills). Frames follow the homepage: the warm hero panel of hero B,
   square cards with a 1px --border2, Newsreader 300 headings, Manrope 300
   text. :root tokens only.
   ========================================================================== */

/* ---------- Hero (the homepage hero B panel) ---------- */
.bv-hero { padding: 40px 164px 0; }
.bv-hero-inner { background: var(--warm); padding: 56px 58px 48px; display: flex; flex-direction: column; gap: 28px; }
.bv-page .bv-crumbs { margin: 0; }
.bv-page .bv-crumbs a, .bv-page .bv-crumbs span, .bv-page .bv-crumbs li { color: var(--muted); }
.bv-page .bv-crumbs li + li::before { color: var(--border); }
.bv-page .bv-crumbs a { text-decoration-color: var(--border); }
.bv-page .bv-crumbs span[aria-current] { color: var(--ink); }
.bv-hero-grid { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.bv-hero-copy { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; max-width: 780px; }
.bv-h1 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 3.5vw, 50px); line-height: 1.12; letter-spacing: -0.5px; color: var(--ink); text-wrap: balance; }
.bv-lede { margin: 0; font-family: var(--sans); font-weight: 300; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.45; color: var(--ink); max-width: 640px; }
.bv-hero-tools { flex: 0 0 340px; }
.bv-pills a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

.bv-search { position: relative; }
.bv-search-input {
  width: 100%; box-sizing: border-box; min-height: 52px; padding: 0 56px 0 20px;
  font-family: var(--sans); font-size: 16px; font-weight: 300; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px; outline: none;
}
.bv-search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); }
.bv-search-btn {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.bv-search-btn:hover { background: var(--warm2); }

/* ---------- Cards ---------- */
.bv-list .hipaa-inner { gap: 32px; }
.bv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bv-grid > li { display: flex; min-width: 0; }
.bv-card { display: flex; width: 100%; }
.bv-card-link {
  display: flex; flex-direction: column; width: 100%;
  background: var(--bg); border: 1px solid var(--border2); color: var(--ink);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.bv-card-link:hover { border-color: var(--border); transform: translateY(-3px); }
.bv-card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--warm2); }
.bv-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bv-card-mark { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--border); }
.bv-card-mark svg { width: 44px; height: 44px; }
.bv-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 22px 24px 24px; }
.bv-card-cat { margin: 0; }
.bv-card-t { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(21px, 1.7vw, 25px); line-height: 1.25; letter-spacing: -0.2px; color: var(--ink); text-wrap: pretty; }
.bv-card-d { font-family: var(--sans); font-weight: 300; font-size: 15.5px; line-height: 1.5; color: var(--muted2); }
.bv-card-meta { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--sans); font-weight: 400; font-size: 13.5px; color: var(--muted); }

/* Feature card (newest post on page 1): image left, words right. */
.bv-card--feature .bv-card-link { flex-direction: row; }
.bv-card--feature .bv-card-img { flex: 0 0 52%; aspect-ratio: 16 / 10; }
.bv-card--feature .bv-card-body { justify-content: center; padding: 40px 48px; gap: 14px; }
.bv-card--feature .bv-card-t { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; }
.bv-card--feature .bv-card-d { font-size: 17px; }
.bv-card--feature.bv-card--noimg .bv-card-img { display: none; }
.bv-card--feature.bv-card--noimg .bv-card-body { padding: 40px 48px; max-width: 860px; }

/* ---------- Pagination ---------- */
.bv-pages ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bv-pages a, .bv-pages span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 14px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--border2); border-radius: 999px; background: var(--bg);
}
.bv-pages a:hover { border-color: var(--border); }
.bv-pages .current { background: var(--ink); border-color: var(--ink); color: var(--white); }
.bv-pages .dots { border-color: transparent; background: transparent; }

/* ---------- Empty state ---------- */
.bv-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 720px; padding: 24px 0 8px; }
.bv-empty-h { margin: 8px 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3vw, 42px); line-height: 1.15; color: var(--ink); }
.bv-empty-p { margin: 0; font-family: var(--sans); font-weight: 300; font-size: 18px; line-height: 1.5; color: var(--ink); }
.bv-empty-links { width: 100%; margin-top: 8px; }

/* ---------- Single post ---------- */
.bv-hero--post .bv-hero-inner { padding-bottom: 40px; }
.bv-post-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 880px; }
.bv-post-cat { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0 -12px; }
.bv-h1--post { font-size: clamp(36px, 3.8vw, 54px); }
.bv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--border); width: 100%; }
.bv-meta-author { display: inline-flex; align-items: center; gap: 12px; }
.bv-avatar, .bv-meta-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bv-meta-author-t { display: flex; flex-direction: column; font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.bv-meta-author-t a { color: var(--ink); }
.bv-meta-role { font-weight: 300; font-size: 13.5px; color: var(--muted); }
.bv-meta-item { display: flex; flex-direction: column; font-family: var(--sans); font-size: 15px; font-weight: 400; color: var(--ink); line-height: 1.3; }
.bv-meta-l { font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.bv-cover { padding: 16px 164px 0; }
.bv-cover-img { display: block; width: 100%; height: auto; max-height: 620px; object-fit: cover; aspect-ratio: 16 / 8; }

.bv-article { max-width: var(--max); margin: 0 auto; padding: 64px 222px 72px; display: grid; grid-template-columns: minmax(0, 1fr); }
.bv-article--toc { grid-template-columns: 260px minmax(0, 1fr); gap: 64px; padding-left: 222px; padding-right: 222px; max-width: none; }
.bv-toc { position: relative; }
.bv-toc-box { position: sticky; top: 32px; }
.bv-toc-h {
  list-style: none; cursor: default; display: flex; align-items: center; min-height: 44px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border); font-family: var(--sans); font-weight: 400; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.bv-toc-h::-webkit-details-marker { display: none; }
.bv-toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.bv-toc-list a {
  display: flex; gap: 10px; min-height: 44px; align-items: center; padding: 6px 0;
  font-family: var(--sans); font-weight: 300; font-size: 15px; line-height: 1.35; color: var(--muted2);
  border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px; transition: color 0.2s ease, border-color 0.2s ease;
}
.bv-toc-list a:hover { color: var(--ink); }
.bv-toc-list a.is-active { color: var(--ink); border-left-color: var(--cyan); }

/* Article text: homepage type, a 720px measure */
.bv-body { min-width: 0; max-width: 720px; font-family: var(--sans); font-weight: 300; font-size: 18px; line-height: 1.65; color: var(--ink); }
.bv-article:not(.bv-article--toc) .bv-body { margin: 0 auto; }
.bv-body > * { margin: 0 0 22px; }
.bv-body h2 { margin: 48px 0 16px; font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 2.4vw, 36px); line-height: 1.2; letter-spacing: -0.3px; scroll-margin-top: 24px; }
.bv-body h3 { margin: 32px 0 12px; font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 1.8vw, 26px); line-height: 1.3; }
.bv-body h4 { margin: 24px 0 8px; font-family: var(--sans); font-weight: 600; font-size: 17px; }
.bv-body > :first-child { margin-top: 0; }
.bv-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--cyan); text-underline-offset: 3px; }
.bv-body strong, .bv-body b { font-weight: 600; }
.bv-body ul, .bv-body ol { padding-left: 24px; }
.bv-body li { margin: 0 0 8px; }
.bv-body ul li::marker { color: var(--cyan); }
.bv-body blockquote { margin: 32px 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--cyan); font-family: var(--serif); font-weight: 300; font-size: 24px; line-height: 1.4; }
.bv-body blockquote p { margin: 0; }
.bv-body img, .bv-body figure, .bv-body video, .bv-body iframe { max-width: 100%; height: auto; }
.bv-body figure { margin: 32px 0; }
.bv-body figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.bv-body table { width: 100%; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.bv-body th, .bv-body td { padding: 10px 12px; border-bottom: 1px solid var(--border2); text-align: left; vertical-align: top; }
.bv-body th { font-weight: 600; background: var(--warm); }
.bv-body pre { overflow-x: auto; padding: 16px; background: var(--warm); font-size: 14px; }
.bv-body hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

.bv-author { display: flex; gap: 16px; align-items: flex-start; margin-top: 48px; padding: 24px; background: var(--warm); border: 1px solid var(--border2); }
.bv-author .bv-avatar { width: 56px; height: 56px; }
.bv-author-l { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.bv-author-n { margin: 4px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.bv-author-n a { text-decoration: none; }
.bv-author-b { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--muted2); }

.bv-related .hipaa-inner { gap: 32px; }
.bv-related-h { margin-top: -16px; }

/* ---------- Responsive (main.css breakpoints) ---------- */
@media (max-width: 1280px) {
  .bv-article { padding-left: 120px; padding-right: 120px; }
  .bv-article--toc { padding-left: 80px; padding-right: 80px; gap: 48px; }
}
@media (max-width: 1024px) {
  .bv-hero { padding: 24px 48px 0; }
  .bv-hero-inner { padding: 40px 32px 36px; }
  .bv-hero-grid { flex-direction: column; align-items: stretch; gap: 24px; }
  .bv-hero-tools { flex: none; }
  .bv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bv-card--feature .bv-card-link { flex-direction: column; }
  .bv-card--feature .bv-card-img { flex: none; aspect-ratio: 16 / 9; }
  .bv-card--feature .bv-card-body { padding: 28px; }
  .bv-cover { padding: 16px 48px 0; }
  .bv-article, .bv-article--toc { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 48px 56px; }
  .bv-toc-box { position: static; background: var(--warm); padding: 4px 20px 8px; }
  .bv-toc-h { cursor: pointer; border-bottom: 0; margin: 0; padding: 0; justify-content: space-between; }
  .bv-toc-h::after { content: '+'; font-size: 20px; letter-spacing: 0; color: var(--ink); }
  .bv-toc-box[open] .bv-toc-h::after { content: '−'; }
  .bv-toc-list a { margin-left: 0; padding-left: 0; border-left: 0; }
  .bv-body { margin: 0 auto; }
}
@media (max-width: 768px) {
  /* Same insets as the .hipaa sections below (16px frame, 20px inside). */
  .bv-hero { padding: 16px 16px 0; }
  .bv-hero-inner { padding: 28px 20px 28px; gap: 20px; }
  /* A long post title stays one line in the crumbs. */
  .bv-crumbs ol { flex-wrap: nowrap; min-width: 0; }
  .bv-crumbs li { flex-shrink: 0; }
  .bv-crumbs li:last-child { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bv-card--feature.bv-card--noimg .bv-card-body { padding: 24px 20px; }
  .bv-h1 { font-size: 36px; }
  .bv-h1--post { font-size: 34px; }
  .bv-lede { font-size: 16px; }
  .bv-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* Phone: row cards (thumb left), as on the hubs */
  .bv-card--grid .bv-card-link { flex-direction: row; }
  .bv-card--grid .bv-card-img { flex: 0 0 34%; aspect-ratio: auto; min-height: 100%; }
  .bv-card--grid .bv-card-body { padding: 14px 14px 12px; gap: 6px; }
  .bv-card--grid .bv-card-t { font-size: 19px; }
  .bv-card--grid .bv-card-d { display: none; }
  .bv-card--grid .bv-card-cat { font-size: 11px; }
  .bv-card--grid .bv-card-meta { font-size: 12.5px; padding-top: 4px; }
  .bv-card--feature .bv-card-body { padding: 20px; }
  .bv-card--feature .bv-card-t { font-size: 26px; }
  .bv-card--feature .bv-card-d { font-size: 15.5px; }
  .bv-meta { gap: 14px 24px; }
  .bv-meta-author { flex-basis: 100%; }
  .bv-cover { padding: 12px 16px 0; }
  .bv-cover-img { aspect-ratio: 3 / 2; }
  .bv-article, .bv-article--toc { padding: 28px 20px 40px; }
  .bv-body { font-size: 17px; }
  .bv-body h2 { font-size: 28px; margin-top: 40px; }
  .bv-body blockquote { font-size: 21px; }
  .bv-author { padding: 18px; }
  .bv-empty-p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .bv-card-link, .bv-card-link:hover { transition: none; transform: none; }
}

/* Authors shown by initials (user meta tely_avatar_initials) */
.bv-page .tely-avatar-initials.bv-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--warm2); border: 1px solid var(--border2); color: var(--ink);
  font-family: var(--serif); font-weight: 400; font-size: 17px; letter-spacing: 0.02em;
}
.bv-author .tely-avatar-initials.bv-avatar { font-size: 20px; background: var(--bg); }

/* 44px tap targets for the byline links and "All articles" */
.bv-meta-author-t a, .bv-author-n a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; }
.bv-page .stories-viewall-link { min-height: 44px; }
