/* Blog detail (single article)
   Tokens, .section, .blog-card, .link-arrow live in styles.css */

.page-post { background: #fff; }

.post {
  padding-top: 4.5rem; /* clear absolute header */
}

/* Shared content container (max-width readable) */
.post__container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Hero (lede + cover + boundary CTA) ---------- */
.post__hero {
  display: grid;
  gap: 0;
  position: relative;       /* anchor for hero CTA */
}

/* 80x80 arrow circle straddling the lede/cover column boundary on desktop.
   Sketch: (680, 410, 80x80) — y=410 is mid-lede, x straddles the 720 column line.
   On mobile, hidden (Sketch mobile artboard doesn't have this CTA in the hero). */
.post__hero-cta {
  display: none;
}

.post__lede {
  padding: var(--space-5) var(--gutter) var(--space-5);
  display: grid;
  gap: var(--space-3);
  max-width: var(--max-width);
  margin-inline: auto;
  width: 100%;
}

.post__topic {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--color-fg-muted);
  margin: 0;
}

/* Sketch: 42px Inter-Regular, kerning -1.68, alignment 2 (CENTER), no line-height */
.post__title {
  font-size: clamp(1.75rem, 3.2vw + 0.5rem, 2.625rem); /* 28-42px, cap matches 42 */
  line-height: 1.05;
  letter-spacing: -0.04em;  /* Sketch kerning -1.68 ÷ font 42 ≈ -0.04em */
  font-weight: 400;
  text-align: center;       /* Sketch alignment: 2 */
  margin: 0;
  max-width: 471px;          /* Sketch title frame width */
}

/* Sketch: 14px Inter-Regular, kerning -0.28 */
.post__byline {
  font-size: 0.875rem;       /* 14px */
  letter-spacing: -0.02em;
  color: var(--color-fg-muted);
  margin: 0;
}

/* ---------- Cover image ---------- */
.post__cover {
  margin: 0;
  aspect-ratio: 375 / 470;
  overflow: hidden;
}

.post__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Share row ---------- */
.post__share {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: var(--space-5) var(--gutter) 0;
  display: grid;
  gap: var(--space-3);
}

.post__share-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--color-fg-muted);
  margin: 0;
}

.post__share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: var(--space-4);
}

.post__share-list a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: opacity 0.2s;
}

.post__share-list a:hover { opacity: 0.6; }

.post__share-list svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Body blocks ----------
   Sketch: 14px Inter-Regular, line-height 18.2 (≈1.3), kerning -0.28 (-0.02em). */
.post__intro,
.post__body {
  display: grid;
  gap: var(--space-4);
  font-size: 0.875rem;     /* 14px */
  line-height: 1.3;
  letter-spacing: -0.02em;
  padding-block: var(--space-5);
  max-width: 70ch;
}

/* Vertical rhythm comes from child margins (not grid gap) so spacing is
   identical in the mobile single-column flow and the desktop 2-col grid,
   where row-gap is 0. Margins are the single source of vertical spacing. */
.post__intro,
.post__body { row-gap: 0; }

.post__intro p,
.post__body p { margin: 0 0 var(--space-4); }

/* Section headings inside the body — light weight to match the article title,
   with extra space above each (delineates a section) and a tight gap below. */
.post__body h2,
.post__body h3 {
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.post__body h2 {
  font-size: 1.5rem;                        /* 24px */
  margin: var(--space-6) 0 var(--space-3);  /* 32 above · 12 below */
}
.post__body h3 {
  font-size: 1.25rem;                       /* 20px */
  margin: var(--space-5) 0 var(--space-2);
}

.post__body ul,
.post__body ol { margin: 0 0 var(--space-4); padding-left: 1.4em; }
.post__body li { margin-bottom: var(--space-1); }

/* First/last child shouldn't fight the section's own vertical padding. */
.post__intro > :first-child,
.post__body  > :first-child { margin-top: 0; }
.post__intro > :last-child,
.post__body  > :last-child { margin-bottom: 0; }

/* Inline images placed in the body editor (Word-style text + images) */
.post__body img {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-5) 0;
  border-radius: 2px;
}
.post__body figure { margin: var(--space-5) 0; }

/* ---------- Wide feature image ---------- */
.post__feature {
  margin: var(--space-5) 0;
  aspect-ratio: 375 / 508;
  overflow: hidden;
}

