.page-blog,
.page-article {
  background: var(--bg-light);
}

/* Hero */
.blog-hero {
  padding: 28px 0 32px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
}

.blog-hero__inner {
  max-width: 760px;
  text-align: left;
}

.blog-hero__label {
  display: block;
  margin-bottom: 12px;
}

.blog-hero__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 12px;
  text-align: left;
}

.blog-hero__text {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
  text-align: left;
}

/* Blog page */
.blog-page {
  padding: 40px 0 72px;
}

.blog-page__empty {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.blog-page__tags {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.blog-page__tags-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.blog-page__tags-list {
  gap: 10px;
}

.blog-featured {
  display: block;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  color: inherit;
}

.blog-featured:hover {
  box-shadow: var(--shadow-md);
}

.blog-featured__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: stretch;
}

.blog-featured__image {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.blog-featured__body {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.blog-tab {
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  background: #fff;
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}

.blog-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.blog-tab--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  color: inherit;
}

.blog-card:hover {
  box-shadow: var(--shadow-md);
}

.blog-card--hidden {
  display: none;
}

.blog-card__image-wrap {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-gray);
}

.blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card__image {
  transform: scale(1.03);
}

.blog-card__body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card__tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 12px;
  width: fit-content;
}

.blog-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 8px;
}

.blog-card__excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.blog-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.blog-pagination__btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  background: #fff;
  transition: all 0.2s;
}

.blog-pagination__btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.blog-pagination__btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.blog-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Article page */
.article-page {
  padding: 32px 0 64px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.article {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.article__header {
  padding: 32px 40px 0;
  text-align: left;
}

.article__tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 16px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.article__tag:hover {
  background: var(--primary);
  color: #fff;
}

.article__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 16px;
  text-align: left;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.article__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article__meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.article__cover-wrap {
  padding: 0 40px 24px;
  text-align: center;
  line-height: 0;
}

.article__cover {
  display: inline-block;
  max-width: 100%;
  width: auto;
  height: auto;
  vertical-align: top;
  border-radius: 12px;
}

.article__content {
  padding: 32px 40px 40px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-body);
}

.article__content img,
.article__content .wp-block-image img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin-inline: auto;
  border-radius: 12px;
}

.article__content .wp-block-image {
  max-width: 100%;
  margin: 24px 0;
}

.article__content .wp-block-image.alignwide,
.article__content .wp-block-image.alignfull {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.article__content figure {
  max-width: 100%;
  margin: 24px 0;
}

.article__content figure img {
  margin-inline: auto;
}

.article__content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 32px 0 14px;
  line-height: 1.35;
}

.article__content h2:first-child {
  margin-top: 0;
}

.article__content p {
  margin-bottom: 16px;
}

.article__content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article__content a:hover {
  color: var(--primary-dark, #4F55E0);
}

.article__content ul,
.article__content ol {
  margin: 0 0 16px 20px;
}

.article__content li {
  margin-bottom: 8px;
}

.article__content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--primary-50);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.7;
}

.article__footer {
  padding: 0 40px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article__tag-link {
  padding: 6px 12px;
  background: var(--bg-gray);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-body);
  transition: all 0.2s;
}

.article__tag-link:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.article__share {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.article__share-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-body);
  background: #fff;
  transition: all 0.2s;
}

.article__share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.article__share-btn svg {
  width: 16px;
  height: 16px;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.sidebar-post {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  color: inherit;
}

.sidebar-post:first-of-type {
  padding-top: 0;
}

.sidebar-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-post__thumb {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-gray);
}

.sidebar-post__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 4px;
}

.sidebar-post:hover .sidebar-post__title {
  color: var(--primary);
}

.sidebar-post__date {
  font-size: 11px;
  color: var(--text-light);
}

.sidebar-cta {
  background: linear-gradient(145deg, #5B61ED 0%, #4F55E0 45%, #4349D4 100%);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  text-align: center;
}

.sidebar-cta__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
}

.sidebar-cta__text {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* Related */
.article-related {
  margin-top: 48px;
}

.article-related__head {
  margin-bottom: 24px;
}

.article-related__head .section-title {
  margin-bottom: 0;
}
