/* ==========================================================================
   Meta Church VR: blog pages
   Used by blog.html and blog-why-people-are-joining.html only.
   Loaded AFTER styles.css. Tokens only: no raw colours, no new font sizes.

   CONTENTS
    1. Blog index (featured post card, quote split)
    2. Post hero + byline avatar
    3. Reading progress bar
    4. Post layout + "In this post" rail
    5. Long-form typography (drop cap, pull quotes, scripture, figures, sign-off)
    6. End of post (author card, invite card, back link)
    7. Print
   ========================================================================== */

/* ==========================================================================
   1. Blog index
   ========================================================================== */
.blog-latest .eyebrow { margin-bottom: 1.5rem; }

/* author line inside a post card (a <p> with a class skips the excerpt styling) */
.post-card__by { margin-top: .9rem; font-size: var(--fs-300); line-height: 1.45; color: var(--ink-soft); }
.post-card__by strong { color: var(--ink); }

/* Featured card. Stacked: the full 16:9 photo on top. Side by side (56.25em+): the photo becomes an
   inset 3:2 print, so Pastor Mike's wave AND thumbs-up stay in frame however tall the text runs. */
@media (min-width: 56.25em) {
  .blog-feature { align-items: center; }
  .blog-feature .post-card__media {
    flex-basis: 46%;
    margin: clamp(1.25rem, 2.2vw, 1.75rem);
    margin-right: 0;
    border-radius: var(--r-md);
  }
  .blog-feature .post-card__media img { height: auto; aspect-ratio: 3 / 2; }
  .blog-feature .post-card__body { padding: clamp(2rem, 3.6vw, 3.25rem); }
}

/* grid for older posts (see the HTML comment in blog.html) */
.post-list { margin-top: clamp(1.5rem, 3vw, 2.5rem); }

/* quote split: keep the arch photo a sensible size when the split stacks */
.blog-quote .split__media { width: 100%; max-width: 26rem; justify-self: center; }
.blog-quote .pullquote { margin-top: 1.75rem; }
.blog-quote .pullquote p { font-size: var(--fs-700); line-height: 1.16; letter-spacing: -.012em; }

/* ==========================================================================
   2. Post hero + byline avatar
   ========================================================================== */
.page-hero--post h1 { font-size: var(--fs-800); line-height: 1.04; }
.page-hero--post .byline { margin-top: 1.6rem; }
.page-hero--post .byline__photo { box-shadow: 0 0 0 2px var(--gold); }

/* pastor-mike-wave.webp is a wide shot: zoom the round crop in on the face */
.avatar-zoom { overflow: hidden; }
.avatar-zoom img { transform: scale(1.7); transform-origin: 50% 36%; }

/* ==========================================================================
   3. Reading progress bar (scroll-linked, no animation; hidden without JS)
   ========================================================================== */
.read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: calc(var(--z-header) + 1);
  height: 3px;
  pointer-events: none;
}
.read-progress__bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}
.no-js .read-progress { display: none; }

/* ==========================================================================
   4. Post layout + "In this post"
   ========================================================================== */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.post { min-width: 0; }
.post .prose { line-height: 1.75; }

/* Phones and tablets: a closed disclosure box above the article */
.post-toc {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  max-width: 65ch;
  border-radius: var(--r-md);
  background: var(--tint);
}
.post-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: .5rem 1.15rem;
  border-radius: var(--r-md);
  font-size: var(--fs-200);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc summary .icon { transition: transform var(--dur-2) var(--ease); }
.post-toc[open] summary .icon { transform: rotate(180deg); }
.post-toc ol { margin: 0; padding: 0 1.15rem .75rem; list-style: none; counter-reset: toc; }
.post-toc a {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: var(--tap);
  padding-block: .4rem;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-300);
  line-height: 1.35;
  color: var(--fg-soft);
  text-decoration: none;
  transition: color var(--dur-1);
}
.post-toc a::before {
  counter-increment: toc;
  content: counter(toc);
  flex: none;
  min-width: 1.1em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-400);
  color: var(--accent);
}
.post-toc a:hover { color: var(--fg); }
.post-toc a[aria-current] { color: var(--fg); font-weight: 700; }

