/* Centered Header Wrapper */
.custom-hub-header-wrapper {
  margin-bottom: 35px;
  text-align: center;
}

.custom-hub-header-wrapper .section-title {
  font-family: "Poppins", sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-hub-header-wrapper .section-subtitle {
  font-family: "Lato", sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Modern Search Input Group */
.custom-search-form {
  max-width: 620px;
  margin: 0 auto 60px auto;
}

.kh-hub-page .custom-search-group {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  width: 100%;
}

.kh-hub-page .custom-search-group:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 32px rgba(11, 94, 215, 0.25),
    0 0 0 4px rgba(11, 94, 215, 0.15);
  transform: translateY(-1px);
}

.kh-hub-page .custom-search-icon {
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.kh-hub-page .custom-search-icon svg {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.kh-hub-page .custom-search-group:focus-within .custom-search-icon {
  color: #ffffff;
}

.kh-hub-page .custom-search-input {
  flex-grow: 1;
  flex-shrink: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 400;
  padding: 10px 0;
  padding-left: 0;
  outline: none;
  box-shadow: none;
  min-width: 0;
  width: 100%;
}

.kh-hub-page .custom-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.kh-hub-page .custom-search-btn {
  position: relative;
  background: #0b5ed7;
  background-color: #0b5ed7;
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(11, 94, 215, 0.3);
  flex-shrink: 0;
  white-space: nowrap;
  left: auto;
  top: auto;
  display: inline-block;
}

.kh-hub-page .custom-search-btn:hover {
  background: #0d6efd;
  background-color: #0d6efd;
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(11, 94, 215, 0.4);
}

.kh-hub-page .custom-search-btn:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .custom-hub-header-wrapper .section-title {
    font-size: 32px;
  }

  .kh-hub-page .custom-search-group {
    padding: 4px 4px 4px 16px;
  }

  .kh-hub-page .custom-search-input {
    font-size: 14px;
  }

  .kh-hub-page .custom-search-btn {
    padding: 8px 20px;
    font-size: 13px;
  }
}

.custom-active-filters {
  margin-top: -30px;
  margin-bottom: 45px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.custom-active-filters strong {
  color: #ffffff;
}

.kh-hub-page .custom-clear-filter-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-left: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.kh-hub-page .custom-clear-filter-btn svg {
  margin-right: 6px;
  vertical-align: middle;
  stroke: #ffffff;
}

.kh-hub-page .custom-clear-filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.kh-hub-page .custom-clear-filter-btn:active {
  transform: translateY(0);
}

/* Modern 3x3 Card Grid Layout */
.custom-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
}

@media (max-width: 991px) {
  .custom-hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .custom-hub-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Card Styles */
.custom-hub-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.custom-hub-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: rgba(11, 94, 215, 0.15);
}

/* Cover Image Box */
.custom-card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background-color: #f8f9fa;
}

.custom-card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.custom-hub-card:hover .custom-card-img-wrapper img {
  transform: scale(1.04);
}

.custom-card-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #adb5bd;
  font-size: 32px;
}

/* Card Content Body */
.custom-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Badge Tags */
.custom-card-tags {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 28px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  padding-bottom: 2px;
  cursor: grab;
  user-select: none;
  transition:
    mask-image 0.2s ease,
    -webkit-mask-image 0.2s ease;
}

.custom-card-tags.active-dragging {
  cursor: grabbing;
}

/* Scroll Fade Indicator Overlays */
.custom-card-tags.has-overflow-right {
  -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 100%);
  mask-image: linear-gradient(to right, #000 82%, transparent 100%);
}