.post__feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Pull quote with side image ---------- */
.post__pull {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-5);
}

.post__pull-figure {
  margin: 0;
  aspect-ratio: 345 / 442;
  overflow: hidden;
}

.post__pull-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post__pull-body { display: grid; gap: var(--space-2); }

/* Sketch: 42px Inter-Regular, kerning -1.68 (-0.04em), no line-height */
.post__pull-quote {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.625rem); /* cap 42px */
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0;
}

/* ---------- Featured product + note block ---------- */
.post__product-block {
  padding-block: var(--space-7);
  display: grid;
  gap: var(--space-5);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.post__product-block-heading {
  font-size: var(--fs-md);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0;
  text-align: center;
}

.post__product-block-layout {
  display: grid;
  gap: var(--space-5);
}

.post__product-card {
  display: grid;
  grid-template-columns: 113px 1fr;
  gap: var(--space-4);
  align-items: end;
  color: inherit;
  text-decoration: none;
}

.post__product-figure {
  margin: 0;
  aspect-ratio: 113 / 178;
  overflow: hidden;
}

.post__product-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post__product-meta {
  display: grid;
  gap: var(--space-1);
  padding-bottom: var(--space-2);
}

.post__product-name {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--color-fg-muted);
  margin: 0;
}

.post__product-price {
  font-size: var(--fs-sm);
  margin: 0;
}

.post__product-card:hover .post__product-name { color: var(--color-fg); }

/* ---------- Product note (optional text beside the product) ---------- */
.post__product-note {
  display: grid;
  gap: var(--space-2);
}

.post__product-note p {
  font-size: var(--fs-sm);
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Gallery ---------- */
.post__gallery {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-5);
  margin-inline: 0;
}

.post__gallery figure {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.post__gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Closing ---------- */
.post__closing {
  padding-block: var(--space-6);
}

/* Sketch closing quote: 24px Inter-Regular, kerning -0.96 (-0.04em) */
.post__closing-quote {
  font-size: 1.5rem;       /* 24px */
  line-height: 1.35;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 30ch;
}

/* ---------- Related ---------- */
.post-related {
  border-top: 1px solid var(--color-line);
  padding-block: var(--space-7) var(--space-9);
}

.post-related__heading {
  font-size: var(--fs-md);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-5);
}

.post-related__grid {
  display: grid;
  gap: var(--space-5);
}

/* ============================================================
   Desktop (>= 768px)
   Reproduces the right-column-content / left-margin-label
   layout from the desktop artboard (1440 frame).
   ============================================================ */
