/* ==========================================================================
   Blog styles — loaded ONLY on blog pages (blog/index.html + posts).
   Relies on the design tokens, nav, footer and buttons from styles.css.
   Keeping this separate means the home page never downloads it.
   ========================================================================== */

/* --- Shared page header for the blog index ------------------------------- */
.page-head {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.page-head__lead {
  max-width: 60ch;
  margin-top: 0.6rem;
  color: var(--text-soft);
  font-size: var(--fs-lead);
}

/* --- Post listing grid --------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
}

/* Shown until the first post is published (delete the note when you add posts) */
.blog-empty {
  margin: 1rem 0;
  padding: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  color: var(--text-mute);
  font-size: var(--fs-lead);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  margin-bottom: clamp(4rem, 9vw, 7rem);
}

.post-card {
  position: relative;            /* scopes the stretched title link to this card */
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 48px -28px rgba(0, 186, 255, 0.5);
}
/* Make the whole card clickable via the stretched title link */
.post-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform 0.5s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }

.post-card__body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.4rem 1.4rem 1.6rem; }
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.post-card__cat { color: var(--accent); }
.post-card__title { font-size: 1.2rem; line-height: 1.25; color: var(--text); }
.post-card__title a { color: inherit; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; } /* stretch link over card */
.post-card__excerpt { font-size: var(--fs-small); color: var(--text-soft); line-height: 1.6; }

/* --- Single post --------------------------------------------------------- */
.post {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(4rem, 9vw, 7rem);
}
.post__inner { max-width: 760px; }     /* comfortable reading measure */

.post__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-bottom: 1.8rem;
  transition: color var(--t-fast) var(--ease);
}
.post__back:hover { color: var(--accent); }

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 1rem;
}
.post__meta .post__cat { color: var(--accent); }

.post__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: linear-gradient(180deg, #ffffff, #b9c1ce);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.post__cover {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.post__cover img { width: 100%; height: auto; display: block; }

/* --- Prose: the article body typography ---------------------------------- */
.prose { color: var(--text-soft); font-size: 1.05rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--text);
  margin-top: 2.4rem;
  line-height: 1.2;
}
.prose h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-top: 1.8rem;
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.4rem 0 0.4rem 1.3rem;
  border-left: 3px solid var(--accent);
  color: var(--silver);
  font-size: 1.15rem;
  font-style: italic;
}

/* Inline article images */
.post__figure { margin: 2rem 0; }
.post__figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.post__figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-mute);
  text-align: center;
}

/* Author bio sign-off at the end of an article */
.post__bio {
  margin-top: 2.5rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-soft);
}

/* Post footer / sign-off */
.post__foot {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.post__foot-note { font-size: var(--fs-small); color: var(--text-mute); }
