/* Article detail — 760px reading column */

.article-wrap {
  position: relative;
  overflow: hidden;

  > .glow {
    top: -140px;
    left: 15%;
    width: 520px;
    height: 380px;
  }
}

.article {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 80px;

  .backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--faint);
    margin-bottom: 32px;
    transition: color 0.2s;

    &:hover {
      color: var(--accent-ink);
    }
  }

  .article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--faint);
    margin: 0 0 18px;
    animation: rise 0.6s ease both;
  }

  h1 {
    font-size: clamp(32px, 4.5vw, 46px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 22px;
    animation: rise 0.6s 0.08s ease both;
  }

  .lead {
    font-size: 19px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0 0 40px;
    text-wrap: pretty;
    animation: rise 0.6s 0.16s ease both;
  }
}

/* ── Prose (Parsedown output) ── */

.prose {
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--prose);

  > * {
    margin: 0;
  }

  h2 {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-top: 20px;
  }

  h3 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin-top: 10px;
  }

  strong {
    color: var(--text);
  }

  a {
    color: var(--accent-ink);
    border-bottom: 1px solid var(--accent-ink);
    border-bottom-color: color-mix(in oklab, var(--accent-ink) 40%, transparent);
    transition: border-color 0.2s, color 0.35s;

    &:hover {
      border-bottom-color: var(--accent-ink);
    }
  }

  ul,
  ol {
    padding-left: 24px;

    li + li,
    ul,
    ol {
      margin-top: 10px;
    }
  }

  :not(pre) > code {
    font-family: var(--font-mono);
    font-size: 14.5px;
    background: var(--line);
    border-radius: 6px;
    padding: 2px 7px;
    transition: background-color 0.35s;
  }

  pre {
    background: var(--code-bg);
    color: #e8e4d4;
    font-size: 13.5px;
    line-height: 1.7;
    border-radius: 14px;
    padding: 24px 28px;
    overflow-x: auto;
    transition: background-color 0.35s;

    code,
    code.hljs {
      display: block;
      background: none;
      border-radius: 0;
      padding: 0;
      font-size: inherit;
      line-height: inherit;
    }
  }

  img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
  }

  blockquote {
    border-left: 3px solid var(--line2);
    padding: 4px 0 4px 20px;
    color: var(--muted);
    transition: border-color 0.35s;

    > * {
      margin: 0;
    }

    > * + * {
      margin-top: 12px;
    }
  }

  table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14.5px;
    line-height: 1.5;
  }

  th,
  td {
    border: 1px solid var(--line);
    padding: 10px 14px;
    text-align: left;
  }

  th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text);
    background: var(--chip);
  }

  hr {
    border: none;
    border-top: 1px solid var(--line);
  }
}

/* ── Author card ── */

.author-card {
  margin-top: 56px;
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: center;

  img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 20%;
    flex-shrink: 0;
  }

  .author-card-text {
    flex: 1;
  }

  .author-card-name {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    margin: 0;
  }

  .author-card-bio {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--muted);
    margin: 4px 0 0;

    a {
      color: var(--accent-ink);
      font-weight: 600;
    }
  }

  .author-card-link {
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
  }
}

/* ── Small screens ── */

@media (max-width: 600px) {
  .article {
    padding: 48px 20px 64px;
  }

  .prose {
    pre {
      padding: 18px 20px;
    }

    table {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  }

  .author-card {
    flex-wrap: wrap;
  }
}
