/*
 * Blog index and post pages. Loads on top of services.css, which supplies the
 * shell, design tokens, header, footer, buttons and section heads.
 *
 * Replaces the old stylesheet, which existed only to undo Kadence's archive
 * grid. The pages are standalone now, so there is nothing left to undo.
 */

/* ---- index ---- */

.bl-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: 64px 40px 44px;
}
.bl-intro-copy { max-width: 46rem; }
.bl-intro-lead {
  margin: 18px 0 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Subject tags, so the header is not a wall of empty space beside the title. */
.bl-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bl-topics li {
  padding: 7px 14px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bl-topics-count {
  border-color: rgba(var(--accent-rgb), 0.55) !important;
  color: var(--accent-text) !important;
}

/* ---- lead post ---- */

.bl-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/*
 * No crop. This artwork carries its own headline inside the image, so any
 * crop cuts the words off -- the same mistake that took the heads off the
 * service cards. Full image, natural ratio, centred in its panel.
 */
.bl-lead-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--bg-image);
}
.bl-lead-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30rem;
  object-fit: contain;
}

.bl-lead-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  padding: 44px 40px 46px;
  background: var(--bg);
}
.bl-lead-badge {
  margin: 0;
  align-self: flex-start;
  padding: 5px 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.bl-lead-title {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.bl-lead-title a { color: var(--ink); }
.bl-lead-title a:hover { color: var(--accent-text); }
.bl-lead-excerpt {
  margin: 0;
  max-width: 46ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ---- archive grid ---- */

.bl-rest { padding-top: 56px; }
.bl-rest .sv-head { padding-left: 40px; padding-right: 40px; }

.bl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.bl-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: background .15s;
}
.bl-card:hover { background: var(--bg-hover); }

/*
 * Uncropped here too. A capped-height well would trim whichever edge the
 * artwork happens to need, and these images are not all the same shape.
 */
.bl-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-image);
}
.bl-card-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 15rem;
  object-fit: contain;
  transition: transform .3s ease;
}
.bl-card:hover .bl-card-media img { transform: scale(1.02); }

.bl-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 24px 26px;
  flex: 1;
}

.bl-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bl-topic { color: var(--accent-text); }

.bl-card-title {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.bl-card-title a { color: var(--ink); }
.bl-card:hover .bl-card-title a { color: var(--accent-text); }

.bl-card-excerpt {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.bl-card-more {
  margin: auto 0 0;
  padding-top: 6px;
}
.bl-card-more a {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.bl-card-more a:hover { text-decoration: underline; }

/* ---- post ---- */

/*
 * One reading column, centred, shared by every block down the page. The
 * article used to sit hard against the left edge with a wide empty band
 * beside it, which on a 2000px monitor is a long way for the eye to travel
 * back on each line.
 *
 * --read is the measure itself; the padding is added on top, so the text is
 * the same width whatever the viewport.
 *
 * 40rem puts the body at about 68 characters per line. Typographic convention
 * puts comfortable reading at 60-75; at 44rem it measured 76, just past it.
 */
.bl-post {
  --read: 40rem;
  padding-bottom: 24px;
}
.bl-post > * {
  box-sizing: content-box;
  max-width: var(--read);
  margin-inline: auto;
  padding-inline: 40px;
}

.bl-crumb {
  padding-top: 28px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bl-crumb a { color: var(--text-muted); }
.bl-crumb a:hover { color: var(--accent-text); }

.bl-post-head { padding-top: 34px; }
.bl-post-title { max-width: 20ch; }

.bl-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.bl-post-standfirst {
  margin: 20px 0 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-soft);
  border-left: 3px solid var(--accent);
  padding-left: 18px;
}

/*
 * Uncropped, like the cards -- the headline is part of the artwork. The image
 * runs a little wider than the text column so it reads as a lead illustration
 * rather than an inline figure, but it is still centred on the same axis.
 */
.bl-post-media {
  display: flex;
  justify-content: center;
  max-width: 54rem;
  margin: 40px auto 0;
  padding: 28px 40px;
  background: var(--bg-image);
}
.bl-post-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/*
 * The article body carries no classes — it is plain p/h2/ul/strong straight
 * from the content file — so everything here is an element selector. That is
 * deliberate: adding a post should not mean adding markup.
 */
.bl-body {
  padding-top: 48px;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-soft);
}
.bl-body > p { margin: 0 0 1.35rem; }
.bl-body > p:first-child {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}
.bl-body h2 {
  margin: 2.6rem 0 1rem;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.bl-body h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-bottom: 14px;
  background: var(--accent);
}
.bl-body ul {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.bl-body li {
  background: var(--bg-raised);
  padding: 14px 18px;
  font-size: 1rem;
  line-height: 1.55;
}
.bl-body strong { color: var(--ink); font-weight: 600; }
.bl-body a { color: var(--accent-text); text-decoration: underline; }

.bl-post-cta {
  margin-top: 52px;
  padding: 30px 32px 32px;
  background: var(--bg-raised);
  border-top: 2px solid var(--accent);
}
.bl-post-cta-title {
  margin: 8px 0 20px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.05;
  text-transform: uppercase;
}

/* Wider than the reading column -- a card grid needs the room. */
.bl-more {
  max-width: 74rem !important;
  padding-top: 56px;
}
.bl-more .bl-list { margin-top: 24px; }

/* ---- comments ---- */

.bl-comments { padding-top: 56px; }
.bl-comments-note {
  margin: 14px 0 26px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.bl-comment-form {
  padding: 26px 26px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
}
.bl-comment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0 20px;
}

.bl-field { margin: 0 0 18px; }
.bl-field label {
  display: block;
  margin: 0 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.bl-req { color: var(--accent-text); }
.bl-hint-inline {
  font-family: Barlow, sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}
.bl-field input,
.bl-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  border-radius: 0;
  background: var(--bg-input);
  color: var(--ink);
  font: inherit;
}
.bl-field input:focus,
.bl-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.bl-field textarea { resize: vertical; min-height: 8rem; }
.bl-actions { margin: 4px 0 0; }

@media (max-width: 980px) {
  .bl-lead { grid-template-columns: 1fr; }
  .bl-lead-media { padding: 20px; }
  .bl-lead-media img { max-height: 22rem; }
  .bl-lead-body { padding: 30px 20px 34px; }
}

@media (max-width: 900px) {
  .bl-intro {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 26px;
    padding: 44px 20px 32px;
  }
  .bl-topics { justify-content: flex-start; }
  .bl-rest { padding-top: 40px; }
  .bl-rest .sv-head { padding-left: 20px; padding-right: 20px; }
  .bl-post > * { padding-inline: 20px; }
  .bl-crumb { padding-top: 22px; }
  .bl-post-head { padding-top: 26px; }
  .bl-body { padding-top: 36px; }
  .bl-post-cta { margin-top: 40px; padding: 24px 22px 26px; }
  .bl-comments { padding-top: 44px; }
  .bl-post-media { padding: 20px; }
}
