/* POST PAGE
   --post-gutter and --post-max-w defined in site.css tokens
   Shared by .post-page and .post-nav so a change to either token
   updates both automatically */

.post-page {
  max-width: var(--post-max-w);
  margin: 0 auto;
  padding: 0 var(--post-gutter) clamp(4rem, 8vw, 7rem);
}

/* Post header */
.post-header {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl-wide);
}

.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 1.25rem;
}

.post-header__cat {
  font-weight: 400;
  color: var(--cat-color, var(--ink-light));
  white-space: nowrap;
}

.post-header__date-cats,
.post-header__topics {
  font-size: 0.67rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--ink-light);
}

.post-header__date-cats a {
  color: var(--ink-light);
  border-bottom: 1px solid var(--border-mid);
  transition: color 0.2s, border-color 0.2s;
}

/* Topic links use ink-mid so they stand out from surrounding ink-light text */
.post-header__topics a {
  color: var(--ink-mid);
  border-bottom: 1px solid var(--border-mid);
  transition: color 0.2s, border-color 0.2s;
}

.post-header__date-cats a:hover,
.post-header__topics a:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.post-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.post-header__lede {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 52ch;
}

/* Featured image */
.post-hero-image {
  margin-bottom: var(--space-xl-wide);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-hero-image img,
.post-body .photo-pair figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-hero-image figcaption {
  padding-top: 0.6rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--ink-light);
  font-style: italic;
}

/* Body copy */
.post-body {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.5vw, 1.15rem);
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink-mid);
  max-width: 68ch;
}

.post-body > * + * { margin-top: 1.5em; }

.post-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em;
  font-weight: 400;
  line-height: 0.82;
  float: left;
  margin-right: 0.1em;
  margin-top: 0.06em;
  color: var(--ink);
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 2.75em;
  margin-bottom: -0.5em;
}

.post-body h3 {
  font-family: var(--font-body);
  font-size: var(--label-lg);
  font-weight: 400;
  letter-spacing: var(--label-lg-tracking);
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 2.5em;
  margin-bottom: -0.75em;
}

.post-body strong { font-weight: 500; color: var(--ink); }
.post-body em { font-style: italic; }

.post-body a {
  overflow-wrap: anywhere;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  transition: color 0.2s, border-color 0.2s;
}
.post-body a:hover { color: var(--accent); border-color: var(--accent); }

.post-body ul, .post-body ol { padding-left: 1.5em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-top: 0.4em; }

/* Shared post media */
.post-body figure { margin: 2.5em 0; }
.post-body figure img { width: 100%; height: auto; object-fit: cover; }

/* Keep legacy map embeds inside the reading column at narrow widths. */
.post-body .map-embed {
  max-width: 100%;
  border: 0;
}

/* Figure size variants */
.post-body figure.figure--wide {
  margin-left: clamp(-1rem, -3vw, -2.25rem);
  margin-right: clamp(-1rem, -3vw, -2.25rem);
}

.post-body figure.figure--small {
  max-width: clamp(180px, 28vw, 260px);
}

.post-body figure.figure--half {
  max-width: 50%;
  margin-inline: auto;
}

.post-body figure.figure--portrait {
  max-width: 420px;
  margin-inline: auto;
}

.post-body figure.figure--full {
  margin-inline: calc(50% - 50vw);
  width: 100vw;
}

.post-body figure.figure--small img,
.post-body figure.figure--portrait img,
.post-body figure.figure--full img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.post-body figure.figure--full img {
  max-height: 80vh;
}

/* Float utility */
.post-body figure.figure--float-left {
  float: left;
  margin: 0.35em 2rem 1.25em 0;
}

.post-body h2,
.post-body h3 {
  clear: both;
}

/* Photo components */
.post-body .photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 2.5em 0;
}

.post-body .photo-pair figure {
  margin: 0;
}

.post-body .photo-pair figcaption {
  padding-top: 0.4rem;
}

.post-body .figure--video iframe,
.post-body .figure--video video,
.post-body .figure--video embed {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  border: none;
  display: block;
}

.post-body figure figcaption {
  margin-top: 0.6rem;
  max-width: 32ch;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--ink-light);
  font-style: italic;
}

@media (max-width: 640px) {
  .post-body figure.figure--small,
  .post-body figure.figure--half,
  .post-body figure.figure--portrait {
    max-width: 100%;
  }

  .post-body .photo-pair {
    grid-template-columns: 1fr;
  }
}

/* Post footer: tags + back link */
.post-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.post-back { white-space: nowrap; }

/* Prev / next navigation
   Shares --post-max-w and --post-gutter with .post-page */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin-top: var(--space-lg-wide);
  max-width: var(--post-max-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--post-gutter);
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--space-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.25s;
}
.post-nav__item:hover { background: var(--accent-pale); }

.post-nav__item--prev { border-right: 1px solid var(--border); }
.post-nav__item--next { grid-column: 2; text-align: right; }

.post-nav__label {
  font-weight: 400;
  color: var(--ink-light);
}

.post-nav__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.2s;
}
.post-nav__item:hover .post-nav__title { color: var(--accent); }

/* Responsive */
@media (max-width: 600px) {
  .post-nav {
    grid-template-columns: 1fr;
    padding: 0 var(--gutter);
  }
  .post-nav__item--next { grid-column: 1; text-align: left; }
  .post-nav__item--prev { border-right: none; border-bottom: 1px solid var(--border); }
  .post-body p:first-child::first-letter { font-size: 2.8em; }
  .post-body figure.figure--float-left {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ── Editorial markup ─────────────────────────────────────────────────────── */

/* Mark, del and .pullquote live in 11b-prose.css (shared with notes). */

/* Part label: <p class="part-label"> */
.post-body .part-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  color: var(--ink-light);
  margin: 4rem 0 0.25rem;
}
.post-body .part-label + h2 {
  margin-top: 0.25rem;
}

