/* ============================================================
   blog.css – Blog-specific styles for NextPost.id
   ============================================================ */

/* ── SKELETON LOADING ── */
.skeleton-bar {
  height: 14px;
  background: linear-gradient(90deg, var(--navy-700) 25%, var(--navy-600) 50%, var(--navy-700) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}
.skeleton-bar.w30 { width: 30%; }
.skeleton-bar.w40 { width: 40%; }
.skeleton-bar.w60 { width: 60%; }
.skeleton-bar.w70 { width: 70%; }
.skeleton-bar.w80 { width: 80%; }
.skeleton-bar.w90 { width: 90%; }
.skeleton-bar.h16 { height: 16px; }
.skeleton-bar.h20 { height: 20px; }
.skeleton-bar.h24 { height: 24px; }
.skeleton-bar.h32 { height: 32px; }
.skeleton-bar.h48 { height: 48px; }
.skeleton-img {
  width: 100%; height: 200px;
  background: linear-gradient(90deg, var(--navy-700) 25%, var(--navy-600) 50%, var(--navy-700) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.post-cover-skeleton { height: 380px !important; border-radius: var(--radius-lg); margin: 28px 0; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── BLOG PREVIEW (homepage) ── */
.blog-preview {
  padding: 100px 0;
  background: rgba(255,255,255,0.01);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.section-cta {
  text-align: center;
}

/* ── BLOG CARD ── */
.blog-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}
.blog-card:hover {
  border-color: rgba(0,212,170,0.2);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.blog-card-img {
  height: 200px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0,212,170,0.12), rgba(0,133,255,0.08));
}
.blog-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.blog-category-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: color-mix(in srgb, var(--cat-color) 15%, rgba(0,0,0,0.5));
  border: 1px solid color-mix(in srgb, var(--cat-color) 40%, transparent);
  color: var(--cat-color);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}
.blog-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}
.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
}
.blog-author, .blog-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.blog-empty {
  text-align: center;
  padding: 64px 24px;
}
.blog-empty-icon { font-size: 3rem; margin-bottom: 16px; }
.blog-empty h3 { font-size: 1.2rem; margin-bottom: 8px; }
.blog-empty p { color: var(--text-muted); font-size: 0.9rem; }

/* ── BLOG PAGE HEADER ── */
.blog-header {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-header-bg {
  position: absolute; inset: 0;
  pointer-events: none;
}
.blog-header-inner { position: relative; z-index: 1; }
.blog-page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin: 16px 0;
  line-height: 1.1;
}
.blog-page-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── FILTER BAR ── */
.blog-filter-bar {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 100;
  background: rgba(11,22,40,0.92);
  backdrop-filter: blur(16px);
}
.blog-filter-bar .container {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.filter-pill {
  padding: 7px 16px;
  border-radius: 100px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.filter-pill.active {
  background: rgba(0,212,170,0.1);
  border-color: rgba(0,212,170,0.3);
  color: var(--teal-400);
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  color: var(--text-muted);
  transition: border-color var(--transition);
}
.blog-search:focus-within {
  border-color: var(--border-hover);
  color: var(--teal-400);
}
.blog-search input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text-primary);
  width: 180px;
}
.blog-search input::placeholder { color: var(--text-muted); }

/* ── BLOG MAIN ── */
.blog-main { padding: 56px 0 100px; }

.blog-grid-full {
  grid-template-columns: repeat(3, 1fr);
}
.blog-card-featured {
  grid-column: span 3;
  flex-direction: row;
}
.blog-card-featured .blog-card-img {
  width: 50%;
  height: auto;
  min-height: 280px;
  flex-shrink: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.blog-card-featured .blog-card-body { padding: 36px; justify-content: center; }
.blog-card-featured .blog-card-title { font-size: 1.4rem; }
.blog-card-featured .blog-card-excerpt { -webkit-line-clamp: 4; line-clamp: 4; }

/* ── PAGINATION ── */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--border-hover); color: var(--teal-400); }
.page-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ── BLOG POST DETAIL ── */
.post-main { padding-top: 80px; }

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 20px 0;
  flex-wrap: wrap;
}
.post-breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.post-breadcrumb a:hover { color: var(--teal-400); }
.post-breadcrumb svg { color: var(--text-muted); flex-shrink: 0; }
.post-breadcrumb span { color: var(--text-secondary); }

