/* ============================================
   Nexion Blog — Ghost theme styles.
   Reuses the design tokens from /style.css
   (the main site's :root and .dark variables).
   ============================================ */

/* The navbar is fixed and always solid on the blog: offset its height */
.blog-main {
  padding-top: 4rem;
}

@media (min-width: 1024px) {
  .blog-main { padding-top: 4.5rem; }
}

/* ============================================
   Blog landing header
   ============================================ */
.blog-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem 0 3.5rem;
}

.blog-hero-header {
  margin-bottom: 0;
}

/* ============================================
   Post grid (same pattern as services-grid)
   ============================================ */
.blog-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.blog-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.blog-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
}

.blog-card-tag {
  align-self: flex-start;
  margin-bottom: 0.75rem;
}

.blog-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
  line-height: 1.4;
}

.blog-card:hover .blog-card-title {
  color: var(--primary);
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.blog-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

/* ============================================
   Pagination (Ghost's {{pagination}} helper)
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination .newer-posts,
.pagination .older-posts {
  display: inline-flex;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination .newer-posts:hover,
.pagination .older-posts:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   Post page
   ============================================ */
.blog-post .container {
  max-width: 760px;
}

.blog-post-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.blog-post-header .section-badge {
  margin-bottom: 1.25rem;
}

.blog-post-title {
  margin-bottom: 1rem;
}

.blog-post-meta {
  justify-content: center;
  font-size: 0.875rem;
}

.blog-post-feature {
  margin: 0 0 2.5rem;
}

.blog-post-feature img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.blog-post-feature figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.blog-post-footer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================
   Post content (HTML produced by the editor)
   ============================================ */
.blog-content {
  font-size: 1.0625rem;
  color: var(--text-primary);
  line-height: 1.8;
}

.blog-content > * + * {
  margin-top: 1.25rem;
}

.blog-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.blog-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.blog-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content a:hover {
  color: var(--primary-hover);
}

.blog-content ul,
.blog-content ol {
  list-style: revert;
  padding-left: 1.5rem;
}

.blog-content li + li {
  margin-top: 0.5rem;
}

.blog-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-style: italic;
}

.blog-content code {
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.blog-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* In dark mode the page background is #0f172a: give the block contrast */
.dark .blog-content pre {
  background: #1e293b;
}

.blog-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.blog-content img {
  border-radius: var(--radius-lg);
  margin-left: auto;
  margin-right: auto;
}

.blog-content figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.blog-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.blog-content th,
.blog-content td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.blog-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

/* Wide cards from the Ghost editor */
.blog-content .kg-width-wide {
  margin-left: -3rem;
  margin-right: -3rem;
}

@media (max-width: 900px) {
  .blog-content .kg-width-wide {
    margin-left: 0;
    margin-right: 0;
  }
}

.blog-content .kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}

.blog-content .kg-width-full img {
  width: 100%;
  border-radius: 0;
}

/* ============================================
   Back button (inherits .btn .btn-outline from the site)
   ============================================ */
.blog-post-footer .btn {
  font-size: 0.875rem;
}
