/* ══════════════════════════════════════════
   blog.css — Infomatrices Blog styles
   ══════════════════════════════════════════ */

/* ── Layout foundation ── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
}
main { flex: 1; }

/* ══════════════════════════════════════════
   TAG PILL COLORS
   ══════════════════════════════════════════ */
.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-blue   { background: #DBEAFE; color: #1D4ED8; }
.tag-green  { background: #D1FAE5; color: #065F46; }
.tag-purple { background: #EDE9FE; color: #6D28D9; }
.tag-orange { background: #FEF3C7; color: #92400E; }
.tag-pink   { background: #FCE7F3; color: #9D174D; }
.tag-teal   { background: #CCFBF1; color: #0F766E; }

/* ── Author chip ── */
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.author-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Byline row ── */
.card-byline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: #6B7280;
  flex-wrap: wrap;
}
.byline-sep { opacity: 0.4; font-size: 1rem; line-height: 1; }

/* ══════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════ */
.blog-page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid #F3F4F6;
}
.blog-page-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.blog-page-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #111827;
  margin-bottom: 10px;
  line-height: 1.15;
}
.blog-page-sub {
  font-size: 1rem;
  color: #6B7280;
  max-width: 520px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   FEATURED HERO POST
   ══════════════════════════════════════════ */
.featured-hero { padding: 40px 0 0; }

.featured-hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #111827;
  color: #fff;
  text-decoration: none;
  min-height: 380px;
  transition: box-shadow 0.25s;
}
.featured-hero-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.featured-hero-img {
  position: relative;
  overflow: hidden;
  background: #1f2937;
}
.featured-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.featured-hero-card:hover .featured-hero-img img {
  transform: scale(1.03);
}
.featured-hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1D4ED8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-hero-body {
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.featured-hero-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}
.featured-hero-excerpt {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
}
.featured-hero-body .card-byline {
  color: rgba(255,255,255,0.55);
}
.featured-hero-body .author-chip-avatar {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
}
.featured-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 4px;
}
.featured-hero-card:hover .featured-hero-cta {
  text-decoration: underline;
}

/* ══════════════════════════════════════════
   SECONDARY FEATURED GRID (2 cards)
   ══════════════════════════════════════════ */
.secondary-featured { padding: 20px 0 0; }

.secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.secondary-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #F3F4F6;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}
.secondary-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.09);
  transform: translateY(-3px);
}

.secondary-card-img {
  height: 200px;
  overflow: hidden;
  background: #F3F4F6;
  flex-shrink: 0;
}
.secondary-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.secondary-card:hover .secondary-card-img img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

.secondary-card-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.secondary-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════
   ARTICLES SECTION (filter + grid)
   ══════════════════════════════════════════ */
.articles-section { padding: 48px 0 80px; }

.articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F3F4F6;
}
.articles-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-btn:hover { background: #E5E7EB; color: #111827; }
.filter-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* ── Articles grid ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #F3F4F6;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.article-card-img {
  height: 180px;
  overflow: hidden;
  background: #F9FAFB;
  flex-shrink: 0;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.article-card:hover .article-card-img img { transform: scale(1.04); }

.article-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.article-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.article-card-excerpt {
  font-size: 0.85rem;
  color: #6B7280;
  line-height: 1.6;
  flex: 1;
}

.no-results {
  text-align: center;
  padding: 40px 0;
  color: #9CA3AF;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════
   NEWSLETTER STRIP
   ══════════════════════════════════════════ */
.blog-newsletter {
  background: #F9FAFB;
  border-top: 1px solid #F3F4F6;
  border-bottom: 1px solid #F3F4F6;
  padding: 48px 0;
}
.blog-newsletter-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.blog-newsletter-text { flex: 1; min-width: 240px; }
.blog-newsletter-text h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.blog-newsletter-text p {
  font-size: 0.9rem;
  color: #6B7280;
  line-height: 1.5;
}
.blog-newsletter-form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.blog-newsletter-form input {
  padding: 10px 16px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.875rem;
  width: 260px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-newsletter-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.blog-newsletter-form button {
  padding: 10px 20px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.blog-newsletter-form button:hover { background: var(--color-primary); }
.blog-nl-success {
  font-size: 0.9rem;
  font-weight: 600;
  color: #059669;
}

/* ══════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════ */
.blog-empty {
  text-align: center;
  padding: 100px 20px;
  color: #9CA3AF;
}
.blog-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #D1D5DB;
}
.blog-empty h3 { font-size: 1.2rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.blog-empty p  { font-size: 0.9rem; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.site-footer {
  background: #111827;
  color: rgba(255,255,255,0.65);
  padding: 52px 0 28px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.footer-brand {}
.footer-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.footer-tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
}
.footer-links-group {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.15s;
}
.footer-col ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  flex-wrap: wrap;
  gap: 8px;
}

/* ══════════════════════════════════════════
   POST PAGE STYLES
   ══════════════════════════════════════════ */

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--color-primary);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Post hero (white, centered) ── */
.post-hero {
  background: #fff;
  border-bottom: 1px solid #F3F4F6;
  padding: 52px 0 44px;
}
.post-hero-inner {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

/* Breadcrumb */
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #9CA3AF;
  align-self: flex-start;
}
.post-breadcrumb a { color: var(--color-primary); font-weight: 500; }
.post-breadcrumb a:hover { text-decoration: underline; }

/* Tags row */
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* Title */
.post-hero-title {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #111827;
  max-width: 720px;
}

/* Subtitle */
.post-hero-excerpt {
  font-size: 1.1rem;
  color: #6B7280;
  line-height: 1.65;
  max-width: 600px;
}

/* Author row */
.post-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid #F3F4F6;
  flex-wrap: wrap;
}
.post-author-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-author-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
.post-author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}
.post-author-meta {
  font-size: 0.8rem;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-meta-dot { opacity: 0.4; }

/* Inline share buttons */
.post-share-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-share-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  margin-right: 2px;
}
.post-share-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.post-share-btn:hover { background: #111827; color: #fff; border-color: #111827; }

/* Featured image */
.post-featured-img {
  max-width: 880px;
  margin: 36px auto 0;
  padding-inline: 24px;
  border-radius: 16px;
  overflow: hidden;
}
.post-featured-img img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

/* ── Body layout: side-share + content ── */
.post-body-wrap {
  display: grid;
  grid-template-columns: 64px 1fr;
  max-width: 920px;
  margin: 52px auto 0;
  padding-inline: 24px;
  gap: 0;
  align-items: start;
}

/* Sticky side share */
.post-side-share { position: relative; }
.post-side-share-sticky {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.post-side-share-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #C0C4CC;
  margin-bottom: 2px;
}
.side-share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.side-share-btn:hover { background: #111827; color: #fff; border-color: #111827; }

.copy-toast {
  font-size: 0.65rem;
  background: #111827;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.copy-toast.visible { opacity: 1; }

/* ── Article typography ── */
.post-content {
  font-size: 1.08rem;
  line-height: 1.85;
  color: #1a1a2e;
  max-width: 720px;
  padding-bottom: 60px;
}
.post-content h2, .post-content h3, .post-content h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 2em 0 0.65em;
  line-height: 1.25;
  color: #111827;
}
.post-content h2 { font-size: 1.6rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.05rem; }
.post-content p  { margin-bottom: 1.2em; }
.post-content ul, .post-content ol { margin: 0.6em 0 1.2em 1.6em; }
.post-content li { margin-bottom: 0.45em; }
.post-content blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 2em 0;
  padding: 1.1em 1.5em;
  background: #F8FBFF;
  border-radius: 0 12px 12px 0;
  color: #1E3A5F;
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.7;
}
.post-content a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: #1D4ED8; }
.post-content strong { font-weight: 700; color: #111827; }
.post-content code {
  background: #F3F4F6;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
  color: #374151;
}
.post-content pre {
  background: #111827;
  color: #F9FAFB;
  padding: 22px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 0.9em;
  line-height: 1.65;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content img { border-radius: 12px; margin: 1.6em 0; max-width: 100%; display: block; }
.post-content hr { border: none; border-top: 1px solid #E5E7EB; margin: 2.5em 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: 0.95em; }
.post-content th, .post-content td { border: 1px solid #E5E7EB; padding: 10px 14px; }
.post-content th { background: #F9FAFB; font-weight: 600; color: #374151; }

/* ── Author card ── */
.post-author-card-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.post-author-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 16px;
  padding: 26px 28px;
}
.post-author-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-author-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  margin-bottom: 3px;
}
.post-author-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
}
.post-author-card-bio { font-size: 0.875rem; color: #6B7280; line-height: 1.5; }

/* ── Related posts ── */
.post-related {
  background: #F9FAFB;
  border-top: 1px solid #F3F4F6;
  padding: 56px 0 72px;
}
.post-related-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}
.post-related-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
  margin-bottom: 28px;
}
.post-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #F3F4F6;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.related-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.09);
  transform: translateY(-3px);
}
.related-card-img {
  height: 180px;
  overflow: hidden;
  background: #F3F4F6;
  flex-shrink: 0;
}
.related-card-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.35s ease;
}
.related-card:hover .related-card-img img { transform: scale(1.04); }
.related-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.related-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.related-card-excerpt {
  font-size: 0.83rem;
  color: #6B7280;
  line-height: 1.55;
  flex: 1;
}

.dot { opacity: 0.4; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  .featured-hero-card { grid-template-columns: 1fr; }
  .featured-hero-img  { height: 240px; }
  .featured-hero-body { padding: 28px 24px; }
  .articles-grid      { grid-template-columns: repeat(2, 1fr); }
  .post-related-grid  { grid-template-columns: repeat(2, 1fr); }
  .post-body-wrap     { grid-template-columns: 1fr; }
  .post-side-share    { display: none; }
}

@media (max-width: 640px) {
  .secondary-grid           { grid-template-columns: 1fr; }
  .articles-grid            { grid-template-columns: 1fr; }
  .articles-header          { flex-direction: column; align-items: flex-start; }
  .blog-newsletter-inner    { flex-direction: column; align-items: flex-start; }
  .blog-newsletter-form     { flex-direction: column; width: 100%; }
  .blog-newsletter-form input { width: 100%; }
  .footer-top               { flex-direction: column; }
  .footer-links-group       { gap: 28px; }
  .footer-bottom            { flex-direction: column; align-items: flex-start; }
  .post-related-grid        { grid-template-columns: 1fr; }
  .post-author-row          { flex-direction: column; align-items: flex-start; }
  .post-hero-inner          { align-items: flex-start; text-align: left; }
  .post-tags                { justify-content: flex-start; }
}
