/* Blog-specific styles — supplements styles.css */

/* ── Nav override for blog pages (always solid) ── */
.nav.scrolled {
  background: #fff;
  border-bottom: 1px solid var(--bd);
  box-shadow: none;
}

/* ── Blog index ── */
.blog-main {
  padding-top: 120px;
  padding-bottom: 80px;
  min-height: 70vh;
}

.blog-header {
  text-align: center;
  margin-bottom: 56px;
}

.blog-heading {
  font-family: var(--fd);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.blog-sub {
  font-family: var(--fb);
  font-size: 1.1rem;
  color: var(--ts);
  max-width: 540px;
  margin: 0 auto;
}

.blog-empty {
  text-align: center;
  color: var(--tm);
  font-family: var(--fb);
  font-size: 1.1rem;
  padding: 60px 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

/* ── Blog card ── */
.blog-card {
  border: 1px solid var(--bd);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .18s, transform .18s;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(21,96,232,.1);
  transform: translateY(-2px);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card-cover {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--slate);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.blog-card:hover .card-cover img {
  transform: scale(1.03);
}

.card-body {
  padding: 24px;
}

.card-category {
  display: inline-block;
  font-family: var(--fm);
  font-size: .72rem;
  font-weight: 500;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--fd);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 10px;
}

.card-excerpt {
  font-family: var(--fb);
  font-size: .92rem;
  color: var(--ts);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--fb);
  font-size: .82rem;
  color: var(--tm);
}

.card-meta span + span::before {
  content: '·';
  margin-right: 12px;
}

/* ── Post page ── */
.post-main {
  padding-top: 120px;
  padding-bottom: 80px;
}

.post-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--fb);
  font-size: .85rem;
  color: var(--tm);
}

.post-category {
  font-family: var(--fm);
  font-size: .72rem;
  font-weight: 500;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.post-meta-top span + span::before {
  content: '·';
  margin-right: 12px;
}

.post-title {
  font-family: var(--fd);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 16px;
}

.post-excerpt {
  font-family: var(--fb);
  font-size: 1.15rem;
  color: var(--ts);
  line-height: 1.65;
  margin-bottom: 36px;
  border-left: 3px solid var(--blue);
  padding-left: 20px;
}

.post-cover {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--slate);
}

.post-cover img {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: cover;
}

/* ── Post body typography ── */
.post-body {
  font-family: var(--fb);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.post-body h2 {
  font-family: var(--fd);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.2em 0 .6em;
  line-height: 1.25;
}

.post-body h3 {
  font-family: var(--fd);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.8em 0 .5em;
}

.post-body p {
  margin-bottom: 1.4em;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.post-body li {
  margin-bottom: .5em;
}

.post-body strong {
  font-weight: 600;
  color: var(--text);
}

.post-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: var(--blue-dk);
}

.post-body code {
  font-family: var(--fm);
  font-size: .88em;
  background: var(--slate);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--text);
}

.post-body pre {
  background: var(--text);
  color: var(--ink);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: .9rem;
}

.post-body blockquote {
  border-left: 3px solid var(--blue);
  padding-left: 20px;
  margin: 1.4em 0;
  color: var(--ts);
  font-style: italic;
}

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

.post-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1em 0;
}

/* ── Post footer ── */
.post-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--bd);
}

.post-back {
  font-family: var(--fb);
  font-size: .95rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}

.post-back:hover {
  color: var(--blue-dk);
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-wrap {
    padding: 0 16px;
  }

  .post-body h2 {
    font-size: 1.3rem;
  }
}
