/* =========================================================
   post page — article typography
   ========================================================= */

body.post {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
}

body.post .top,
body.bloglist .top {
  border-bottom: 1px solid rgba(109, 93, 109, 0.3);
}

.article {
  position: relative;
  z-index: 5;
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.meta-date {
  color: var(--fg-dim);
}

.post-cve {
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.post-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-left: auto;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.post-github:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: rgba(236, 80, 0, 0.08);
}
.post-github svg { flex-shrink: 0; }

.article-meta {
  flex-wrap: wrap;
}

.article-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1rem 0;
  color: var(--fg);
  letter-spacing: 0.005em;
}

.article-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
  background: rgba(83, 64, 77, 0.5);
  border: 1px solid rgba(109, 93, 109, 0.4);
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

/* article body */
.article-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--fg);
}

.article-body > *:first-child { margin-top: 0; }

.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: var(--font-sans);
  color: var(--fg);
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  position: relative;
  scroll-margin-top: 1.5rem;
}

.heading-anchor {
  position: absolute;
  left: -1.3rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  opacity: 0;
  font-weight: 400;
  text-decoration: none;
  border: none !important;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor,
.article-body h4:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
  color: var(--accent);
}

.article-body h2 {
  font-size: 1.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(109, 93, 109, 0.4);
}

.article-body h3 { font-size: 1.25rem; color: var(--accent-2); }
.article-body h4 { font-size: 1.05rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.article-body p { margin: 1rem 0; }

.article-body a {
  color: var(--accent-2);
  border-bottom: 1px dashed var(--accent-2);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.article-body a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.article-body strong { color: var(--fg); font-weight: 600; }
.article-body em     { color: var(--accent-2); font-style: normal; }

.article-body ul,
.article-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.article-body li { margin: 0.3rem 0; }
.article-body li::marker { color: var(--accent); }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  color: var(--fg);
  opacity: 0.9;
  background: rgba(83, 64, 77, 0.3);
  font-style: italic;
}

.article-body hr {
  border: none;
  border-top: 1px solid rgba(109, 93, 109, 0.35);
  margin: 2.5rem 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin: 1.2rem 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.article-body th,
.article-body td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body th {
  background: rgba(83, 64, 77, 0.5);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* inline code */
.article-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(83, 64, 77, 0.6);
  color: var(--accent-2);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid rgba(109, 93, 109, 0.4);
}

/* code blocks (shiki-generated) */
.article-body pre {
  background: #011627 !important;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
.article-body pre code {
  font-family: var(--font-mono);
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
}

.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--fg-dim);
  border-bottom: 1px dashed transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.back-link:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

/* ========== bloglist page ========== */
body.bloglist {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

body.bloglist .stage {
  padding-top: 2rem;
  padding-bottom: 3rem;
  justify-content: flex-start;
}

.recent-full { max-width: 100%; }

/* mobile */
@media (max-width: 720px) {
  .article { padding: 2rem 1.2rem 3rem; }
  .article-body { font-size: 0.98rem; }
  .article-body pre { padding: 0.8rem 0.9rem; font-size: 0.8rem; }
}
