/* ══ Post Grid ══════════════════════════════════════════════ */
.pg-wrapper {
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}

.pg-wrapper *,
.pg-wrapper *::before,
.pg-wrapper *::after {
  box-sizing: inherit;
}

/* ─── Grid layout ─── */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}

/* ─── List layout ─── */
.pg-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pg-layout-list .pg-card {
  flex-direction: row;
  overflow: hidden;
}

.pg-layout-list .pg-thumb {
  flex: 0 0 260px;
  width: 260px;
  height: 180px !important;
  border-radius: 0 !important;
}

.pg-layout-list .pg-card-body {
  padding: 20px 24px;
}

/* --- Filter Bar --- */
.pg-filter-wrapper {
  display: flex;
  width: 100%;
  justify-content: center;
}

.pg-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.pg-filter-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid #eee;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  transition: all 0.3s ease;
  outline: none;
  line-height: 1.2;
}

.pg-filter-item:hover {
  border-color: #b5865a;
  color: #b5865a;
}

.pg-filter-item.is-active {
  background: #b5865a;
  border-color: #b5865a;
  color: #fff;
}

/* ─── Card ─── */
.pg-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ─── Hover effects ─── */
.pg-hover-lift .pg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.13) !important;
}

.pg-hover-zoom .pg-thumb img {
  transition: transform 0.5s ease;
}

.pg-hover-zoom .pg-card:hover .pg-thumb img {
  transform: scale(1.07);
}

.pg-hover-fade .pg-card:hover .pg-thumb-overlay {
  background: rgba(0, 0, 0, 0.2) !important;
}

/* ─── Thumbnail ─── */
.pg-thumb {
  display: block;
  overflow: hidden;
  position: relative;
  height: 220px;
  background: #f0f0f0;
  flex-shrink: 0;
  text-decoration: none;
}

.pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.pg-thumb-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.3s ease;
  pointer-events: none;
}

/* ─── Card body ─── */
.pg-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* ─── Meta row ─── */
.pg-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.pg-meta {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  line-height: 1;
}

.pg-sep {
  color: #ccc;
  font-size: 11px;
}

.pg-cat {
  font-size: 13px;
  color: #b5865a;
  text-decoration: none;
  transition: opacity 0.2s;
}

.pg-cat:hover {
  opacity: 0.75;
}

.pg-author {
  font-size: 13px;
  color: #888;
}

/* ─── Title ─── */
.pg-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.pg-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pg-title a:hover {
  color: #b5865a;
}

/* ─── Excerpt ─── */
.pg-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.65;
  margin: 0 0 12px;
}

/* ─── Read More ─── */
.pg-read-more {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  align-self: flex-start;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
}

/* Style 1: Standard */
.pg-btn-style-1 {
  color: #b5865a;
  border: 1px solid currentColor;
  padding: 7px 18px;
  border-radius: 4px;
  gap: 8px;
}

.pg-btn-style-1:hover {
  background: #b5865a;
  color: #fff !important;
}

.pg-btn-style-1 .pg-btn-icon {
  display: inline-flex;
  transition: transform 0.3s ease;
}

.pg-btn-style-1:hover .pg-btn-icon {
  transform: translateX(3px);
}

/* Style 2: Icon only -> Expand Text */
.pg-btn-style-2 {
  color: #fff;
  background: #b5865a;
  height: 42px;
  min-width: 42px;
  border-radius: 50px;
  /* Default full radius */
  padding: 0 14px;
  position: relative;
  overflow: hidden;
  gap: 0;
  justify-content: center;
}

.pg-btn-style-2 .pg-btn-text {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease,
    margin 0.4s ease;
}

.pg-btn-style-2 .pg-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pg-btn-style-2 .pg-btn-icon svg {
  display: block;
  width: 1em;
  height: auto;
}

.pg-btn-style-2:hover {
  padding: 0 22px;
  gap: 10px;
  justify-content: flex-start;
}

.pg-btn-style-2:hover .pg-btn-text {
  max-width: 200px;
  opacity: 1;
}

.pg-btn-style-2:hover .pg-btn-icon {
  transform: translateX(2px);
}

/* ─── No posts ─── */
.pg-no-posts {
  padding: 48px 20px;
  text-align: center;
  color: #aaa;
  font-size: 15px;
  margin: 0;
}

