/* FCS Magazine — post.hbs (article reading view) styles.
 *
 * Spec: Doc #163 §2a (Step 4 of Doc #162 §7).
 * Sustained-reading typography. The most-visited template in any magazine
 * site, lowest tolerance for design self-indulgence — readers came for content.
 *
 * Inheritance principles (Doc #163 §0):
 *   - Lift V7 tokens, fonts, eyebrow, nav, footer verbatim (handled elsewhere).
 *   - Article body sits on plain --paper, NOT --paper-deep (paper-deep is the
 *     proof-spine register; reserved for the homepage hero).
 *   - No reveal animations on body content (staged reveals fight reading).
 *   - Featured image BELOW title block (NYT/Atlantic editorial pattern, not
 *     the homepage cover-spread pattern).
 *
 * Type scale references homepage Quote (clamp(2rem, 4vw, 3.75rem)) and
 * media-kit-title — pull-quote sits one half-step below those so each Zodiak
 * moment stays smaller than the next downstream Zodiak moment in hierarchy
 * (the masthead-Zodiak rule from Doc #158 §4).
 */

/* ─── 0. ARTICLE WRAPPER ────────────────────────────────────
 * The 1320px outer container is provided by .container; .post-article is the
 * vertical-rhythm shell that sits inside it. No max-width here — the inner
 * .post-body provides the 720px reading well.
 */
.post-article {
  background: var(--paper);
  padding: 7rem 0 5rem;
  position: relative;
  z-index: 2;
}

/* ─── 1. TITLE BLOCK (eyebrow + title + dek + metadata) ─────
 * Sits inside the 720px reading well so the title's measure rhymes with the
 * body's measure. Article titles exceeding 720px wrap naturally — no special
 * handling needed.
 */
.post-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.post-title {
  font-family: var(--font-display);
  /* Per Doc #163 §2a: clamp(2.5rem, 5vw, 4.25rem). Same scale as media-kit-title
   * but ink-on-paper instead of paper-on-sage. Article masthead moment. */
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 1.25rem;
  /* h1 em → Zodiak global rule from base.css applies: word-level italics
   * earn Zodiak permission, same as homepage hero. */
}

.post-subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-mute);
  margin-top: 1.5rem;
  max-width: 600px;
}

/* ─── 2. METADATA BLOCK (date · author · read-time) ─────────
 * Single horizontal row beneath title, above featured image (Doc #163 §2a).
 * Separators are 1px copper hairlines.
 */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.post-meta-author {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.post-meta-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sage-wash);
}

.post-meta-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.post-meta-divider {
  width: 1px;
  height: 0.85rem;
  background: var(--rule-copper);
  display: inline-block;
}

.post-meta-date,
.post-meta-time {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ─── 3. FEATURED IMAGE (below title block, full-bleed in container) ─
 * Per Kaleb's Step 4 sign-off: BELOW title — NYT/Atlantic pattern,
 * not the homepage cover-spread vocabulary.
 */
.post-feature-image {
  margin: 4rem auto 0;
  max-width: 1320px;
  padding: 0 2.5rem;
}

.post-feature-image img {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  display: block;
}

.post-feature-caption {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-whisper);
  text-align: right;
  padding-top: 0.75rem;
}

/* ─── 4. BODY — the sustained-reading register ──────────────
 * Doc #163 §2a: this is V7's missing register. Satoshi at length, --ink-soft
 * (not pure --ink — eyestrain rule), 1.7 line-height, 1.15rem.
 */
.post-body {
  max-width: 720px;
  margin: 4rem auto 0;
  padding: 0 2.5rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-soft);
}

.post-body > p,
.post-body > ul,
.post-body > ol,
.post-body > blockquote,
.post-body > pre,
.post-body > figure,
.post-body > hr {
  margin-bottom: 1.5rem;
}

.post-body > p:last-child,
.post-body > ul:last-child,
.post-body > ol:last-child {
  margin-bottom: 0;
}

/* H2 — section break inside an article. Always smaller than the post-title
 * so the article's masthead moment remains primary. */
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin: 3rem 0 1rem;
}

.post-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
}

.post-body h4 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 2rem 0 0.5rem;
}

/* Inline <em> — Satoshi italic, NOT Zodiak.
 * The base.css global rule (h1 em, h2 em, h3 em, .quote-text em → Zodiak)
 * does NOT extend to article-body em. Boundary enforced here with higher
 * specificity than the global selector. */
