/* =============================================================
   blog.css — Blog listing page styles
   Base: 19px → scaled via global.css media queries
   Reuses: .container, .btn/.btn-primary/.btn-outline, cs-pagination-*
           from global.css. Contact section + header/footer are NOT
           styled here — they come from the shared includes/components.
   ============================================================= */

/* ── 1. Local tokens (things global.css doesn't already define) ─── */
:root {
  --bl-badge-amber-bg: rgba(248, 153, 35, 0.16);
  --bl-badge-blue-bg: #ddeeff;
  --bl-badge-blue-alt-bg: #d3ebff;
  --bl-badge-purple-bg: #e8dff5;
  --bl-badge-green-bg: rgba(125, 255, 118, 0.16);
  --bl-badge-grey-bg: #e8e8e8;
  --bl-secondary-800: #181a2a;
  --bl-gray-500: #667085;
}

/* ── 2. Hero / Search ─────────────────────────────────────────── */

.bl-hero {
  padding: 11.91rem 0 4.105rem;
  /* 180px top clears fixed navbar, matches pf-section */
  text-align: center;
  background: linear-gradient(167deg, #f0f4ff 0%, #f5f0ff 40%, #e8f8ff 100%);
  position: relative;
  z-index: 50;
}

body.dark-theme .bl-hero {
  background: #000;
}

.bl-hero-title {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 3.75rem;
  /* 60px / 19 */
  line-height: 3.526rem;
  /* 67px / 19 */
  color: var(--base-dark);
  /* margin-bottom: 2rem; */
  max-width: 35rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.bl-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.421rem;
  /* 46px / 19 */
  flex-wrap: wrap;
  position: relative;
  z-index: 55;
}

.bl-search-bar {
  flex: 1;
  max-width: 34.947rem;
  width: 100%;
  min-width: 0;
  height: 3.368rem;
  /* 64px / 19 */
  background: var(--body-bg-white);
  border: 0.053rem solid rgba(151, 156, 255, 0.83);
  border-radius: 3.158rem;
  box-shadow: 0px 8px 16px 0px rgba(162, 114, 251, 0.22);
  display: flex;
  align-items: center;
  padding: 0.211rem 0.211rem;
  padding-inline-start: 1.579rem;
  padding-inline-end: 0.211rem;
  position: relative;
  z-index: 100;
}

.bl-search-icon {
  color: var(--accent-purple);
  margin-right: 0.737rem;
  width: 1rem;
  height: 1rem;
}

.bl-search-bar input {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 300;
  background: transparent;
  color: var(--text-sub);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-right: 0.5rem;
}

.bl-search-bar input::placeholder,
.bl-search-bar input::-webkit-input-placeholder,
.bl-search-bar input::-moz-placeholder,
.bl-search-bar input:-ms-input-placeholder {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

[dir="rtl"] .bl-search-bar input {
  padding-right: 0;
  padding-left: 0.5rem;
}

.bl-search-submit {
  background: linear-gradient(144deg, #0a4e96 0%, #1e6fd9 100%);
  color: var(--bg-white);
  border-radius: 1.421rem;
  width: 3.947rem;
  height: 2.895rem;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bl-search-submit svg {
  width: 1.3875rem;
  height: 1.3875rem;
}

[dir="rtl"] .bl-search-submit svg {
  transform: scale(1, -1) rotate(180deg);
}

.bl-search-submit:hover {
  transform: translateX(2px);
}

.bl-hero-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.474rem;
  font-size: 0.947rem;
  color: var(--base-dark);
  white-space: nowrap;
  flex: 0 0 auto;
}

.bl-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1.053rem;
}

.bl-toggle {
  position: relative;
  display: inline-block;
  width: 3.158rem;
  height: 1.684rem;
}

.bl-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.bl-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cfd4e6;
  border-radius: 1.684rem;
  cursor: pointer;
  transition: 0.2s;
}

.bl-toggle-slider::before {
  content: "";
  position: absolute;
  height: 1.368rem;
  width: 1.368rem;
  left: 0.158rem;
  top: 0.158rem;
  background: var(--bg-white);
  border-radius: 50%;
  transition: 0.2s;
}

.bl-toggle input:checked+.bl-toggle-slider {
  background: var(--primary-blue);
}

.bl-toggle input:checked+.bl-toggle-slider::before {
  transform: translateX(1.474rem);
}

/* Reading-mode state, toggled on <body> by blog.js */
/* body.bl-reading-mode .bl-card-text {
  font-size: 1.05rem;
  line-height: 1.7;
} */

/* ── 3. Topic filter bar ──────────────────────────────────────── */

.bl-topics-bar {
  background: rgba(248, 250, 255, 0.9);
  border-bottom: 0.053rem solid rgba(0, 102, 255, 0.07);
  padding: 0.947rem 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

body.dark-theme .bl-topics-bar {
  background: rgba(20, 20, 30, 0.9);
}

.bl-topics-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* flex-wrap: wrap; */
  gap: 0.842rem;
  min-width: 0;
  max-width: 76.19307rem;
}

.bl-topic-pills-wrapper {
  position: relative;
  min-width: 0;
  max-width: 50%;
  flex: 1;
  display: flex;
  align-items: center;
}

.bl-topic-pills {
  display: flex;
  gap: 0.842rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* old Edge/IE */
  padding-block: 0.211rem;
  padding-right: 2.8rem;
  /* keeps hover/focus box-shadow from clipping */
  min-width: 0;
  max-width: 100%;
}

.bl-topic-pills::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.bl-topic-pills-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.2rem;
  pointer-events: none;
  z-index: 2;

  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 1),
    rgba(255, 255, 255, 0)
  );
}

