/* ── Article hero ── */
.article-hero {
  padding: calc(var(--nav-height) + 1.25rem) var(--space-page-x) 1.75rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.article-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 50% 100%,
    rgba(249, 115, 22, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.article-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .breadcrumb {
    opacity: 0;
    animation: fadeUp 0.5s var(--ease-out) forwards 0.1s;
  }
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}

@media (hover: hover) {
  .breadcrumb a:hover {
    color: var(--accent);
  }
}

.breadcrumb span {
  color: var(--muted2);
}

.article-category {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .article-category {
    opacity: 0;
    animation: fadeUp 0.55s var(--ease-out) forwards 0.15s;
  }
}

.article-category::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.article-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .article-hero h1 {
    opacity: 0;
    animation: fadeUp 0.65s var(--ease-out) forwards 0.25s;
  }
}

.article-hero h1 em {
  color: var(--accent);
  font-style: italic;
}

.article-subtitle {
  font-size: var(--text-sm);
  color: var(--copy-soft);
  font-weight: 300;
  margin-bottom: 1.25rem;
  max-width: 36rem;
  line-height: 1.7;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .article-subtitle {
    opacity: 0;
    animation: fadeUp 0.65s var(--ease-out) forwards 0.35s;
  }
}

.article-meta-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.85rem 0 0;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .article-meta-bar {
    opacity: 0;
    animation: fadeUp 0.65s var(--ease-out) forwards 0.45s;
  }
}

.meta-item {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.06em;
}

.meta-sep {
  color: var(--muted);
  opacity: 0.4;
  font-size: 0.6rem;
  line-height: 1;
}

.meta-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

a.meta-tag {
  text-decoration: none !important;
  cursor: pointer;
}

a.meta-tag:hover {
  opacity: 0.8;
}

/* ── Article body (reading experience) ── */
.article-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.75rem var(--space-page-x) 2.5rem;
  width: 100%;
  min-width: 0;
}

.article-body h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin: 2rem 0 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
}

.article-body h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  min-height: 1.1em;
  margin-top: 0.15em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.article-body h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 1.75rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1rem;
  color: var(--copy);
  font-weight: 300;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.article-body p strong {
  color: var(--text);
  font-weight: 500;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (hover: hover) {
  .article-body a:hover {
    text-decoration-thickness: 2px;
  }
}

.article-body .btn-primary,
.article-body .btn-secondary {
  text-decoration: none;
}

.article-body .btn-primary {
  color: #000;
}

.article-body .btn-secondary {
  color: var(--muted);
}

ul.body-list {
  list-style: none;
  margin: 0.65rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

ul.body-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--copy-soft);
  font-size: var(--text-sm);
  font-weight: 300;
  line-height: 1.65;
}

ul.body-list li::before {
  content: "→";
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 0.05rem;
  font-size: 0.75rem;
}

/* ── Markdown default lists ── */
.article-body ul,
.article-body ol {
  margin: 0.65rem 0 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.article-body ul li,
.article-body ol li {
  color: var(--copy-soft);
  font-size: var(--text-sm);
  font-weight: 300;
  line-height: 1.65;
}

/* Callout boxes */
.error-box,
.success-box,
.info-box,
.warn-box {
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  font-size: var(--text-sm);
  line-height: 1.65;
}

.error-box {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-left: 3px solid var(--red);
  font-family: var(--font-mono);
  color: var(--red);
}

.error-box .box-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(248, 113, 113, 0.6);
  margin-bottom: 0.4rem;
}

.success-box {
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.18);
  border-left: 3px solid var(--green);
  color: #b6f7cb;
  font-weight: 300;
}

.success-box strong {
  color: var(--green);
}

.info-box {
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-left: 3px solid var(--blue);
  color: #bfdbfe;
  font-weight: 300;
}

.warn-box {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-left: 3px solid var(--accent);
  color: #fed7aa;
  font-weight: 300;
}

.box-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

/* Code and mock terminal window */
pre {
  background: #1a1a1f;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  padding-top: 2rem;
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
}

pre code {
  display: block;
  overflow-x: auto;
  padding: 0.6rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}

/* Terminal header bar — background strip dengan tiga dots */
pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2rem;
  background: #111116;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Three macOS style mock terminal window control dots */
pre::after {
  content: "";
  position: absolute;
  top: 0.65rem;
  left: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow:
    14px 0 0 #ffbd2e,
    28px 0 0 #27c93f;
  opacity: 0.75;
}

pre .file-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--muted2);
  position: absolute;
  top: 0.72rem;
  right: 1rem;
  letter-spacing: 0.06em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--pre-code-text);
}

.article-body p code,
.article-body li code {
  background: var(--inline-code-bg);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--inline-code-text);
}

.cm { color: #3a3a3f; }
.cd { color: var(--blue); }
.cv { color: var(--green); }
.cp { color: #a78bfa; }
.bp { color: var(--muted2); user-select: none; }

/* ── Spacing: heading after code block ── */
.article-body pre + h1,
.article-body pre + h2,
.article-body pre + h3 {
  margin-top: 3rem;
}

/* Diagrams */
.diagram {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-x: auto;
}

.diagram-label {
  font-size: 0.58rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.2rem 0;
}

.box {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.45rem;
  font-size: 0.65rem;
}

.box.client { border-color: var(--blue); color: var(--blue); }
.box.nginx  { border-color: var(--accent); color: var(--accent); }
.box.up     { border-color: #a78bfa; color: #a78bfa; }
.box.fail   { border-color: var(--red); color: var(--red); background: rgba(248, 113, 113, 0.05); }
.box.ok     { border-color: var(--green); color: var(--green); background: rgba(74, 222, 128, 0.05); }

.arr   { color: var(--muted); }
.arr.r { color: var(--red); }
.arr.g { color: var(--green); }

/* Tables — scroll on mobile */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.72rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.article-body td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  color: var(--copy);
  vertical-align: top;
}

.article-body tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .article-body tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
  }
}

