/* Audit Friendly blog home - hero, search, pills, Featured, Latest.
 *
 * Values come from docs/prototypes/blog-redesign/BlogIndex.dc.html. Hosted as
 * a site asset; see docs/blog-design-deployment.md for why it is not inline.
 *
 * Nothing here changes the page until enhance.js has loaded the index and
 * rendered. The new page lives under .af-blog, and the native sections are
 * hidden only under body.af-index. The one exception is html.af-pending, set
 * by a few lines in the page head so the old page does not flash up before
 * the new one replaces it - and the head clears it on a timer whether or not
 * this file or enhance.js ever arrives, so the page can never be left blank.
 */

html.af-pending .s-blog-landing-hero,
html.af-pending .s-blog-grid { visibility: hidden; }

/* Replaced, not restyled. Left in the DOM, so every post link Webflow
 * renders is still there for anything reading the raw HTML. */
.af-index .s-blog-landing-hero,
.af-index .s-blog-grid { display: none !important; }

.af-blog {
  --af-ink: #0F2137;
  --af-body: #48596E;
  --af-muted: #8697A8;
  --af-green: #0E7C52;
  --af-line: #EEF2F7;
  --af-edge: #E3E9EF;
  --af-band: #F4F7FA;
  --af-dot: #D6DFE8;
  --af-shadow: 0 1px 2px rgba(15, 33, 55, .04), 0 12px 28px -20px rgba(15, 33, 55, .28);
  --af-shadow-up: 0 2px 4px rgba(15, 33, 55, .05), 0 20px 34px -22px rgba(15, 33, 55, .34);
  --af-font: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;

  background: #FFFFFF;
  color: var(--af-ink);
  font-family: var(--af-font);
  -webkit-font-smoothing: antialiased;
}
.af-blog *,
.af-blog *::before,
.af-blog *::after { box-sizing: border-box; }

/* The site's global type styles reach in here; these reset what they touch. */
.af-blog h1, .af-blog h2, .af-blog h3, .af-blog p {
  font-family: var(--af-font);
  text-transform: none;
}

.af-blog .af-wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

/* 1 - hero */

.af-blog .af-head .af-wrap { padding-top: 56px; }
.af-blog .af-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--af-green); margin: 0 0 14px;
}
.af-blog .af-title {
  font-size: clamp(40px, 4.2vw, 58px); line-height: 1; letter-spacing: -.032em; font-weight: 800;
  color: var(--af-ink); margin: 0 0 20px; max-width: 20ch; text-wrap: pretty;
}
.af-blog .af-lede {
  font-size: 16.5px; line-height: 1.62; color: var(--af-body);
  margin: 0 0 32px; max-width: 62ch; text-wrap: pretty;
}

/* 2 - search */

.af-blog .af-search { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 22px; }
.af-blog .af-search-field { position: relative; flex: 1 1 460px; max-width: 520px; min-width: 0; }
.af-blog .af-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--af-muted); pointer-events: none;
}
.af-blog .af-search-field input {
  display: block; width: 100%; height: 48px; margin: 0; padding: 0 44px;
  border: 1px solid var(--af-edge); border-radius: 11px; background: #FFFFFF;
  color: var(--af-ink); font-family: var(--af-font); font-size: 15px; line-height: normal;
  box-shadow: 0 1px 2px rgba(15, 33, 55, .04); outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.af-blog .af-search-field input::placeholder { color: var(--af-muted); opacity: 1; }
.af-blog .af-search-field input:focus { border-color: var(--af-green); box-shadow: 0 0 0 3px rgba(14, 124, 82, .14); }
/* We draw our own clear button; the browser's would sit on top of it. */
.af-blog .af-search-field input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.af-blog .af-search-clear {
  display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--af-muted); font-family: var(--af-font);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.af-blog .af-search-clear:hover { color: var(--af-ink); background: var(--af-band); }
.af-index.af-querying .af-blog .af-search-clear { display: block; }
.af-blog .af-count { font-size: 13.5px; color: var(--af-muted); font-variant-numeric: tabular-nums; }

/* 3 - category pills */

.af-blog .af-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 0 34px;
  border-bottom: 1px solid var(--af-line);
}
.af-blog .af-pill {
  height: 30px; margin: 0; padding: 0 14px; border: 1px solid var(--af-edge); border-radius: 999px;
  background: #FFFFFF; color: var(--af-body); font-family: var(--af-font);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.af-blog .af-pill:hover { border-color: var(--af-green); color: var(--af-green); }
.af-blog .af-pill[aria-pressed="true"] { background: var(--af-ink); border-color: var(--af-ink); color: #FFFFFF; }

/* 4 - cards, shared */

.af-blog .af-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #FFFFFF; border-radius: 18px; box-shadow: var(--af-shadow);
  color: inherit; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.af-blog .af-card:hover { transform: translateY(-2px); box-shadow: var(--af-shadow-up); color: inherit; }

/* The box owns the shape and the background; the image lies over it. A post
 * with no art, or an image that fails, leaves a clean box of the right size. */
.af-blog .af-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--af-band); }
.af-blog .af-media img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  max-width: none; object-fit: cover;
}

.af-blog .af-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; min-height: 16px; }
.af-blog .af-cat {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--af-green);
}
.af-blog .af-dot { flex: none; width: 3px; height: 3px; border-radius: 50%; background: var(--af-dot); }
/* "7 min read" is one unit: wrapped, it reads as "7 min" and a stray "read". */
.af-blog .af-read { font-size: 12.5px; color: var(--af-muted); white-space: nowrap; }
.af-blog .af-date { font-size: 12.5px; color: var(--af-muted); }

/* 5 - featured: one lead, two beside it */

