/* =========================================================
   ClearTrace — Blog Styles (blog.css)
   Works with variables defined in styles.css (:root)
   ========================================================= */

/* ---------- Global blog layout guards ---------- */

/* Keep all blog pages away from viewport edges */
main.section {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- Blog Index (list of posts) ---------- */

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 32px;
}

/* Clickable card */
.post-card {
  display: block;                /* entire card is clickable */
  height: 100%;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background-color .15s ease,
    border-color .15s ease;
}

.post-card:hover,
.post-card:focus-visible {
  background: rgba(91,124,255,.12);
  border-color: rgba(91,124,255,.45);
  transform: translateY(-3px);
  outline: none;
}

.post-card h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 32px);
}

.post-card .excerpt {
  margin: 0 0 12px;
  color: var(--muted);
}

.post-card .meta {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Single Article (post page) ---------- */

article.post {
  /* readable line length & centered */
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;

  /* breathing room so text never hits edges */
  padding: 40px 20px;
}

.post .eyebrow {
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.post h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  margin: 0 0 16px;
}

.post .meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.post h2 {
  font-size: 22px;
  margin-top: 28px;
  margin-bottom: 12px;
}

.post p {
  margin: 0 0 18px;
}

.post ul,
.post ol {
  padding-left: 20px;
  margin: 0 0 18px;
}

.post li {
  margin: 0 0 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  main.section {
    padding-left: 16px;
    padding-right: 16px;
  }
  article.post {
    padding: 32px 16px;
  }
}

@media (max-width: 600px) {
  .post-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  article.post {
    padding: 24px 14px;
  }
}
/* --- Force containment on single-article pages --- */
/* Higher specificity than .section from styles.css */
body main.section {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

body main.section article.post {
  max-width: 820px;              /* comfortable line-length */
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}
