/* =========================================================================
   blog.css — additional styles for the journal (index + post pages).
   Loaded AFTER /assets/css/style.css so all tokens (colors, type, motion)
   are inherited. This sheet only adds the editorial-typography surface
   and the blog-specific components.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Page chrome — solid nav variant for pages without a photographic hero
   ------------------------------------------------------------------------- */
.page-blog {
  background: var(--canvas);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Blog pages render the same custom cursor as the home page — see blog.js. */

.page-blog .nav--solid {
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
          backdrop-filter: blur(28px) saturate(190%);
  border-bottom: 1px solid var(--hairline);
}

.page-blog main {
  /* clear the floating nav */
  padding-top: clamp(5rem, 4rem + 4vw, 7rem);
}

.nav__link.is-current,
.drawer__link.is-current {
  color: var(--accent);
}

/* -------------------------------------------------------------------------
   Blog index — hero
   ------------------------------------------------------------------------- */
.blog-hero {
  padding: clamp(2rem, 1rem + 4vw, 5rem) 0 clamp(2rem, 1rem + 3vw, 4rem);
}

.blog-hero__eyebrow {
  font-size: var(--t-eyebrow);
  font-weight: var(--w-medium);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
}

.blog-hero__title {
  font-family: var(--font-display);
  font-size: var(--t-display-lg);
  font-weight: var(--w-bold);
  letter-spacing: var(--tr-display-tight);
  line-height: var(--lh-display);
  color: var(--text-primary);
  max-width: 14ch;
  margin-bottom: var(--s-6);
}

.blog-hero__title em {
  font-style: italic;
  color: var(--accent);
}

.blog-hero__lead {
  font-size: var(--t-lead);
  line-height: var(--lh-prose);
  color: var(--text-body);
  max-width: 56ch;
}

/* -------------------------------------------------------------------------
   Blog index — category filter
   ------------------------------------------------------------------------- */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-10);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--hairline);
}

.cat-chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--t-body-sm);
  font-weight: var(--w-medium);
  letter-spacing: var(--tr-tight);
  padding: var(--s-2) var(--s-5);
  border-radius: var(--rad-pill);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.cat-chip:hover {
  color: var(--text-primary);
  border-color: var(--hairline-bright);
}

.cat-chip.is-active {
  color: var(--canvas);
  background: var(--accent);
  border-color: var(--accent);
}

/* -------------------------------------------------------------------------
   Blog index — post grid
   ------------------------------------------------------------------------- */
.post-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  padding-bottom: var(--section-y);
}

.post-card {
  position: relative;
}

.post-card[data-cat][hidden] { display: none; }

.post-card__link {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--rad-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}

.post-card__link:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-2);
}

.post-card__cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--canvas-soft);
}

.post-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slower) var(--ease-out);
}

.post-card__link:hover .post-card__cover img {
  transform: scale(1.04);
}

.post-card__body {
  padding: var(--s-6) var(--s-6) var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.post-card__cat {
  font-size: var(--t-caption);
  font-weight: var(--w-medium);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--accent);
}

.post-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  font-weight: var(--w-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  color: var(--text-primary);
}

.post-card__excerpt {
  font-size: var(--t-body);
  line-height: var(--lh-prose);
  color: var(--text-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  gap: var(--s-2);
  font-size: var(--t-caption);
  color: var(--text-muted);
  margin-top: auto;
  letter-spacing: var(--tr-tight);
}

/* -------------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------------- */
.blog-empty {
  text-align: center;
  padding: var(--section-y) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-6);
}

.blog-empty p {
  font-size: var(--t-lead);
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   Post page — hero
   ------------------------------------------------------------------------- */
.post-hero {
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 4rem);
}

.post-hero__cover {
  aspect-ratio: 21 / 9;
  max-height: 70vh;
  width: 100%;
  overflow: hidden;
  background: var(--canvas-soft);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 4rem);
}

.post-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-hero__body {
  max-width: 800px;
}

.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  font-size: var(--t-caption);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-6);
}

.post-hero__cat {
  color: var(--accent);
  text-decoration: none;
  font-weight: var(--w-medium);
}

.post-hero__cat:hover { text-decoration: underline; }

.post-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 3vw, 4rem);
  font-weight: var(--w-bold);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  color: var(--text-primary);
  margin-bottom: var(--s-6);
  text-wrap: balance;
}

.post-hero__lead {
  font-size: var(--t-lead-lg);
  line-height: var(--lh-prose);
  color: var(--text-body);
  max-width: 56ch;
  font-weight: var(--w-regular);
}

/* -------------------------------------------------------------------------
   Post body — long-form editorial typography
   ------------------------------------------------------------------------- */
.post-body {
  max-width: 680px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);  /* 17–19 */
  line-height: 1.75;
  color: var(--text-body);
  padding-bottom: var(--s-16);
}

