/* ==========================================================================
   Blog — index, archives, search.

   Structure is the Kissflow blog's (kissflow.com/blog, measured 2026-09-11):
   centred title band → spotlight post beside a side tile and a subscribe box
   → "All blogs" three-up grid with a promo tile in the fourth slot → View more
   → Meet the authors. Everything visual is this theme's: the contact page's
   pattern band, the 1264 measure and 32px gutters of section 05, hairlines in
   --gw-line, images on an 8px radius, Cal Sans / Space Grotesk / Inter on the
   ramp in tokens.css. Kissflow's cards are borderless with a bordered image;
   that is kept — the image carries the hairline, the card does not.
   ========================================================================== */

.gw-blog {
  position: relative;
  padding-block: 88px 120px;
  background: var(--gw-white);
  overflow: clip;
}

/* the hero's pattern, cropped to the top and faded out under the lead row —
   identical to .gw-contact__bg */
.gw-blog__bg {
  position: absolute;
  inset: -72px 0 auto;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 100%);
}
.gw-blog__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.7;
  filter: invert(1) brightness(2.2) invert(1);   /* same lift as the hero */
}

/* ---- band: centred title + lede -------------------------------------- */
.gw-blog__head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gw-blog__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 52px;
  text-wrap: balance;
  /* the gradient is clipped to the text box, so the descenders need the room */
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.gw-blog__lede {
  margin-top: 20px;
  max-width: 34em;
  font-size: 18px;
  line-height: 28px;
  color: var(--gw-ink);
  text-wrap: pretty;
}
.gw-blog__count {
  margin-top: 16px;
  font-size: var(--gw-t-meta);
  line-height: var(--gw-lh-meta);
  color: var(--gw-gray-500);
  font-variant-numeric: tabular-nums;
}

/* Section titles on the blog ("All articles", "Meet the authors", "Related
   articles") are Cal Sans, like the 05 title, not the Space Grotesk primitive
   the homepage sections use. */
.gw-blog .gw-section-title,
.gw-post .gw-section-title {
  font-family: var(--gw-font-display);
  font-weight: 400;
}

/* ---- the 1264 measure --------------------------------------------------- */
.gw-blog__wrap {
  position: relative;
  z-index: 1;
  width: 1264px;
  max-width: calc(100% - var(--gw-gutter) * 2);
  margin-inline: auto;
}

/* ---- shared: label row, byline, image slot, fallback tile --------------- */
.gw-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  line-height: 16.8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gw-gray-500);
  font-variant-numeric: tabular-nums;
}
.gw-meta__cat { color: var(--gw-violet); }
.gw-meta__dot { color: var(--gw-line); }

.gw-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
  font-variant-numeric: tabular-nums;
}
.gw-byline__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gw-gray-100);
}
.gw-byline__name { font-weight: 500; color: var(--gw-black); }
.gw-byline__rule { width: 1px; height: 14px; background: var(--gw-line); }

/* every image slot is the same object: 16:9, hairline, 8px radius, clipped */
.gw-card__media,
.gw-spot__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--gw-r-card);
  background: var(--gw-gray-100);
  overflow: hidden;
  isolation: isolate;
}
.gw-card__media img,
.gw-spot__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--gw-dur-slow) var(--gw-ease);
}
/* The hairline is drawn OVER the image, on its own layer: a border would eat
   into the box and an inset shadow paints under child content, so either way
   the art would cover it. As a pseudo-element on top it stays crisp over dark
   art and never changes the frame's size — the section 06 reasoning, one step
   further. */
.gw-card__media::after,
.gw-spot__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--gw-line);
  pointer-events: none;
}

/* No featured image: the label gradient with the hero pattern screened through
   it and the CTA flag in the corner. Same slot, same radius — a deliberate
   tile, not a hole. */
.gw-tile { background: var(--gw-grad-label); }
.gw-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--tile-pattern) center / cover;
  opacity: 0.32;
  mix-blend-mode: screen;
  /* the asset is dark strokes on white; invert makes the strokes the light
     part, and brightness lifts them far enough to survive the screen blend */
  filter: invert(1) brightness(6);
}
.gw-tile__flag {
  position: absolute;
  right: 6%;
  bottom: -10%;
  width: 30%;
  height: auto;
  color: var(--gw-white);
  opacity: 0.26;
}
/* the tile's flag is a static mark, not the button's furling cloth */
.gw-tile .gw-flag__cloth { transform: none; }