.post-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  padding-bottom: 100px;
  align-items: start;
}

.post-article { min-width: 0; }

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

.post-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 24px;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.author-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.author-name { display: block; font-size: 0.88rem; font-weight: 600; }
.post-date { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.post-share {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.share-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-size: 0.72rem; font-weight: 700;
}
.share-btn:hover { border-color: var(--border-hover); color: var(--teal-400); }

.post-cover {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 0 28px;
}
.post-cover-placeholder {
  width: 100%; height: 280px;
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,133,255,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 0 28px;
}

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.post-content h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin: 2rem 0 1rem; letter-spacing: -0.5px; }
.post-content h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 0.75rem; }
.post-content p { margin-bottom: 1.2rem; }
.post-content ul, .post-content ol { margin: 1rem 0 1.2rem 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content a { color: var(--teal-400); text-decoration: underline; }
.post-content blockquote { border-left: 3px solid var(--teal-400); padding-left: 20px; margin: 1.5rem 0; color: var(--text-secondary); font-style: italic; }
.post-content code { background: rgba(0,212,170,0.08); color: var(--teal-400); padding: 2px 7px; border-radius: 4px; font-size: 0.88em; }
.post-content img { max-width: 100%; border-radius: var(--radius-md); margin: 16px 0; }

.post-footer-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.tag-pill {
  padding: 5px 12px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--cat-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color) 25%, transparent);
  color: var(--cat-color);
  font-size: 0.78rem; font-weight: 600;
}

.post-cta-inline {
  margin-top: 48px;
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,133,255,0.05));
  border: 1px solid rgba(0,212,170,0.15);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}
.post-cta-inline h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.post-cta-inline p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }

.post-not-found { text-align: center; padding: 80px 24px; }
.post-not-found h2 { font-size: 1.5rem; margin: 16px 0 8px; }
.post-not-found p { color: var(--text-muted); }

/* ── SIDEBAR ── */
.post-sidebar { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 20px; }

.sidebar-widget {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.sidebar-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.related-posts { display: flex; flex-direction: column; gap: 12px; }
.related-post-item {
  display: block;
  text-decoration: none;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.related-post-item:hover { border-color: rgba(0,212,170,0.2); background: rgba(0,212,170,0.04); }
.related-post-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 4px; }
.related-post-date { font-size: 0.75rem; color: var(--text-muted); }

.sidebar-cta {
  background: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,133,255,0.05));
  border: 1px solid rgba(0,212,170,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.sidebar-cta h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.sidebar-cta p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

/* ── INDEX PAGE ADDITIONS ── */
.cta-email {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cta-email a { color: var(--teal-400); text-decoration: none; font-weight: 500; }
.cta-email a:hover { text-decoration: underline; }

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-400);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 18px;
  transition: opacity var(--transition);
}
.footer-email:hover { opacity: 0.75; }

/* ── POST LOADING ── */
.post-loading { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid-full { grid-template-columns: repeat(2, 1fr); }
  .blog-card-featured { grid-column: span 2; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}

@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid-full { grid-template-columns: 1fr; }
  .blog-card-featured { grid-column: span 1; flex-direction: column; }
  .blog-card-featured .blog-card-img { width: 100%; min-height: 200px; }
  .blog-filter-bar .container { flex-direction: column; align-items: stretch; }
  .blog-search { width: 100%; }
  .blog-search input { width: 100%; }
  .post-meta { flex-direction: column; align-items: flex-start; }
  .post-cover { height: 240px; }
}
