/* ==================================================================
   Blog post — kwizzbit/blog-post  (single-article reading experience)
   Designed for digital reading: comfortable measure, generous rhythm,
   full-bleed media, pull-quotes, share row, reading-progress bar.
   Prose targets the core post-content (.blog-post__prose).
   ================================================================== */

  .kwb-segment--blog-post { background: var(--wp--preset--color--cream); }

  /* Reading-progress bar (fixed, set by blog-post.js) */
  .blog-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: var(--wp--preset--color--coral);
    z-index: 200;
    transition: width 80ms linear;
    pointer-events: none;
  }

  /* ── ARTICLE HEADER ─────────────────────────────────────── */
  .blog-post__hero { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }
  .blog-post__hero-inner,
  .blog-post__content {
    max-width: 720px;       /* optimal reading measure */
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
  }

  /* Whole-article "window" lift on load — the header and body rise
     together as one block once the page-loader clears (held at frame 0
     by the html.kwb-loading animation pause in base.css). The fixed
     reading-progress bar lives outside both, so it's untouched. */
  .blog-post__hero,
  .blog-post__body {
    animation: kwb-content-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }
  @media (prefers-reduced-motion: reduce) {
    .blog-post__hero,
    .blog-post__body { animation: none; }
  }

  .blog-post__back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--wp--preset--font-family--body);
    font-weight: 600;
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--custom--color--nav-ink);
    text-decoration: none;
    margin-bottom: 1.5rem;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--wp--custom--motion--dur-base) var(--wp--custom--motion--ease-out);
  }
  @media (hover: hover) {
    .blog-post__back:hover { color: var(--wp--preset--color--coral); }
  }
  /* Tap feedback on touch — coral, never the default burgundy/ink */
  .blog-post__back:active { color: var(--wp--preset--color--coral); }

  /* Pillbox tags — font-size:0 wrapper hides the term separator text */
  .blog-post__cat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0;
    margin-bottom: 1rem;
  }
  .blog-post__cat a {
    display: inline-block;
    font-family: var(--wp--preset--font-family--body);
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--wp--preset--color--coral);
    background: rgba(255, 54, 35, 0.10);
    padding: 0.25rem 0.5rem;
    border-radius: 0;
    text-decoration: none;
    transition: background-color var(--wp--custom--motion--dur-base) var(--wp--custom--motion--ease-out);
  }
  .blog-post__cat a:hover { background: rgba(255, 54, 35, 0.18); }

  .blog-post__title {
    font-family: 'Roobert Semimono', monospace;
    font-weight: 400;
    font-size: clamp(2.25rem, 5.5vw, 3.5rem);
    line-height: 0.98;
    letter-spacing: -0.091em;
    color: var(--wp--preset--color--ink);
    margin: 0 0 0.75rem;
    text-wrap: balance;
  }

  .blog-post__meta-icon {
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    animation: meta-icon-rock 6s ease-in-out infinite;
    transform-origin: center bottom;
  }
  @keyframes meta-icon-rock {
    0%, 100% { transform: rotate(0deg); }
    20%       { transform: rotate(-6deg); }
    40%       { transform: rotate(5deg); }
    60%       { transform: rotate(-4deg); }
    80%       { transform: rotate(3deg); }
  }
  @media (prefers-reduced-motion: reduce) { .blog-post__meta-icon { animation: none; } }

  .blog-post__meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--wp--preset--font-family--body);
    font-weight: 500;
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--custom--color--nav-ink);
  }
  .blog-post__meta .wp-block-post-author-name,
  .blog-post__meta .wp-block-post-author-name a { color: var(--wp--preset--color--ink); font-weight: 600; text-decoration: none; margin: 0; }
  .blog-post__meta .wp-block-post-date,
  .blog-post__meta .wp-block-post-time-to-read { margin: 0; }
  .blog-post__read { font-weight: 700; }
  .blog-post__dot { opacity: 0.45; }
  /* Author name hidden site-wide — byline uses date + read time only */
  .blog-post__author,
  .blog-post__meta .wp-block-post-author-name { display: none; }
  /* Also hide the dot spacers that flanked the author */
  .blog-post__dot:first-of-type { display: none; }

  /* ── FEATURED IMAGE (wider than the text column) ────────── */
  .blog-post__featured {
    /* Match the article text column width so image sits within the same bounds */
    max-width: 720px;
    margin: 0.75rem auto clamp(2rem, 4vw, 3rem);
    padding-inline: clamp(1.25rem, 4vw, 2rem);
  }
  .blog-post__featured img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* ── ARTICLE BODY ───────────────────────────────────────── */
  .blog-post__body { padding-bottom: clamp(3rem, 6vw, 5rem); }

  /* ── PROSE TYPOGRAPHY (the reading experience) ──────────── */
  .blog-post__prose {
    font-family: var(--wp--preset--font-family--body);
    color: #2E211D;
  }
  .blog-post__prose > * { margin-block: 0; }
  .blog-post__prose > * + * { margin-top: 1.5em; }

  .blog-post__prose p {
    font-size: 1.1875rem;       /* 19px */
    line-height: 1.75;
    font-weight: 450;
    letter-spacing: -0.003em;
  }
  /* Lead paragraph — the opener reads a touch larger */
  .blog-post__prose > p:first-of-type {
    font-size: 1.375rem;
    line-height: 1.6;
    color: var(--wp--preset--color--ink);
  }

  .blog-post__prose h2 {
    font-family: 'Roobert Semimono', monospace;
    font-weight: 600;
    font-size: 1.625rem;
    line-height: 1.05;
    letter-spacing: -0.08em;
    color: var(--wp--preset--color--ink);
    margin-top: 2.25em;
    margin-bottom: 0;
  }
  .blog-post__prose h2 + * { margin-top: 0.75em; }
  .blog-post__prose h3 {
    font-family: 'Roobert Semimono', monospace;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.07em;
    color: var(--wp--preset--color--ink);
    margin-top: 2em;
    margin-bottom: 0;
  }
  .blog-post__prose h3 + * { margin-top: 0.5em; }

  .blog-post__prose a {
    color: var(--wp--preset--color--coral);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }
  .blog-post__prose strong { font-weight: 700; color: var(--wp--preset--color--ink); }

  /* Lists */
  .blog-post__prose ul,
  .blog-post__prose ol {
    font-size: 1.1875rem;
    line-height: 1.7;
    padding-left: 1.5rem;
  }
  .blog-post__prose li + li { margin-top: 0.5em; }
  .blog-post__prose ul li::marker { color: var(--wp--preset--color--coral); }
  .blog-post__prose ol li::marker { color: var(--wp--preset--color--coral); font-weight: 700; }

  /* Pull-quote */
  .blog-post__prose blockquote {
    margin: 2em 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 3px solid var(--wp--preset--color--coral);
    font-family: var(--wp--preset--font-family--display);
    font-weight: 400;
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--wp--preset--color--ink);
  }
  .blog-post__prose blockquote p { font-size: inherit; line-height: inherit; }
  .blog-post__prose blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-family: var(--wp--preset--font-family--body);
    font-style: normal;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--wp--custom--color--nav-ink);
  }

  /* Images / figures — break out wider than the text column */
  .blog-post__prose .wp-block-image,
  .blog-post__prose figure {
    margin-block: 2em;
  }
  .blog-post__prose .wp-block-image img,
  .blog-post__prose figure img {
    display: block;
    width: 100%;
    height: auto;
  }
  .blog-post__prose figcaption {
    margin-top: 0.625rem;
    text-align: center;
    font-family: var(--wp--preset--font-family--body);
    font-size: 0.8125rem;
    color: var(--wp--custom--color--nav-ink);
  }
  /* Images + figures stay within the 720px article column — no bleed */
  .blog-post__prose .wp-block-image,
  .blog-post__prose figure { max-width: 100%; }

  /* Divider */
  .blog-post__prose hr {
    border: none;
    height: 1px;
    background: var(--wp--custom--color--warm-border);
    margin-block: 2.5em;
    max-width: 120px;
    margin-inline: auto;
  }

  /* Inline + block code */
  .blog-post__prose code {
    font-family: ui-monospace, 'SFMono-Regular', monospace;
    font-size: 0.9em;
    background: rgba(0,0,0,0.05);
    padding: 0.1em 0.35em;
    border-radius: 0;
  }
  .blog-post__prose pre {
    background: var(--wp--preset--color--ink);
    color: #F5EAE0;
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.9375rem;
    line-height: 1.6;
  }
  .blog-post__prose pre code { background: none; padding: 0; color: inherit; }

  /* ── SHARE ROW ──────────────────────────────────────────── */
  /* Two instances per article (2026-07-19, user's ask): this one sits below
     the prose, separated by a rule; .blog-post__share--top is the duplicate
     under the byline meta row, spacing-only variant below. The white
     box/border was dropped then restored same day (user changed their
     mind) — kept, just sized down a touch (40px → 34px). */
  .blog-post__share {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--wp--custom--color--warm-border);
  }
  .blog-post__share--top {
    margin-top: 1.25rem;
    padding-top: 0;
    border-top: none;
  }
  .blog-post__share-label {
    font-family: var(--wp--preset--font-family--body);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wp--custom--color--nav-ink);
    margin-right: 0.25rem;
  }
  .blog-post__share-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--wp--custom--color--warm-border);
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--ink);
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    padding: 0;
    transition: color var(--wp--custom--motion--dur-base) var(--wp--custom--motion--ease-out),
                border-color var(--wp--custom--motion--dur-base) var(--wp--custom--motion--ease-out),
                transform var(--wp--custom--motion--dur-base) var(--wp--custom--motion--ease-out);
  }
  @media (hover: hover) {
    .blog-post__share-btn:hover {
      color: var(--wp--preset--color--coral);
      border-color: var(--wp--preset--color--coral);
      transform: translateY(-2px);
    }
  }
  .blog-post__share-btn:active {
    color: var(--wp--preset--color--coral);
    border-color: var(--wp--preset--color--coral);
    transform: translateY(1px);
  }
  .blog-post__copied {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--wp--preset--color--ink);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--body);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
  }
  .blog-post__share-copy.is-copied .blog-post__copied { opacity: 1; transform: translateX(-50%) translateY(0); }

  .blog-post__back--bottom {
    margin-top: 2.5rem;
    margin-bottom: 0;
  }

  /* ── READ NEXT ──────────────────────────────────────────── */
  .blog-post__read-next {
    background: #F0E3D9;
    padding-block: clamp(3rem, 6vw, 5rem);
  }
  .blog-post__read-next-header,
  .blog-post__read-next-query {
    /* Slightly wider than the article column to give 3 cards room */
    max-width: 900px;
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
  }
  .blog-post__read-next-header { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
  .blog-post__read-next-title {
    font-family: 'Roobert Semimono', monospace;
    font-weight: 400;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.08em;
    color: var(--wp--preset--color--ink);
    margin: 0;
  }
  .blog-post__read-next-cursor {
    color: var(--wp--preset--color--coral);
    display: inline-block;
    animation: faq-cursor-blink 1.1s step-end infinite;
  }
  @media (prefers-reduced-motion: reduce) { .blog-post__read-next-cursor { animation: none; } }

  /* ── Generate quiz CTA button ───────────────────────────── */
  .blog-post__quiz-cta {
    margin-top: 2.5rem;
  }
  .blog-post__quiz-btn { display: inline-flex; }

  /* Reuse the blog-card grid from the index */
  .blog-post__read-next-query .wp-block-post-template {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.875rem, 1.5vw, 1.25rem);
  }
  .blog-post__read-next-query .wp-block-post-template > li { margin: 0; min-width: 0; }

  @media (max-width: 640px) {
    /* 2-column grid, 2 articles only — matches the read-these row at the bottom
       of How it Works. The third card is hidden (the query still fetches 3;
       we just don't show it) so the 2-up grid stays balanced. */
    .blog-post__read-next-query .wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
    .blog-post__read-next-query .wp-block-post-template > li:nth-child(3) { display: none; }
    /* 2-col cards: category, headline, time-est only — no date */
    .blog-post__read-next-query .blog-card__date { display: none; }
    /* Pin time-est to the bottom of each card body */
    .blog-post__read-next-query .blog-card__meta { margin-top: auto; }
  }

  /* ── Reduced motion ─────────────────────────────────────── */
  @media (prefers-reduced-motion: reduce) {
    .blog-progress,
    .blog-card__image img,
    .blog-post__share-btn { transition: none; }
  }
