/* ============================================================
   blog.css — Blog Styles
   Portfolio: Madan Kumar PC
   ============================================================ */

/* --- Blog Listing Page --- */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.blog-search-wrap {
  position: relative;
  max-width: 480px;
}

.blog-search {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
}

.blog-search:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.blog-search::placeholder { color: var(--color-muted); }

.blog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Tag filters */
.blog-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-filter-label {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: 4px;
}

.tag-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.03em;
}

.tag-filter-btn:hover,
.tag-filter-btn.active {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Result count */
.blog-result-count {
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-bottom: 28px;
  min-height: 1.2em;
}

/* Blog Cards Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
  min-height: 200px;
}

.blog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-gold);
}

.blog-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-thumb {
  transform: scale(1.04);
}

.blog-card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.blog-card:hover {
  border-color: rgba(201, 168, 76, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold-md);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.blog-card-meta i {
  color: var(--color-gold);
  margin-right: 4px;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.4;
  transition: var(--transition);
  display: block;
}

.blog-card-title:hover { color: var(--color-gold); }

.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.75;
  flex: 1;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-gold);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}

.blog-tag:hover {
  background: rgba(201, 168, 76, 0.18);
}

.blog-card-read-more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  transition: var(--transition);
}

.blog-card-read-more:hover {
  color: var(--color-gold-light);
  gap: 10px;
}

/* Empty state */
.blog-empty {
  text-align: center;
  padding: 64px 0;
  color: var(--color-muted);
  grid-column: 1 / -1;
}

.blog-empty i {
  font-size: 2.4rem;
  color: var(--color-gold);
  opacity: 0.35;
  margin-bottom: 16px;
  display: block;
}

.blog-empty p { font-size: 0.95rem; }

/* Pagination */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 64px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--color-gold); color: var(--color-gold); }

.page-btn.active {
  background: var(--color-gold);
  color: #0a0a0a;
  border-color: var(--color-gold);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================================
   BLOG POST PAGE
   ============================================================ */
.blog-post {
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: 36px;
  transition: var(--transition);
}

.back-link:hover { color: var(--color-gold-light); gap: 10px; }

.post-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.post-meta i { color: var(--color-gold); margin-right: 5px; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.post-tags .blog-tag { cursor: default; }

/* Post Content Typography */
.post-content {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 56px;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-white);
  margin: 44px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-white);
  margin: 32px 0 12px;
}

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

.post-content ul,
.post-content ol {
  margin: 0 0 20px 22px;
}

.post-content li { margin-bottom: 8px; list-style: disc; }
.post-content ol li { list-style: decimal; }

.post-content a {
  color: var(--color-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content strong { color: var(--color-white); }

.post-content blockquote {
  border-left: 3px solid var(--color-gold);
  margin: 28px 0;
  padding: 14px 22px;
  background: rgba(201, 168, 76, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-white);
}

.post-content code {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  color: var(--color-gold-light);
}

.post-content pre {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 36px 0;
}

/* Post content tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.post-content thead th {
  background: rgba(201, 168, 76, 0.1);
  color: var(--color-white);
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  border: 1px solid rgba(201, 168, 76, 0.25);
}

.post-content tbody td {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  vertical-align: top;
  line-height: 1.65;
}

.post-content tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Callout boxes */
.post-callout {
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 28px 0;
}

.post-callout p:last-child { margin-bottom: 0; }

.post-callout strong.callout-title {
  display: block;
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-style: normal;
}

/* Placeholder notice */
.placeholder-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 36px;
  font-size: 0.88rem;
  color: var(--color-gold);
}

.placeholder-notice i { margin-top: 2px; flex-shrink: 0; }

/* Social Share */
.social-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 52px;
}

.share-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-white);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }

.share-btn.linkedin  { border-color: rgba(10,102,194,0.4); }
.share-btn.linkedin:hover  { background: #0A66C2; border-color: #0A66C2; color: #fff; }

.share-btn.twitter   { border-color: rgba(0,0,0,0.6); }
.share-btn.twitter:hover   { background: #000; border-color: #000; color: #fff; }

.share-btn.facebook  { border-color: rgba(24,119,242,0.4); }
.share-btn.facebook:hover  { background: #1877F2; border-color: #1877F2; color: #fff; }

.share-btn.whatsapp  { border-color: rgba(37,211,102,0.4); }
.share-btn.whatsapp:hover  { background: #25D366; border-color: #25D366; color: #000; }

.share-btn.copylink  { border-color: rgba(201,168,76,0.4); color: var(--color-gold); }
.share-btn.copylink:hover  { background: rgba(201,168,76,0.1); border-color: var(--color-gold); }
.share-btn.copylink.copied { border-color: #22c55e; color: #22c55e; }

/* Comments Section */
.cusdis-wrap {
  margin-top: 48px;
}

.cusdis-section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-gold);
  display: inline-block;
}

#cusdis_thread iframe {
  width: 100% !important;
  min-height: 600px;
  border: none;
  display: block;
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 50%, var(--color-gold) 100%);
  background-size: 200% 100%;
  z-index: 9999;
  transition: width 0.08s linear;
  animation: progress-shimmer 2.2s linear infinite, progress-pulse 1.8s ease-in-out infinite;
  transform-origin: left;
}

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

@keyframes progress-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(201,168,76,0.55), 0 0 12px rgba(201,168,76,0.2); }
  50%       { box-shadow: 0 0 10px rgba(201,168,76,1), 0 0 28px rgba(201,168,76,0.55), 0 0 48px rgba(201,168,76,0.2); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-post { padding: 40px 20px 60px; }
  .post-title { font-size: 1.7rem; }
  .social-share { gap: 8px; }
  .share-btn { padding: 7px 12px; font-size: 0.76rem; }
}
