/* Blog styling. Layers on top of legal.css and mirrors the glassmorphism the
   main site uses on .glass / .recruit-card so the blog feels like the same
   product: blurred translucent panel, saturated backdrop, soft lift on hover. */

/* Ambient glow behind the content, same trick the homepage sections use.
   Kept at 100% width: anything wider pushes the page sideways on narrow
   screens, which is what was clipping the nav buttons. */
.page-wrap { position: relative; }
.page-wrap::before {
  content: ''; position: absolute; left: 50%; top: 6%;
  width: min(900px, 100%); height: 520px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,20,40,.12), rgba(255,20,40,.035) 45%, transparent 72%);
  filter: blur(20px); pointer-events: none; z-index: 0;
}
.page-wrap > * { position: relative; z-index: 1; }

/* ---------- the post card ---------- */
.post {
  background: rgba(11,12,16,.66);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 44px);
  margin-top: 2.2rem;
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  box-shadow: 0 14px 44px rgba(0,0,0,.55);
  transition: transform .5s var(--ease), border-color .4s, background .4s;
}
.post:hover {
  transform: translateY(-4px);
  border-color: rgba(255,20,40,.42);
  background: rgba(15,16,21,.72);
}

/* ---------- meta row ---------- */
.post-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.post-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--ice);
  border: 1px solid rgba(255,20,40,.4); padding: 7px 13px; border-radius: 999px;
  background: rgba(255,20,40,.07);
}
.post-date {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------- post page header ---------- */
/* Breadcrumb. Doubles as the post's only link back up to the index, which
   the page otherwise lacks: the nav only offers "Back to site". */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.6rem;
}
.crumbs a { color: var(--muted); text-decoration: none; transition: color .3s; }
.crumbs a:hover { color: var(--ice); opacity: 1; text-decoration: none; }
.crumb-sep { opacity: .4; }
.crumb-here { color: var(--silver); }

/* The article headline is the h1 here, but legal.css sizes h1 for a landing
   page (up to 52px). Dial it back so a long title stays readable. */
.post-h1 {
  font-size: clamp(1.5rem, 3.8vw, 2.4rem);
  font-weight: 300; line-height: 1.2;
  overflow-wrap: break-word;
}
/* Sits where .updated does on the legal pages, so keep the same bottom gap */
.post-meta--head { margin-bottom: 2.6rem; }

/* ---------- video hero ---------- */
.post-hero {
  position: relative; display: block; border-radius: 16px; overflow: hidden;
  aspect-ratio: 16/9; background: #0b0c10; margin-bottom: 2rem;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.post-hero:hover img { transform: scale(1.04); }
.post-play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,20,40,.9);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(255,20,40,.35), 0 4px 18px rgba(0,0,0,.5);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.post-play svg { width: 23px; height: 23px; color: #fff; margin-left: 3px; }
.post-hero:hover .post-play { transform: scale(1.12); box-shadow: 0 10px 38px rgba(255,20,40,.5), 0 4px 18px rgba(0,0,0,.5); }
.post-hero-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 13px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .06em; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
}

/* ---------- body ---------- */
.post-lead {
  font-size: 1.02rem; line-height: 1.85; color: var(--silver); margin-bottom: 1.9rem;
  padding-bottom: 1.6rem; border-bottom: 1px solid rgba(255,255,255,.09);
}

/* Section headings are h2 now that the article title owns the h1 . h3 stays
   supported for any future post that needs a third level. */
.post h2, .post h3 {
  font-family: 'Unbounded', sans-serif; font-weight: 300;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 2.2rem 0 .9rem; display: flex; align-items: center; gap: 12px;
}
.post h2::before, .post h3::before { content: ''; display: block; width: 14px; height: 1px; background: var(--ice); flex-shrink: 0; }

.post p { font-size: .95rem; line-height: 1.9; color: var(--mid); margin-bottom: 1.1rem; }
.post em { color: var(--silver); font-style: italic; }

/* glass pull-quote */
.post blockquote {
  margin: 1.4rem 0; padding: 18px 22px;
  border: 1px solid rgba(255,20,40,.24);
  border-left: 2px solid var(--ice);
  border-radius: 4px 14px 14px 4px;
  background: rgba(255,20,40,.055);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 1rem; line-height: 1.75; color: var(--silver); font-style: italic;
}