/* Headings inside the body */
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: var(--w-bold);
  letter-spacing: var(--tr-tight);
  line-height: var(--lh-snug);
  margin: var(--s-12) 0 var(--s-4);
  text-wrap: balance;
}

.post-body h1 { font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem); }
.post-body h2 { font-size: clamp(1.5rem,  1.3rem + 0.9vw, 1.875rem); }
.post-body h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
.post-body h4 { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem); }

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

.post-body p {
  margin: 0 0 var(--s-6);
}

.post-body p + p {
  text-indent: 0;
}

/* First paragraph: slightly larger, soft drop into the piece */
.post-body > p:first-of-type {
  font-size: 1.05em;
  color: var(--text-primary);
}

.post-body a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}

.post-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent-bright);
}

.post-body strong { color: var(--text-primary); font-weight: var(--w-semibold); }
.post-body em     { font-style: italic; }

.post-body ul,
.post-body ol {
  margin: 0 0 var(--s-6);
  padding-left: var(--s-6);
}

.post-body li {
  margin-bottom: var(--s-2);
}

.post-body li::marker {
  color: var(--accent);
}

.post-body blockquote {
  margin: var(--s-10) 0;
  padding: var(--s-2) 0 var(--s-2) var(--s-6);
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-style: italic;
  font-weight: var(--w-regular);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}

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

.post-body hr {
  margin: var(--s-12) auto;
  border: 0;
  height: 1px;
  width: 4rem;
  background: var(--hairline-bright);
}

.post-body code {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.9em;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--rad-xs);
  padding: 0.1em 0.4em;
  color: var(--accent-bright);
}

.post-body pre {
  margin: var(--s-8) 0;
  padding: var(--s-6);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--rad-md);
  overflow-x: auto;
  font-size: 0.9em;
}

.post-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-body);
}

.post-body figure {
  margin: var(--s-10) 0;
}

/* Allow figures to extend slightly beyond the prose column */
@media (min-width: 768px) {
  .post-body figure { margin-left: -2rem; margin-right: -2rem; }
}

.post-body figure img,
.post-body p img {
  width: 100%;
  height: auto;
  border-radius: var(--rad-md);
  display: block;
}

.post-body figcaption {
  margin-top: var(--s-3);
  font-size: var(--t-caption);
  color: var(--text-muted);
  text-align: center;
  letter-spacing: var(--tr-tight);
  font-style: italic;
}

/* -------------------------------------------------------------------------
   Tags + author + adjacent posts
   ------------------------------------------------------------------------- */
.post-tags {
  max-width: 680px;
  margin: 0 auto var(--s-12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.post-tag {
  font-size: var(--t-caption);
  font-weight: var(--w-medium);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--hairline-strong);
  padding: var(--s-1) var(--s-4);
  border-radius: var(--rad-pill);
}

.author-card {
  max-width: 680px;
  margin: 0 auto var(--s-12);
  display: flex;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5) var(--s-6);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--rad-lg);
}

.author-card__photo {
  width: 56px;
  height: 56px;
  border-radius: var(--rad-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--hairline-strong);
}

.author-card__text { flex: 1; min-width: 0; }

.author-card__name {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: var(--t-body);
  color: var(--text-primary);
  letter-spacing: var(--tr-tight);
  margin-bottom: 2px;
}

.author-card__bio {
  font-size: var(--t-body-sm);
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: var(--s-2);
  white-space: pre-line;
}

.author-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--t-caption);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
}

.author-card__links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: var(--w-medium);
}

.author-card__links a:hover { text-decoration: underline; }

.post-adjacent {
  max-width: 680px;
  margin: 0 auto var(--s-12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.post-adjacent .adj {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-6);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--rad-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}

.post-adjacent .adj:only-child { grid-column: 1 / -1; }
.post-adjacent .adj.next:only-child { text-align: right; }

.post-adjacent .adj:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.post-adjacent .adj.next { text-align: right; }

.post-adjacent .adj__label {
  font-size: var(--t-caption);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.post-adjacent .adj__title {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  color: var(--text-primary);
  font-size: var(--t-body-lg);
  letter-spacing: var(--tr-tight);
  line-height: var(--lh-snug);
}

.post-back {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: var(--section-y);
  text-align: center;
}

.post-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--t-body-sm);
  letter-spacing: var(--tr-tight);
  border: 1px solid var(--hairline-strong);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--rad-pill);
  transition: color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  display: inline-block;
}

.post-back a:hover {
  color: var(--text-primary);
  border-color: var(--hairline-bright);
}

@media (max-width: 600px) {
  .post-adjacent { grid-template-columns: 1fr; }
  .author-card { flex-direction: column; text-align: center; }
  .author-card__photo { margin: 0 auto; }
  .author-card__links { justify-content: center; }
}
