/* ============================================================
   BLOG STYLES — Subify Blog
   Loaded alongside styles.css on blog pages only.
   Reuses existing :root design tokens; defines blog-specific
   components only. Does NOT redefine .container, .btn, .navbar,
   .footer, body, or any shared token.
   ============================================================ */

/* --- Blog index page --- */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}
.blog-header h1 { font-size: 2.5rem; }
.blog-header p  { color: var(--text); opacity: 0.7; font-size: 1.1rem; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}
.blog-card:hover { transform: translateY(-2px); }

.blog-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.blog-card .blog-excerpt {
  color: var(--text); opacity: 0.7; font-size: 0.95rem;
  line-height: 1.6; margin-bottom: 1rem; flex-grow: 1;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.6;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.read-time svg { width: 14px; height: 14px; margin-right: 0.3em; vertical-align: middle; }

/* --- Article prose --- */
.blog-container { max-width: 720px; margin: 0 auto; padding: 4rem 1.5rem; }

.blog-prose h1 { font-size: 2.25rem; margin-bottom: 0.75rem; line-height: 1.2; }
.blog-prose h2 {
  font-size: 1.6rem; margin: 2.5rem 0 1rem; padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--border);
}
.blog-prose h3 { font-size: 1.25rem; margin: 1.75rem 0 0.75rem; }
.blog-prose h4 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.blog-prose p { margin: 1rem 0; }
.blog-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.blog-prose a:hover { opacity: 0.8; }
.blog-prose ul, .blog-prose ol { margin: 0.75rem 0; padding-left: 1.75rem; }
.blog-prose li { margin: 0.3rem 0; line-height: 1.6; }
.blog-prose li strong { color: var(--text); }
.blog-prose blockquote {
  border-left: 3px solid var(--primary); margin: 1.25rem 0; padding: 0.25rem 1.25rem;
  color: var(--text); opacity: 0.7; font-style: italic; background: var(--hover-bg);
}
.blog-prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.95rem; }
.blog-prose th, .blog-prose td { border: 1px solid var(--border); padding: 0.6rem 0.85rem; text-align: left; }
.blog-prose th { background: var(--background); font-weight: 600; }
.blog-prose img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1.25rem auto; display: block; }
.blog-prose .img-caption { text-align: center; font-size: 0.85rem; color: var(--text); opacity: 0.6; margin-top: 0.4rem; }
.blog-prose code {
  background: var(--background); padding: 0.12rem 0.35rem; border-radius: 4px;
  font-size: 0.9em; color: var(--primary);
}
.blog-prose .highlight-box {
  background: var(--hover-bg); border: 1px solid var(--primary); border-radius: 0.5rem;
  padding: 1rem 1.25rem; margin: 1.25rem 0;
}

/* --- Article metadata --- */
.blog-post-meta {
  display: flex; gap: 0.75rem; align-items: center; font-size: 0.85rem;
  color: var(--text); opacity: 0.6; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border); padding-bottom: 1rem;
}

/* --- CTA / related --- */
.blog-cta {
  text-align: center; padding: 0.5rem 1rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0.75rem; margin: 2rem 0;
}
.blog-cta h3 { margin-bottom: 0.5rem; font-size: 1.3rem; }
.blog-cta p { color: var(--text); opacity: 0.7; margin-bottom: 1.25rem; }

/* White text on blog CTA buttons — overrides .blog-prose a { color: var(--primary) }
   while keeping the .btn-primary blue gradient background from styles.css */
.blog-cta .btn-primary {
  color: #fff;
  text-decoration: none;
}
.blog-cta .btn-primary:hover {
  opacity: 0.9;
}

.related-articles { border-top: 2px solid var(--border); margin-top: 3rem; padding-top: 2rem; }
.related-articles h3 { font-size: 1.15rem; margin-bottom: 1rem; }
.related-list { display: flex; flex-direction: column; gap: 0.75rem; }
.related-list a {
  display: block; padding: 0.75rem 1rem; background: var(--background);
  border-radius: 0.5rem; text-decoration: none; border: 1px solid var(--border);
}
.related-list a:hover { border-color: var(--primary); }

.back-to-blog {
  display: inline-block; margin-bottom: 1.5rem; color: var(--primary);
  text-decoration: none; font-weight: 600;
}
.back-to-blog:hover { text-decoration: underline; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .blog-container { padding: 3rem 1rem; }
  .blog-header h1 { font-size: 2rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-prose { font-size: 1rem; }
  .blog-prose h2 { font-size: 1.4rem; }
}