.af-blog .af-featured .af-wrap { padding-top: 40px; }
.af-index.af-filtering .af-blog .af-featured { display: none; }
.af-blog .af-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--af-muted); margin: 0 0 18px;
}
.af-blog .af-featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.af-blog .af-featured-side { display: flex; flex-direction: column; gap: 24px; }

.af-blog .af-lead-body { padding: 26px 28px 30px; }
.af-blog .af-lead .af-meta { margin-bottom: 12px; }
.af-blog .af-lead-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.026em; line-height: 1.18;
  color: var(--af-ink); margin: 0 0 14px; text-wrap: pretty;
}
.af-blog .af-lead-summary {
  font-size: 14.5px; line-height: 1.6; color: var(--af-body); margin: 0 0 18px; text-wrap: pretty;
}

.af-blog .af-side { display: grid; grid-template-columns: 172px minmax(0, 1fr); }
/* The row's height comes from the text; the image fills whatever that is. */
.af-blog .af-side-media { aspect-ratio: auto; min-height: 100%; }
.af-blog .af-side-media img { object-position: left center; }
.af-blog .af-side-body { padding: 22px 24px; }
.af-blog .af-side .af-meta { margin-bottom: 10px; }
.af-blog .af-side-title {
  font-size: 17px; font-weight: 700; letter-spacing: -.016em; line-height: 1.32;
  color: var(--af-ink); margin: 0 0 10px; text-wrap: pretty;
}

/* 6 - latest / results */

.af-blog .af-band { margin-top: 56px; background: var(--af-band); }
.af-blog .af-band .af-wrap { padding-top: 52px; padding-bottom: 68px; }
.af-blog .af-band-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin: 0 0 26px;
}
.af-blog .af-band-title {
  font-size: 34px; line-height: 1.08; letter-spacing: -.028em; font-weight: 800;
  color: var(--af-ink); margin: 0;
}
.af-blog .af-band-count { font-size: 13.5px; color: var(--af-muted); font-variant-numeric: tabular-nums; }

.af-blog .af-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.af-blog .af-tile-body { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; padding: 20px 22px 24px; }
.af-blog .af-tile-title {
  font-size: 17px; font-weight: 700; letter-spacing: -.016em; line-height: 1.32;
  color: var(--af-ink); margin: 0; text-wrap: pretty;
}
.af-blog .af-tile .af-date { margin-top: auto; }

.af-blog .af-empty {
  display: none; padding: 56px 40px; text-align: center;
  background: #FFFFFF; border-radius: 18px; box-shadow: var(--af-shadow);
}
.af-index.af-empty-state .af-blog .af-empty { display: block; }
.af-index.af-empty-state .af-blog .af-grid { display: none; }
.af-blog .af-empty-title { font-size: 19px; font-weight: 700; letter-spacing: -.016em; color: var(--af-ink); margin: 0 0 8px; }
.af-blog .af-empty-text { font-size: 14.5px; color: var(--af-body); margin: 0 0 20px; }
.af-blog .af-empty-reset {
  height: 38px; margin: 0; padding: 0 20px; border: 1px solid var(--af-ink); border-radius: 999px;
  background: var(--af-ink); color: #FFFFFF; font-family: var(--af-font);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}

.af-blog .af-more { display: flex; justify-content: center; margin-top: 44px; }
.af-blog .af-more[hidden] { display: none; }
.af-blog .af-more-btn {
  height: 46px; margin: 0; padding: 0 28px; border: 1px solid var(--af-dot); border-radius: 999px;
  background: #FFFFFF; color: var(--af-ink); font-family: var(--af-font);
  font-size: 14.5px; font-weight: 600; cursor: pointer; transition: border-color .15s;
}
.af-blog .af-more-btn:hover { border-color: var(--af-ink); }

/* 7 - focus: visible for keyboard, never for a mouse click */

.af-blog .af-card:focus-visible,
.af-blog .af-pill:focus-visible,
.af-blog .af-more-btn:focus-visible,
.af-blog .af-empty-reset:focus-visible,
.af-blog .af-search-clear:focus-visible { outline: 2px solid var(--af-green); outline-offset: 3px; }

/* 8 - smaller screens */

@media (max-width: 1000px) {
  .af-blog .af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .af-blog .af-featured-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .af-blog .af-wrap { padding-left: 20px; padding-right: 20px; }
  .af-blog .af-head .af-wrap { padding-top: 36px; }
  .af-blog .af-title { font-size: 36px; }
  .af-blog .af-lede { font-size: 15.5px; margin-bottom: 26px; }
  .af-blog .af-search-field { flex-basis: 100%; max-width: none; }
  .af-blog .af-pills { padding-bottom: 26px; }
  .af-blog .af-featured .af-wrap { padding-top: 30px; }
  .af-blog .af-lead-body { padding: 20px 22px 24px; }
  .af-blog .af-lead-title { font-size: 22px; }
  /* Side by side, a phone leaves the text about 240px, and category and read
   * time break apart. Stacked, they read like every other card on the page. */
  .af-blog .af-side { display: flex; flex-direction: column; }
  .af-blog .af-side-media { aspect-ratio: 16 / 9; min-height: 0; }
  .af-blog .af-side-media img { object-position: center; }
  .af-blog .af-side-body { padding: 20px 22px 24px; }
  .af-blog .af-band { margin-top: 40px; }
  .af-blog .af-band .af-wrap { padding-top: 36px; padding-bottom: 48px; }
  .af-blog .af-band-title { font-size: 28px; }
  .af-blog .af-grid { grid-template-columns: minmax(0, 1fr); }
  .af-blog .af-empty { padding: 40px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .af-blog *, .af-blog *::before, .af-blog *::after { transition: none !important; }
  .af-blog .af-card:hover { transform: none; }
}
