/* ===============================
   ARTICLE PAGE
================================ */
body.article-page {
  position: relative;
}

body.article-page #articleHeaderTitle,
body.article-page .article-main {
  transition: opacity 0.18s ease;
}

body.article-page.article-page--booting #articleHeaderTitle,
body.article-page.article-page--booting .article-main {
  opacity: 0;
  pointer-events: none;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--blog-card-border);
  background: var(--blog-card-bg);
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-back:hover {
  transform: translateY(-1px);
  border-color: var(--blog-outline);
  box-shadow: 0 0 12px rgba(255, 237, 0, 0.2);
}

.article-main {
  width: var(--blog-shell);
  margin: 0 auto;
  padding: 2.5rem 0 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--blog-header-height));
}

.article-card {
  border-radius: var(--blog-radius);
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  box-shadow: var(--blog-card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-hero {
  padding: 2rem;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.article-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--blog-muted);
  margin: 0;
}

.article-title {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.08;
  margin: 0;
}

.article-excerpt {
  color: var(--blog-muted);
  max-width: 720px;
  margin: 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  color: var(--blog-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.article-meta-icon {
  width: 0.95rem;
  height: 0.95rem;
  color: rgba(255, 237, 0, 0.92);
  flex: 0 0 auto;
}

body:not(.dark-mode).article-page .article-meta-icon {
  color: #8a7d00;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.article-tag {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 237, 0, 0.45);
  background: rgba(255, 237, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0.12);
  color: var(--text-color);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

body:not(.dark-mode).article-page .article-tag {
  background: rgba(255, 237, 0, 0.15);
  border-color: rgba(180, 138, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(180, 138, 0, 0.18);
}

.article-cover {
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.article-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.article-body {
  padding: 2rem;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  line-height: 1.82;
  font-family: inherit;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.article-body p {
  margin: 0;
  color: var(--text-color);
  font-weight: 300;
  max-width: none;
}

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

.article-body .article-lead {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-color);
  font-weight: 300;
}

.article-body .article-byline {
  font-family: "Kanit", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blog-muted);
  font-weight: 500;
}

.article-body .article-subtitle {
  margin: 1rem 0 0.2rem;
  font-family: "Kanit", sans-serif;
  font-size: clamp(1.05rem, 1.4vw, 1.28rem);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-color);
}

.article-body .article-editorial {
  margin-top: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 237, 0, 0.45);
  background: rgba(255, 237, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 237, 0, 0.12);
}

.article-body .article-editorial-title {
  margin: 0 0 0.6rem;
  font-family: "Kanit", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-color);
}

.article-body .article-editorial p {
  color: var(--blog-muted);
}

.article-body .article-code-block {
  margin: 0.2rem 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 237, 0, 0.22);
  background:
    linear-gradient(180deg, rgba(11, 13, 19, 0.96), rgba(20, 23, 32, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 28px rgba(0, 0, 0, 0.18);
  overflow-x: auto;
}

.article-body .article-code {
  display: block;
  margin: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #f6f3d1;
  white-space: pre;
}

.article-body .article-code[data-language]::before {
  content: attr(data-language);
  display: inline-block;
  margin-bottom: 0.7rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 237, 0, 0.28);
  background: rgba(255, 237, 0, 0.08);
  color: rgba(255, 237, 0, 0.92);
  font-family: "Kanit", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

body:not(.dark-mode).article-page .article-body .article-editorial {
  background: rgba(255, 237, 0, 0.15);
  border-color: rgba(180, 138, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(180, 138, 0, 0.18);
}

body:not(.dark-mode).article-page .article-body .article-editorial p {
  color: #3a3d45;
}

body:not(.dark-mode).article-page .article-body .article-code-block {
  border-color: rgba(180, 138, 0, 0.28);
  background:
    linear-gradient(180deg, rgba(31, 33, 40, 0.95), rgba(46, 49, 60, 0.98));
}

.article-body ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--blog-muted);
  display: grid;
  gap: 0.45rem;
}

.article-recommended {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.article-tail {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.article-empty {
  padding: 2.5rem 2rem;
  border-radius: var(--blog-radius);
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-card-border);
  box-shadow: var(--blog-card-shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-empty p {
  color: var(--blog-muted);
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 960px) {
  .article-main {
    padding: 2.2rem 0 4rem;
  }

  .article-back {
    font-size: 0.65rem;
    padding: 0.4rem 0.95rem;
  }
}

@media (max-width: 720px) {
  .article-main {
    width: min(100vw - 1.4rem, 100%);
  }
}

@media (max-width: 640px) {
  .article-hero,
  .article-body,
  .article-empty {
    padding: 1.6rem;
  }

  .article-title {
    font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  }

  .article-meta {
    gap: 0.6rem 1rem;
  }
}
