/* ==========================================================================
   QUAD UK Blog (round 29): listing (blog.html) and single article
   (blog-post.html). Figma "Blog page" section 1864:457, frames 1859:1321
   (listing) and 1859:2004 (single), 1920 wide. The closing CTA and footer
   come from home.css unchanged.
   ========================================================================== */

/* ---- Shared: outlined tag ("Insights") --------------------------------- */
/* Figma: 1px #cfcfcf outline, radius 30, 14px padding, 16px white. The single
   page draws it in blue in Figma; kept neutral here (no blue on the site). */
.tag {
  display: inline-flex; align-items: center;
  height: 2.25rem; padding: 0 0.875rem;
  border: 1px solid var(--color-gray-150);
  border-radius: var(--radius-pill);
  font-size: var(--fs-body); line-height: 1; color: var(--color-white);
  white-space: nowrap;
}

/* ---- Listing: header band --------------------------------------------- */
/* 338px tall at 1920, silk behind the nav, title near the bottom and a
   3px light hairline closing the band. */
.blog-head {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(15rem, 17.6vw, 21.125rem);
  padding: calc(var(--nav-height) + 3rem) 0 clamp(2.25rem, 4vw, 4.75rem);
  border-bottom: 3px solid var(--color-gray-150);
  background: #000;
}
.blog-head__media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.blog-head__media img {
  position: absolute; left: 0; top: -10%; width: 100%; height: 120%;
  object-fit: cover; object-position: 50% 40%;
}
.blog-head__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.1) 60%);
}
.blog-head .container { width: 100%; }
.blog-head__title { line-height: 1; }

/* ---- Listing: grid ----------------------------------------------------- */
.blog-list { padding: clamp(2.5rem, 3.3vw, 4rem) 0 var(--section-y); }
.post-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2vw, 2.375rem);
  list-style: none; margin: 0; padding: 0;
}
.post-grid [hidden] { display: none; }

/* Card 495 x 653 at 1920: copy block (360) / 5px bar / image (288). */
.post-card { min-width: 0; }
.post-card__link {
  display: flex; flex-direction: column; height: 100%;
  border-radius: var(--radius-md); overflow: hidden;
  background: #0e0e0e; color: var(--color-white);
  outline-offset: 4px;
}
.post-card__body {
  flex: 1; display: flex; flex-direction: column;
  min-height: clamp(15rem, 18.75vw, 22.5rem);
  padding: clamp(1.5rem, 2.1vw, 2.5rem) clamp(1.25rem, 1.7vw, 2rem) clamp(1.5rem, 2vw, 2.4rem);
  border-bottom: 5px solid var(--color-gray-150);
}
.post-card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.post-card__q { width: clamp(2.5rem, 3.33vw, 4rem); height: auto; aspect-ratio: 20 / 18; color: var(--color-white); }
.post-card__title {
  margin: clamp(2rem, 4vw, 4.9rem) 0 var(--space-6);
  max-width: 25.5rem;
  font-family: var(--font-body); font-weight: var(--weight-regular);
  font-size: clamp(1.25rem, 1.05rem + 0.55vw, 1.75rem); line-height: 1.25;
  text-wrap: balance;
}
.post-card__meta {
  margin-top: auto;
  display: flex; justify-content: space-between; gap: var(--space-4);
  font-size: var(--fs-body); color: var(--color-gray-450);
}
.post-card__media { aspect-ratio: 495 / 288; overflow: hidden; background: #050505; }
.post-card__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); /* per-photo crop set inline */
  transition: scale var(--dur-slow) var(--ease-out);
}
.post-card__link:hover .post-card__media img,
.post-card__link:focus-visible .post-card__media img { scale: 1.05; }
.post-card__title { transition: color var(--dur-base) var(--ease-out); }
.post-card__link:hover .post-card__title { color: var(--color-gray-150); }