@media (min-width: 1024px) {
  .post { padding-top: 0; }    /* cover goes to viewport top per Sketch */

  /* Hero: lede left half, cover right half — full bleed top.
     Sketch: cover Rectangle 5832 (720, 0, 720x900) — starts at y=0. */
  .post__hero {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    padding-top: 0;
    min-height: 900px;          /* matches Sketch hero height */
  }
  .post__lede {
    margin-inline: 0;
    padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 4vw, 4rem);
    align-self: center;         /* lede vertically centered in hero, like Sketch */
    justify-items: center;      /* topic/title/byline centered horizontally (grid inline axis) */
  }
  .post__topic {
    text-align: center;
  }
  .post__title {
    font-size: clamp(2rem, 3vw + 0.5rem, 2.625rem); /* cap 42px */
    max-width: 471px;
    text-align: center;
  }
  .post__byline {
    text-align: center;
  }
  .post__cover {
    aspect-ratio: 720 / 900;
    height: 100%;
  }
  /* Hero arrow CTA — straddles the lede/cover boundary at mid-hero.
     Black circle is the SVG; the arrow sits on top and drops top→down on hover. */
  .post__hero-cta {
    display: grid;
    place-items: center;
    position: absolute;
    left: 50%;
    top: 45%;                   /* Sketch y=410 / hero h=900 = 45.5% */
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    color: var(--color-invert);
    z-index: 2;
    transition: transform 0.2s ease;
  }
  .post__hero-cta-circle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }
  .post__hero-cta-arrow {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
  }
  .post__hero-cta:hover .post__hero-cta-arrow {
    animation: post-cta-arrow-drop 0.55s both;
  }
  @keyframes post-cta-arrow-drop {
    0%     { transform: translateY(0);     animation-timing-function: ease-in; }
    50%    { transform: translateY(260%); }                                       /* drops out the bottom (clipped) */
    50.01% { transform: translateY(-260%); animation-timing-function: ease-out; } /* instant reposition above */
    100%   { transform: translateY(0); }                                          /* eases back in from the top */
  }

  /* Share + intro side-by-side per Sketch:
     y=1000 has both share label (138, 1000) and lede (613, 1000).
     Wrap them in one 2-col grid so they align. */
  .post__share-intro {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: var(--space-7);
    align-items: start;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
    padding-block: var(--space-6);
  }
  .post__share {
    grid-column: 1;
    display: grid;
    gap: var(--space-3);
    padding: 0;
    max-width: none;
    margin: 0;
  }
  .post__share-list {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .post__share-intro .post__intro {
    grid-column: 2;
    /* Parent already placed us in col 2 — don't re-apply the standalone 1fr 2fr
       grid, or the text gets pushed into the right 2/3 of the right 2/3 (misaligned
       with .post__body). Flow as a plain block so paragraphs share the body's edge. */
    display: block;
    padding: 0;
    max-width: 60ch;
    /* .post__container's margin-inline:auto would center us in the wide col-2 track,
       shifting the text right of .post__body — pin to the column start instead. */
    margin-inline: 0;
    justify-self: start;
  }

  /* Body and intro sit in the right 2/3 column on desktop */
  .post__intro,
  .post__body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    column-gap: var(--space-7);
    padding-block: var(--space-6);
    max-width: var(--max-width);
    font-size: 1rem;
  }
  .post__intro > *,
  .post__body > * {
    grid-column: 2;
    max-width: 60ch;
  }

  /* Wide feature image — full bleed */
  .post__feature {
    aspect-ratio: 1440 / 800;
    margin-block: var(--space-7);
  }

  /* Pull section — portrait left col, quote right col */
  .post__pull {
    grid-template-columns: 1fr 2fr;
    column-gap: var(--space-7);
    align-items: start;
    padding-block: var(--space-7);
  }
  .post__pull-figure {
    aspect-ratio: 335 / 430;
  }
  .post__pull-body {
    align-self: center;
    max-width: 60ch;
  }
  .post__pull-quote {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.625rem);
    line-height: 1.2;
  }

  /* Featured-product + note combined block */
  .post__product-block {
    padding-block: var(--space-8);
  }
  .post__product-block-heading {
    font-size: var(--fs-md);
  }
  .post__product-block-layout {
    grid-template-columns: 1fr 2fr;
    column-gap: var(--space-7);
    align-items: start;
  }
  /* Product card: Sketch Rectangle 5852 (613/3314, 453x400) bg with image 38
     (149x235) centred horizontally inside, plus name/price below. */
  .post__product-card {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    justify-self: start;
    max-width: 453px;
    width: 100%;
  }
  .post__product-figure {
    aspect-ratio: 453 / 400;     /* card bg aspect */
    display: grid;
    place-items: center;
    background: var(--color-bg);
    overflow: hidden;
  }
  .post__product-figure img {
    width: auto;
    max-width: 33%;              /* 149/453 ≈ 33% */
    height: auto;
    max-height: 60%;             /* 235/400 ≈ 59% */
    object-fit: contain;
  }
  .post__product-meta { padding-bottom: 0; }

  .post__product-note { gap: var(--space-6); max-width: 60ch; }

  /* 3-image gallery: large + small + large */
  .post__gallery {
    grid-template-columns: 1fr clamp(180px, 18vw, 260px) 1fr;
    column-gap: var(--space-5);
    align-items: end;
    padding-block: var(--space-7);
  }
  .post__gallery figure:first-child,
  .post__gallery figure:last-child {
    aspect-ratio: 453 / 582;
  }
  .post__gallery figure:nth-child(2) {
    aspect-ratio: 216 / 276;
    align-self: end;
  }

  /* Closing — sits in the right column */
  .post__closing {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: var(--space-7);
    padding-block: var(--space-8);
  }
  .post__closing-quote {
    grid-column: 2;
    font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
    line-height: 1.3;
    max-width: 50ch;
  }

  /* Related — heading on left margin, cards on right */
  .post-related {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: var(--space-7);
    align-items: start;
    padding-block: var(--space-8);
  }
  .post-related__heading {
    margin: 0;
    font-size: var(--fs-md);
  }
  .post-related__grid {
    grid-template-columns: 1fr 1fr;
    margin: 0;
  }
}
