/* Frankly — blog listing template ("The Table Spread").
   Scoped to .blog-listing-page. Tokens, tags, avatars, the Next-step offers,
   buttons, and the subscribe form come from blog-base.css (.fk-blog, the same
   wrapper element).

   The week's papers spread on the kitchen table: the newest post laid on top
   as a wide sheet, the rest as smaller sheets, the sign-up clipped to the
   header like a note. Sheets are flat at rest; they lift only on hover.

   Contrast, measured (WCAG 2.x), beyond those listed in blog-base.css:
     --bp-muted  on --bp-cream ... 5.11:1   counts, placeholder-free labels
     --bp-muted  on --bp-paper ... 5.43:1   search placeholder, sheet meta
     white       on teal-600   ... 5.05:1   search button

   Breakpoints: 900px (header note beside the title; lead sheet goes
   side by side; three-up grid), 600px (two-up grid), 520px. */

.blog-listing-page .bl-stage {
  max-width: calc(1180px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.blog-listing-page { padding-top: clamp(16px, 3vw, 28px); }

/* ── Top of the table: header, sign-up note, topics, lead ──── */

.blog-listing-page .bl-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "topics" "lead" "note";
}
.blog-listing-page .bl-head   { grid-area: head; }
.blog-listing-page .bl-note   { grid-area: note; }
.blog-listing-page .bl-topics { grid-area: topics; }
.blog-listing-page .bl-lead   { grid-area: lead; }

.blog-listing-page .bl-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bp-body);
  text-decoration: none;
  transition: color 150ms var(--bp-ease);
}
.blog-listing-page .bl-crumb svg { transition: transform 150ms var(--bp-ease); }
@media (hover: hover) {
  .blog-listing-page .bl-crumb:hover { color: var(--fk-teal-700); }
  .blog-listing-page .bl-crumb:hover svg { transform: translateX(-2px); }
}

.blog-listing-page .bl-title {
  margin: 12px 0 0;
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--bp-ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.blog-listing-page .bl-title--sub {
  margin-top: 0;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
}

.blog-listing-page .bl-desc {
  max-width: 34em;
  margin: 18px 0 0;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--bp-body);
  text-wrap: pretty;
}
.blog-listing-page .bl-count {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--bp-muted);
  font-variant-numeric: tabular-nums;
}

.blog-listing-page .bl-author {
  display: flex;
  align-items: center;
  gap: 20px;
}
.blog-listing-page .bl-author .bl-count { margin-top: 6px; }
.blog-listing-page .bl-author__avatar {
  width: 72px;
  height: 72px;
  border: 0;
}

/* Search: HubSpot site search, limited to this blog's posts. */
.blog-listing-page .bl-search {
  position: relative;
  max-width: 500px;
  margin-top: 28px;
}
.blog-listing-page .bl-search__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--bp-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.blog-listing-page .bl-search__input {
  width: 100%;
  min-height: 54px;
  padding: 0 112px 0 46px;
  border: 1px solid var(--bp-hair-strong);
  border-radius: var(--r-lg);
  background: var(--bp-paper);
  font: 400 16px/1.3 var(--font-brand);
  color: var(--bp-ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 150ms var(--bp-ease), box-shadow 150ms var(--bp-ease);
}
.blog-listing-page .bl-search__input::placeholder { color: var(--bp-muted); opacity: 1; }
.blog-listing-page .bl-search__input::-webkit-search-decoration { -webkit-appearance: none; }
.blog-listing-page .bl-search__input:focus {
  outline: none;
  border-color: var(--fk-teal-600);
  box-shadow: 0 0 0 3px rgba(63, 120, 117, 0.16);
}
.blog-listing-page .bl-search__button {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--fk-teal-600);
  font: 600 14.5px/1 var(--font-brand);
  color: var(--white);
  cursor: pointer;
  transition: background-color 150ms var(--bp-ease);
}
.blog-listing-page .bl-search__button:hover { background: var(--fk-teal-700); }

/* The sign-up note, held by the same paper clip as a post's In-brief note. */
.blog-listing-page .bl-note {
  position: relative;
  margin-top: clamp(40px, 6vw, 56px);
  padding: 30px 26px 26px;
  background: var(--fk-teal-50);
  border: 1px solid var(--fk-teal-100);
  border-radius: 16px;
}
.blog-listing-page .bl-note__clip {
  position: absolute;
  top: -22px;
  right: 34px;
  color: var(--fk-teal-700);
}
.blog-listing-page .bl-note__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fk-teal-700);
}
.blog-listing-page .bl-note__body {
  margin: 6px 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--bp-body);
}
.blog-listing-page .bl-note .bp-subscribe__form .hs-form-field { flex-basis: 100%; }
.blog-listing-page .bl-note .bp-subscribe__form .hs_submit,
.blog-listing-page .bl-note .bp-subscribe__form .actions,
.blog-listing-page .bl-note .bp-subscribe__form input[type="submit"],
.blog-listing-page .bl-note .bp-subscribe__form .hs-button { width: 100%; }

