.blog-page {
  padding-block: clamp(5.5rem, 10vw, 7rem) clamp(2.5rem, 5vw, 4rem);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.blog-card {
  border: 1px solid var(--mb-card-border, rgba(255, 188, 0, 0.22));
  border-radius: var(--radius-frame, 12px);
  background: var(--mb-card, rgba(255, 255, 255, 0.04));
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 193, 7, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.blog-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem 1.25rem;
  flex: 1;
}

.blog-card-date {
  color: var(--mb-muted, rgba(255, 255, 255, 0.7));
  font-size: 0.78rem;
  font-weight: 600;
}

.blog-card-body h2 {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.35;
  color: var(--theme-text, #fff);
}

.blog-card-body p {
  margin: 0;
  color: var(--mb-muted, rgba(255, 255, 255, 0.7));
  font-size: 0.92rem;
  line-height: 1.6;
  flex: 1;
}

.blog-card-cta {
  margin-top: 0.35rem;
  color: var(--color-primary, #ffc107);
  font-weight: 700;
  font-size: 0.88rem;
}

.blog-empty {
  text-align: center;
  color: var(--mb-muted, rgba(255, 255, 255, 0.7));
  padding: 2rem 1rem;
  border: 1px dashed var(--mb-card-border, rgba(255, 188, 0, 0.22));
  border-radius: var(--radius-frame, 12px);
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.blog-pagination a {
  color: var(--color-primary, #ffc107);
  font-weight: 700;
  text-decoration: none;
}

.blog-pagination span {
  color: var(--mb-muted, rgba(255, 255, 255, 0.7));
  font-size: 0.9rem;
}

.blog-post-page {
  padding-block: clamp(5.5rem, 10vw, 7rem) clamp(2.5rem, 5vw, 4rem);
}

.blog-post-wrap {
  max-width: 760px;
}

.blog-back {
  display: inline-flex;
  margin-bottom: 1.25rem;
  color: var(--color-primary, #ffc107);
  font-weight: 700;
  text-decoration: none;
}

.blog-post-header time {
  display: block;
  color: var(--mb-muted, rgba(255, 255, 255, 0.7));
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.blog-post-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.25;
  color: var(--theme-text, #fff);
}

.blog-post-excerpt {
  margin: 0;
  color: var(--mb-muted, rgba(255, 255, 255, 0.75));
  font-size: 1.05rem;
  line-height: 1.7;
}

.blog-post-cover {
  margin: 1.5rem 0 1.75rem;
  border-radius: var(--radius-frame, 12px);
  overflow: hidden;
  border: 1px solid var(--mb-card-border, rgba(255, 188, 0, 0.22));
}

.blog-post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-post-content {
  color: var(--theme-text, #fff);
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-post-content > *:first-child {
  margin-top: 0;
}

.blog-post-content p {
  margin: 0 0 1.1rem;
  color: inherit;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  color: inherit;
  margin: 1.75rem 0 0.85rem;
  line-height: 1.3;
  font-weight: 800;
}

.blog-post-content h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.blog-post-content h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
.blog-post-content h4 { font-size: 1.05rem; }

.blog-post-content ul,
.blog-post-content ol {
  margin: 0 0 1.1rem;
  padding-inline-start: 1.35rem;
}

.blog-post-content li {
  margin: 0.35rem 0;
}

.blog-post-content a {
  color: var(--color-primary, #ffc107);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-post-content a:hover {
  color: var(--color-primary-dark, #ffa000);
}

.blog-post-content strong,
.blog-post-content b {
  font-weight: 800;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-frame, 12px);
  margin: 0.75rem 0 1.1rem;
}

.blog-post-content blockquote {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  border-inline-start: 3px solid var(--color-primary, #ffc107);
  background: rgba(255, 193, 7, 0.08);
  border-radius: 0 var(--radius-frame, 12px) var(--radius-frame, 12px) 0;
}

.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1rem;
}

.blog-post-content th,
.blog-post-content td {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: start;
}

html[data-theme="light"] .blog-post-content th,
html[data-theme="light"] .blog-post-content td {
  border-color: rgba(0, 0, 0, 0.1);
}

.blog-post-cta {
  margin-top: 2rem;
  text-align: center;
}

html[data-theme="light"] .blog-card,
html[data-theme="light"] .blog-post-cover {
  background: #fff;
  border-color: rgba(180, 130, 0, 0.28);
}

html[data-theme="light"] .blog-card-body h2,
html[data-theme="light"] .blog-post-header h1,
html[data-theme="light"] .blog-post-content {
  color: #121212;
}

html[data-theme="light"] .blog-card-body p,
html[data-theme="light"] .blog-card-date,
html[data-theme="light"] .blog-post-excerpt,
html[data-theme="light"] .blog-post-header time,
html[data-theme="light"] .blog-empty,
html[data-theme="light"] .blog-pagination span {
  color: #5c5c5c;
}

/* Phone only — iPad keeps desktop 3-column blog grid */
@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-post-content {
    font-size: 1rem;
  }
}
