/* Blog section component — carousel cards (ใช้ร่วมกับ owl.carousel) */
.blog-section {
  padding: 60px 0;
}

.blog-img--uniform {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: linear-gradient(145deg, #eef2fb 0%, #e4eaf8 100%);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.blog-img__link {
  display: block;
  width: 100%;
  height: 100%;
}

.blog-img__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.blog-section__head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.blog-section .section-header {
  margin-bottom: 0;
}

.blog-section .section-header h2 {
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #111827;
  margin-bottom: 0;
}

.blog-section .sub-title {
  margin-top: 12px;
  margin-bottom: 0;
}

.blog-item {
  box-shadow: 0 4px 4px rgba(217, 217, 217, 0.25);
  border-radius: 10px;
  margin-bottom: 40px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-item .blog-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-item .blog-content h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-item .blog-content h6 a {
  color: #111827;
  text-decoration: none;
}

.blog-item .blog-content h6 a:hover {
  color: #5b7cfa;
}

.blog-item .blog-content .badge {
  font-size: 10px;
  font-weight: 500;
  padding: 8px;
  border-radius: 20px;
}

.badge.badge-info-transparent {
  background: #f0ebfd;
  color: #673bea;
}

.two-line-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.blog-section .blog-meta,
.blog-item .blog-meta {
  font-size: 14px;
  color: #677788;
  margin-bottom: 0.5rem;
}

.blog-section__cta {
  text-align: center;
  margin-top: 8px;
}

.blog-section .blog-slider {
  position: relative;
}

/* Owl carousel — การ์ดสูงเท่ากันทุกใบ */
.blog-section .owl-stage {
  display: flex;
  align-items: stretch;
}

.blog-section .owl-item {
  display: flex;
  align-items: stretch;
  height: auto;
}

.blog-section .owl-item .blog-item {
  width: 100%;
  margin-bottom: 0;
}

.blog-section .blog-item .blog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* หัวข้อการ์ด — เล็กลง จำกัด 2 บรรทัด */
.blog-section .blog-card__title {
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  min-height: calc(1.4em * 2);
}

.blog-section .blog-card__title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-section .blog-content > .two-line-ellipsis {
  flex: 1 0 auto;
  min-height: calc(1.5em * 2);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #677788;
}

.blog-section .nav-center .owl-nav button.owl-next,
.blog-section .nav-center .owl-nav button.owl-prev {
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: #242b3a;
  background: #fff;
  box-shadow: 0 4px 14px rgba(141, 141, 141, 0.25);
  border: 0;
  border-radius: 50px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.blog-section .nav-center .owl-nav button.owl-next:hover,
.blog-section .nav-center .owl-nav button.owl-prev:hover {
  background: #ffa000;
  color: #fff;
}

.blog-section .nav-center .owl-nav button.owl-next {
  right: -20px;
}

.blog-section .nav-center .owl-nav button.owl-prev {
  left: -20px;
}

@media (max-width: 991.98px) {
  .blog-section .nav-center .owl-nav button.owl-next {
    right: -5px;
  }
  .blog-section .nav-center .owl-nav button.owl-prev {
    left: -5px;
  }
}

/* minimal utilities (2026 layout ไม่มี bootstrap) */
.blog-section .d-inline-flex { display: inline-flex; }
.blog-section .d-flex { display: flex; }
.blog-section .align-items-center { align-items: center; }
.blog-section .flex-wrap { flex-wrap: wrap; }
.blog-section .mb-1 { margin-bottom: 0.25rem; }
.blog-section .mb-2 { margin-bottom: 0.5rem; }
.blog-section .mb-3 { margin-bottom: 1rem; }
.blog-section .me-2 { margin-right: 0.5rem; }
.blog-section .mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.blog-section .ms-2 { margin-left: 0.5rem; }
.blog-section .mt-auto { margin-top: auto; }
.blog-section .fs-6 { font-size: 0.875rem; }
.blog-section .text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Blog listing page grid ---------- */
.blog-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.blog-page-grid .blog-item--grid {
  margin-bottom: 0;
  height: 100%;
}

.blog-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.blog-card__title a {
  color: #111827;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__title a:hover {
  color: #5b7cfa;
}

.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-family: var(--font-display, inherit);
  font-weight: 600;
  font-size: 14px;
  color: #1e78e6;
  text-decoration: none;
}

.blog-card__more i {
  font-size: 16px;
  line-height: 1;
}

.blog-card__more:hover {
  color: #673bea;
}

.blog-page-empty {
  text-align: center;
  color: #677788;
  padding: 48px 16px;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 48px;
}

.blog-pagination__btn {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #e4e8f4;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(20, 30, 70, 0.06);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.blog-pagination__btn:hover {
  transform: translateY(-2px);
  border-color: #7c5cfc;
  color: #7c5cfc;
}

.blog-pagination__btn.is-active {
  background: linear-gradient(120deg, #1e78e6, #7c5cfc);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(91, 124, 250, 0.28);
}

@media (max-width: 1080px) {
  .blog-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .blog-page-grid {
    grid-template-columns: 1fr;
  }
}
