/* =============================================
   SourcePilot Global — Blog Stylesheet
   Extends main styles.css
   ============================================= */

/* ── Category badge ──────────────────────────────────────────────────────────── */
.cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

/* ── Blog top nav (category filter) ─────────────────────────────────────────── */
.blog-cat-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 72px;
  z-index: 90;
}
.blog-cat-nav-inner {
  display: flex;
  gap: 6px;
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.blog-cat-nav-inner::-webkit-scrollbar { display: none; }
.blog-cat-nav-inner a {
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  text-decoration: none;
  flex-shrink: 0;
}
.blog-cat-nav-inner a:hover { border-color: var(--navy-mid); color: var(--navy); }
.blog-cat-nav-inner a.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ── Featured post card ──────────────────────────────────────────────────────── */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 56px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s;
}
.post-featured:hover { box-shadow: var(--shadow-lg); }
.post-featured-visual {
  background: linear-gradient(135deg, var(--navy) 0%, #1a4a7a 60%, #0d3a6e 100%);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 340px;
}
.post-featured-visual::before {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,166,35,0.15), transparent 70%);
  border-radius: 50%;
}
.post-featured-visual .feat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.post-featured-visual .feat-num {
  font-size: 5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.06);
  font-family: var(--font-head);
  line-height: 1;
  position: absolute;
  bottom: 24px; right: 28px;
}
.post-featured-content {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-featured-content .post-meta { margin-bottom: 14px; }
.post-featured-content h2 {
  font-size: 1.55rem;
  color: var(--navy);
  margin-bottom: 14px;
  line-height: 1.3;
}
.post-featured-content h2 a { color: inherit; text-decoration: none; }
.post-featured-content h2 a:hover { color: var(--navy-mid); }
.post-featured-content p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 24px;
}

/* ── Post grid ───────────────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 52px;
}

/* ── Post card ───────────────────────────────────────────────────────────────── */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s;
}
.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(245,166,35,0.3);
}
.post-card-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1a4a7a 100%);
  padding: 28px 24px 22px;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.post-card-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(245,166,35,0.12), transparent 70%);
}
.post-card-header .post-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  position: relative;
}
.post-card-header .post-card-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.05);
  position: absolute;
  top: 8px; right: 16px;
  font-family: var(--font-head);
  line-height: 1;
}
.post-card-body {
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.post-date {
  font-size: 0.75rem;
  color: var(--gray);
}
.post-read-time {
  font-size: 0.75rem;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-card-body h3 {
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.4;
}
.post-card-body h3 a { color: inherit; text-decoration: none; }
.post-card-body h3 a:hover { color: var(--navy-mid); }
.post-card-body p {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 18px;
}
.post-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy-mid);
  text-decoration: none;
  transition: gap 0.2s;
}
.post-read-link:hover { gap: 10px; color: var(--navy); }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 40px;
}
.blog-pagination ul {
  display: flex;
  gap: 6px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--navy); background: var(--light); }
.page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--gray);
}
.page-info { font-size: 0.8rem; color: var(--gray); }

/* ── Category page hero ──────────────────────────────────────────────────────── */
.cat-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3f6e 100%);
  padding: 120px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,166,35,0.10), transparent 70%);
}
.cat-hero h1 { color: var(--white); margin-bottom: 10px; }
.cat-hero p  { color: rgba(255,255,255,0.65); font-size: 1.05rem; }

/* ── Single post layout ──────────────────────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 60px;
  align-items: start;
}
.post-sidebar {
  position: sticky;
  top: 100px;
}

/* ── Article typography ──────────────────────────────────────────────────────── */
.post-article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 52px;
}
.post-article-header { margin-bottom: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.post-article-header .post-meta { margin-bottom: 16px; }
.post-article-header h1 { font-size: 2rem; color: var(--navy); line-height: 1.25; margin-bottom: 16px; }
.post-article-header .post-excerpt {
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.8;
  border-left: 4px solid var(--gold);
  padding-left: 20px;
  margin: 0;
}

/* Article body rich text */
.post-body { font-size: 1rem; color: #374151; line-height: 1.85; }
.post-body h2 {
  font-size: 1.35rem;
  color: var(--navy);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.post-body h3 { font-size: 1.1rem; color: var(--navy); margin: 28px 0 10px; }
.post-body p  { margin-bottom: 20px; }
.post-body ul, .post-body ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}
.post-body li { margin-bottom: 8px; }
.post-body strong { color: var(--navy); }
.post-body a { color: var(--navy-mid); text-decoration: underline; }
.post-body a:hover { color: var(--navy); }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-body table th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.82rem;
}
.post-body table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.post-body table tr:last-child td { border-bottom: none; }
.post-body table tr:nth-child(even) { background: #fafafa; }

/* ── Post sidebar widgets ────────────────────────────────────────────────────── */
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.sidebar-post-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.sidebar-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post-item:hover .sp-title { color: var(--navy-mid); }
.sidebar-post-item .sp-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  transition: color 0.2s;
}
.sidebar-post-item .sp-meta { font-size: 0.75rem; color: var(--gray); }

/* ── Prev / Next navigation ──────────────────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
}
.post-nav-link {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  text-decoration: none;
  transition: all 0.2s;
}
.post-nav-link:hover { box-shadow: var(--shadow); border-color: rgba(245,166,35,0.35); transform: translateY(-2px); }
.post-nav-link.nav-next { text-align: right; }
.post-nav-dir {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  margin-bottom: 6px;
}
.post-nav-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}

/* ── Tags ────────────────────────────────────────────────────────────────────── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.tag-pill {
  background: var(--light);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s;
}
.tag-pill:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Share bar ───────────────────────────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.share-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
  color: #fff;
}
.share-btn:hover { opacity: 0.85; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.twitter  { background: #1d9bf0; }
.share-btn.email    { background: var(--navy); }

/* ── Related posts ───────────────────────────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  display: block;
  transition: all 0.2s;
}
.related-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: rgba(245,166,35,0.3); }
.related-card h4 { font-size: 0.9rem; color: var(--navy); margin: 10px 0 8px; line-height: 1.4; }
.related-card p  { font-size: 0.8rem; color: var(--gray); line-height: 1.6; margin: 0; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}
.empty-state h3 { color: var(--navy); margin-bottom: 10px; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-featured-visual { min-height: 180px; padding: 32px 28px; }
  .post-featured-content { padding: 28px; }
  .post-featured-content h2 { font-size: 1.25rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-article { padding: 28px 22px; }
  .post-article-header h1 { font-size: 1.5rem; }
  .post-nav { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .post-grid { grid-template-columns: 1fr; }
  .blog-cat-nav-inner { gap: 4px; }
}