body.dark-theme .bl-topic-pills-wrapper::after {
  background: linear-gradient(
    to left,
    rgba(20, 20, 30, 0.95),
    rgba(20, 20, 30, 0)
  );
}

/* Category Filter Scroll Button */
.bl-pills-scroll-btn {
  position: absolute;
  right: -2.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.105rem;
  height: 2.105rem;
  border-radius: 50%;
  background: var(--body-bg-white);
  border: 0.053rem solid rgba(0, 102, 255, 0.15);
  color: var(--base-dark, #1e1e1e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0px 2px 8px rgba(0, 102, 255, 0.1);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.bl-pills-scroll-btn:hover {
  background: var(--primary-blue, #0066ff);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0px 4px 12px rgba(0, 102, 255, 0.3);
  transform: translateY(-50%) scale(1.06);
}

.bl-pills-scroll-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.bl-pills-scroll-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.2s ease;
}

body.dark-theme .bl-pills-scroll-btn {
  /* background: rgba(30, 30, 45, 0.95); */
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .bl-pills-scroll-btn:hover {
  background: var(--primary-blue, #0066ff);
  color: #ffffff;
  border-color: transparent;
}

[dir="rtl"] .bl-pills-scroll-btn {
  right: auto;
  left: 0;
}

[dir="rtl"] .bl-pills-scroll-btn svg {
  transform: rotate(180deg);
}

[dir="rtl"] .bl-topic-pills-wrapper::after {
  right: auto;
  left: 2.4rem;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 1),
    rgba(255, 255, 255, 0)
  );
}

.bl-pill {
  border: 0.053rem solid rgba(0, 102, 255, 0.1);
  background: var(--body-bg-white);
  border-radius: 1.579rem;
  padding: 0.368rem 0.895rem;
  font-size: 1rem;
  line-height: 1.363rem;
  font-weight: 300;
  cursor: pointer;
  color: var(--text-sub);
  box-shadow: 0px 2px 8px 0px rgba(0, 102, 255, 0.04);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  flex-shrink: 0;
  /* new */
  white-space: nowrap;
  font-family: var(--font-primary);
}


.bl-pill:hover {
  border-color: rgba(0, 102, 255, 0.3);
}

.bl-pill.active {
  background: linear-gradient(161deg, #0066ff 0%, #7b61ff 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0px 4px 6px rgba(0, 102, 255, 0.28);
}

.bl-view-controls {
  display: flex;
  align-items: center;
  gap: 0.842rem;
}

.bl-view-btn {
  width: 2.105rem;
  height: 2.105rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.421rem;
  color: var(--base-dark);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}



.bl-view-btn:hover,
.bl-view-btn.active {
  background: rgba(8, 75, 129, 0.08);
  color: var(--primary-blue);
}

/* ── 4. Blog grid ─────────────────────────────────────────────── */

.bl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.579rem;
  padding: 2.947rem 0 2.105rem;
}

.bl-grid.bl-list-view {
  grid-template-columns: 1fr;
}

.bl-grid.bl-list-view .bl-card {
  flex-direction: row;
  align-items: stretch;
}

.bl-grid.bl-list-view .bl-card-image {
  flex: 0 0 29.632rem;
  height: 15.789rem;
  margin: 0;
  border-radius: 0.316rem 0 0 0.316rem;
  padding: 1rem;
}

.bl-grid.bl-list-view .bl-card-title,
.bl-grid.bl-list-view .bl-card-text {
  width: 85%;
}

.bl-card {
  border: 0.053rem solid var(--border-gray);
  border-radius: 0.632rem;
  overflow: hidden;
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  min-height: 13.25rem;
}

.bl-card:hover {
  box-shadow: 0px 8px 24px rgba(8, 75, 129, 0.1);
  transform: translateY(-2px);
}

/* Make the whole card clickable via the title link (stretched link) */
.bl-card .bl-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bl-card[hidden] {
  display: none;
}


.bl-card-image {
  aspect-ratio: 506 / 240;
  margin: 0.842rem 0.842rem 0;
  border-radius: 0.316rem;
  overflow: hidden;
}

.bl-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.316rem;
}

