/* Blog: home page section, All posts page and post pages. Uses the site's colour tokens from home.css. */

/* ---------- Section ---------- */
.blog-section { background: var(--paper-dark); }
.blog-section .section-heading h1 { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; letter-spacing: -.025em; font-size: clamp(50px, 6.1vw, 82px); line-height: .88; }
.blog-section .section-heading h1 span { color: var(--signal); font-style: italic; }
.blog-more .section-heading h2 { font-size: clamp(40px, 4.6vw, 62px); }
.blog-view-all { margin-top: 38px; }
.blog-empty { margin: 0; padding: 30px 0; border-top: 1px solid rgba(32,26,23,.42); color: var(--body); font-size: 13px; }
.blog-index { min-height: 60vh; }

/* ---------- Cards: headline, image, excerpt, meta ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 34px; }
.post-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; border-top: 1px solid rgba(32,26,23,.52); }
.post-card-link { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; padding-top: 20px; color: var(--ink); }
.post-card-title { margin: 0 0 20px; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(27px, 2.4vw, 34px); font-weight: 400; line-height: .98; letter-spacing: -.02em; transition: color .18s ease-out; }
.post-card-image { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: radial-gradient(ellipse at 80% 20%, rgba(240,198,83,.25), transparent 40%), linear-gradient(150deg, #34231f, #201a17 74%); }
.post-card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.23,1,.32,1); }
.post-card-placeholder { position: absolute; left: 16px; top: 14px; color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .13em; }
.post-card-excerpt { margin: 18px 0 0; color: var(--body); font-size: 12px; line-height: 1.85; }
.post-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(32,26,23,.18); color: #766b60; font-family: 'IBM Plex Mono', monospace; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; align-self: end; }
.post-card-more { display: inline-flex; align-items: center; gap: 7px; color: var(--signal); transition: gap .18s ease-out; }
.post-card-link:hover .post-card-title { color: var(--signal); }
.post-card-link:hover .post-card-image img { transform: scale(1.04); }
.post-card-link:hover .post-card-more { gap: 11px; }
.post-card-link:focus-visible { outline: 2px solid var(--signal); outline-offset: 6px; }

/* ---------- Post page ---------- */
.post { padding: 96px 10.3% 110px; background: var(--paper); }
.post-header { max-width: 860px; }
.post-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 44px; color: #766b60; font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; transition: color .18s ease-out, gap .18s ease-out; }
.post-back svg { transform: rotate(180deg); }
.post-back:hover { color: var(--signal); gap: 12px; }
.post-title { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(50px, 6.6vw, 92px); font-weight: 400; line-height: .9; letter-spacing: -.025em; }
.post-hero { margin: 56px 0 0; }
.post-hero img { display: block; width: 100%; height: auto; }

/* Article text from the editor */
.post-body { margin: 60px 0 0; color: var(--body); font-size: 15px; line-height: 1.85; }
.post-body > * + * { margin-top: 1.3em; }
.post-body h2, .post-body h3, .post-body h4 { margin-top: 1.9em; color: var(--ink); font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; letter-spacing: -.02em; line-height: 1.02; }
.post-body h2 { font-size: clamp(32px, 3.6vw, 44px); }
.post-body h3 { font-size: clamp(26px, 2.8vw, 33px); }
.post-body h4 { font-size: 23px; }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: .7em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body ul { list-style: square; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: .45em; }
.post-body li::marker { color: var(--signal); }
.post-body blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--signal); color: var(--ink); font-family: 'Instrument Serif', Georgia, serif; font-size: 26px; font-style: italic; line-height: 1.25; }
.post-body img { display: block; width: 100%; height: auto; margin-top: 2em; margin-bottom: 2em; }
.post-body p:has(> img:only-child) { margin-top: 2em; }
.post-body hr { margin: 2.6em 0; border: 0; border-top: 1px solid rgba(32,26,23,.3); }
.post-body code { padding: 1px 5px; background: rgba(32,26,23,.07); font-family: 'IBM Plex Mono', monospace; font-size: .85em; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.post-body th, .post-body td { padding: 10px 12px 10px 0; border-bottom: 1px solid rgba(32,26,23,.2); text-align: left; }

.post-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 64px 0 0; padding-top: 28px; border-top: 1px solid rgba(32,26,23,.42); }
.post-footer .dark-link { margin-top: 0; }

/* ---------- Wide screens ---------- */
@media (min-width: 1500px) {
  .post { padding-left: max(10.3%, calc((100vw - 1220px) / 2)); padding-right: max(10.3%, calc((100vw - 1220px) / 2)); }
}

/* ---------- Tablet: 2 columns ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 26px; }
  .post { padding: 76px 7% 90px; }
  .post-body { margin-top: 48px; }
}

/* ---------- Phone: 1 column ---------- */
@media (max-width: 650px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .post-card-title { font-size: 30px; }
  .post { padding: 56px 7% 72px; }
  .post-back { margin-bottom: 32px; }
  .post-title { font-size: clamp(42px, 12vw, 58px); }
  .post-hero { margin-top: 38px; margin-left: -7.6%; margin-right: -7.6%; }
  .post-body { margin-top: 40px; font-size: 14px; }
  .post-body blockquote { font-size: 22px; }
  .post-footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card-image img, .post-card-title, .post-card-more, .post-back { transition: none; }
  .post-card-link:hover .post-card-image img { transform: none; }
}
