/* ============================================================
   NeatSnap Blog Styles
   Works on top of the base styles.css (Inter, CSS vars)
   ============================================================ */

/* ── Blog index ── */
.blog-main {
  padding-top: 100px;
  padding-bottom: 80px;
  min-height: calc(100vh - 80px);
  background: var(--background);
}

.blog-header {
  text-align: center;
  padding: 48px 0 40px;
}

.blog-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.15;
}

.blog-subheading {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Tag cloud */
.blog-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.blog-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--background-alt);
  color: var(--text-light);
  border: 1px solid var(--border);
  transition: background .2s, color .2s, border-color .2s;
}
.blog-tag:hover,
.blog-tag--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Post grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Post card */
.blog-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}
.blog-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  transform: translateY(-3px);
}

.blog-card-link { text-decoration: none; color: inherit; display: block; }

.blog-card-image {
  aspect-ratio: 16/8;
  overflow: hidden;
  background: var(--background-alt);
}
.blog-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.blog-card:hover .blog-card-image img { transform: scale(1.04); }

.blog-card-image--placeholder {
  aspect-ratio: 16/8;
  background: linear-gradient(135deg, var(--background-alt) 0%, #e5e7eb 100%);
}

.blog-card-body { padding: 20px 24px 24px; }

.blog-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.blog-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.blog-reading-time::before {
  content: '·';
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
  transition: color .2s;
}
.blog-card:hover .blog-card-title { color: var(--primary); }

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-card-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 60px;
}

/* Subscribe strip (index) */
.blog-subscribe-strip {
  margin: 40px 0 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  color: #fff;
}
.blog-subscribe-inner { max-width: 480px; margin: 0 auto; }
.blog-subscribe-strip h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.blog-subscribe-strip p {
  font-size: 14px;
  opacity: .85;
  margin-bottom: 20px;
}

.blog-subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.blog-subscribe-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  outline: none;
}
.blog-subscribe-form .btn {
  white-space: nowrap;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.blog-subscribe-form .btn:hover { background: rgba(255,255,255,.3); }

.blog-subscribe-status {
  margin-top: 10px;
  font-size: 13px;
  opacity: .9;
}

/* ── Active nav link ── */
.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

/* ── Blog post page ── */
.post-main {
  padding-top: 100px;
  padding-bottom: 80px;
  background: var(--background);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span[aria-hidden] { color: var(--border); }

/* Post layout: article + sidebar */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { display: none; }
}

/* Post header */
.post-header {
  margin-bottom: 28px;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.post-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-light);
}
.post-author { font-weight: 600; color: var(--text); }
.post-date   {}
.post-read-time::before { content: '·'; margin-right: 6px; }
.post-updated { font-style: italic; }

/* Cover image */
.post-cover {
  margin: 0 0 36px;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1200/630;
}
.post-cover img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

/* Table of Contents */
.toc {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.toc-list {
  margin: 0; padding-left: 18px;
}
.toc-list li { margin-bottom: 6px; }
.toc-list a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 14px;
  transition: color .2s;
}
.toc-list a:hover { color: var(--primary); }

/* Sidebar */
.post-sidebar {
  position: sticky;
  top: 100px;
}
.sidebar-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
}
.sidebar-cta h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.sidebar-cta p  { font-size: 13px; opacity: .88; margin-bottom: 16px; line-height: 1.5; }
.sidebar-cta .btn {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  width: 100%;
  justify-content: center;
}
.sidebar-cta .btn:hover { background: rgba(255,255,255,.3); }
.btn-full { width: 100%; justify-content: center; }
.sidebar-toc .toc { margin-bottom: 0; }

/* Post body (prose) */
.prose {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.prose h1 { font-size: 1.9rem; margin: 1.6em 0 .6em; }
.prose h2 { font-size: 1.5rem; margin: 1.5em 0 .5em; }
.prose h3 { font-size: 1.2rem; margin: 1.3em 0 .4em; }
.prose h4 { font-size: 1rem;   margin: 1.1em 0 .3em; }

.prose p { margin-bottom: 1.2em; }
.prose a { color: var(--primary); font-weight: 500; }
.prose a:hover { text-decoration: underline; }

.prose ul, .prose ol { padding-left: 1.6em; margin-bottom: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; margin-bottom: .4em; }

.prose blockquote {
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  margin: 1.6em 0;
  background: var(--background-alt);
  border-radius: 0 12px 12px 0;
  color: var(--text-light);
  font-style: italic;
  font-size: 1.05em;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  background: var(--background-alt);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .88em;
  font-family: 'Fira Code', 'Consolas', monospace;
  color: var(--color-pink);
}
.prose pre {
  background: #1a1a2e;
  color: #e4e6f0;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 1.4em;
}
.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.prose img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.4em 0;
  display: block;
}
.prose figure {
  margin: 1.6em 0;
  text-align: center;
}
.prose figcaption {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4em;
  font-size: 15px;
}
.prose th, .prose td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  background: var(--background-alt);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.prose tr:nth-child(even) td { background: var(--background-alt); }

.prose hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2em 0;
}

/* Heading anchor */
.heading-anchor {
  opacity: 0;
  margin-left: 6px;
  font-size: .75em;
  color: var(--text-light);
  text-decoration: none;
  transition: opacity .2s;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor { opacity: 1; }

/* Inline CTA block */
.post-inline-cta {
  background: linear-gradient(135deg, rgba(76,175,80,.08) 0%, rgba(56,142,60,.12) 100%);
  border: 1px solid rgba(76,175,80,.3);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 2em 0;
  font-size: 15px;
  line-height: 1.6;
}
.post-inline-cta .cta-link {
  color: var(--primary);
  font-weight: 600;
}

/* Post footer */
.post-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.share-label { font-size: 13px; font-weight: 600; color: var(--text-light); }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  transition: opacity .2s, transform .15s;
  color: #fff;
}
.share-btn:hover { opacity: .88; transform: translateY(-1px); }
.share-btn--twitter   { background: #000; }
.share-btn--linkedin  { background: #0a66c2; }
.share-btn--pinterest { background: #e60023; }
.share-btn--facebook  { background: #1877f2; }

/* Post subscribe section */
.post-subscribe {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  margin-top: 56px;
}
.post-subscribe h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.post-subscribe p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 18px;
}

/* End-of-post CTA */
.post-end-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  color: #fff;
  margin-top: 56px;
}
.post-end-cta h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.post-end-cta p {
  max-width: 500px;
  margin: 0 auto 24px;
  font-size: 15px;
  opacity: .88;
  line-height: 1.6;
}
.post-end-cta .btn {
  margin: 4px 6px;
}
.post-end-cta .btn-primary {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 700;
}
.post-end-cta .btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* Related posts */
.related-posts {
  margin-top: 64px;
}
.related-posts h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.related-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.related-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.related-card a { text-decoration: none; color: inherit; display: block; }
.related-card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--background-alt); }
.related-card-image img { width: 100%; height: 100%; object-fit: cover; }
.related-card-body { padding: 14px 16px; }
.related-card-body h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  color: var(--text);
  transition: color .2s;
}
.related-card:hover .related-card-body h3 { color: var(--primary); }

/* ── Pinterest save button on cover ── */
.post-cover { position: relative; }
.pinterest-save {
  position: absolute;
  top: 12px; right: 12px;
  background: #e60023;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  opacity: 0;
  transition: opacity .2s;
}
.post-cover:hover .pinterest-save { opacity: 1; }

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-subscribe-form { flex-direction: column; }
  .post-end-cta { padding: 36px 20px; }
  .post-subscribe { padding: 28px 20px; }
  .prose { font-size: 16px; }
}