/* Topic chips: links to each topic's page; the current one is filled. */
.blog-listing-page .bl-topics { margin-top: clamp(32px, 4vw, 48px); }
.blog-listing-page .bl-topics__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.blog-listing-page .bl-topics__list li { margin: 0; flex-shrink: 0; }
.blog-listing-page .bl-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--bp-hair);
  border-radius: var(--r-full);
  background: var(--bp-paper);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--bp-body);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 150ms var(--bp-ease), color 150ms var(--bp-ease), background-color 150ms var(--bp-ease);
}
@media (hover: hover) {
  .blog-listing-page .bl-chip:hover {
    border-color: var(--fk-teal-600);
    color: var(--fk-teal-700);
  }
}
.blog-listing-page .bl-chip[aria-current] {
  border-color: var(--fk-teal-600);
  background: var(--fk-teal-50);
  color: var(--fk-teal-700);
  font-weight: 600;
}

.blog-listing-page .bl-lead { margin-top: 20px; }

/* ── Sheets ────────────────────────────────────────────────── */

.blog-listing-page .bl-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: var(--bp-paper);
  border: 1px solid var(--bp-hair);
  border-radius: 16px;
  transition: border-color 200ms var(--bp-ease), box-shadow 200ms var(--bp-ease);
}
@media (hover: hover) {
  .blog-listing-page .bl-sheet:hover {
    border-color: var(--fk-teal-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .blog-listing-page .bl-sheet:hover .bl-sheet__title { color: var(--fk-teal-700); }
}
/* The whole sheet is one click target: the title link stretches over it.
   The topic tag sits above that layer and stays its own link. */
.blog-listing-page .bl-sheet__link {
  color: inherit;
  text-decoration: none;
}
.blog-listing-page .bl-sheet__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.blog-listing-page .bl-sheet__link:focus-visible { outline: none; }
.blog-listing-page .bl-sheet:has(.bl-sheet__link:focus-visible) {
  outline: 2px solid var(--fk-teal-600);
  outline-offset: 3px;
}
.blog-listing-page .bl-sheet__tag {
  position: relative;
  z-index: 1;
  min-height: 26px;
  padding: 2px 11px;
  font-size: 12.5px;
}

.blog-listing-page .bl-sheet__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--bp-sand);
}

.blog-listing-page .bl-sheet__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px 26px 26px;
}
.blog-listing-page .bl-sheet__lede {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.blog-listing-page .bl-sheet__rest {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.blog-listing-page .bl-sheet__title {
  margin: 0;
  font-size: clamp(19px, 1.7vw, 21px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--bp-ink);
  text-wrap: balance;
  overflow-wrap: break-word;
  transition: color 150ms var(--bp-ease);
}

.blog-listing-page .bl-sheet__summary {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--bp-body);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.blog-listing-page .bl-sheet__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 8px;
  margin: auto 0 0;
  padding-top: 18px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--bp-muted);
  font-variant-numeric: tabular-nums;
}
.blog-listing-page .bl-sheet__facts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
}
/* Dots sit only between facts, so a wrapped line never starts with one. */
.blog-listing-page .bl-sheet__facts > * + *::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--bp-muted);
  vertical-align: middle;
}
.blog-listing-page .bl-sheet__authors { color: var(--bp-body); font-weight: 500; }

/* The lead sheet: the newest post, laid on top. */
.blog-listing-page .bl-sheet--lead { border-radius: 20px; }
.blog-listing-page .bl-sheet--lead .bl-sheet__img { aspect-ratio: 16 / 9; }
.blog-listing-page .bl-sheet--lead .bl-sheet__text { padding: clamp(24px, 4.5vw, 56px); }
.blog-listing-page .bl-sheet--lead .bl-sheet__title {
  margin-top: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.blog-listing-page .bl-sheet--lead .bl-sheet__summary {
  display: block;
  max-width: 34em;
  margin-top: 16px;
  font-size: clamp(16px, 1.4vw, 17.5px);
  -webkit-line-clamp: unset;
  line-clamp: none;
}
.blog-listing-page .bl-sheet--lead .bl-sheet__meta {
  padding-top: 24px;
  font-size: 14.5px;
}

/* ── Grid of smaller sheets ────────────────────────────────── */

.blog-listing-page .bl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  list-style: none;
  align-items: start;
  margin: 20px 0 0;
  padding: 0;
}
.blog-listing-page .bl-grid li { display: flex; margin: 0; }
.blog-listing-page .bl-next + .bl-grid { margin-top: 0; }

/* ── Next step band ────────────────────────────────────────── */

.blog-listing-page .bl-next {
  margin-block: clamp(40px, 5vw, 64px);
  padding: clamp(28px, 4.5vw, 56px) clamp(22px, 5vw, 64px);
  background: var(--bp-sand);
  border: 1px solid var(--bp-hair);
  border-radius: 20px;
}

/* ── Empty blog, and the /all index ────────────────────────── */