/* ---------- CTAs ---------- */
.post-cta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2.5rem;
  padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.09);
}
.post-btn {
  display: inline-block; text-decoration: none; font-size: .85rem; font-weight: 400;
  padding: 12px 24px; border-radius: 999px;
  background: var(--ice); color: #fff; border: 1px solid var(--ice);
  box-shadow: 0 6px 22px rgba(255,20,40,.28);
  transition: filter .3s, transform .3s var(--ease), box-shadow .3s;
}
.post-btn:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,20,40,.4); }
.post-btn--ghost {
  background: rgba(255,255,255,.05); color: var(--silver);
  border-color: rgba(255,255,255,.16); box-shadow: none;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.post-btn--ghost:hover { border-color: rgba(255,20,40,.5); color: var(--ice); box-shadow: none; }

@media (max-width: 560px) {
  .post { padding: 20px 17px; border-radius: 16px; }
  .post:hover { transform: none; }           /* no hover lift on touch */
  .post-play { width: 50px; height: 50px; }
  .post-play svg { width: 18px; height: 18px; }
  .post-hero-cap { font-size: 10px; padding: 22px 12px 10px; }
  .post blockquote { padding: 14px 16px; font-size: .92rem; }
  .post-cta .post-btn { flex: 1 1 100%; text-align: center; }
}

/* Phones and tablets: swap the live backdrop blur for a near-opaque panel.
   Large backdrop-filter areas force the compositor to re-sample the page on
   every scroll frame, which is what made the card paint late on mobile. The
   look is nearly identical, the cost is gone. */
@media (max-width: 900px), (hover: none) {
  .post {
    background: rgba(13,14,19,.95);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .post blockquote,
  .post-btn--ghost,
  .post-play { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .post blockquote { background: rgba(255,20,40,.09); }
  .post-btn--ghost { background: rgba(255,255,255,.08); }
  /* The blurred glow is a full-page filter layer; a plain gradient is free */
  .page-wrap::before { filter: none; opacity: .85; }
}

/* Tail link back up to the index, for readers who reach the end of a post */
.post-back {
  display: inline-block; margin-top: 2rem;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .3s;
}
.post-back:hover { color: var(--ice); opacity: 1; text-decoration: none; }


/* ════════════════════════════════════════════════════════════
   BLOG INDEX (bi-), the post listing on /blog
   Same glass recipe as .post above and the homepage .news-card, so the
   index, the article and the site all read as one product. The meta row
   reuses .post-meta / .post-tag / .post-date, no duplicate styling.
   ════════════════════════════════════════════════════════════ */

/* auto-fit with min(100%, 320px) so a track can never be wider than the
   container, which keeps 320px phones free of horizontal overflow.
   Empty tracks collapse, so a single post fills the row on its own, and
   that lone card gets the wide two column treatment below instead of
   looking like a leftover in a broken grid. */
.bi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-top: 2.2rem;
}

.bi-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(11,12,16,.66);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  box-shadow: 0 14px 44px rgba(0,0,0,.55);
  color: var(--silver);
  text-decoration: none;
  transition: transform .5s var(--ease), border-color .4s, background .4s, box-shadow .4s;
}
/* legal.css fades and underlines every <a> on hover. The whole card is an
   <a>, so it has to opt out of both. */
.bi-card:hover,
.bi-card:focus-visible {
  opacity: 1;
  text-decoration: none;
  transform: translateY(-4px);
  border-color: rgba(255,20,40,.42);
  background: rgba(15,16,21,.72);
  box-shadow: 0 18px 52px rgba(0,0,0,.6);
}

.bi-thumb {
  position: relative; display: block; overflow: hidden;
  border-radius: 14px; aspect-ratio: 16 / 9; background: #0b0c10;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
}
.bi-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease);
}
.bi-card:hover .bi-thumb img { transform: scale(1.05); }

.bi-body { display: flex; flex-direction: column; min-width: 0; }
.bi-body .post-meta { gap: 10px; }

.bi-title {
  font-family: 'Unbounded', sans-serif; font-weight: 300;
  font-size: clamp(1.02rem, 2.6vw, 1.28rem); line-height: 1.35;
  color: var(--silver); margin: 13px 0 0;
  overflow-wrap: break-word;
  transition: color .35s;
}
.bi-card:hover .bi-title { color: #fff; }

/* Clamped to two lines so cards in the same row stay the same shape no
   matter how long the copy runs. */
.bi-excerpt {
  font-size: .88rem; line-height: 1.7; color: var(--mid); margin: 11px 0 0;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* margin-top:auto pins the affordance to the bottom edge, so the
   "Read the story" lines up across a row of uneven cards. */
.bi-more {
  margin-top: auto; padding-top: 16px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ice);
  display: flex; align-items: center; gap: 9px;
}
.bi-arrow { display: inline-block; transition: transform .35s var(--ease); }
.bi-card:hover .bi-arrow { transform: translateX(5px); }

/* One post only: the card owns the full row, so lay it out sideways like
   the homepage news card. As soon as a second post lands this rule stops
   matching and the grid takes over with no other change. */
@media (min-width: 700px) {
  .bi-card:only-child {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 24px; align-items: center; padding: 18px;
  }
  .bi-card:only-child .bi-title { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
  .bi-card:only-child .bi-excerpt { -webkit-line-clamp: 3; line-clamp: 3; }
}

@media (max-width: 560px) {
  .bi-grid { gap: 14px; margin-top: 1.8rem; }
  .bi-card { padding: 12px; border-radius: 16px; gap: 13px; }
  .bi-card:hover { transform: none; }        /* no hover lift on touch */
  .bi-card .post-tag { font-size: 8.5px; padding: 6px 11px; }
  .bi-card .post-date { font-size: 10px; letter-spacing: .12em; }
  .bi-title { margin-top: 11px; }
  .bi-excerpt { font-size: .84rem; line-height: 1.6; margin-top: 9px; }
  .bi-more { padding-top: 13px; font-size: 9px; letter-spacing: .18em; }
  .crumbs { font-size: 9px; letter-spacing: .12em; gap: 7px; margin-bottom: 1.3rem; }
}

/* Same trade as .post above: on phones and tablets a column of live
   backdrop blurs makes the compositor re-sample the page every scroll
   frame. Near opaque panel, same look, none of the cost. Must stay after
   the base .bi-card rule. */
@media (max-width: 900px), (hover: none) {
  .bi-card {
    background: rgba(13,14,19,.95);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .bi-card:hover, .bi-card:focus-visible { background: rgba(16,17,23,.96); }
}

/* Touch devices keep a sticky :hover after a tap, which would leave a card
   stuck mid lift. Kill the motion, keep the colour shift. */
@media (hover: none) {
  .bi-card:hover,
  .bi-card:hover .bi-thumb img,
  .bi-card:hover .bi-arrow { transform: none; }
}
