/* ==========================================================================
   Blog post list - CrickHunt

   The list companion to the post page: the same dark hero the post page opens
   with, then the posts as lifted cards - the newest one leading at full width,
   the rest in a two-up grid. Scoped to .html-blog-page so nothing here reaches
   the post page, which keeps its own blog-detail.css.

   Pairs with blog-list.responsive.css.
   ========================================================================== */

.html-blog-page {
  /* surfaces */
  --bl-paper: #f6f8f7;
  --bl-card: #ffffff;
  --bl-line: #e4e8e6;
  --bl-line-strong: #d3dad6;
  /* ink */
  --bl-ink: #0c1711;
  --bl-body: #3c4742;
  --bl-muted: #5a6660;
  --bl-faint: #7d8a84;
  /* the accent is black: links, chips, the lit card edge and the pager all use it */
  --bl-green: #0c1711;
  --bl-green-ink: #0c1711;
  --bl-green-deep: #000000;
  --bl-green-tint: #eef1ef;
  /* the one dark surface - the hero */
  --bl-dark: #060d1f;
  /* cards are lifted, never outlined hard */
  --bl-shadow: 0 1px 3px rgba(16, 34, 25, .06);
  --bl-shadow-lift: 0 1px 3px rgba(16, 34, 25, .06), 0 14px 34px -22px rgba(16, 34, 25, .3);
  --bl-shadow-hover: 0 2px 8px rgba(16, 34, 25, .08), 0 22px 44px -22px rgba(16, 34, 25, .42);
  --bl-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bl-radius: 16px;
}

/* ---- hero ---------------------------------------------------------------- */
.html-blog-page .ch-bl-hero-wrap {
  margin-bottom: 34px;
}

.html-blog-page .ch-bl-hero {
  position: relative;
  overflow: hidden;
  padding: 62px 32px 56px;
  background: var(--bl-dark);
  background-image:
    radial-gradient(ellipse at 72% 46%, rgba(255, 255, 255, .08) 0%, transparent 58%),
    radial-gradient(ellipse at 18% 110%, rgba(35, 107, 213, .18) 0%, transparent 55%);
  text-align: center;
}

/* a faint pitch-line ruling across the hero, so the dark block is not flat */
.html-blog-page .ch-bl-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 100% 42px;
}

.html-blog-page .ch-bl-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.html-blog-page .ch-bl-hero-eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 15px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-family: var(--bl-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #ffffff;
}

.html-blog-page .ch-bl-hero-title {
  margin: 0 0 16px;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.02em;
  color: #fff;
  overflow-wrap: break-word;
}

.html-blog-page .ch-bl-hero-sub {
  max-width: 620px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .76);
}

.html-blog-page .ch-bl-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
}

.html-blog-page .ch-bl-hero-count {
  font-family: var(--bl-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

.html-blog-page .ch-bl-hero-rss {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.html-blog-page .ch-bl-hero-rss:hover,
.html-blog-page .ch-bl-hero-rss:focus {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
  text-decoration: none;
}

.html-blog-page .ch-bl-hero-rss svg {
  flex: none;
  color: currentColor;
}

/* the old centred page title is replaced by the hero */
.html-blog-page .blog-title {
  display: none;
}

/* ---- the grid ------------------------------------------------------------ */
.html-blog-page .ch-bl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ---- a card -------------------------------------------------------------- */
.html-blog-page .ch-bl-card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--bl-line);
  border-radius: var(--bl-radius);
  background: var(--bl-card);
  box-shadow: var(--bl-shadow-lift);
  text-align: left;
  font-size: inherit;
  font-weight: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* the green edge that lights up with the card */
.html-blog-page .ch-bl-card::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--bl-green);
  opacity: 0;
  transition: opacity .18s ease;
}

.html-blog-page .ch-bl-card:hover,
.html-blog-page .ch-bl-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--bl-line-strong);
  box-shadow: var(--bl-shadow-hover);
}

.html-blog-page .ch-bl-card:hover::before,
.html-blog-page .ch-bl-card:focus-within::before {
  opacity: 1;
}

.html-blog-page .ch-bl-card-in {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 20px;
}

/* the lead post takes the full width and is set larger */
.html-blog-page .ch-bl-card--lead {
  grid-column: 1 / -1;
}

.html-blog-page .ch-bl-card--lead .ch-bl-card-in {
  padding: 32px 34px 28px;
}

.html-blog-page .ch-bl-card--lead .ch-bl-card-title {
  font-size: 30px;
}

.html-blog-page .ch-bl-card--lead .ch-bl-card-excerpt {
  font-size: 16.5px;
  -webkit-line-clamp: 3;
}