/* ---- lead row: spotlight + aside --------------------------------------- */
.gw-blog__lead {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  column-gap: 32px;
  align-items: start;
}

.gw-spot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gw-spot__frame { position: relative; }
.gw-spot__badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--gw-line);
  background: var(--gw-white);
  font-family: var(--gw-font-display);
  font-size: var(--gw-t-btn-sm);
  line-height: var(--gw-lh-btn-sm);
  color: var(--gw-black);
  pointer-events: none;
}
.gw-spot__badge-icon { width: 14px; height: 16px; color: var(--gw-violet); }
.gw-spot .gw-meta { margin-top: 8px; }
.gw-spot__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 41.6px;
  color: var(--gw-black);
  text-wrap: balance;
  transition: color var(--gw-dur) var(--gw-ease);
}
.gw-spot__excerpt {
  max-width: 64ch;
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
  color: var(--gw-gray-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gw-spot .gw-byline { margin-top: 4px; }

.gw-blog__aside {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.gw-blog__side { list-style: none; }

/* ---- the card ------------------------------------------------------------ */
.gw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gw-card__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  color: var(--gw-black);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--gw-dur) var(--gw-ease);
}
/* the title's link covers the whole card — one link per card */
.gw-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.gw-card__excerpt {
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gw-card .gw-byline { margin-top: 4px; }
.gw-card__excerpt + .gw-byline { margin-top: 4px; }

/* hover: the image eases in, the title takes the violet */
.gw-card:hover .gw-card__media img,
.gw-card:focus-within .gw-card__media img,
.gw-spot:hover .gw-spot__media img,
.gw-spot:focus-within .gw-spot__media img { transform: scale(1.03); }
.gw-card:hover .gw-card__title,
.gw-card:focus-within .gw-card__title,
.gw-spot:hover .gw-spot__title,
.gw-spot:focus-within .gw-spot__title { color: var(--gw-violet); }

/* ---- subscribe -------------------------------------------------------- */
.gw-news {
  padding: 28px;
  border: 1px solid var(--gw-violet-200);
  border-radius: var(--gw-r-card);
  background: var(--gw-violet-50);
}
.gw-news__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 36px;
  text-wrap: balance;
}
.gw-news__copy {
  margin-top: 10px;
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
  color: var(--gw-ink);
}
.gw-news__form { margin-top: 20px; min-height: 96px; }
.gw-news__form iframe { display: block; width: 100%; border: 0; }
.gw-news__cta,
.gw-promo__cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--gw-black);
  color: var(--gw-white);
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: var(--gw-t-btn-sm);
  line-height: var(--gw-lh-btn-sm);
  transition: background var(--gw-dur-fast) var(--gw-ease);
}
.gw-news__cta:hover,
.gw-promo__cta:hover { background: #1a1a1a; }
.gw-news__cta-icon,
.gw-promo__cta-icon { width: 1.1875rem; height: 1.375rem; flex: none; }
.gw-news__note {
  margin-top: 14px;
  font-size: var(--gw-t-meta);
  line-height: var(--gw-lh-meta);
  color: var(--gw-gray-500);
}
.gw-news__note a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- grid --------------------------------------------------------------- */
.gw-blog__section-title {
  margin-top: 96px;
}
.gw-blog__grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 48px;
  /* rows stretch and the byline sits on the bottom edge, so a two-line title
     and a three-line title in the same row still close on the same line */
  align-items: stretch;
  list-style: none;
}
.gw-blog--archive .gw-blog__grid { margin-top: 64px; }
.gw-blog__grid .gw-card .gw-byline { margin-top: auto; padding-top: 4px; }
.gw-blog__empty {
  margin-top: 64px;
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
  color: var(--gw-gray-700);
}

/* promo tile — one grid slot, the aside's wash with the nav's button */
.gw-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 24px 0;
  border: 1px solid var(--gw-violet-200);
  border-radius: var(--gw-r-card);
  background: var(--gw-violet-50);
  overflow: hidden;
  align-self: stretch;
}
.gw-promo__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  color: var(--gw-black);
  text-wrap: balance;
}
.gw-promo__copy {
  margin-top: 10px;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-700);
}
.gw-promo__img {
  margin-top: auto;
  padding-top: 20px;
  width: 62%;
  height: auto;
  /* sits on the tile's bottom edge, cropped a little, like the Kissflow card */
  margin-bottom: -6%;
}