.post-body em,
.post-body p em,
.post-body li em,
.post-body td em {
  font-family: var(--font-body);
  font-style: italic;
}

.post-body strong {
  font-weight: 700;
  color: var(--ink);
}

.post-body a {
  color: var(--copper-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-thickness 0.2s ease;
}

.post-body a:hover {
  color: var(--copper);
  text-decoration-thickness: 2px;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

/* Pull quote — body-register Zodiak. Half-step below homepage Quote scale
 * (clamp(2rem, 4vw, 3.75rem)) so the Quote section stays primary. */
.post-body blockquote {
  font-family: var(--font-script);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.3;
  color: var(--ink);
  padding: 2rem 0 2rem 2rem;
  border-left: 2px solid var(--copper);
  max-width: 600px;
  margin: 2.5rem 0;
}

.post-body blockquote em {
  /* Quote-internal em can take Zodiak weight elevation — but blockquote IS
   * Zodiak already, so simply enforce italic without re-stating the family. */
  font-style: italic;
}

/* Code (Ghost editors get <code>; ship clean even if FCS is unlikely to use) */
.post-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.92rem;
  background: var(--sage-wash);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--paper-deep);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.post-body img,
.post-body figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.post-body figcaption {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-whisper);
  text-align: right;
  padding-top: 0.75rem;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ─── 5. DROP CAP — #feature posts only (launch-nice mechanism) ────
 * Per Doc #163 §4: Caity tags a post `#feature` (Ghost internal tag)
 * to opt into the masthead-register opening. Without #feature, default
 * Satoshi body type — drop caps on a 200-word press release would overdress.
 *
 * Mechanism shipped in v1; the visual is "polish-stage" — if Caity sees
 * the post template before launch and reads it as too blog-y, this is the
 * lever (Doc #163 §6 decision 3).
 */
.post-body--feature > p:first-of-type::first-letter {
  font-family: var(--font-script);
  font-style: italic;
  font-weight: 400;
  font-size: 4.5em;
  line-height: 0.85;
  float: left;
  padding: 0.1em 0.15em 0 0;
  color: var(--copper);
}

/* ─── 6. ARTICLE-END BLOCK (tags + share + author bio) ──────
 * Sits inside the 720px reading well, separated from body by a hairline rule.
 */
.post-end {
  max-width: 720px;
  margin: 4rem auto 0;
  padding: 0 2.5rem;
}

.post-end-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 2.5rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.post-tags a {
  /* Lifts .blog-card-category visual vocabulary — settled component. */
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(207, 125, 95, 0.12);
  color: var(--copper);
  transition: background 0.25s ease, color 0.25s ease;
}

.post-tags a:hover {
  background: var(--copper);
  color: var(--paper);
}

/* Share row — three icons matched to .footer-social treatment */
.post-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.post-share-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.post-share-icons {
  display: flex;
  gap: 0.6rem;
}

.post-share-icons a {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--sage-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-dark);
  transition: all 0.3s ease;
}

.post-share-icons a:hover {
  background: var(--copper);
  color: var(--paper);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(207, 125, 95, 0.45);
}

/* Author bio — optional. Renders only when bio present. */
.post-author-bio {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--paper-soft);
  padding: 2rem;
  border-radius: 4px;
}

.post-author-bio-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--sage-wash);
}

.post-author-bio-content {
  flex: 1;
}

.post-author-bio-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
  letter-spacing: -0.015em;
}

.post-author-bio-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-mute);
  margin-bottom: 0.75rem;
}

.post-author-bio-links {
  display: flex;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-author-bio-links a {
  color: var(--copper-dark);
  transition: color 0.2s ease;
}

.post-author-bio-links a:hover { color: var(--copper); }

/* ─── 7. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .post-article { padding: 5rem 0 3.5rem; }
  .post-header,
  .post-body,
  .post-end { padding: 0 1.25rem; }
  .post-feature-image { padding: 0 1.25rem; margin-top: 2.5rem; }
  .post-body { margin-top: 2.5rem; font-size: 1.08rem; }
  .post-body h2 { font-size: 1.55rem; margin: 2.25rem 0 0.75rem; }
  .post-body h3 { font-size: 1.2rem; }
  .post-body blockquote { padding-left: 1.25rem; margin: 2rem 0; }
  .post-meta { gap: 0.6rem; }
  .post-author-bio { flex-direction: column; padding: 1.5rem; }
  .post-body--feature > p:first-of-type::first-letter { font-size: 3.75em; }
}