/* ---- Listing: pager ---------------------------------------------------- */
/* Outlined 56px arrows at the container edges, page numbers centred
   (Figma draws the current "1" in blue; white here). */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  margin-top: clamp(2.5rem, 4vw, 4.5rem);
}
.pager[hidden] { display: none; }
.pager__arrow {
  width: var(--plus-btn); height: var(--plus-btn); flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.6);
  color: var(--color-white);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out), opacity var(--dur-fast);
}
.pager__arrow svg { width: 2.4rem; height: 2.4rem; }
.pager__arrow:hover:not([disabled]) { background: var(--color-white); color: var(--color-black); border-color: var(--color-white); }
.pager__arrow[disabled] { opacity: 0.3; cursor: default; }
.pager__nums { display: flex; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.pager__num {
  min-width: 2.5rem; height: 2.5rem; padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-family: var(--font-display); font-size: var(--fs-body-lg); color: var(--color-gray-450);
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.pager__num:hover { color: var(--color-white); }
.pager__num[aria-current="page"] { color: var(--color-white); background: var(--color-gray-850); }

/* ---- Single: layout ---------------------------------------------------- */
/* 1920: rail at x105, article column 1035 wide starting near x452. */
.post-page { padding-top: calc(var(--nav-height) + clamp(3rem, 7.5vw, 8.5rem)); }
.post {
  --rail-btn: 3.625rem; /* 58 */
  display: grid;
  grid-template-columns: minmax(var(--rail-btn), 1fr) minmax(0, 64.6875rem) minmax(0, 1fr);
  column-gap: clamp(2rem, 4vw, 5rem);
  padding-inline: clamp(1.25rem, 5.47vw, 6.5625rem);
  padding-bottom: var(--section-y);
}
.post-rail { grid-column: 1; justify-self: start; }
.post-rail__inner {
  position: sticky; top: calc(var(--nav-height) + 3.5rem);
  display: flex; flex-direction: column; gap: min(20.5rem, 28vh);
}
.post-main { grid-column: 2; min-width: 0; }

.post-rail__label { display: block; font-size: var(--fs-body); color: var(--color-gray-450); white-space: nowrap; }
.post-back { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); color: var(--color-white); }
.post-rail__btn {
  width: var(--rail-btn); height: var(--rail-btn);
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: #0e0e0e; color: var(--color-white);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), scale var(--dur-base) var(--ease-out);
}
.post-rail__btn svg { width: 1.125rem; height: 1.125rem; }
.post-back .post-rail__btn svg { width: 2.4rem; height: 2.4rem; }
.post-back:hover .post-rail__btn,
.post-rail__btn:hover { background: var(--color-white); color: var(--color-black); }
.post-rail__btn:active { scale: 0.94; }
.post-share { display: flex; flex-direction: column; gap: var(--space-4); }
.post-share__list { display: flex; flex-direction: column; gap: 0.625rem; list-style: none; margin: 0; padding: 0; }

/* ---- Single: header ---------------------------------------------------- */
.post-head { display: grid; justify-items: start; }
.post-head__title {
  margin: clamp(1.75rem, 3.3vw, 3.5rem) 0 clamp(1.5rem, 2.4vw, 2.6rem);
  max-width: 55rem;
  font-family: var(--font-display); font-weight: var(--weight-light);
  font-size: clamp(2.25rem, 1.45rem + 2.4vw, 3.75rem); line-height: 1.05;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
.post-meta { display: flex; flex-wrap: wrap; gap: var(--space-8); list-style: none; margin: 0; padding: 0; font-size: var(--fs-body); color: var(--color-gray-450); }
.post-meta li { display: inline-flex; align-items: center; gap: var(--space-3); }
.post-meta svg { width: 1.5rem; height: 1.5rem; color: var(--color-white); flex: none; }
.post-author { display: flex; align-items: center; gap: var(--space-6); margin-top: clamp(2rem, 3vw, 3rem); }
.post-author img { width: clamp(3.5rem, 4vw, 4.75rem); aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 50% 22%; filter: grayscale(1); }
.post-author p { display: grid; gap: 0.25rem; }
.post-author__name { color: var(--color-white); }
.post-author__role { color: var(--color-gray-450); }

.post-hero {
  margin: clamp(2.5rem, 5vw, 5.4rem) 0 0;
  aspect-ratio: 1035 / 602; overflow: hidden;
  border-radius: clamp(1.25rem, 1.6vw, 1.875rem);
  background: #050505;
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }

/* ---- Single: prose ----------------------------------------------------- */
/* Figma: 20px FFF Acid Grotesk, #808080, full 1035 column. The measure is
   held to ~52rem and the tone lifted to the secondary text token so long
   reads stay comfortable on black. */
.prose {
  max-width: 52rem;
  margin-top: clamp(2.5rem, 4.5vw, 5rem);
  font-size: var(--fs-body-lg); line-height: 1.55; color: var(--text-secondary);
}
.prose > * + * { margin-top: 1.25em; }
.prose h2 {
  margin-top: 2.2em;
  font-family: var(--font-display); font-weight: var(--weight-light);
  font-size: var(--fs-title-lg); line-height: 1.2; color: var(--color-white);
}
.prose h2 + * { margin-top: 0.9em; }
.prose ul { padding-left: 1.2em; list-style: disc; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--color-gray-150); }
.prose blockquote {
  margin-block: 2em; padding: 0.2em 0 0.2em clamp(1.25rem, 2vw, 2rem);
  border-left: 3px solid var(--color-gray-150);
  font-family: var(--font-display); font-weight: var(--weight-light);
  font-size: var(--fs-title); line-height: 1.3; color: var(--color-white);
}
.prose a { color: var(--color-white); text-decoration: underline; text-underline-offset: 0.2em; }

/* ---- Toast (share fallback: "Link copied") ----------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: var(--z-menu);
  translate: -50% 1rem; opacity: 0; pointer-events: none;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-pill);
  background: var(--color-white); color: var(--color-black); font-size: var(--fs-small);
  transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Rail folds into the article flow: back link first, share at the end */
  .post { grid-template-columns: minmax(0, 1fr); padding-inline: var(--margin); }
  .post-rail, .post-rail__inner { display: contents; }
  .post-main { grid-column: 1; }
  .post-back { order: -1; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); }
  .post-back .post-rail__btn { --rail-btn: 2.75rem; }
  .post-share { order: 2; flex-direction: row; align-items: center; gap: var(--space-4); margin-top: var(--space-12); padding-top: var(--space-8); border-top: 1px solid var(--color-gray-700); }
  .post-share__list { flex-direction: row; }
  .post-rail__btn { --rail-btn: 3rem; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-card__body { min-height: 0; }
  .post-card__title { margin-block: var(--space-10) var(--space-8); }
  .pager__arrow { width: 3rem; height: 3rem; }
  .post-meta { gap: var(--space-6); }
  .prose { line-height: 1.5; }
}
