/* ============================================================
   MBC PULSE – COMPONENT STYLES
   Single posts, archives, sidebar, search, 404, comments
   ============================================================ */

/* ============================================================
   SKIP LINK
   ============================================================ */
.mbc-skip-link:focus {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.mbc-breadcrumbs {
  padding-block: 80px 20px;
  font-size: 13px;
  color: var(--color-muted);
}
.mbc-breadcrumbs a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.mbc-breadcrumbs a:hover { color: var(--color-primary); }
.mbc-breadcrumbs span { color: var(--color-white); }
.mbc-breadcrumbs .sep { margin-inline: 6px; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.mbc-single-page {
  padding-top: 72px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.mbc-single-hero {
  background: var(--bg-secondary);
  padding-block: 60px;
  border-bottom: 1px solid var(--color-border);
}

.mbc-single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.mbc-single-cat { /* reuses .mbc-post-category */ }
.mbc-single-date { font-size: 13px; color: var(--color-muted); }
.mbc-reading-time { font-size: 13px; color: var(--color-muted); display: flex; align-items: center; gap: 4px; }

.mbc-single-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.mbc-single-excerpt {
  font-size: 18px;
  color: var(--color-muted);
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 28px;
}

.mbc-single-author-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.mbc-single-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}
.mbc-author-name { font-size: 14px; font-weight: 600; color: var(--color-white); }
.mbc-author-role { font-size: 12px; color: var(--color-muted); }

/* Article layout */
.mbc-single-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  padding-block: 48px;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.mbc-single-featured-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  border: 1px solid var(--color-border);
}

/* Post content typography */
.mbc-post-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-light);
}
.mbc-post-content h2,
.mbc-post-content h3,
.mbc-post-content h4 {
  font-family: var(--font-heading);
  color: var(--color-white);
  margin-top: 2em;
  margin-bottom: 0.75em;
}
.mbc-post-content h2 { font-size: 28px; letter-spacing: -0.02em; }
.mbc-post-content h3 { font-size: 22px; }
.mbc-post-content h4 { font-size: 18px; }
.mbc-post-content p  { margin-bottom: 1.5em; }
.mbc-post-content a  { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.mbc-post-content a:hover { color: var(--color-accent); }
.mbc-post-content strong { color: var(--color-white); font-weight: 600; }
.mbc-post-content em     { font-style: italic; }

.mbc-post-content ul,
.mbc-post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}
.mbc-post-content ul { list-style: disc; }
.mbc-post-content ol { list-style: decimal; }
.mbc-post-content li { margin-bottom: 0.5em; color: var(--color-light); }

.mbc-post-content blockquote {
  margin: 2em 0;
  padding: 20px 28px;
  border-left: 3px solid var(--color-primary);
  background: rgba(59,130,246,0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 18px;
  color: var(--color-white);
}

.mbc-post-content code {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  color: var(--color-accent);
}

.mbc-post-content pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 1.5em;
}
.mbc-post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: var(--color-light);
}

.mbc-post-content img {
  border-radius: var(--radius-md);
  margin-block: 1.5em;
  border: 1px solid var(--color-border);
}

.mbc-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 15px;
}
.mbc-post-content th,
.mbc-post-content td {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  text-align: left;
}
.mbc-post-content th {
  background: var(--bg-secondary);
  color: var(--color-white);
  font-weight: 600;
}
.mbc-post-content td { color: var(--color-light); }
.mbc-post-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.mbc-post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin-block: 2em;
}

/* Post tags */
.mbc-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}
.mbc-post-tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--color-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.mbc-post-tag:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(59,130,246,0.08);
}

