/* ============================================================
   Shaniur.com — Blog Stylesheet
   Extends /css/style.css — same palette & font
   ============================================================ */

/* ── Blog page wrapper ───────────────────────────────────── */
.blog-page {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Blog hero / page header ─────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, #f0f6ff 0%, #fafcff 60%, #f0faf5 100%);
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border-light);
}

.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: .4rem;
}

.blog-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
}

/* ── Search bar ──────────────────────────────────────────── */
.blog-search-wrap {
  margin-top: 1.8rem;
}

.blog-search {
  display: flex;
  max-width: 520px;
  gap: .5rem;
}

.blog-search input {
  flex: 1;
  padding: .7rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  font-size: .93rem;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.blog-search input:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(26,95,168,.1);
}

.blog-search button {
  padding: .7rem 1.4rem;
  background: var(--blue-primary);
  color: #fff;
  border-radius: 50px;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}
.blog-search button:hover { background: var(--blue-dark); }

/* ── Tag filter pills ────────────────────────────────────── */
.blog-tags-section {
  padding: 1.5rem 0 .5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-white);
}

.blog-tags-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
  margin-bottom: .7rem;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .85rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-body);
  background: var(--bg-white);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.tag-pill:hover,
.tag-pill.active {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: #fff;
}

.tag-pill .tag-count {
  background: rgba(255,255,255,.25);
  border-radius: 50px;
  padding: 0 .4rem;
  font-size: .72rem;
}

.tag-pill:not(.active) .tag-count {
  background: var(--bg-alt);
  color: var(--text-muted);
}

.tag-pill-all {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}
.tag-pill-all.active,
.tag-pill-all:hover {
  background: var(--blue-primary);
  color: #fff;
}

/* ── Blog listing area ───────────────────────────────────── */
.blog-listing {
  padding: 3rem 0 4rem;
}

.blog-results-meta {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

.blog-results-meta strong { color: var(--text-body); }

/* ── Post cards grid ─────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--blue-xlight), var(--green-light));
}

/* Placeholder when no featured image */
.post-card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--blue-xlight) 0%, var(--green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-img-placeholder svg {
  opacity: .25;
  color: var(--blue-primary);
}

.post-card-body {
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .8rem;
}

.post-tag {
  font-size: .72rem;
  font-weight: 600;
  color: var(--blue-primary);
  background: var(--blue-xlight);
  border-radius: 50px;
  padding: .2rem .65rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.post-tag:hover {
  background: var(--blue-primary);
  color: #fff;
}

.post-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: .6rem;
  text-decoration: none;
  display: block;
}
.post-card-title:hover { color: var(--blue-primary); }

.post-card-excerpt {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.1rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-xmuted);
  border-top: 1px solid var(--border-light);
  padding-top: .9rem;
  margin-top: auto;
}

.post-card-date { display: flex; align-items: center; gap: .3rem; }

.post-card-read {
  font-size: .82rem;
  font-weight: 600;
  color: var(--blue-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: gap var(--transition);
}
.post-card-read:hover { gap: .6rem; }

/* ── Empty state ─────────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
}

.blog-empty svg { margin: 0 auto 1rem; opacity: .3; }
.blog-empty h3 { font-size: 1.2rem; color: var(--text-body); margin-bottom: .5rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 .8rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text-body);
  background: var(--bg-white);
  transition: all var(--transition);
}

.page-btn:hover  { border-color: var(--blue-primary); color: var(--blue-primary); }
.page-btn.active { background: var(--blue-primary); border-color: var(--blue-primary); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ════════════════════════════════════════════════════════════
   SINGLE POST PAGE
════════════════════════════════════════════════════════════ */

.post-page {
  padding-top: var(--nav-h);
}

/* ── Post header ─────────────────────────────────────────── */
.post-header {
  background: linear-gradient(135deg, #f0f6ff 0%, #fafcff 70%, #f0faf5 100%);
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

.post-breadcrumb {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.post-breadcrumb a { color: var(--blue-primary); text-decoration: none; }
.post-breadcrumb a:hover { text-decoration: underline; }

.post-header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 1.2rem;
  max-width: 800px;
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* ── Featured image ──────────────────────────────────────── */
.post-featured-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* ── Post layout ─────────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.5rem;
  padding: 3rem 0 4rem;
  align-items: start;
}

/* ── Post content (Markdown rendered) ───────────────────── */
.post-content {
  min-width: 0;
}

.post-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-body);
}

.post-body h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 2.2rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--border-light);
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 1.8rem 0 .6rem;
}

.post-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 1.4rem 0 .5rem;
}

.post-body p { margin-bottom: 1.2rem; }

.post-body ul,
.post-body ol {
  margin: 0 0 1.2rem 1.5rem;
}

.post-body li { margin-bottom: .4rem; }

.post-body blockquote {
  border-left: 4px solid var(--blue-primary);
  padding: .8rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--blue-xlight);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-dark);
}

.post-body pre {
  background: #1a2333;
  color: #e2e8f0;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .88rem;
  line-height: 1.7;
}

.post-body code {
  background: var(--bg-alt);
  color: var(--red-primary);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .9em;
}

.post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.2rem 0;
  box-shadow: var(--shadow-sm);
}

.post-body hr {
  border: none;
  border-top: 2px solid var(--border-light);
  margin: 2rem 0;
}

.post-body a {
  color: var(--blue-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-body a:hover { color: var(--blue-dark); }

.post-body strong { font-weight: 700; color: var(--text-dark); }

/* ── Social share ────────────────────────────────────────── */
.post-share {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}

.post-share h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}

.share-btn-linkedin  { background: #0a66c2; color: #fff; }
.share-btn-twitter   { background: #000; color: #fff; }
.share-btn-facebook  { background: #1877f2; color: #fff; }
.share-btn-whatsapp  { background: #25d366; color: #fff; }
.share-btn-copy      { background: var(--bg-alt); color: var(--text-body); border: 1.5px solid var(--border); }

.share-btn:hover     { opacity: .88; transform: translateY(-2px); }

/* ── Post sidebar ────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.sidebar-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--blue-primary);
  margin-bottom: 1rem;
}

/* Table of contents */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.toc-link {
  font-size: .86rem;
  color: var(--text-body);
  text-decoration: none;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.toc-link:hover,
.toc-link.toc-active {
  color: var(--blue-primary);
  border-left-color: var(--blue-primary);
  background: var(--blue-xlight);
}

/* Related posts */
.related-post {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  transition: opacity var(--transition);
}
.related-post:last-child { border-bottom: none; padding-bottom: 0; }
.related-post:hover { opacity: .75; }

.related-post-title {
  font-size: .86rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: .2rem;
}

.related-post-date {
  font-size: .75rem;
  color: var(--text-muted);
}

/* Author card */
.author-card {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  flex-shrink: 0;
  border: 2px solid var(--border-light);
}

.author-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .15rem;
}

.author-title {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: .5rem;
}

.author-linkedin {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  color: #0a66c2;
  text-decoration: none;
}
.author-linkedin:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   HOMEPAGE BLOG SNIPPET SECTION
════════════════════════════════════════════════════════════ */

#latest-posts {
  background: var(--bg-alt);
}

.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.latest-post-skeleton {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  height: 160px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}

.blog-view-all {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .latest-posts-grid { grid-template-columns: 1fr; }
  .blog-search { flex-direction: column; max-width: 100%; }
  .blog-search button { border-radius: 50px; }
  .post-header h1 { font-size: 1.7rem; }
  .share-buttons { gap: .4rem; }
  .share-btn { font-size: .78rem; padding: .45rem .9rem; }
}