/* view more / newer — the section 05 pill */
.gw-blog__pager {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gw-blog__back { margin-top: 56px; display: flex; justify-content: center; }
.gw-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border: 1px solid var(--gw-line);
  background: var(--gw-white);
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: var(--gw-t-btn-sm);
  line-height: var(--gw-lh-btn-sm);
  color: var(--gw-black);
  transition: border-color var(--gw-dur-fast) var(--gw-ease), color var(--gw-dur-fast) var(--gw-ease);
}
.gw-pill:hover { border-color: var(--gw-black); }
.gw-pill__chev {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.gw-blog__more.is-busy { color: var(--gw-gray-500); pointer-events: none; }

/* ---- authors ------------------------------------------------------------ */
.gw-authors { margin-top: 112px; text-align: center; }
.gw-authors__lede {
  margin-top: 8px;
  font-size: 18px;
  line-height: 28px;
  color: var(--gw-gray-700);
}
.gw-authors__grid {
  margin-top: 40px;
  display: grid;
  /* auto-fit, so two authors sit centred as two cards rather than in the first
     two of three tracks; the 1264 measure caps it at three across */
  grid-template-columns: repeat(auto-fit, minmax(0, 400px));
  justify-content: center;
  gap: 32px;
  list-style: none;
  text-align: left;
}
.gw-author__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-card);
  background: var(--gw-white);
  transition: border-color var(--gw-dur-fast) var(--gw-ease);
}
.gw-author__link:hover { border-color: var(--gw-black); }
.gw-author__avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gw-gray-100);
}
.gw-author__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gw-author__name {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  color: var(--gw-black);
}
.gw-author__sub {
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- back to top -------------------------------------------------------
   Bottom right on the blog and on posts. The nav CTA's black on white, round
   like the footer's social buttons; hidden until the reader is a viewport
   down, shown by main.js. */
.gw-totop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;                      /* under the bar (50), over everything else */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gw-black);
  color: var(--gw-white);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px rgb(17 24 39 / 0.16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--gw-dur) var(--gw-ease), transform var(--gw-dur) var(--gw-ease), background var(--gw-dur-fast) var(--gw-ease);
}
.gw-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.gw-totop:hover { background: #1a1a1a; }
.gw-totop svg { width: 22px; height: 22px; transform: rotate(180deg); }

/* ---- responsive (section 05's breaks) ---------------------------------- */
@media (max-width: 1023px) {
  .gw-blog { padding-block: 64px 88px; }
  .gw-blog__title { font-size: 38px; line-height: 42px; }
  .gw-blog__lead { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  /* the side tile and the subscribe box share a row once the spotlight is
     full width */
  .gw-blog__aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
  .gw-spot__title { font-size: 28px; line-height: 36px; }
  .gw-blog__section-title { margin-top: 72px; }
  .gw-blog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gw-authors__grid { grid-template-columns: repeat(auto-fit, minmax(0, calc(50% - 16px))); }
  .gw-authors { margin-top: 88px; }
}

@media (max-width: 720px) {
  .gw-blog { padding-block: 48px 64px; }
  .gw-blog__title { font-size: 30px; line-height: 34px; }
  .gw-blog__lede { font-size: 16px; line-height: 25px; }
  .gw-blog__lead { margin-top: 40px; }
  .gw-blog__aside { grid-template-columns: minmax(0, 1fr); }
  .gw-spot__title { font-size: 24px; line-height: 31.2px; }
  .gw-spot__badge { top: 12px; left: 12px; padding: 4px 10px; }
  .gw-blog__section-title { margin-top: 56px; }
  .gw-blog__grid,
  .gw-authors__grid { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .gw-authors__grid { row-gap: 16px; }
  .gw-news { padding: 24px; }
  .gw-news__title { font-size: 24px; line-height: 31.2px; }
  .gw-authors { margin-top: 64px; }
  .gw-totop { right: 16px; bottom: 16px; }
}
