/* ---- LAYOUT ---- */
.page-content {
  max-width: 1100px;
}

/* HTML posts carry their own internal padding */
.page-content.html-post {
  padding-top: 11rem;
}

/* ---- READING PROGRESS BAR ---- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 200;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ---- BACK LINK ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 3.5rem;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.back-link:hover {
  background: #00cc6a;
  box-shadow: 0 0 18px var(--accent);
  transform: translateY(-1px);
}

/* ---- POST HEADER ---- */
.post-header {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.post-header::before {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  margin-bottom: 2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  letter-spacing: 0.07em;
  margin-bottom: 1.75rem;
}

.post-meta-sep {
  color: var(--border);
  user-select: none;
}

.post-meta-date { color: var(--text-secondary); }

.post-meta-readtime { color: var(--text-dim); }

.post-meta-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid #00ff8833;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
}

.post-title {
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.12;
  margin-bottom: 1.25rem;
}

.post-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  max-width: 680px;
}

/* ---- ARTICLE BODY ---- */
.post-body {
  max-width: 720px;
  line-height: 1.85;
  font-size: 1.12rem;
  color: var(--text-primary);
}

.post-body h1 { display: none; }

.post-body h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: #ffffff;
  margin: 3.25rem 0 1rem;
  letter-spacing: -0.02em;
}

.post-body h2::before {
  content: '//';
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0;
  flex-shrink: 0;
  opacity: 0.8;
}

.post-body h3 {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  margin: 2.5rem 0 0.75rem;
}

.post-body h4 {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 1.75rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.post-body p { margin-bottom: 1.4rem; }

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s, color 0.2s;
}

.post-body a:hover {
  border-color: var(--accent);
  color: #fff;
}

.post-body strong { color: #ffffff; }
.post-body em { font-style: italic; }

.post-body ul, .post-body ol { margin: 1rem 0 1.5rem 1.25rem; }
.post-body li { margin-bottom: 0.6rem; line-height: 1.78; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  background: linear-gradient(to right, var(--accent-dim), transparent 70%);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-body blockquote p { margin-bottom: 0; }

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: #161616;
  border: 1px solid #222;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--accent);
}

.post-body pre {
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-primary);
}

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

.post-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 25%, var(--border) 75%, transparent);
  margin: 3rem 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.88rem;
}

.post-body th, .post-body td {
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  text-align: left;
}

.post-body th {
  background: #111;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- LOADING / ERROR ---- */
.post-loading, .post-error {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---- MOBILE ---- */
@media (max-width: 768px) {
  .post-body { max-width: 100%; }
  .post-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
}
