/* Blog: hub, category grids and articles. Uses the theme's colour tokens. */

.mb-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 130px 1.5rem 90px;
}

/* Sticky sidebar needs a non-scrolling ancestor. */
.single-post .cp-main {
  overflow: clip;
}

/* Breadcrumb */
.mb-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--hp-text-muted);
  margin-bottom: 1.25rem;
}

.mb-breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: #94a3b8;
}

.mb-breadcrumb a {
  color: var(--hp-text-muted);
  text-decoration: none;
}

.mb-breadcrumb a:hover {
  color: var(--hp-blue);
  text-decoration: underline;
}

.mb-breadcrumb [aria-current] {
  color: var(--hp-text-main);
  font-weight: 500;
}

/* Hero */
.mb-hero {
  max-width: 760px;
  margin-bottom: 3.5rem;
}

.mb-hero--compact {
  max-width: none;
  margin-bottom: 2.5rem;
}

.mb-hero__title {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--hp-text-main);
  margin-bottom: 1rem;
}

.mb-hero--compact .mb-hero__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.mb-hero__intro {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #475569;
  max-width: 680px;
}

/* Sections */
.mb-section {
  margin-top: 4rem;
}

.mb-hero + .mb-section {
  margin-top: 0;
}

.mb-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--hp-border);
}

.mb-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hp-text-main);
}

.mb-section__note {
  font-size: 0.875rem;
  color: var(--hp-text-muted);
}

/* Shared bits */
.mb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--hp-blue);
  text-decoration: none;
}

.mb-link span {
  transition: transform 0.2s ease;
}

a.mb-link:hover span,
.mb-cat:hover .mb-link span {
  transform: translateX(4px);
}

.mb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  font-size: 0.8125rem;
  color: var(--hp-text-muted);
}

.mb-meta > * + *::before {
  content: "·";
  margin-right: 0.9rem;
}

.mb-meta--lg {
  font-size: 0.9375rem;
}

.mb-thumb-fallback {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--hp-blue) 0%, var(--hp-blue-dark) 60%, #0f172a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

/* Category cards */
.mb-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.mb-cat {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--hp-border);
  border-radius: 16px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mb-cat:hover {
  transform: translateY(-3px);
  border-color: var(--hp-blue);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.1);
}

.mb-cat__media {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hp-surface-light);
}

.mb-cat__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mb-cat__body {
  min-width: 0;
}

.mb-cat__name {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hp-text-main);
  margin-bottom: 0.35rem;
}

.mb-cat__desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--hp-text-muted);
  margin-bottom: 0.75rem;
}

/* Featured: lead article with a side list */
.mb-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.mb-lead__media,
.mb-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--hp-surface-light);
}

.mb-lead__media {
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.mb-lead__media img,
.mb-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.mb-lead:hover .mb-lead__media img,
.mb-card:hover .mb-card__media img {
  transform: scale(1.04);
}

.mb-lead__title {
  font-size: clamp(1.4rem, 2.6vw, 1.875rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0.6rem 0 0.75rem;
}

.mb-lead__title a,
.mb-card__title a,
.mb-mini__title {
  color: var(--hp-text-main);
  text-decoration: none;
}

.mb-lead__title a:hover,
.mb-card__title a:hover,
.mb-mini__title:hover {
  color: var(--hp-blue);
}

.mb-lead .mb-card__excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 3;
}

.mb-lead .mb-meta {
  margin-bottom: 1rem;
}

/* Mini list */
.mb-mini {
  list-style: none;
}

.mb-mini li {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hp-border);
}

.mb-mini li:first-child {
  padding-top: 0;
}

.mb-mini li:last-child {
  border-bottom: 0;
}

.mb-mini__media {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--hp-surface-light);
}

.mb-mini__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mb-mini__media .mb-thumb-fallback span {
  display: none;
}

.mb-mini__title {
  display: block;
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.3rem;
}

/* Category pills */
.mb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.mb-pills a {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--hp-border);
  border-radius: 50px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.mb-pills a:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

.mb-pills a.is-current {
  background: var(--hp-dark);
  border-color: var(--hp-dark);
  color: #fff;
}

/* Post card grid */
.mb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.mb-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--hp-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mb-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.mb-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.35rem 1.4rem;
}

.mb-card__cat {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hp-blue);
  text-decoration: none;
  margin-bottom: 0.6rem;
}

.mb-card__cat:hover {
  text-decoration: underline;
}

.mb-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.mb-card__excerpt {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--hp-text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.mb-card .mb-meta {
  margin-top: auto;
  margin-bottom: 1rem;
}

.mb-card .mb-link--page {
  margin-top: auto;
}

/* Pagination */
.mb-pagination {
  margin-top: 3rem;
}

.mb-pagination .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mb-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.mb-pagination .page-numbers {
  min-width: 42px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--hp-border);
  border-radius: 50px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: #334155;
  text-decoration: none;
}

.mb-pagination a.page-numbers:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

.mb-pagination .page-numbers.current {
  background: var(--hp-dark);
  border-color: var(--hp-dark);
  color: #fff;
}