.custom-card-tags.has-overflow-left {
  -webkit-mask-image: linear-gradient(to left, #000 82%, transparent 100%);
  mask-image: linear-gradient(to left, #000 82%, transparent 100%);
}

.custom-card-tags.has-overflow-left.has-overflow-right {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
}

.custom-card-tags::-webkit-scrollbar {
  display: none; /* Chrome, Safari, and Opera */
}

.custom-card-tags-placeholder {
  height: 28px;
  margin-bottom: 14px;
}

.custom-tag-badge {
  background-color: #f1f3f5;
  color: #495057;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.custom-tag-badge:hover {
  background-color: #e2e6ea;
  color: #0b5ed7;
  text-decoration: none;
}

.custom-tag-badge.active-tag {
  background-color: #0b5ed7;
  color: #ffffff;
  pointer-events: none; /* Disable clicking active tag */
}

/* Title */
.custom-card-title {
  font-family: "Poppins", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #121416;
  margin-top: 0;
  margin-bottom: 12px;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 50px; /* Aligns titles perfectly across rows */
  transition: color 0.2s ease;
}

.custom-card-title-link {
  text-decoration: none;
}

.custom-card-title-link:hover {
  text-decoration: none;
}

.custom-hub-card:hover .custom-card-title {
  color: #0b5ed7;
}

/* Excerpt (Max 100 words in PHP, capped at 3 lines visual overflow) */
.custom-card-excerpt {
  font-family: "Lato", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: #6c757d;
  margin-bottom: 20px;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 64px; /* Standardize excerpt area height */
}

/* Footer Section */
.custom-card-footer {
  margin-top: auto;
  border-top: 1px solid #f1f3f5;
  padding-top: 14px;
}

.custom-card-author {
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #212529;
  display: block;
  margin-bottom: 4px;
}

.custom-card-meta {
  font-family: "Lato", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #868e96;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-card-separator {
  color: #dee2e6;
}

/* Pagination Styles override for light theme compatibility */
.custom-pagination-wrapper {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

.kh-hub-page .custom-pagination-wrapper .pagination {
  display: flex;
  gap: 6px;
  border-radius: 50px !important;
  padding: 6px 12px;
  background: #ffffff !important;
  border: 1px solid #eaeaea !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

.custom-pagination-wrapper .pagination .page-item {
  margin: 0;
}

.kh-hub-page .custom-pagination-wrapper .pagination .page-link {
  border: none !important;
  border-radius: 50px !important;
  color: #333333 !important;
  background: transparent !important;
  padding: 8px 16px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.kh-hub-page .custom-pagination-wrapper .pagination .page-link:hover {
  background: rgba(11, 94, 215, 0.08) !important;
  color: #0b5ed7 !important;
}

.kh-hub-page
  .custom-pagination-wrapper
  .pagination
  .page-item.active
  .page-link {
  background: #0b5ed7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(11, 94, 215, 0.3) !important;
}

.kh-hub-page
  .custom-pagination-wrapper
  .pagination
  .page-item.disabled
  .page-link {
  color: #b5b5b5 !important;
  background: transparent !important;
}

/* Blog/Media Post Detail Typography & Spacing */
.blog-post-content-wrap {
  font-family: "Lato", sans-serif;
  color: #2b303a;
  line-height: 1.8;
}

.blog-post-content-wrap p {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: #2b303a !important;
  margin-bottom: 24px !important;
  margin-top: 0 !important;
}

.blog-post-content-wrap h1,
.blog-post-content-wrap h2,
.blog-post-content-wrap h3,
.blog-post-content-wrap h4,
.blog-post-content-wrap h5,
.blog-post-content-wrap h6 {
  font-family: "Poppins", sans-serif !important;
  color: #121416 !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin-top: 36px !important;
  margin-bottom: 16px !important;
}

.blog-post-content-wrap h1 {
  font-size: 32px !important;
}
.blog-post-content-wrap h2 {
  font-size: 26px !important;
}
.blog-post-content-wrap h3 {
  font-size: 22px !important;
}
.blog-post-content-wrap h4 {
  font-size: 18px !important;
}
.blog-post-content-wrap h5 {
  font-size: 16px !important;
}
.blog-post-content-wrap h6 {
  font-size: 14px !important;
}

/* List Styles Restoration */
.blog-post-content-wrap ul {
  list-style-type: disc !important;
  padding-left: 24px !important;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
}

.blog-post-content-wrap ul li {
  list-style-type: disc !important;
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: #2b303a !important;
  margin-bottom: 10px !important;
}

.blog-post-content-wrap ol {
  list-style-type: decimal !important;
  padding-left: 24px !important;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
}

.blog-post-content-wrap ol li {
  list-style-type: decimal !important;
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: #2b303a !important;
  margin-bottom: 10px !important;
}

/* Link Styling */
.blog-post-content-wrap a {
  color: #0b5ed7 !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
  transition: color 0.2s ease !important;
}

.blog-post-content-wrap a:hover {
  color: #0d6efd !important;
}

/* Blockquotes */
.blog-post-content-wrap blockquote {
  border-left: 4px solid #0b5ed7 !important;
  padding: 10px 20px !important;
  margin: 28px 0 !important;
  background-color: #f8f9fa !important;
  font-style: italic !important;
  color: #4a5568 !important;
  border-radius: 0 8px 8px 0 !important;
}

.blog-post-content-wrap blockquote p {
  margin-bottom: 0 !important;
  font-size: 16px !important;
}

/* Images & Media */
.blog-post-content-wrap img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  margin: 28px 0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

.blog-post-content-wrap iframe,
.blog-post-content-wrap video {
  max-width: 100% !important;
  border-radius: 8px !important;
  margin: 28px 0 !important;
}

/* Bold/Strong text */
.blog-post-content-wrap strong,
.blog-post-content-wrap b {
  font-weight: 700 !important;
  color: #121416 !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .blog-post-content-wrap p,
  .blog-post-content-wrap ul li,
  .blog-post-content-wrap ol li,
  .blog-post-content-wrap blockquote p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  .blog-post-content-wrap h1 {
    font-size: 26px !important;
  }
  .blog-post-content-wrap h2 {
    font-size: 22px !important;
  }
  .blog-post-content-wrap h3 {
    font-size: 19px !important;
  }
  .blog-post-content-wrap h4 {
    font-size: 16px !important;
  }
}
