/* ============================================
   POST PAGES — uses variables from styles.css
   ============================================ */

/* ── POSTS INDEX PAGE ── */
.posts-page {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 4rem) 4vw 6rem;
}

.posts-page-inner {
  max-width: 900px;
  margin: 0 auto;
}

.posts-page-title {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 1rem;
}

.posts-page-sub {
  color: var(--fg-muted);
  font-size: 1.1rem;
  max-width: 540px;
  margin-bottom: 4rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid var(--border);
}

.post-card {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.post-card:hover { background: var(--bg-alt); }
.post-card:hover .post-card-arrow { color: var(--accent); transform: translate(4px, -4px); }

.post-card-inner { flex: 1; }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-card-tags span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--fg-muted);
}

.post-card-title {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 580px;
}

.post-card-arrow {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 1rem;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease;
}

.post-card-img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── POST ARTICLE PAGE ── */
.post-content {
  max-width: 72ch;
  margin: calc(var(--nav-h) + 3rem) auto 6rem;
  padding: 0 2rem;
}

.blog-post {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 2.5em;
  margin-bottom: 2em;
  border: 1px solid var(--border);
}

.post-header {
  margin-bottom: 2em;
  text-align: center;
}

.post-header h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5em;
}

.post-meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1em;
}

.post-meta time {
  display: block;
  margin-bottom: 1em;
  font-style: italic;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg);
}

.post-body h2 {
  font-family: var(--font-sans);
  color: var(--fg);
  margin: 2em 0 1em;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4em;
}

.post-body h3 {
  font-family: var(--font-sans);
  color: var(--fg);
  margin: 1.5em 0 1em;
  font-size: 1.2rem;
  font-weight: 600;
}

.post-body p { margin-bottom: 1.5em; }

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

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

.post-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2em 0.45em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}

.post-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.post-body ul {
  list-style: none;
  margin-left: 0;
  margin-bottom: 1.5em;
}

.post-body ul li {
  padding-left: 1.2em;
  margin-bottom: 0.5em;
  position: relative;
}

.post-body ul li::before {
  content: "\2192";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: 700;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

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

.post-body th {
  background: var(--bg);
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-sans);
}

/* ── TOC ── */
.toc-inline {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 8px;
}

.toc-inline h3 {
  font-family: var(--font-sans);
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.toc-inline ul { margin: 0; padding-left: 1rem; }
.toc-inline li { margin: 0.3rem 0; list-style: disc; }
.toc-inline a { color: var(--accent); text-decoration: none; }
.toc-inline a:hover { text-decoration: underline; }

/* ── READ TIME / BREADCRUMBS ── */
.read-time {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
  opacity: 0.85;
}

.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  opacity: 0.7;
  color: var(--fg-muted);
}

.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ── POST TAGS ── */
.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--fg-muted);
  transition: border-color 0.2s, color 0.2s;
}

/* ── POST NAVIGATION ── */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3em;
  padding: 2em;
  background: var(--bg-alt);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.prev-post, .next-post { flex: 1; }
.next-post { text-align: right; }

.post-navigation a { color: var(--fg); text-decoration: none; transition: color 0.2s ease; }
.post-navigation a:hover { color: var(--accent); }
.post-navigation span { display: block; color: var(--accent); font-size: 0.9em; margin-top: 0.5em; }

/* ── FEATURED IMAGE ── */
.post-featured-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 2rem;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .post-content { padding: 0 1rem; }
  .blog-post { padding: 1.5em; }
  .post-header h1 { font-size: 1.6rem; }
  .post-navigation { flex-direction: column; gap: 1em; }
  .next-post { text-align: left; }
  .post-card { flex-direction: column-reverse; gap: 1.5rem; }
  .post-card-img { width: 100%; height: 160px; }
}