/* ══ Card entrance animation (stagger — added by JS) ═════════ */
@keyframes pg-slide-up {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step 1: JS adds --animate → card hidden immediately */
.pg-card--animate {
  opacity: 0;
  will-change: opacity, transform;
}

/* Step 2: JS adds --in (with stagger delay) → animation plays */
.pg-card--animate.pg-card--in {
  animation: pg-slide-up 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Ensure hover transforms still work after animation fill */
.pg-hover-lift .pg-card--animate.pg-card--in:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.13) !important;
}

/* ══ Pagination ═════════════════════════════════════════════ */
.pg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
  width: 100%;
}

/* Number buttons — works for both <button> and <a> elements */
.pg-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.3s ease;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
  border: 1px solid transparent;
}

.pg-page-btn.is-active {
  cursor: default;
  pointer-events: none;
}

.pg-page-btn.pg-nav {
  font-size: 16px;
  font-weight: 700;
}

.pg-page-btn:disabled,
.pg-page-btn.is-disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: not-allowed;
}

.pg-ellipsis {
  color: #bbb;
  font-size: 14px;
  line-height: 36px;
  padding: 0 4px;
  user-select: none;
}

/* Loading state */
.pg-pagination.pg-loading .pg-page-btn {
  pointer-events: none;
  opacity: 0.5;
}

