/* ============================================================
   BLOG — All styles for the Next.js blog pages.
   This file is separate from pages.css so static HTML
   updates can never accidentally overwrite these rules.

   Covers:
   - /blog  (BlogGridV1)   — sec-head, filter chips, featured post,
                             post-grid, blog post cards
   - /post/*               — article layout, author meta, share bar,
                             related posts, prev/next nav
   ============================================================ */

/* ============================================================
   BLOG GRID — Post listing page
   Used on: /blog (BlogGridV1)
   ============================================================ */

/* Standalone pill tag — used on feature cards and article pages */
.pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cream);
  background: var(--sage);
  padding: .5em .9em;
  border-radius: 2px;
}

.article-header > .pill {
  margin-bottom: 1.6rem;
  background: var(--sage);
  color: var(--cream);
}

/* Filter chip row */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: clamp(2rem, 3vw, 3rem);
}

/* Featured post card — reuses .feature shell, adds excerpt */
.feature .excerpt {
  font-weight: 300;
  color: rgba(22, 22, 15, .7);
  font-size: .97rem;
  line-height: 1.6;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Next.js blog renders <img> inside .feature .cover — support both approaches */
.feature .cover {
  position: relative;
  overflow: hidden;
}

.feature .cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .5s var(--ease);
}

.feature:hover .cover img { transform: scale(1.04); }

/* Post card grid — 3-col responsive */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: clamp(2rem, 3vw, 3rem);
}

/* Blog card thumb — supports both background-image (static HTML)
   and <img> tag (Next.js BlogGridV1) */
.pcard .thumb {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--image-ph);
  position: relative;
  overflow: hidden;
  transition: transform .5s var(--ease);
}

.pcard:hover .thumb { transform: scale(1.03); }

/* <img> inside .pcard .thumb (Next.js BlogGridV1) */
.pcard .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .45s var(--ease);
}

.pcard:hover .thumb img { transform: scale(1.04); }

/* Blog card body */
.pcard .pc-body {
  padding: 22px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* Category label inside card */
.cat {
  display: block;
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sage-deep);
  margin-bottom: .5rem;
}

/* Excerpt text */
.excerpt {
  font-weight: 300;
  color: rgba(22, 22, 15, .7);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Pcard h3 */
.pcard .pc-body h3 {
  font-size: clamp(1.05rem, 1.5vw, 1.26rem);
  line-height: 1.25;
  margin-top: .2rem;
  margin-bottom: .8rem;
  transition: color .3s var(--ease);
}

.pcard:hover .pc-body h3 { color: var(--sage-deep); }

/* Date meta inside card */
.pcard .meta {
  display: block;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .04em;
  color: rgba(22, 22, 15, .46);
  margin-top: .7rem;
}

/* Spacer pushes .read to bottom */
.pcard .spacer { flex: 1 1 auto; min-height: 1rem; }

/* Empty state */
.no-results {
  text-align: center;
  color: rgba(22, 22, 15, .48);
  font-style: italic;
  padding: 3.5rem 0;
}

/* Responsive */
@media (max-width: 960px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BLOG POST PAGE
   Used on: /blog/[slug] (BlogPostArticleV1, BlogShareV1, BlogAuthorV2)
   ============================================================ */

/* Back-to-blog bar */
.back-bar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.back-bar-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(22, 22, 15, .56);
  text-decoration: none;
  transition: color .3s var(--ease);
}

.back-link:hover { color: var(--sage-deep); }

.back-link svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform .3s var(--ease);
}

.back-link:hover svg { transform: translateX(-3px); }

/* Article wrapper */
.article-wrap {
  padding-block: clamp(48px, 7vw, 96px);
}

/* ── Editorial header — centred title, wide image, then body ── */
.article-header {
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
  padding-bottom: clamp(2rem, 3.5vw, 3.2rem);
}

.article-header .display {
  margin-top: .8rem;
  line-height: 1.08;
}

/* Full-width featured image */
.article-featured-img {
  border-radius: var(--radius-img);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: clamp(2.4rem, 4vw, 4.4rem);
}

.article-featured-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: cover;
}

/* Meta row: author + date — centred under title */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 1.8rem;
}

.meta-author {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.meta-author .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}

.meta-author .avatar img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.meta-author .author-info { display: flex; flex-direction: column; }

.meta-author .name {
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
}

.meta-author .role {
  font-family: var(--sans);
  font-size: .76rem;
  color: rgba(22, 22, 15, .52);
}

.meta-date {
  display: flex;
  align-items: center;
  gap: .4em;
  font-family: var(--sans);
  font-size: .78rem;
  color: rgba(22, 22, 15, .48);
}

.meta-date svg { width: 14px; height: 14px; flex: none; }

/* Article body prose — wider reading column */
.article-body {
  max-width: 860px;
  margin-inline: auto;
  margin-top: clamp(2.4rem, 4vw, 3.6rem);
}

.article-body p {
  color: rgba(22, 22, 15, .78);
  font-weight: 300;
  line-height: 1.82;
  margin-bottom: 1.4rem;
}

.article-body h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  margin-top: 2.8rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.38rem);
  margin-top: 2.2rem;
  margin-bottom: .75rem;
}

.article-body h4, .article-body h5, .article-body h6 {
  margin-top: 1.8rem;
  margin-bottom: .6rem;
}

.article-body a {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover { color: var(--ink); text-decoration: none; }

.article-body strong, .article-body b { font-weight: 600; }

.article-body ul, .article-body ol {
  color: rgba(22, 22, 15, .78);
  font-weight: 300;
  line-height: 1.72;
  margin-bottom: 1.4rem;
}

.article-body li { margin-bottom: .4em; }

.article-body blockquote {
  border-left: 3px solid var(--sage);
  padding-left: 1.4em;
  margin: 2rem 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--sage-deep);
}

.article-body img {
  border-radius: var(--radius-img);
  max-width: 100%;
  height: auto;
  margin: 1.4rem 0;
}

/* Share section */
.share-bar {
  border-top: 1px solid var(--line);
  padding: 2.2rem var(--gutter);
  margin-top: 3rem;
}

.share-bar-inner {
  max-width: 860px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.share-label {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}

.share-buttons { display: flex; gap: 10px; }

.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(22, 22, 15, .6);
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}

.share-btn:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--cream);
}

.share-btn svg { width: 18px; height: 18px; }

/* Post prev/next navigation */
.post-nav {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter);
}

.post-nav-inner {
  max-width: 860px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Related articles section */
.related-section { background: var(--bone); }

/* Responsive */
@media (max-width: 640px) {
  .share-bar-inner { flex-direction: column; align-items: flex-start; }
  .post-nav-inner  { flex-direction: column; align-items: stretch; }
  .article-meta    { flex-direction: column; align-items: center; }
}