/* .bl-card-body {
  padding: 1.211rem 1.158rem 1.158rem;
  display: flex;
  flex-direction: column;
  gap: 0.684rem;
  flex: 1;
} */

.bl-tag {
  align-self: flex-start;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.053rem;
  padding: 0.211rem 0.526rem;
  border-radius: 0.211rem;
  color: var(--base-dark);
  width: fit-content;
}

.bl-tag-r {
  border-radius: 100%;
}

.bl-tag-amber {
  background: var(--bl-badge-amber-bg);
}

.bl-tag-blue {
  background: var(--bl-badge-blue-bg);
  color: #000;
}

.bl-tag-purple {
  background: var(--bl-badge-purple-bg);
  color: #000;
}

.bl-tag-green {
  background: var(--bl-badge-green-bg);
}

.bl-tag-grey,
.bl-tag-gray {
  background: var(--bl-badge-grey-bg);
  color: #000;
}

.bl-card-title {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.363rem;
  color: var(--bl-secondary-800);
}

body.dark-theme .bl-card-title {
  color: var(--base-dark);
}

.bl-card-text {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.211rem;
  color: var(--text-sub);
  flex: 1;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bl-card-meta {
  display: flex;
  align-items: center;
  gap: 0.632rem;
  margin-top: 0.316rem;
  font-size: 0.737rem;
  flex-wrap: wrap;
}

.bl-avatar {
  width: 2.053rem;
  height: 2.053rem;
  border-radius: 50%;
  object-fit: cover;
}

.bl-author {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-sub);
}

.bl-read-time {
  background: var(--bl-badge-blue-bg);
  border-radius: 1.579rem;
  padding: 0.211rem 0.421rem;
  font-size: 0.775rem;
  color: var(--bl-gray-500);
}

body.dark-theme .bl-read-time{
  background: #151515;
  border: 1px solid #212124;
  color: #ffffff;
}

.bl-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-sub);
}

/* ── 5. Pagination wrapper (buttons reuse cs-pagination-* from global.css) ── */

.bl-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.053rem;
  border-top: 0.053rem solid #eaecf0;
  margin-bottom: 3.158rem;
}

body.dark-theme .bl-pagination {
  border-top: 0.053rem solid var(--border-gray);
}

.bl-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.421rem;
  padding: 0.526rem 0.842rem;
  border-radius: 0.421rem;
  border: 0.053rem solid #d0d5dd;
  background-color: var(--bg-white);
  font-family: var(--font-primary);
  font-size: 0.737rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bl-pagination-btn span{
  margin-top: 0.125rem;
} 

.bl-pagination-btn svg{
  width: 0.72919rem;
  height: 0.72919rem;
}

[dir=rtl] .bl-pagination-btn svg {
  transform: scale(1, -1) rotate(180deg);
}

.bl-pagination-btn:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #d0d5dd;
  color: var(--primary-blue);
}

.bl-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bl-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.105rem;
}

.bl-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.105rem;
  height: 2.105rem;
  border-radius: 0.421rem;
  border: none;
  background-color: transparent;
  font-family: var(--font-primary);
  font-size: 0.842rem;
  font-weight: 400;
  color: #667085;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bl-page-btn:hover {
  background-color: rgba(8, 75, 129, 0.06);
  color: var(--primary-blue);
}

