/* ═══════════════════════════════════════════════
   IMBILA.AI BLOG STYLES
   Extends design-system.css for blog layouts
   ═══════════════════════════════════════════════ */

/* ─── ARTICLE TYPOGRAPHY ─── */
.prose {
  max-width: 64ch;
  margin: 0 auto;
}

.post-content {
  margin-top: 32px;
  line-height: 1.8;
  font-size: 16.5px;
  color: var(--text-body);
}

.post-content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.post-content h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content a {
  color: var(--honey);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.post-content a:hover {
  color: var(--honey-light);
}

/* ─── BLOCKQUOTES ─── */
.post-content blockquote {
  border-left: 3px solid var(--honey);
  padding: 12px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--bg-card-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-content blockquote p {
  margin-bottom: 0;
}

/* ─── CODE BLOCKS ─── */
.post-content code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.875em;
  background: var(--bg-code);
  color: var(--text-code);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

/* ─── IMAGES ─── */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.post-content figure {
  margin: 32px 0;
}

.post-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── HORIZONTAL RULE ─── */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ─── TABLES ─── */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-card-alt);
  font-weight: 600;
  color: var(--text-heading);
}

/* ─── POST HEADER ─── */
.post-header {
  margin-bottom: 8px;
}

.post-header h1 {
  margin-top: 16px;
  margin-bottom: 16px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.post-tags a {
  text-decoration: none;
}

/* ─── POST META ─── */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-meta-sep {
  color: var(--border-strong);
}

.post-author {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ─── POST CARD ─── */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.post-card-reading-time::before {
  content: '\00B7';
  margin-right: 12px;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.35;
}

.post-card-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* ─── POST NAVIGATION ─── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-nav-link:hover {
  border-color: var(--honey);
  box-shadow: var(--shadow-card-hover);
}

.post-nav-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
}

.post-nav-next {
  text-align: right;
  grid-column: 2;
}

/* ─── SUBSCRIBE FORM ─── */
.subscribe-form {
  text-align: center;
}

.subscribe-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.subscribe-input-group {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.subscribe-input-group .input {
  flex: 1;
}

.subscribe-message {
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
}

.subscribe-message.success {
  color: var(--success);
}

.subscribe-message.error {
  color: var(--error);
}

/* ─── NEWSLETTER CTA ─── */
.newsletter-cta {
  margin-top: 48px;
}

.newsletter-cta-heading {
  margin-bottom: 16px;
  color: var(--text-heading);
}

.newsletter-cta-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
}

.newsletter-cta-form .input {
  flex: 1;
}

/* ─── TERMS LIST ─── */
.terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.term-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s;
}

.term-item:hover {
  border-color: var(--honey);
}

.term-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── SECTION DESCRIPTION ─── */
.section-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}

.pagination a:hover {
  color: var(--honey);
  background: var(--honey-10);
}

.pagination .active {
  color: var(--honey);
  font-weight: 700;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .subscribe-input-group,
  .newsletter-cta-form {
    flex-direction: column;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    text-align: left;
    grid-column: 1;
  }

  .post-content {
    font-size: 15.5px;
  }
}