/* Post share */
.mbc-post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.mbc-share-label { font-size: 13px; font-weight: 600; color: var(--color-white); }
.mbc-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-glass);
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mbc-share-btn:hover { color: var(--color-white); transform: translateY(-2px); }
.mbc-share-btn.twitter:hover  { border-color: rgba(29,161,242,0.4); background: rgba(29,161,242,0.1); color: #1DA1F2; }
.mbc-share-btn.linkedin:hover { border-color: rgba(0,119,181,0.4);  background: rgba(0,119,181,0.1);  color: #0077B5; }
.mbc-share-btn.copy:hover     { border-color: rgba(34,197,94,0.4);  background: rgba(34,197,94,0.1);  color: #22C55E; }

/* Author bio card */
.mbc-author-bio-card {
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 48px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.mbc-author-bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}
.mbc-author-bio-name  { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--color-white); margin-bottom: 6px; }
.mbc-author-bio-desc  { font-size: 14px; color: var(--color-muted); line-height: 1.65; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.mbc-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mbc-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.mbc-widget-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.mbc-widget ul { display: flex; flex-direction: column; gap: 8px; }
.mbc-widget ul li a {
  font-size: 14px;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mbc-widget ul li a:hover { color: var(--color-primary); }
.mbc-widget ul li a span {
  font-size: 11px;
  background: var(--color-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  color: var(--color-muted);
}

/* ============================================================
   ARCHIVE / BLOG PAGE
   ============================================================ */
.mbc-archive-page {
  padding-top: 72px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.mbc-archive-header {
  background: var(--bg-secondary);
  padding-block: 60px 48px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.mbc-archive-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.mbc-archive-desc {
  font-size: 17px;
  color: var(--color-muted);
  max-width: 560px;
  line-height: 1.65;
}

.mbc-archive-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding-block: 48px;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

/* Pagination */
.mbc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.mbc-pagination a,
.mbc-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-glass);
  color: var(--color-muted);
  transition: all var(--transition-fast);
}
.mbc-pagination a:hover,
.mbc-pagination .current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ============================================================
   SEARCH RESULTS PAGE
   ============================================================ */
.mbc-search-page { padding-top: 72px; background: var(--bg-primary); min-height: 100vh; }
.mbc-search-page-header { background: var(--bg-secondary); padding-block: 60px 40px; border-bottom: 1px solid var(--color-border); }
.mbc-search-page-form { display: flex; gap: 12px; max-width: 600px; margin-top: 24px; }
.mbc-search-page-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-white);
  outline: none;
  transition: border-color var(--transition-fast);
}
.mbc-search-page-input:focus { border-color: var(--color-primary); }
.mbc-search-page-input::placeholder { color: var(--color-muted); }

/* ============================================================
   404 PAGE
   ============================================================ */
.mbc-404-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding-top: 72px;
  text-align: center;
}
.mbc-404-inner { max-width: 560px; padding: 40px 20px; }
.mbc-404-code {
  font-family: var(--font-heading);
  font-size: clamp(80px, 15vw, 140px);
  font-weight: 900;
  letter-spacing: -0.05em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}
.mbc-404-title { font-size: 28px; font-weight: 700; color: var(--color-white); margin-bottom: 12px; }
.mbc-404-desc  { font-size: 16px; color: var(--color-muted); margin-bottom: 32px; line-height: 1.65; }

/* ============================================================
   COMMENTS
   ============================================================ */
.mbc-comments-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}
.mbc-comments-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 28px;
}

/* WordPress comment list */
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .comment {
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}
.comment-list .children { padding-left: 40px; margin-top: 16px; }
.comment-list .comment-author img { width: 40px; height: 40px; border-radius: 50%; float: left; margin-right: 12px; }
.comment-list .comment-meta { font-size: 13px; color: var(--color-muted); margin-bottom: 8px; }
.comment-list .comment-meta a { color: var(--color-white); font-weight: 600; text-decoration: none; }
.comment-list .comment-content p { font-size: 15px; color: var(--color-light); line-height: 1.65; margin: 0; }
.comment-list .reply { margin-top: 12px; }
.comment-list .reply a { font-size: 13px; color: var(--color-primary); text-decoration: none; font-weight: 500; }

/* Comment form */
.comment-respond {
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 32px;
}
.comment-reply-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 24px;
}
.comment-form label { display: block; font-size: 13px; font-weight: 600; color: var(--color-muted); margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-white);
  outline: none;
  transition: border-color var(--transition-fast);
  margin-bottom: 16px;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--color-primary); }
.comment-form textarea { resize: vertical; min-height: 120px; }
.comment-form .form-submit input[type="submit"] {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(59,130,246,0.35);
  width: auto;
  margin: 0;
}
.comment-form .form-submit input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.50);
}

/* ============================================================
   RELATED POSTS
   ============================================================ */
.mbc-related-posts {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}
.mbc-related-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 28px;
}
.mbc-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ============================================================
   TABLE OF CONTENTS (injected by JS)
   ============================================================ */
.mbc-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 40px;
}
.mbc-toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mbc-toc ol { padding-left: 0; counter-reset: toc; }
.mbc-toc li { counter-increment: toc; }
.mbc-toc li a {
  font-size: 14px;
  color: var(--color-muted);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-block: 4px;
  transition: color var(--transition-fast);
}
.mbc-toc li a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 600;
  flex-shrink: 0;
}
.mbc-toc li a:hover { color: var(--color-white); }

/* ============================================================
   RESPONSIVE – Components
   ============================================================ */
@media (max-width: 1024px) {
  .mbc-single-layout  { grid-template-columns: 1fr; }
  .mbc-archive-layout { grid-template-columns: 1fr; }
  .mbc-sidebar        { position: static; }
  .mbc-related-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .mbc-related-grid    { grid-template-columns: 1fr; }
  .mbc-author-bio-card { flex-direction: column; }
  .mbc-post-share      { flex-direction: column; align-items: flex-start; }
}