.bl-page-btn.active {
  background-color: #f9f5ff;
  color: var(--primary-blue);
  font-weight: 600;
}

.bl-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.105rem;
  height: 2.105rem;
  font-family: var(--font-primary);
  font-size: 0.842rem;
  color: #667085;
  font-weight: 500;
  user-select: none;
}

/* ── Filter dropdown (hero row) ──────────────────────────────── */

.bl-filter-dropdown {
  position: relative;
  z-index: 100;
}

.bl-filter-dropdown.open {
  z-index: 1000;
}

.bl-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.526rem;
  border: 0.053rem solid rgba(151, 156, 255, 0.5);
  border-radius: 1.579rem;
  padding: 0 1.263rem;
  height: 2.474rem;
  width: 9.5rem;
  font-family: var(--font-primary);
  font-size: 0.947rem;
  font-weight: 300;
  color: var(--base-dark);
  /* background-color: var(--bg-white); */
  cursor: pointer;
  transition: all 0.3s ease;
}

#bl-filter-selected {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.bl-filter-toggle:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(8, 75, 129, 0.08);
}

.bl-filter-arrow {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.bl-filter-dropdown.open .bl-filter-arrow {
  transform: rotate(180deg);
}

.bl-filter-menu {
  display: none;
  position: absolute;
  top: 115%;
  left: 0;
  width: 9.5rem;
  max-height: 14rem;
  overflow-y: auto;
  background-color: var(--bg-white);
  border: 0.053rem solid var(--border-gray);
  border-radius: 0.526rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.421rem 0;
  list-style: none;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.bl-filter-dropdown.open .bl-filter-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[dir="rtl"] .bl-filter-menu {
  left: auto;
  right: 0;
  text-align: right;
}

.bl-filter-item {
  position: relative;
  font-family: var(--font-primary);
  font-size: 0.842rem;
  color: var(--text-sub);
  padding: 0.526rem 1.053rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.bl-filter-item-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: left;
}

[dir="rtl"] .bl-filter-item,
[dir="rtl"] .bl-filter-item-text {
  text-align: right;
}

[dir="rtl"] #bl-filter-selected {
  text-align: right;
}

.bl-filter-item:hover {
  background-color: rgba(8, 75, 129, 0.06);
  color: var(--primary-blue);
}

.bl-filter-item.active {
  background-color: rgba(8, 75, 129, 0.1);
  color: var(--primary-blue);
  font-weight: 500;
}

/* Custom white tooltip for filter items */
.bl-filter-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--bg-white);
  color: var(--base-dark, #191d23);
  border: 0.053rem solid var(--border-gray, #e5e7eb);
  border-radius: 0.421rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0.75rem;
  font-family: var(--font-primary);
  font-size: 0.789rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  min-width: 12rem;
  max-width: 16rem;
}

.bl-filter-item[data-tooltip]::before {
  content: '';
  position: absolute;
  left: calc(100% + 1px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--bg-white);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1001;
}

.bl-filter-item[data-tooltip]:hover::after,
.bl-filter-item[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Tooltip Left positioning variant (when right side space is constrained) */
.bl-filter-item.tooltip-left[data-tooltip]::after {
  left: auto !important;
  right: calc(100% + 8px) !important;
}

.bl-filter-item.tooltip-left[data-tooltip]::before {
  left: auto !important;
  right: calc(100% + 1px) !important;
  border-right-color: transparent !important;
  border-left-color: #ffffff !important;
}

/* Tooltip Top positioning variant (for small mobile screens) */
.bl-filter-item.tooltip-top[data-tooltip]::after {
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(100% + 6px) !important;
  transform: translateX(-50%) !important;
  max-width: 80vw !important;
  min-width: 8rem !important;
}

.bl-filter-item.tooltip-top[data-tooltip]::before {
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(100% + 0px) !important;
  transform: translateX(-50%) !important;
  border-right-color: transparent !important;
  border-top-color: #ffffff !important;
  border-left-color: transparent !important;
}

/* ── Badge color (matches static reference palette) ───────────── */

.bl-tag-purple {
  /* background: rgba(132, 57, 112, 0.12); */
  /* color: var(--accent-purple); */
}

/* ── Avatar fallback ──────────────────────────────────────────── */

.bl-avatar-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bl-badge-blue-bg);
  color: var(--primary-blue);
}



