/* ==========================================================================
   Savery blog — layered on top of css/styles.css, which owns the palette,
   the type stack, and the shared header/footer.

   Accent discipline: --orange (#E0531F) is the single accent, used for rules,
   markers, and large UI. Inline prose links use --rust (#B0410F) because
   #E0531F only reaches 3.46:1 on the paper background, short of the 4.5:1
   needed for body text; --rust reaches 5.21:1.
   ========================================================================== */

.post {
  padding: 72px var(--pad-x) 96px;
}

.post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
}
.post-container--wide {
  max-width: 960px;
}

/* ---------- back link ---------- */

.post-back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  margin-bottom: 40px;
}
.post-back:hover {
  color: var(--ink);
}

/* ---------- post header ---------- */

.post-header {
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.post-meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted-3);
  text-transform: uppercase;
  margin: 0 0 20px;
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5.5vw, 48px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

/* ---------- prose ---------- */

.post-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

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

.post-body p {
  margin: 0 0 1.35em;
}

.post-body h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.7em;
}

.post-body h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.9em 0 0.6em;
}

.post-body a {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-body a:hover {
  color: var(--orange);
}

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

.post-body ul,
.post-body ol {
  margin: 0 0 1.35em;
  padding-left: 0;
  list-style: none;
}

.post-body ol {
  counter-reset: post-ol;
}

.post-body li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 0.6em;
}

/* single accent, used as the list marker */
.post-body ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
}

.post-body ol > li {
  counter-increment: post-ol;
}
.post-body ol > li::before {
  content: counter(post-ol);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  line-height: 1.9;
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--orange);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}

/* data / figures / inline code all read as mono */
.post-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
}

.post-body pre {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0 0 1.35em;
}
.post-body pre code {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.6em 0;
}

.post-body img {
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 0 0 1.35em;
}

/* ---------- sources / citations ---------- */

.post-sources {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}

.post-sources h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.post-sources ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-sources li {
  position: relative;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  padding-left: 22px;
  margin-bottom: 14px;
}
.post-sources li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
}
.post-sources li:last-child {
  margin-bottom: 0;
}

.post-sources a {
  color: var(--rust);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.post-sources a:hover {
  color: var(--orange);
}

.post-sources em {
  font-style: italic;
}

/* ---------- end-of-post CTA ---------- */

.post-cta {
  margin-top: 64px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: 16px;
  padding: 32px 32px 34px;
  text-align: center;
}

.post-cta-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

.post-cta-btn {
  display: inline-flex;
  padding: 14px 30px;
  font-size: 15px;
}

/* ==========================================================================
   Blog index
   ========================================================================== */

.blog-rule {
  margin-bottom: 32px;
}

.blog-index-title {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 48px;
  max-width: 22ch;
  text-wrap: balance;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.post-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition:
    transform 220ms var(--ease),
    box-shadow 220ms var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(28, 25, 23, 0.1);
}

.post-card-link {
  display: block;
  padding: 32px 32px 30px;
  color: inherit;
}
.post-card-link:hover {
  color: inherit;
}

.post-card-meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted-3);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.post-card-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.24;
  margin: 0 0 12px;
  color: var(--ink);
}

.post-card-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 62ch;
}

.post-card-more {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--rust);
}
.post-card:hover .post-card-more {
  color: var(--orange);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .post {
    padding-top: 48px;
    padding-bottom: 64px;
  }

  .post-back {
    margin-bottom: 28px;
  }

  .post-header {
    margin-bottom: 34px;
    padding-bottom: 22px;
  }

  .post-body {
    font-size: 16.5px;
  }

  .post-body h2 {
    font-size: 24px;
  }

  .post-body blockquote {
    font-size: 19px;
    padding-left: 18px;
  }

  .post-cta {
    padding: 26px 22px 28px;
    margin-top: 48px;
  }

  .blog-index-title {
    margin-bottom: 32px;
    max-width: none;
  }

  .post-card-link {
    padding: 26px 22px 24px;
  }

  .post-card-title {
    font-size: 22px;
  }
}
