/* ==========================================================================
   Blogs page
   Markup: resources/views/frontend/blog.blade.php
   Script: public/frontend/assets/js/pages/blog.js
   Design: "Webase — Services Section Redesign" canvas, BlogPage.dc.html
   Hero: <x-page-hero> · Cards: <x-post-card> (css/components/*)
   ========================================================================== */

.wb-blog {
  --wb-blog-bg: #F4F1EA;
  --wb-blog-navy: #202547;
  --wb-blog-muted: #474C6E;
  --wb-blog-accent: #ED194E;
  --wb-blog-ease: cubic-bezier(.2, .8, .2, 1);

  background: var(--wb-blog-bg);
  color: var(--wb-blog-navy);
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---------- Section ---------- */

.wb-blog-list {
  position: relative;
  overflow: hidden;
  padding: 80px 0 120px;
}

.wb-blog-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wb-blog-glow span {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.wb-blog-glow__red {
  right: -80px;
  top: 4%;
  width: 480px;
  height: 440px;
  background: var(--wb-blog-accent);
  opacity: .13;
  filter: blur(120px);
}

.wb-blog-glow__blue {
  left: -120px;
  top: 45%;
  width: 520px;
  height: 460px;
  background: #3D5AFE;
  opacity: .12;
  filter: blur(130px);
}

.wb-blog-list__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---------- Toolbar: sort chips + search ---------- */

.wb-blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.wb-blog-sorts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wb-blog-chip {
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid rgba(32, 37, 71, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  color: var(--wb-blog-navy);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, transform .35s var(--wb-blog-ease);
}

.wb-blog-chip:hover {
  border-color: var(--wb-blog-navy);
  transform: translateY(-2px);
}

.wb-blog-chip[aria-pressed="true"] {
  border-color: var(--wb-blog-navy);
  background: var(--wb-blog-navy);
  color: #FFFFFF;
}

.wb-blog-chip:focus-visible {
  outline: 2px solid var(--wb-blog-accent);
  outline-offset: 2px;
}

.wb-blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  max-width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 18px;
  border: 1.5px solid rgba(32, 37, 71, .15);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--wb-blog-muted);
  transition: border-color .35s ease, box-shadow .35s ease;
}

.wb-blog-search:focus-within {
  border-color: var(--wb-blog-navy);
  box-shadow: 0 0 0 4px rgba(32, 37, 71, .12);
}

.wb-blog-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--wb-blog-navy);
  font: inherit;
  font-size: 15px;
}

.wb-blog-count {
  margin: -16px 0 0;
  font-size: 14px;
  color: var(--wb-blog-muted);
}

.wb-blog-count strong {
  color: var(--wb-blog-navy);
}

/* Design: slightly shorter card images on this page */
.wb-blog .wb-post-card__media {
  height: 230px;
}

.wb-blog .wb-post-card__title {
  font-size: 22px;
  line-height: 1.22;
}

/* ---------- Load more + empty state ---------- */

.wb-blog-more {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 30px;
  border: 1.5px solid var(--wb-blog-navy);
  border-radius: 999px;
  background: var(--wb-blog-navy);
  color: #FFFFFF;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .35s var(--wb-blog-ease), box-shadow .35s ease;
}

.wb-blog-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -16px rgba(32, 37, 71, .6);
}

.wb-blog-more[hidden],
.wb-blog-empty[hidden] {
  display: none;
}

.wb-blog-more__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  box-sizing: border-box;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--wb-blog-accent);
  font-size: 13px;
}

.wb-blog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  border: 1px dashed rgba(32, 37, 71, .25);
  border-radius: 24px;
  background: rgba(255, 255, 255, .6);
  text-align: center;
}

.wb-blog-empty__title {
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
  .wb-blog-list {
    padding: 50px 0;
  }

  .wb-blog-list__inner {
    gap: 28px;
  }

  .wb-blog-search {
    width: 100%;
  }

  .wb-blog-count {
    margin-top: -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wb-blog-chip,
  .wb-blog-more {
    transition: none;
  }
}