.article-body td.td-dir { color: var(--blue); font-family: var(--font-mono); }
.article-body td.td-old { color: var(--red); font-family: var(--font-mono); }
.article-body td.td-new { color: var(--green); font-family: var(--font-mono); }

.takeaway {
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.takeaway h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  margin-top: 0;
  font-size: 0.75rem;
}

.takeaway p {
  color: var(--info-text);
  margin: 0;
  font-size: var(--text-sm);
}

.article-image {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.article-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition:
    transform var(--duration-normal) var(--ease-out),
    border-color var(--duration-fast);
  display: block;
}

@media (hover: hover) {
  @media (prefers-reduced-motion: no-preference) {
    .article-image img:hover {
      transform: scale(1.01);
      border-color: var(--accent);
    }
  }
}

.article-image figcaption {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.6rem;
  text-align: center;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.article-image figcaption::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1px;
  background: var(--muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.article-image figcaption::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1px;
  background: var(--muted);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Article footer */
.article-body .article-footer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-top: 2rem;
}

.article-body .article-footer-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.article-body .article-footer .author-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.article-body .article-footer .author-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #c2410c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
}

.article-body .article-footer .author-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 0.2rem;
}

.article-body .article-footer .author-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.article-body .article-footer .author-bio {
  font-size: var(--text-sm);
  color: var(--copy-soft);
  font-weight: 300;
  line-height: 1.65;
}

.article-body .article-footer .article-tags-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.article-body .article-footer .atag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.article-body .article-footer .post-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-body .article-footer .post-nav a {
  text-decoration: none;
  width: 100%;
}

.article-body .article-footer .post-nav .btn-primary,
.article-body .article-footer .post-nav .btn-secondary {
  width: 100%;
  font-size: 0.65rem;
  padding: 1rem 2rem;
  line-height: 1.2;
}

/* ── Light mode override for code blocks ── */
[data-theme="light"] pre {
  background: #f0f0f4;
  border-color: #d8d8e2;
}

[data-theme="light"] pre::before {
  background: #e2e2ea;
  border-bottom-color: #d0d0dc;
}

[data-theme="light"] pre code {
  color: #1a1a2e;
}

[data-theme="light"] code {
  color: #1a1a2e;
}

[data-theme="light"] .article-body p code,
[data-theme="light"] .article-body li code {
  background: #e8e8f0;
  border-color: #d0d0dc;
  color: #c2410c;
}

[data-theme="light"] .pre-title {
  color: #777;
}

[data-theme="light"] .copy-btn {
  background: #e2e2ea;
  border-color: #d0d0dc;
  color: #555;
}

[data-theme="light"] .copy-btn:hover {
  color: #1a1a2e;
  border-color: #999;
}
  .article-hero {
    padding: calc(var(--nav-height) + 2rem) var(--space-page-x) 2.5rem;
  }

  .breadcrumb {
    font-size: 0.65rem;
    margin-bottom: 1.25rem;
  }

  .article-category {
    font-size: 0.65rem;
    margin-bottom: 0.85rem;
  }

  .article-category::before {
    width: 1.5rem;
  }

  .article-hero h1 {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    margin-bottom: 1rem;
  }

  .article-subtitle {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
  }

  .article-meta-bar {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .article-body {
    padding: 2.5rem var(--space-page-x) 3.5rem;
  }

  .article-body h2 {
    font-size: 1.45rem;
    margin: 2.5rem 0 1rem;
  }

  .article-body p {
    font-size: 1rem;
    margin-bottom: 1.15rem;
  }

  pre {
    padding: 0;
    padding-top: 2.75rem;
  }

  pre code {
    padding: 1.25rem;
  }

  code {
    font-size: 0.82rem;
  }

  .diagram {
    padding: 1.5rem;
    font-size: 0.78rem;
  }

  .article-body table {
    display: table;
    overflow-x: visible;
    font-size: 0.82rem;
  }

  .article-body th,
  .article-body td {
    padding: 0.6rem 0.85rem;
  }

  .article-body .article-footer .author-card {
    flex-direction: row;
    padding: 1.5rem;
  }

  .article-body .article-footer .author-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.35rem;
  }

  .article-body .article-footer .post-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .article-body .article-footer .post-nav a {
    width: auto;
  }

  .article-body .article-footer .post-nav .btn-primary,
  .article-body .article-footer .post-nav .btn-secondary {
    width: auto;
    font-size: inherit;
    padding: 0.95rem 2rem;
  }
}

/* ── Desktop ── */
@media (min-width: 56.25rem) {
  .article-hero {
    padding: calc(var(--nav-height) + 2.5rem) var(--space-page-x) 3rem;
  }

  .article-body {
    padding: 3rem var(--space-page-x) 4.5rem;
  }

  .article-body h1 {
    font-size: 2rem;
    margin: 3.5rem 0 1.25rem;
  }

  .article-body h2 {
    font-size: 1.6rem;
    margin: 3rem 0 1.15rem;
  }

  .takeaway {
    padding: 1.75rem;
  }
}

/* ── Footer ── */
footer {
  display: flex;
  justify-content: flex-end;
  padding: 1.5rem var(--space-page-x, 2rem);
  border-top: 1px solid var(--border);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}