/* Blog styles.
   Loaded after styles.css and built entirely on its tokens (--ink, --muted,
   --grad, --glass, --edge, --lift, --radius, --display, --body, --mono) so the
   blog cannot drift away from the rest of the site when the palette changes. */

/* ---------- index ---------- */

.bhero h1 { max-width: 14ch; }

.bgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
  margin-top: clamp(22px, 3vw, 34px);
}

.bcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .38s cubic-bezier(.2, .7, .3, 1), box-shadow .38s;
}

.bcard:hover { transform: translateY(-4px); box-shadow: var(--lift); }

/* One stretched link over the whole card keeps the card clickable without
   nesting interactive elements inside a heading. */
.bcard-hit { position: absolute; inset: 0; z-index: 2; text-indent: -9999px; overflow: hidden; }
.bcard-hit:focus-visible { outline: 2px solid var(--g1); outline-offset: -4px; border-radius: var(--radius); }

.bcard-img { aspect-ratio: 16 / 9; overflow: hidden; background: rgba(255,255,255,.4); }
.bcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.bcard:hover .bcard-img img { transform: scale(1.03); }

.bcard-body { padding: clamp(18px, 2vw, 24px); display: flex; flex-direction: column; gap: 10px; }

.bcard-t {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.18;
  font-size: clamp(19px, 1.5vw, 22px);
  margin: 0;
  color: var(--ink);
}

.bcard-x { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0; }
.bcard-m { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 2px 0 0; }

.bcats { display: flex; flex-wrap: wrap; gap: 8px; }
.bcat {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: rgba(255,255,255,.55);
  color: var(--muted);
}

/* Featured post: full width, image beside the text once there is room. */
.bcard-lg { margin-top: clamp(22px, 3vw, 34px); }
.bcard-lg .bcard-t { font-size: clamp(24px, 3vw, 38px); }
.bcard-lg .bcard-x { font-size: 16.5px; max-width: 62ch; }

@media (min-width: 900px) {
  .bcard-lg { flex-direction: row; align-items: stretch; }
  .bcard-lg .bcard-img { flex: 0 0 52%; aspect-ratio: auto; }
  .bcard-lg .bcard-body { justify-content: center; padding: clamp(28px, 3vw, 44px); }
}

.bempty { padding: 40px 0 80px; }

/* ---------- post ---------- */

.bpost-hero h1 { max-width: 20ch; font-size: clamp(32px, 4.6vw, 56px); }
.bpost-hero .bcats { margin-bottom: 18px; }
.bpost-hero .eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.bpost-m { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 26px 0 0; }

/* .sec only carries padding-bottom, so the gap under the cover has to come
   from here or the body text sits flush against the image. */
.bcover { margin: clamp(24px, 3vw, 40px) 0 clamp(32px, 4vw, 54px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); }
.bcover img { width: 100%; height: auto; display: block; }

/* The article column. 68ch is the same measure the site's .prose uses. */
.bbody { max-width: 72ch; }

.bbody h1, .bbody h2, .bbody h3, .bbody h4 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.022em;
  line-height: 1.2;
  color: var(--ink);
  scroll-margin-top: 100px;
}

.bbody h1 { font-size: clamp(28px, 3.2vw, 38px); margin: 52px 0 16px; }
.bbody h2 { font-size: clamp(24px, 2.6vw, 31px); margin: 48px 0 14px; }
.bbody h3 { font-size: clamp(19px, 2vw, 23px); margin: 36px 0 12px; }
.bbody h4 { font-size: 17px; margin: 30px 0 10px; }
.bbody > *:first-child { margin-top: 0; }

.bbody p { color: var(--muted); font-size: 16.5px; line-height: 1.75; margin: 0 0 20px; }

.bbody a { color: var(--ink); text-decoration: none; background-image: var(--grad); background-repeat: no-repeat; background-size: 100% 1.5px; background-position: 0 100%; padding-bottom: 1px; transition: background-size .25s; }
.bbody a:hover { background-size: 100% 100%; }

.bbody ul, .bbody ol { color: var(--muted); font-size: 16.5px; line-height: 1.75; margin: 0 0 20px; padding-left: 22px; }
.bbody li { margin: 0 0 9px; }
.bbody li::marker { color: var(--g1); }

.bbody blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid transparent;
  border-image: var(--grad) 1;
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  font-weight: 300;
}

.bbody code { font-family: var(--mono); font-size: .88em; background: rgba(255,255,255,.7); border: 1px solid var(--edge); border-radius: 6px; padding: 2px 6px; color: var(--ink); }
.bbody u { text-underline-offset: 3px; }

.bfig { margin: 34px 0; }
.bfig img { width: 100%; height: auto; display: block; border-radius: 18px; border: 1px solid var(--edge); }
.bfig figcaption { font-size: 13.5px; color: var(--faint); margin-top: 10px; text-align: center; }

.bcode { margin: 30px 0; border-radius: 16px; overflow: hidden; border: 1px solid rgba(27,28,46,.12); background: #1b1c2e; }
.bcode-f { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.bcode pre { margin: 0; padding: 18px; overflow-x: auto; }
.bcode code { font-family: var(--mono); font-size: 13.5px; line-height: 1.65; color: #e6e8f5; background: none; border: 0; padding: 0; white-space: pre; }

.bnote { margin: 30px 0; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(255,255,255,.55); border-left: 3px solid var(--g2); }
.bnote p { margin: 0; font-size: 15.5px; color: var(--muted); }
.bnote-tip { border-left-color: var(--g3); }
.bnote-warning { border-left-color: #f0a35e; }

.bauthor { display: flex; gap: 16px; align-items: flex-start; margin: clamp(40px, 5vw, 64px) 0 0; padding: 24px; border-radius: var(--radius); border: 1px solid var(--edge); background: var(--glass); max-width: 72ch; }
.bauthor img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.bauthor strong { display: block; font-family: var(--display); font-size: 16px; color: var(--ink); }
.bauthor span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.bauthor p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

.brelated { padding-top: 0; }
.brel-h { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.02em; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .bcard, .bcard-img img, .bbody a { transition: none; }
  .bcard:hover { transform: none; }
  .bcard:hover .bcard-img img { transform: none; }
}