.blog-listing-page .bl-empty {
  margin-top: 20px;
  padding: clamp(32px, 5vw, 64px);
  background: var(--bp-paper);
  border: 1px solid var(--bp-hair);
  border-radius: 20px;
}
.blog-listing-page .bl-empty__title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--bp-ink);
  text-wrap: balance;
}
.blog-listing-page .bl-empty__body {
  max-width: 32em;
  margin: 10px 0 0;
  font-size: 16.5px;
  line-height: 1.6;
}

.blog-listing-page .bl-index { margin-top: clamp(32px, 4vw, 48px); }
.blog-listing-page .bl-index__title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bp-ink);
}
.blog-listing-page .bl-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.blog-listing-page .bl-index__list li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 4px 24px;
  align-items: baseline;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--bp-hair);
}
.blog-listing-page .bl-index__list time {
  font-size: 14px;
  color: var(--bp-muted);
  font-variant-numeric: tabular-nums;
}
.blog-listing-page .bl-index__list a {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--bp-ink);
  text-decoration: none;
}
.blog-listing-page .bl-index__list a:hover {
  color: var(--fk-teal-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Paging ────────────────────────────────────────────────── */

.blog-listing-page .bl-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  margin-top: clamp(40px, 5vw, 64px);
}
.blog-listing-page .bl-pages__list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.blog-listing-page .bl-pages__list li { margin: 0; }
.blog-listing-page .bl-pages__num,
.blog-listing-page .bl-pages__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--bp-body);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms var(--bp-ease), color 150ms var(--bp-ease), background-color 150ms var(--bp-ease);
}
.blog-listing-page .bl-pages__num {
  border-color: var(--bp-hair);
  background: var(--bp-paper);
}
.blog-listing-page .bl-pages__step {
  gap: 6px;
  padding: 0 18px;
  border-color: var(--bp-hair);
  background: var(--bp-paper);
  font-size: 14.5px;
}
@media (hover: hover) {
  .blog-listing-page a.bl-pages__num:hover,
  .blog-listing-page .bl-pages__step:hover {
    border-color: var(--fk-teal-600);
    color: var(--fk-teal-700);
  }
}
.blog-listing-page .bl-pages__num[aria-current] {
  border-color: var(--fk-teal-600);
  background: var(--fk-teal-50);
  color: var(--fk-teal-700);
}
.blog-listing-page .bl-pages__gap {
  min-width: 20px;
  text-align: center;
  color: var(--bp-muted);
}

/* ── Responsive ────────────────────────────────────────────── */

@media (min-width: 600px) {
  .blog-listing-page .bl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .blog-listing-page .bl-top {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "head note" "topics topics" "lead lead";
    column-gap: clamp(40px, 6vw, 88px);
    align-items: start;
  }
  .blog-listing-page .bl-note { margin-top: 26px; }

  .blog-listing-page .bl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Lead with an image: image and text side by side. */
  .blog-listing-page .bl-sheet--lead.bl-sheet--img {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  }
  .blog-listing-page .bl-sheet--lead.bl-sheet--img .bl-sheet__img {
    height: 100%;
    min-height: 360px;
    max-height: 520px;
    aspect-ratio: auto;
  }
  .blog-listing-page .bl-sheet--lead.bl-sheet--img .bl-sheet__text { justify-content: center; }
  .blog-listing-page .bl-sheet--lead.bl-sheet--img .bl-sheet__rest { flex: 0 1 auto; }

  /* Lead without an image: title on the left, summary and byline on the
     right, so the sheet reads as a spread instead of a half-empty card. */
  .blog-listing-page .bl-sheet--lead:not(.bl-sheet--img) .bl-sheet__text {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: clamp(40px, 5vw, 72px);
    align-items: end;
  }
  .blog-listing-page .bl-sheet--lead:not(.bl-sheet--img) .bl-sheet__title {
    font-size: clamp(32px, 3.8vw, 50px);
  }
  .blog-listing-page .bl-sheet--lead:not(.bl-sheet--img) .bl-sheet__summary { margin-top: 0; }
}

@media (max-width: 599px) {
  /* Topic chips scroll sideways instead of stacking into a wall. */
  .blog-listing-page .bl-topics {
    margin-inline: calc(-1 * var(--gutter));
    overflow-x: auto;
    scrollbar-width: none;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
  }
  .blog-listing-page .bl-topics::-webkit-scrollbar { display: none; }
  .blog-listing-page .bl-topics__list {
    flex-wrap: nowrap;
    width: max-content;
    padding-inline: var(--gutter);
  }
  .blog-listing-page .bl-topics__list li { scroll-snap-align: start; }
}

@media (max-width: 520px) {
  .blog-listing-page .bl-search__input { padding-right: 96px; }
  .blog-listing-page .bl-search__button { padding: 0 14px; }
  .blog-listing-page .bl-index__list li { grid-template-columns: minmax(0, 1fr); }
  .blog-listing-page .bl-pages__step { padding: 0 14px; }
}