.con-dummy {
  display: flex;
  align-items: flex-end;
  gap: 1.875rem;
  max-width: 76.19307rem;
  width: 100%;
}

.ddumm {
  display: flex;

  flex-direction: column;
  align-items: center;
  gap: 2.375rem;
  margin-inline-start: auto;
  width: 100%;
  max-width: 100%;
}

.cs-ddumm {
  display: flex;

  flex-direction: column;
  align-items: center;
  gap: 2.375rem;
  margin-inline-start: auto;
  width: 49.4375rem;
}

.bb-ddumm {
  /* max-width: 48.4375rem; */
  width: 100%;
}

/* Search Autocomplete Dropdown */
.bl-search-bar {
  position: relative;
}

.bl-search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-white, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  max-height: 24rem;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 0.5rem 0;
  text-align: left;
}

.bl-grid,
#bl-blog-grid,
.cs-grid,
#cs-cards-grid {
  position: relative;
  z-index: 1;
}

.bl-search-dropdown.show {
  display: block;
}

.bl-search-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid var( --border-gray);
  transition: background-color 0.15s ease;
  align-items: flex-start;
  text-align: left;
}

.bl-search-item:last-child {
  border-bottom: none;
}

.bl-search-item:hover,
.bl-search-item:focus {
  background-color: #f8fafc;
}

body.dark-theme .bl-search-item:hover,
body.dark-theme .bl-search-item:focus {
  background-color: var(--body-bg-white);
}

.bl-search-item-title {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--base-dark, #1e293b);
  line-height: 1.3;
  text-align: left;
}

.bl-search-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-sub, #64748b);
  text-align: left;
}

.bl-search-item-tag {
  background: rgba(119, 89, 255, 0.1);
  color: #7759FF;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  font-size: 0.75rem;
}

.bl-search-no-results {
  padding: 0.75rem 1.25rem;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-sub);
  text-align: left;
}

[dir="rtl"] .bl-search-dropdown,
[dir="rtl"] .bl-search-item,
[dir="rtl"] .bl-search-item-title,
[dir="rtl"] .bl-search-item-meta,
[dir="rtl"] .bl-search-no-results {
  text-align: right;
  align-items: flex-end;
}

.bl-card-body {
  padding: 1.211rem 1.158rem 1.158rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tags  tags"
    "title title"
    "text  text"
    "meta  meta";
  gap: 0.684rem;
  flex: 1;
}

.bl-card-tags {
  grid-area: tags;
  display: flex;
  flex-wrap: wrap;
  gap: 0.421rem;
}

.bl-card-title {
  grid-area: title;
}

.bl-card-text {
  grid-area: text;
}

.bl-card-meta {
  grid-area: meta;
}

/* List view: tags move to the bottom row, right-aligned next to meta */
.bl-grid.bl-list-view .bl-card-body {
  grid-template-areas:
    "title title"
    "text  text"
    "meta  tags";
}

.bl-grid.bl-list-view .bl-card-meta {
  justify-self: start;
  align-self: center;
}

.bl-grid.bl-list-view .bl-card-tags {
  justify-self: end;
  align-self: center;
}

/* ── 6. Responsive ────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .bl-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bl-hero-row {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .bl-hero {
    padding-top: 9.5rem;
  }

  .bl-hero-title {
    font-size: 2rem;
    line-height: 2.4rem;
  }

  .bl-grid {
    grid-template-columns: 1fr;
  }

  .bl-grid.bl-list-view .bl-card {
    flex-direction: column;
  }

  .bl-grid.bl-list-view .bl-card-image {
    flex: none;
    margin: 0.842rem 0.842rem 0;
    border-radius: 0.316rem;
  }

  .bl-pagination {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }

  .bl-pagination-pages {
    order: -1;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .cs-pagination-pages {
    order: -1;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .bl-view-controls {
    display: none;
  }

  .con-dummy {
    flex-direction: column;
  }

  .cs-ddumm {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .bl-hero-title {
    font-size: 1.6rem;
  }

  .bl-search-bar {
    flex-wrap: nowrap;
    border-radius: 3.158rem;
  }

  .bl-hero-controls {
    flex-direction: row;
    align-items: center;
    gap: 0.737rem;
    white-space: normal;
  }
}