/* =====================================================================
   The blog's lists, written by scripts/blog-hub.js; behaviour in
   /js/blog-hub.js. Loaded after house.css and blog.css.

   The blog index (/blog/) sits on one soft grey ground. Each power-up is a
   white sheet: its heading, then its guides in a row that scrolls sideways,
   so another power-up adds a row, never a longer page. Under the search, a
   row of the power-ups jumps to each sheet and marks the one being read.
   A power-up's own blog keeps its page's ground and heading, then the same
   search and one sheet with all its guides.
   ===================================================================== */

body.bh-page { background: #EEF2F7; }
body.bh-page::before { display: none; }

/* ===== Masthead: words on the left, the mark on the right ===== */
.bh-mast { display: grid; gap: 28px; align-items: center; margin-bottom: 44px; }
/* The same air under the heading as the home page leaves under its hero
   (56px, 70px from 768px), less the contents row's own 12px. */
@media (min-width: 768px) { .bh-mast { margin-bottom: 58px; } }
@media (min-width: 1000px) { .bh-mast { grid-template-columns: minmax(0, 1fr) auto; gap: 56px; } }
.bh-mast-text { display: grid; gap: 14px; max-width: 700px; }
.bh-kicker { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.bh-mast h1 { font-size: clamp(34px, 4.8vw, 52px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
.bh-mast h1 em { font-style: normal; color: var(--primary); }
.bh-mast p { font-size: 17.5px; color: var(--body); max-width: 56ch; }

/* The mark itself: /css/mark.css. */
.bh-mark-wrap { display: none; }
@media (min-width: 1000px) { .bh-mark-wrap { display: block; } }

.bh-search { position: relative; max-width: 520px; margin-top: 12px; }
.bh-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.bh-search input {
  width: 100%; height: 48px; padding: 0 52px 0 46px;
  font: 500 15px 'Inter', sans-serif; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-search input::placeholder { color: var(--muted); }
.bh-search input:hover { border-color: var(--border-active); }
.bh-search input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(59, 130, 246, .14); }
.bh-search input::-webkit-search-cancel-button { display: none; }
/* The key that jumps to the search, shown until the reader types. */
.bh-search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); min-width: 24px; height: 24px; display: grid; place-items: center; font: 600 12px 'Inter', sans-serif; color: var(--muted); background: #F1F4F8; border: 1px solid var(--border); border-radius: 7px; pointer-events: none; }
.bh-search input:focus + kbd, .bh-search input:not(:placeholder-shown) + kbd { display: none; }
@media (hover: none) { .bh-search kbd { display: none; } }
/* A power-up's blog: the search under the page's own heading. */
.blog-wide > .bh-search { margin: -12px 0 20px; }

/* ===== Contents: the power-ups, kept in view ===== */
.bh-nav { position: sticky; top: 80px; z-index: 5; margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter); background: rgba(238, 242, 247, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bh-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.bh-tabs::-webkit-scrollbar { display: none; }
.bh-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  font: 600 13.5px 'Inter', sans-serif; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 6px 14px 6px 6px; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}
.bh-tab img { width: 22px; height: 22px; border-radius: 6px; }
.bh-tab:hover { border-color: var(--border-active); }
.bh-tab.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.bh-tab:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.bh-tab-free { padding-left: 14px; color: #15803D; }
.bh-tab-free.is-current { color: #fff; }
.bh-tab.is-empty { opacity: .35; }

/* ===== A sheet per power-up ===== */
.bh-row { margin-top: 20px; background: var(--surface); border-radius: 26px; padding: 22px 20px 6px; box-shadow: 0 1px 2px rgba(12, 40, 100, .06); }
/* Below the header and the sticky contents; beats house.css's section[id]. */
section.bh-row[id] { scroll-margin-top: 150px; }
.bh-row[hidden] { display: none; }
@media (min-width: 768px) { .bh-row { padding: 26px 28px 10px; } }
.bh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.bh-logos { display: flex; }
.bh-logos img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 0 0 3px var(--surface), 0 8px 18px -8px rgba(12, 40, 100, .5); }
.bh-logos img + img { margin-left: -10px; }
.bh-head-text { flex: 1; min-width: 200px; }
.bh-head h2 { font-size: 24px; line-height: 1.15; }
.bh-count { display: inline-block; vertical-align: 4px; margin-left: 6px; font: 700 12.5px 'Inter', sans-serif; color: var(--body); background: #EEF2F7; border-radius: 999px; padding: 1px 9px; }
.bh-head p { font-size: 15px; color: var(--body); margin-top: 2px; }
.bh-head .bh-head-quiet { flex: 1; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bh-head-quiet .bh-count { letter-spacing: 0; }
.bh-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.bh-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.bh-link svg { width: 15px; height: 15px; }
.bh-link:hover { text-decoration: underline; }
.bh-about { font-size: 14px; font-weight: 600; color: var(--body); white-space: nowrap; }
.bh-about:hover { color: var(--ink); text-decoration: underline; }
.bh-arrows { display: none; gap: 8px; }
@media (min-width: 900px) { .bh-arrows { display: inline-flex; } }
.bh-arrows button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.bh-arrows button:hover { border-color: var(--border-active); }
.bh-arrows button:disabled { opacity: .35; cursor: default; }
.bh-arrows button:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.bh-arrows svg { width: 18px; height: 18px; }

/* On the index the guides scroll sideways, the next one peeking in; on a
   power-up's blog they wrap. */
.bh-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(82%, 310px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; margin: 0 -20px; padding: 4px 20px 18px; scrollbar-width: none; }
.bh-track::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .bh-track { margin: 0 -28px; padding: 4px 28px 20px; scroll-padding: 0 28px; } }
.bh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; padding: 4px 0 18px; }

.bh-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; background: #F7FAFD; border: 1px solid transparent; border-radius: 18px; padding: 20px 20px 18px; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.bh-card[hidden] { display: none; }
.bh-card:hover { background: var(--surface); border-color: var(--border-active); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.bh-who { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--primary-ink); }
.bh-who img { width: 18px; height: 18px; border-radius: 5px; }
.bh-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--ink); text-wrap: balance; }
.bh-card:hover .bh-title { color: var(--primary); }
.bh-line { font-size: 14px; line-height: 1.55; color: var(--body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bh-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bh-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .6; }
.bh-type { font-weight: 600; color: var(--primary-ink); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; }

.bh-none { margin-top: 20px; padding: 36px 28px; text-align: center; font-size: 16px; color: var(--body); background: var(--surface); border-radius: 22px; }
.bh-none[hidden] { display: none; }
.bh-none b { color: var(--ink); }

.bh-end { margin: 20px 0 24px; padding: 28px 32px; border-radius: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; background: var(--surface); }
.bh-end p { font-size: 16px; color: var(--body); }
.bh-end p b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 22px; color: var(--ink); margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bh-tab, .bh-card { transition: none; }
}
