/* ───────────────────────────────────────────────
   Post footer — Prev/Next nav + Comments (utterances)
   Style: editorial aesthetic-care, Stitch-inspired
   ─────────────────────────────────────────────── */

/* ── Override PaperMod's default .paginav ───────────── */
.paginav {
  --rule: var(--color-rule, rgba(30, 35, 30, 0.08));
  --surface: var(--color-surface-low, #f4f4f2);

  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 4rem !important;
  margin-bottom: 2.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.paginav a {
  position: relative;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  padding: 22px 26px !important;
  border: 1px solid var(--rule) !important;
  border-radius: 10px;
  background: var(--color-paper, #f9f9f7);
  color: var(--color-ink, #1a1c1b);
  text-decoration: none;
  transition: border-color 220ms ease, background 220ms ease,
              box-shadow 220ms ease, transform 260ms cubic-bezier(.2,.6,.2,1);
  overflow: hidden;
}

.paginav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--color-accent-soft, rgba(134, 33, 34, 0.035)) 100%);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.paginav a:hover {
  border-color: var(--color-accent, #2e352e) !important;
  background: var(--color-paper, #f9f9f7);
  box-shadow: 0 8px 24px -12px rgba(30, 35, 30, 0.15);
  transform: translateY(-1px);
}

.paginav a:hover::before {
  opacity: 0.4;
}

/* Eyebrow label ("« Prev" / "Next »") */
.paginav .title {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-ink-muted, #5e5e63) !important;
  opacity: 0.75;
  margin-bottom: 0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.paginav a:hover .title {
  color: var(--color-accent, #2e352e) !important;
  opacity: 1;
}

/* Title of the linked article */
.paginav a > span:not(.title) {
  font-family: var(--font-display, 'Fraunces', 'Georgia', serif);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-ink, #1a1c1b);
  letter-spacing: -0.01em;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:lang(zh) .paginav a > span:not(.title) {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'PingFang SC', var(--font-body), serif;
  font-size: 1.04rem;
  letter-spacing: 0.01em;
  font-weight: 500;
}

:lang(en) .paginav a > span:not(.title) {
  font-style: normal;
}

/* Align next card to the right */
.paginav .next {
  text-align: right;
  align-items: flex-end;
}

.paginav .next .title {
  justify-content: flex-end;
}

/* Mobile: stack */
@media (max-width: 720px) {
  .paginav {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .paginav .next,
  .paginav .next .title {
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
  }
}

/* Dark theme */
body.dark .paginav a {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark .paginav a:hover {
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}


/* ── Comments wrapper (utterances) ─────────────────── */
.post-comments {
  margin-top: 4.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--color-rule, rgba(30, 35, 30, 0.08));
}

.post-comments__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.post-comments__title {
  font-family: var(--font-display, 'Fraunces', 'Georgia', serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-ink, #1a1c1b);
  margin: 0;
  line-height: 1.2;
}

:lang(zh) .post-comments__title {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'PingFang SC', var(--font-body), serif;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.post-comments__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-ink-muted, #5e5e63);
  opacity: 0.55;
}

.post-comments__dash {
  opacity: 0.5;
}

:lang(zh) .post-comments__meta {
  letter-spacing: 0.14em;
  font-family: 'PingFang SC', var(--font-body), system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: none;
}

.post-comments__body {
  position: relative;
  min-height: 120px;
}

/* Tame utterances iframe padding so it visually breathes */
.post-comments__body .utterances {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Soft skeleton hint while utterances loads */
.post-comments__body:empty::before,
.post-comments__body:has(> script:only-child)::before {
  content: "";
  display: block;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    var(--color-surface-low, #f4f4f2) 0%,
    rgba(30, 35, 30, 0.03) 50%,
    var(--color-surface-low, #f4f4f2) 100%);
  background-size: 200% 100%;
  animation: postCommentsShimmer 2s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes postCommentsShimmer {
  0%, 100% { background-position: 200% 0; }
  50%      { background-position: -200% 0; }
}

body.dark .post-comments {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Reduced motion: stop the comments-loading shimmer sweep. The
   skeleton stays as a calm static placeholder until the embed
   loads, so no information is lost.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .post-comments__body:has(> script:only-child)::before {
    animation: none !important;
  }
}