/* Empty state */
.mb-empty {
  padding: 3.5rem 1.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  color: var(--hp-text-muted);
}

.mb-empty__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--hp-text-main);
  margin-bottom: 0.5rem;
}

.mb-empty .hp-btn {
  width: auto;
  margin-top: 1.5rem;
}

/* Article */
.mb-article__head {
  max-width: 860px;
  margin-bottom: 2rem;
}

.mb-article__title {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--hp-text-main);
  margin: 0.25rem 0 1rem;
}

.mb-article__image {
  aspect-ratio: 16 / 8;
  border-radius: 20px;
  overflow: hidden;
  background: var(--hp-surface-light);
  margin-bottom: 3rem;
}

.mb-article__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mb-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 4rem;
  align-items: start;
}

.mb-article__side {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-right: 4px;
}

.mb-side__title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp-text-main);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--hp-border);
}

.mb-side__block {
  margin-top: 2.25rem;
}

.mb-toc__list {
  list-style: none;
  counter-reset: toc;
}

.mb-toc__list li {
  counter-increment: toc;
}

.mb-toc__list a {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #475569;
  text-decoration: none;
}

.mb-toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  padding-top: 0.15rem;
}

.mb-toc__list a:hover {
  color: var(--hp-blue);
}

.mb-toc--inline {
  display: none;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--hp-border);
  border-radius: 12px;
  background: #fff;
}

.mb-toc--inline summary {
  font-weight: 700;
  color: var(--hp-text-main);
  cursor: pointer;
}

.mb-toc--inline nav {
  margin-top: 0.75rem;
}

.mb-side__cats {
  list-style: none;
}

.mb-side__cats li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hp-border);
  font-size: 0.925rem;
}

.mb-side__cats li:last-child {
  border-bottom: 0;
}

.mb-side__cats a {
  color: #334155;
  text-decoration: none;
}

.mb-side__cats a:hover {
  color: var(--hp-blue);
}

.mb-side__cats span {
  color: var(--hp-text-muted);
  font-size: 0.8125rem;
}

/* Long-form content */
.mb-prose {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #334155;
  overflow-wrap: break-word;
}

.mb-prose > * + * {
  margin-top: 1.35em;
}

.mb-prose h2 {
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--hp-text-main);
  margin-top: 2.4em;
  scroll-margin-top: 110px;
}

.mb-prose h3 {
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--hp-text-main);
  margin-top: 1.9em;
}

.mb-prose h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hp-text-main);
}

.mb-prose a {
  color: var(--hp-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mb-prose strong {
  color: var(--hp-text-main);
}

.mb-prose ul,
.mb-prose ol {
  padding-left: 1.4rem;
}

.mb-prose li + li {
  margin-top: 0.5em;
}

.mb-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.mb-prose blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--hp-blue);
  color: var(--hp-text-main);
  font-size: 1.125rem;
}

.mb-prose pre {
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: var(--hp-dark);
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

.mb-prose :not(pre) > code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: #eef2f7;
  font-size: 0.9em;
}

.mb-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.mb-prose th,
.mb-prose td {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hp-border);
  text-align: left;
  vertical-align: top;
}

.mb-prose th {
  background: var(--hp-surface-light);
  color: var(--hp-text-main);
}

/* Article footer */
.mb-article__foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hp-border);
}

.mb-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--hp-text-muted);
}

.mb-share span {
  margin-right: 0.4rem;
  font-weight: 600;
  color: var(--hp-text-main);
}

.mb-share a {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--hp-border);
  border-radius: 50px;
  background: #fff;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

.mb-share a:hover {
  border-color: var(--hp-blue);
  color: var(--hp-blue);
}

.mb-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.mb-prevnext a {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--hp-border);
  border-radius: 14px;
  background: #fff;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hp-text-main);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.mb-prevnext a:hover {
  border-color: var(--hp-blue);
}

.mb-prevnext a span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--hp-text-muted);
}

.mb-prevnext__next {
  text-align: right;
}

.mb-related {
  margin-top: 5rem;
}

/* Tablet */
@media (max-width: 1024px) {
  .mb-cats,
  .mb-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mb-featured {
    grid-template-columns: minmax(0, 1fr);
  }

  .mb-article__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .mb-article__side {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .mb-toc--side {
    display: none;
  }

  .mb-toc--inline {
    display: block;
  }

  .mb-side__block {
    margin-top: 0;
  }
}

/* Mobile */
@media (max-width: 680px) {
  .mb-wrap {
    padding: 110px 1.1rem 64px;
  }

  .mb-cats,
  .mb-grid,
  .mb-prevnext {
    grid-template-columns: 1fr;
  }

  .mb-hero {
    margin-bottom: 2.5rem;
  }

  .mb-section {
    margin-top: 3rem;
  }

  .mb-article__image {
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    margin-bottom: 2rem;
  }

  .mb-prevnext__next {
    text-align: left;
  }

  .mb-prose {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mb-cat,
  .mb-card,
  .mb-link span,
  .mb-lead__media img,
  .mb-card__media img {
    transition: none;
  }
}