/* meta row */
.html-blog-page .ch-bl-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 12px;
}

.html-blog-page .ch-bl-card-date,
.html-blog-page .ch-bl-card-read {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bl-faint);
  text-align: left;
}

.html-blog-page .ch-bl-card-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--bl-line-strong);
}

/* title */
.html-blog-page .ch-bl-card-title {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.01em;
}

.html-blog-page .ch-bl-card-title a {
  color: var(--bl-ink);
  text-decoration: none;
  transition: color .16s ease;
}

.html-blog-page .ch-bl-card-title a:hover,
.html-blog-page .ch-bl-card-title a:focus {
  color: var(--bl-green-ink);
  text-decoration: none;
}

/* the title link covers the card, so the whole card is clickable. The tag links and
   the read link sit above it, so they keep their own destinations. */
.html-blog-page .ch-bl-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--bl-radius);
}

/* excerpt - clamped so uneven overviews still line the cards up */
.html-blog-page .ch-bl-card-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 18px;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--bl-muted);
}

.html-blog-page .ch-bl-card-excerpt > *:first-child {
  margin-top: 0;
}

.html-blog-page .ch-bl-card-excerpt p,
.html-blog-page .ch-bl-card-excerpt ul,
.html-blog-page .ch-bl-card-excerpt ol,
.html-blog-page .ch-bl-card-excerpt h1,
.html-blog-page .ch-bl-card-excerpt h2,
.html-blog-page .ch-bl-card-excerpt h3,
.html-blog-page .ch-bl-card-excerpt h4 {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.html-blog-page .ch-bl-card-excerpt img,
.html-blog-page .ch-bl-card-excerpt table,
.html-blog-page .ch-bl-card-excerpt iframe {
  display: none;
}

/* foot: tags on the left, the read link on the right */
.html-blog-page .ch-bl-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--bl-line);
}

.html-blog-page .ch-bl-card-tags {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.html-blog-page .ch-bl-card-tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.html-blog-page .ch-bl-card-tags li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.html-blog-page .ch-bl-card-tags a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bl-green-tint);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--bl-green-deep);
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}

.html-blog-page .ch-bl-card-tags a:hover,
.html-blog-page .ch-bl-card-tags a:focus {
  background: var(--bl-green);
  color: #ffffff;
  text-decoration: none;
}

.html-blog-page .ch-bl-card-cta {
  position: relative;
  z-index: 1;
  margin-left: auto;
}

.html-blog-page .ch-bl-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font-size: 14.5px;
  font-weight: 700;
  /* the label comes from the Blog.MoreInfo resource, which is lower case - the card wants it
     to read as a heading-height link, so it is capitalised here rather than in the resource */
  text-transform: capitalize;
  color: var(--bl-green-ink);
  text-decoration: none;
  transition: color .16s ease, gap .16s ease;
}

.html-blog-page .ch-bl-more:hover,
.html-blog-page .ch-bl-more:focus {
  gap: 11px;
  color: var(--bl-green-deep);
  text-decoration: none;
  background: none;
}

.html-blog-page .ch-bl-more svg {
  flex: none;
}

/* ---- empty state --------------------------------------------------------- */
.html-blog-page .ch-bl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  border: 1px dashed var(--bl-line-strong);
  border-radius: var(--bl-radius);
  background: var(--bl-card);
  text-align: center;
  color: var(--bl-muted);
}

.html-blog-page .ch-bl-empty-mark {
  color: var(--bl-green);
}

.html-blog-page .ch-bl-empty p {
  margin: 0;
  font-size: 16px;
}

/* ---- pager --------------------------------------------------------------- */
.html-blog-page .ch-bl-pager {
  margin-top: 26px;
}

.html-blog-page .ch-bl-pager ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.html-blog-page .ch-bl-pager li {
  margin: 0;
  list-style: none;
}

.html-blog-page .ch-bl-pager li a,
.html-blog-page .ch-bl-pager li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--bl-line);
  border-radius: 10px;
  background: var(--bl-card);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--bl-ink);
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.html-blog-page .ch-bl-pager li a:hover,
.html-blog-page .ch-bl-pager li a:focus {
  border-color: var(--bl-green);
  background: var(--bl-green-tint);
  color: var(--bl-green-deep);
  text-decoration: none;
}

.html-blog-page .ch-bl-pager li.current-page span {
  border-color: var(--bl-green-ink);
  background: var(--bl-green-ink);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .html-blog-page .ch-bl-card,
  .html-blog-page .ch-bl-more,
  .html-blog-page .ch-bl-card::before {
    transition: none;
  }

  .html-blog-page .ch-bl-card:hover,
  .html-blog-page .ch-bl-card:focus-within {
    transform: none;
  }
}