/* Load more button */
.pg-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.pg-load-more-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.pg-no-more {
  display: block;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

/* Infinite sentinel */
.pg-sentinel {
  height: 20px;
  display: block;
  text-align: center;
  color: #aaa;
  font-size: 13px;
  transition: height 0.2s;
}

.pg-sentinel.pg-sentinel-done {
  height: auto;
  padding: 8px 0;
  font-size: 14px;
}

/* ══ Responsive ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .pg-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .pg-grid {
    grid-template-columns: 1fr !important;
  }

  .pg-layout-list .pg-card {
    flex-direction: column;
  }

  .pg-layout-list .pg-thumb {
    flex: none;
    width: 100% !important;
    height: 200px !important;
  }
}

/* ─── Card Style 2: Full Width Bottom Content Overlay ─── */
.pg-card-style-2 {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 380px;
  /* Crucial to prevent height collapse when children are absolute positioned! */
  background-color: #000;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  justify-content: end;
  /* Matching rounded corners of user's screenshot */
}

.pg-card-style-2 .pg-thumb {
  height: 100% !important;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  border-radius: inherit;
  margin-bottom: 0 !important;
}

.pg-card-style-2 .pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.pg-card-style-2:hover .pg-thumb img {
  transform: scale(1.05);
}

.pg-card-style-2 .pg-card-body {
  position: relative;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: rgba(20, 20, 20, 0.85) !important;
  /* Semi-transparent dark background from screenshot */
  border: none !important;
  border-radius: 0;
  padding: 24px 30px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.3s ease;
  margin: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  height: auto;
  flex: inherit;
}

.pg-card-style-2:hover .pg-card-body {
  background: rgba(10, 10, 10, 0.95) !important;
  transform: none !important;
}

.pg-card-style-2 .pg-title {
  font-size: 20px !important;
  line-height: 1.35;
  margin: 0 0 6px 0 !important;
  font-weight: 500 !important;
  order: 1;
}

.pg-card-style-2 .pg-title a {
  color: #ffffff !important;
  text-decoration: none;
  transition: color 0.3s ease;
}

.pg-card-style-2 .pg-title a:hover {
  color: var(--pg-hover-color, #00a896) !important;
}

.pg-card-style-2 .pg-meta-row {
  margin-bottom: 0px !important;
  order: 2;
  /* Date below title */
  margin-top: 4px;
  gap: 8px;
  align-items: center;
}

.pg-card-style-2 .pg-meta {
  color: rgba(255, 255, 255, 1);
  font-size: 14px;
}

.pg-card-style-2 .pg-sep {
  color: rgba(255, 255, 255, 0.3) !important;
}

.pg-card-style-2 .pg-cat {
  color: var(--pg-hover-color, #00a896) !important;
  font-weight: 500;
}

/* Hide Excerpt and Read More buttons inside overlay style to match layout screenshot */
.pg-card-style-2 .pg-excerpt,
.pg-card-style-2 .pg-read-more {
  display: none !important;
}

/* Adjustments for Style 2 with List Layout */
.pg-layout-list .pg-card-style-2 .pg-thumb {
  position: relative !important;
  width: 350px;
  height: 100% !important;
}

.pg-layout-list .pg-card-style-2 .pg-card-body {
  position: relative !important;
  background: #1a1a1a !important;
  min-height: auto;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 24px !important;
  display: flex !important;
}

.pg-layout-list .pg-card-style-2:hover .pg-card-body {
  transform: none;
  background: #1f1f1f !important;
}

/* ─── Card Style 3: Hover Overlay Content ─── */
.pg-card-style-3 {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 380px;
  background-color: #000;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

.pg-card-style-3 .pg-thumb {
  height: 100% !important;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  border-radius: inherit;
  margin-bottom: 0 !important;
}

.pg-card-style-3 .pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.pg-card-style-3:hover .pg-thumb img {
  transform: scale(1.05);
}

.pg-card-style-3 .pg-card-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.8);
  border: none !important;
  border-radius: 0;
  padding: 30px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  margin: 0 !important;
  box-shadow: none !important;
  opacity: 0;
  visibility: hidden;
  height: auto;
}

.pg-card-style-3:hover .pg-card-body {
  opacity: 1;
  visibility: visible;
}

.pg-card-style-3 .pg-title {
  font-size: 22px;
  line-height: 1.35;
  margin: 0 0 10px 0 !important;
  font-weight: 500;
}

.pg-card-style-3 .pg-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.pg-card-style-3 .pg-title a:hover {
  color: var(--pg-hover-color, #00a896);
}

.pg-card-style-3 .pg-meta-row {
  margin-bottom: 12px;
  gap: 8px;
  align-items: center;
}

.pg-card-style-3 .pg-meta {
  color: rgba(255, 255, 255, 0.9);
}

.pg-card-style-3 .pg-sep {
  color: rgba(255, 255, 255, 0.3);
}

.pg-card-style-3 .pg-cat {
  color: var(--pg-hover-color, #00a896);
  font-weight: 500;
}

.pg-card-style-3 .pg-excerpt {
  color: rgba(255, 255, 255, 0.8);
}

/* Adjustments for Style 3 with List Layout */
.pg-layout-list .pg-card-style-3 .pg-thumb {
  position: relative !important;
  width: 350px;
  height: 100% !important;
}

.pg-layout-list .pg-card-style-3 .pg-card-body {
  position: relative !important;
  background: #1a1a1a !important;
  opacity: 1;
  visibility: visible;
  min-height: auto;
  border-radius: 0;
  padding: 24px !important;
  display: flex !important;
}

/* ─── Vertical Filter Sidebar Layout ─── */
.pg-wrapper.pg-filter-layout-vertical {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: start;
  width: 100%;
}

.pg-filter-sidebar {
  position: sticky;
  top: 100px;
  height: auto;
}

.pg-wrapper.pg-filter-layout-vertical .pg-filter {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 0;
  border-right: 1px solid #eef2f5;
  padding-right: 0;
  width: 100%;
}

.pg-wrapper.pg-filter-layout-vertical .pg-filter-item {
  justify-content: flex-start;
  padding: 12px 0 12px 15px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: #4a4a4a;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-right: 2px solid transparent !important;
  /* Indicator line on the RIGHT side */
  margin-right: -1px;
  /* Blends border perfectly over sidebar divider */
  width: 100%;
}

.pg-wrapper.pg-filter-layout-vertical .pg-filter-item:hover {
  color: var(--pg-hover-color, #00a896) !important;
  border-right: 2px solid var(--pg-hover-color, #00a896) !important;
  padding-left: 20px;
}

.pg-wrapper.pg-filter-layout-vertical .pg-filter-item.is-active {
  color: var(--pg-active-color, #00a896) !important;
  border-right: 2px solid var(--pg-active-color, #00a896) !important;
  /* Indicator line on the RIGHT side */
  padding-left: 20px;
  font-weight: 600;
}

.pg-wrapper.pg-filter-layout-vertical .pg-content-main {
  border-left: 1px solid #eeeeee;
  padding-left: 50px;
  transition: all 0.3s ease;
}

@media (max-width: 991px) {
  .pg-wrapper.pg-filter-layout-vertical {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .pg-wrapper.pg-filter-layout-vertical .pg-filter {
    flex-direction: row;
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid #eef2f5;
    padding-bottom: 20px;
    justify-content: center;
    gap: 12px;
  }

  .pg-wrapper.pg-filter-layout-vertical .pg-filter-item {
    border-right: none !important;
    border-bottom: 2px solid transparent !important;
    padding: 8px 16px;
    margin-right: 0;
  }

  .pg-wrapper.pg-filter-layout-vertical .pg-filter-item.is-active {
    border-bottom: 2px solid var(--pg-active-color, #00a896) !important;
    border-right: none !important;
    padding-left: 16px;
  }

  .pg-wrapper.pg-filter-layout-vertical .pg-content-main {
    border-left: none !important;
    padding-left: 0 !important;
  }
}