/* Desktop: a sticky rail beside the article */
@media (min-width: 68.75em) {
  .post-layout {
    grid-template-columns: 14rem minmax(0, 65ch);
    column-gap: var(--gap-grid);
    align-items: start;
  }
  .post-toc {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    margin-bottom: 0;
    background: none;
    border-radius: 0;
  }
  .post-toc summary { padding-inline: 0; }
  .post-toc ol { padding: 0; }
  .post-toc a { position: relative; }
  .post-toc a[aria-current]::after {
    /* small maple leaf marks the section being read */
    content: "";
    position: absolute;
    left: -1.35rem;
    top: 50%;
    width: .6rem; height: .6rem;
    margin-top: -.3rem;
    border-radius: var(--r-leaf);
    background: var(--accent-2);
  }
  /* blog.js opens the list on desktop and marks it as a rail: the title then reads as a label */
  .post-toc.is-rail summary { cursor: default; pointer-events: none; }
  .post-toc.is-rail summary .icon { display: none; }
}

/* ==========================================================================
   5. Long-form typography
   ========================================================================== */
/* opening paragraph: lede + drop cap */
.post .prose > .lede { max-width: none; }
.post .prose > .lede::first-letter {
  float: left;
  margin: .06em .1em 0 0;
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: .8;
  color: var(--maple);
}

/* section headings: a short amber-to-gold rule above each one */
.post .prose h2 { margin-top: 2.6em; }
.post .prose h2::before {
  content: "";
  display: block;
  width: 3rem; height: 2px;
  margin-bottom: 1.25rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
}
.post .prose h2 + figure { margin-top: 1.5em; }

/* pull quotes: the blockquotes already in the post that are people's words */
.prose blockquote.post-quote {
  margin-block: 2.6em;
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
  border-left: 0;
  border-block: 1px solid var(--rule-strong);
  font-size: var(--fs-700);
  line-height: 1.16;
  letter-spacing: -.012em;
  text-align: center;
  text-wrap: balance;
}
.post-quote .leaf { width: 1.5rem; height: 1.5rem; margin: 0 auto 1.1rem; color: var(--amber); }
.post .prose figure + .post-quote { margin-top: 2.2em; }

/* scripture */
.post .prose .verse { margin-block: 2.2em; }
.prose cite.ref { font-family: var(--font-serif); font-style: italic; color: var(--accent); white-space: nowrap; }

/* figures */
.post .prose figure img { object-fit: cover; }

/* SAFE CROP, do not change: service-sunset-congregation.webp has an outdated in-world
   "service times" poster about 63% across. A 1:1 crop pinned to the left 10% keeps it out of
   frame at every width (same rule as the homepage). Never show this photo wider than 1:1. */
.post-figure--sunset img { aspect-ratio: 1 / 1; object-position: 10% 50%; }
@media (min-width: 40em) {
  .post-figure--sunset {
    display: grid;
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: end;
  }
  .post .prose .post-figure--sunset figcaption { margin-top: 0; }
}

/* early-days-seaside.webp is low-res: keep it small */
.post-figure--small { max-width: 30rem; }

/* pastor-mike-wave.webp: 3:2 keeps the wave and the thumbs-up both in frame */
.post-figure--wave img { aspect-ratio: 3 / 2; object-position: 50% 30%; }

/* wide figures lean out of the text column where the layout has room */
@media (min-width: 68.75em) {
  .post-figure--wide { margin-right: calc(-1 * clamp(0rem, 5vw, 6rem)); }
}

/* sign-off */
.prose .post-signoff,
.prose .post-signature {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: var(--fs-600);
  line-height: 1.3;
  color: var(--fg);
}
.prose .post-signoff { margin-top: 1.6em; }
.prose .post-signature { margin-top: .35em; color: var(--accent); }

/* ==========================================================================
   6. End of post
   ========================================================================== */
.author-card__head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: .5rem; }
.author-card__head > div { min-width: 0; }
.author-card__photo {
  flex: none;
  width: 5.5rem; height: 5.5rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sand);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--amber);
}
.author-card__photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); transform-origin: 50% 36%; }
.author-card h3 { margin-top: .45rem; }
.author-card__role { margin-top: .3rem; font-size: var(--fs-300); color: var(--fg-soft); }

.invite-card h3 { margin-top: .9rem; }
.mini-steps { display: grid; gap: 1rem; margin: 1.5rem 0 1.75rem; padding: 0; list-style: none; }
.mini-steps li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.mini-steps__num {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  background: var(--paper);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-400);
  line-height: 1;
  color: var(--accent);
}
.mini-steps p { padding-top: .2rem; font-size: var(--fs-300); line-height: 1.55; color: var(--fg-soft); }
.mini-steps strong { color: var(--fg); }
.invite-card .actions { margin-top: auto; }

.post-end__back { margin-top: clamp(2rem, 4vw, 3rem); }

@media (max-width: 26em) {
  .author-card__head { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   7. Print
   ========================================================================== */
@media print {
  .read-progress, .post-toc, .post-end { display: none !important; }
}
