/* =========================================
   ARTICLE BACK LINK
   ========================================= */

.article-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);

  margin-bottom: var(--sp-8);

  color: var(--text-2);
  text-decoration: none;

  font-size: 0.84rem;
  line-height: 1;

  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.article-back:hover {
  color: var(--accent);
  transform: translateX(-2px);
}

.article-back svg {
  width: 14px;
  height: 14px;

  flex-shrink: 0;

  display: block;

  stroke-width: 2.2;
}

/* =========================================
   ARTICLE
   ========================================= */

.article-header {
  margin-bottom: var(--sp-10);
}

.article-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);

  margin-bottom: var(--sp-5);
}

.article-title {
  font-family: var(--serif);

  font-size: clamp(1.9rem, 7vw, 2.8rem);

  line-height: 1.4;

  margin-bottom: var(--sp-5);

  letter-spacing: 0.01em;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);

  padding-top: var(--sp-5);

  border-top: 1px solid var(--border);
}

.article-body {
  font-size: 1rem;
  line-height: 1.95;
}

.article-body > * + * {
  margin-top: 1.5rem;
}

.article-body h2 {
  font-family: var(--serif);

  font-size: 1.3rem;

  line-height: 1.5;

  margin-top: 3rem;
  margin-bottom: 1rem;

  padding-bottom: 0.65rem;

  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-family: var(--sans);

  font-size: 1rem;
  font-weight: 600;

  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  color: var(--text);
}

.article-body strong {
  font-weight: 700;
}

.article-body em {
  font-style: italic;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body li::marker {
  color: var(--text-3);
}

.article-body a {
  color: var(--accent);

  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body a:hover {
  opacity: 0.8;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);

  padding-left: var(--sp-5);

  color: var(--text-2);

  font-style: italic;
}

.article-body code {
  font-family: var(--mono);

  background: var(--surface-2);

  padding:
    0.15rem
    0.4rem;

  border-radius: 4px;

  font-size: 0.9em;
}

.article-body pre {
  overflow-x: auto;

  padding: var(--sp-5);

  border: 1px solid var(--border);
  border-radius: var(--r-md);

  background: var(--surface);
}

.article-body pre code {
  background: none;
  padding: 0;
}

/* =========================================
   TOC
   ========================================= */

.toc {
  margin: var(--sp-8) 0;

  padding:
    var(--sp-5)
    var(--sp-6);

  background: var(--surface-2);

  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.toc-label {
  font-size: 0.72rem;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: var(--text-3);

  margin-bottom: var(--sp-4);
}

.toc-list {
  list-style: none;
}

.toc-list li + li {
  margin-top: var(--sp-2);
}

.toc-list a {
  display: inline-flex;
  align-items: center;

  color: var(--text-2);

  text-decoration: none;

  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.toc-list a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

/* =========================================
   NEXT ARTICLE
   ========================================= */

.next-article {
  margin-top: var(--sp-10);

  padding: var(--sp-6);

  display: flex;
  align-items: center;
  gap: var(--sp-5);

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: var(--r-lg);

  text-decoration: none;

  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.next-article:hover {
  border-color: var(--accent);

  transform: translateY(-2px);

  box-shadow:
    0 4px 20px
    color-mix(in srgb, var(--text) 6%, transparent);
}

.next-article-body {
  flex: 1;
  min-width: 0;
}

.next-label {
  font-size: 0.72rem;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: var(--text-3);

  margin-bottom: var(--sp-2);
}

.next-title {
  font-family: var(--serif);

  font-size: 1rem;

  line-height: 1.55;
}

.next-article:hover .next-title {
  color: var(--accent);
}

.next-arrow {
  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--text-3);

  flex-shrink: 0;

  transition:
    transform 0.15s ease,
    color 0.15s ease;
}

.next-arrow svg {
  width: 18px;
  height: 18px;

  display: block;

  stroke-width: 2.2;
}

.next-article:hover .next-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* =========================================
   FOOTER
   ========================================= */

.site-footer {
  margin-top: var(--sp-12);

  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-w);

  margin: 0 auto;

  padding:
    var(--sp-8)
    var(--sp-5);

  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-3);

  line-height: 1.8;
}

.site-footer a {
  color: var(--text-2);
  text-decoration: none;

  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--accent);
}